From 986141500cad72848b16f3e8c6f2780f74277da1 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Tue, 25 Jan 2022 23:10:40 +0000 Subject: [PATCH 01/30] Started on raylib 4.0, builds and runs most samples in both windows and web --- raylib-sys/Cargo.toml | 4 +- raylib-sys/binding/binding.h | 261 + raylib-sys/{ => binding}/config.h | 0 raylib-sys/binding/raygui.h | 4409 ++++ raylib-sys/{ => binding}/rgui_wrapper.c | 3 +- raylib-sys/{ => binding}/rgui_wrapper.cpp | 3 +- raylib-sys/{ => binding}/rgui_wrapper.h | 0 raylib-sys/bindings_linux.rs | 8198 ------- raylib-sys/bindings_osx.rs | 18480 ---------------- raylib-sys/bindings_web.rs | 15977 ------------- raylib-sys/bindings_windows.rs | 17873 --------------- raylib-sys/build.rs | 72 +- raylib-sys/external/glad.h | 5474 ----- raylib-sys/raygui.h | 3946 ---- raylib-sys/raylib | 2 +- raylib-sys/raylib.h | 1519 -- raylib-sys/raymath.h | 1516 -- raylib-sys/ricons.h | 557 - raylib-sys/rlgl.h | 4069 ---- raylib-test/Cargo.toml | 4 +- raylib-test/src/misc.rs | 2 +- raylib-test/src/texture.rs | 2 +- raylib/Cargo.toml | 4 +- raylib/src/consts.rs | 2 +- raylib/src/core/audio.rs | 20 +- raylib/src/core/collision.rs | 62 +- raylib/src/core/color.rs | 4 +- raylib/src/core/drawing.rs | 68 +- raylib/src/core/input.rs | 19 +- raylib/src/core/math.rs | 28 +- raylib/src/core/misc.rs | 4 +- raylib/src/core/models.rs | 18 +- raylib/src/core/shaders.rs | 7 +- raylib/src/core/text.rs | 64 +- raylib/src/core/texture.rs | 22 +- raylib/src/core/vr.rs | 2 - raylib/src/rgui/safe.rs | 34 - samples/Cargo.toml | 4 +- showcase/Cargo.toml | 4 +- .../src/example/audio/audio_raw_stream.rs | 4 +- .../controls_test_suite.rs | 8 +- showcase/src/example/core/core_3d_picking.rs | 4 +- .../src/example/core/core_input_gamepad.rs | 4 +- .../src/example/core/core_input_gestures.rs | 4 +- showcase/src/example/core/core_input_mouse.rs | 6 +- .../src/example/core/core_input_multitouch.rs | 12 +- .../src/example/core/core_scissor_test.rs | 2 +- .../example/image_exporter/image_exporter.rs | 6 +- showcase/src/example/models/models_loading.rs | 8 +- .../example/models/models_mesh_generation.rs | 2 +- .../src/example/models/models_mesh_picking.rs | 42 +- .../models/models_rlgl_solar_system.rs | 47 +- .../portable_window/portable_window.rs | 4 +- .../src/example/shaders/shaders_julia_set.rs | 6 +- .../example/textures/textures_bunnymark.rs | 2 +- .../textures/textures_mouse_painting.rs | 18 +- 56 files changed, 4929 insertions(+), 77987 deletions(-) create mode 100644 raylib-sys/binding/binding.h rename raylib-sys/{ => binding}/config.h (100%) create mode 100644 raylib-sys/binding/raygui.h rename raylib-sys/{ => binding}/rgui_wrapper.c (80%) rename raylib-sys/{ => binding}/rgui_wrapper.cpp (88%) rename raylib-sys/{ => binding}/rgui_wrapper.h (100%) delete mode 100644 raylib-sys/bindings_linux.rs delete mode 100644 raylib-sys/bindings_osx.rs delete mode 100644 raylib-sys/bindings_web.rs delete mode 100644 raylib-sys/bindings_windows.rs delete mode 100644 raylib-sys/external/glad.h delete mode 100755 raylib-sys/raygui.h delete mode 100644 raylib-sys/raylib.h delete mode 100644 raylib-sys/raymath.h delete mode 100755 raylib-sys/ricons.h delete mode 100644 raylib-sys/rlgl.h diff --git a/raylib-sys/Cargo.toml b/raylib-sys/Cargo.toml index f0651cbd..2fe4c247 100644 --- a/raylib-sys/Cargo.toml +++ b/raylib-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-sys" -version = "3.7.0" +version = "4.0.0" authors = ["DeltaPHC "] license = "Zlib" description = "Raw FFI bindings for Raylib" @@ -19,7 +19,7 @@ exclude = [ fs_extra = "1.1" cmake = "0.1.35" cc = "1.0" - +bindgen = "0.53.1" [features] default = [] diff --git a/raylib-sys/binding/binding.h b/raylib-sys/binding/binding.h new file mode 100644 index 00000000..a4625060 --- /dev/null +++ b/raylib-sys/binding/binding.h @@ -0,0 +1,261 @@ +#include "raygui.h" +#include "../raylib/src/rlgl.h" + +typedef enum { + RAYGUI_ICON_NONE = 0, + RAYGUI_ICON_FOLDER_FILE_OPEN = 1, + RAYGUI_ICON_FILE_SAVE_CLASSIC = 2, + RAYGUI_ICON_FOLDER_OPEN = 3, + RAYGUI_ICON_FOLDER_SAVE = 4, + RAYGUI_ICON_FILE_OPEN = 5, + RAYGUI_ICON_FILE_SAVE = 6, + RAYGUI_ICON_FILE_EXPORT = 7, + RAYGUI_ICON_FILE_NEW = 8, + RAYGUI_ICON_FILE_DELETE = 9, + RAYGUI_ICON_FILETYPE_TEXT = 10, + RAYGUI_ICON_FILETYPE_AUDIO = 11, + RAYGUI_ICON_FILETYPE_IMAGE = 12, + RAYGUI_ICON_FILETYPE_PLAY = 13, + RAYGUI_ICON_FILETYPE_VIDEO = 14, + RAYGUI_ICON_FILETYPE_INFO = 15, + RAYGUI_ICON_FILE_COPY = 16, + RAYGUI_ICON_FILE_CUT = 17, + RAYGUI_ICON_FILE_PASTE = 18, + RAYGUI_ICON_CURSOR_HAND = 19, + RAYGUI_ICON_CURSOR_POINTER = 20, + RAYGUI_ICON_CURSOR_CLASSIC = 21, + RAYGUI_ICON_PENCIL = 22, + RAYGUI_ICON_PENCIL_BIG = 23, + RAYGUI_ICON_BRUSH_CLASSIC = 24, + RAYGUI_ICON_BRUSH_PAINTER = 25, + RAYGUI_ICON_WATER_DROP = 26, + RAYGUI_ICON_COLOR_PICKER = 27, + RAYGUI_ICON_RUBBER = 28, + RAYGUI_ICON_COLOR_BUCKET = 29, + RAYGUI_ICON_TEXT_T = 30, + RAYGUI_ICON_TEXT_A = 31, + RAYGUI_ICON_SCALE = 32, + RAYGUI_ICON_RESIZE = 33, + RAYGUI_ICON_FILTER_POINT = 34, + RAYGUI_ICON_FILTER_BILINEAR = 35, + RAYGUI_ICON_CROP = 36, + RAYGUI_ICON_CROP_ALPHA = 37, + RAYGUI_ICON_SQUARE_TOGGLE = 38, + RAYGUI_ICON_SYMMETRY = 39, + RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40, + RAYGUI_ICON_SYMMETRY_VERTICAL = 41, + RAYGUI_ICON_LENS = 42, + RAYGUI_ICON_LENS_BIG = 43, + RAYGUI_ICON_EYE_ON = 44, + RAYGUI_ICON_EYE_OFF = 45, + RAYGUI_ICON_FILTER_TOP = 46, + RAYGUI_ICON_FILTER = 47, + RAYGUI_ICON_TARGET_POINT = 48, + RAYGUI_ICON_TARGET_SMALL = 49, + RAYGUI_ICON_TARGET_BIG = 50, + RAYGUI_ICON_TARGET_MOVE = 51, + RAYGUI_ICON_CURSOR_MOVE = 52, + RAYGUI_ICON_CURSOR_SCALE = 53, + RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54, + RAYGUI_ICON_CURSOR_SCALE_LEFT = 55, + RAYGUI_ICON_UNDO = 56, + RAYGUI_ICON_REDO = 57, + RAYGUI_ICON_REREDO = 58, + RAYGUI_ICON_MUTATE = 59, + RAYGUI_ICON_ROTATE = 60, + RAYGUI_ICON_REPEAT = 61, + RAYGUI_ICON_SHUFFLE = 62, + RAYGUI_ICON_EMPTYBOX = 63, + RAYGUI_ICON_TARGET = 64, + RAYGUI_ICON_TARGET_SMALL_FILL = 65, + RAYGUI_ICON_TARGET_BIG_FILL = 66, + RAYGUI_ICON_TARGET_MOVE_FILL = 67, + RAYGUI_ICON_CURSOR_MOVE_FILL = 68, + RAYGUI_ICON_CURSOR_SCALE_FILL = 69, + RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70, + RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71, + RAYGUI_ICON_UNDO_FILL = 72, + RAYGUI_ICON_REDO_FILL = 73, + RAYGUI_ICON_REREDO_FILL = 74, + RAYGUI_ICON_MUTATE_FILL = 75, + RAYGUI_ICON_ROTATE_FILL = 76, + RAYGUI_ICON_REPEAT_FILL = 77, + RAYGUI_ICON_SHUFFLE_FILL = 78, + RAYGUI_ICON_EMPTYBOX_SMALL = 79, + RAYGUI_ICON_BOX = 80, + RAYGUI_ICON_BOX_TOP = 81, + RAYGUI_ICON_BOX_TOP_RIGHT = 82, + RAYGUI_ICON_BOX_RIGHT = 83, + RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84, + RAYGUI_ICON_BOX_BOTTOM = 85, + RAYGUI_ICON_BOX_BOTTOM_LEFT = 86, + RAYGUI_ICON_BOX_LEFT = 87, + RAYGUI_ICON_BOX_TOP_LEFT = 88, + RAYGUI_ICON_BOX_CENTER = 89, + RAYGUI_ICON_BOX_CIRCLE_MASK = 90, + RAYGUI_ICON_POT = 91, + RAYGUI_ICON_ALPHA_MULTIPLY = 92, + RAYGUI_ICON_ALPHA_CLEAR = 93, + RAYGUI_ICON_DITHERING = 94, + RAYGUI_ICON_MIPMAPS = 95, + RAYGUI_ICON_BOX_GRID = 96, + RAYGUI_ICON_GRID = 97, + RAYGUI_ICON_BOX_CORNERS_SMALL = 98, + RAYGUI_ICON_BOX_CORNERS_BIG = 99, + RAYGUI_ICON_FOUR_BOXES = 100, + RAYGUI_ICON_GRID_FILL = 101, + RAYGUI_ICON_BOX_MULTISIZE = 102, + RAYGUI_ICON_ZOOM_SMALL = 103, + RAYGUI_ICON_ZOOM_MEDIUM = 104, + RAYGUI_ICON_ZOOM_BIG = 105, + RAYGUI_ICON_ZOOM_ALL = 106, + RAYGUI_ICON_ZOOM_CENTER = 107, + RAYGUI_ICON_BOX_DOTS_SMALL = 108, + RAYGUI_ICON_BOX_DOTS_BIG = 109, + RAYGUI_ICON_BOX_CONCENTRIC = 110, + RAYGUI_ICON_BOX_GRID_BIG = 111, + RAYGUI_ICON_OK_TICK = 112, + RAYGUI_ICON_CROSS = 113, + RAYGUI_ICON_ARROW_LEFT = 114, + RAYGUI_ICON_ARROW_RIGHT = 115, + RAYGUI_ICON_ARROW_DOWN = 116, + RAYGUI_ICON_ARROW_UP = 117, + RAYGUI_ICON_ARROW_LEFT_FILL = 118, + RAYGUI_ICON_ARROW_RIGHT_FILL = 119, + RAYGUI_ICON_ARROW_DOWN_FILL = 120, + RAYGUI_ICON_ARROW_UP_FILL = 121, + RAYGUI_ICON_AUDIO = 122, + RAYGUI_ICON_FX = 123, + RAYGUI_ICON_WAVE = 124, + RAYGUI_ICON_WAVE_SINUS = 125, + RAYGUI_ICON_WAVE_SQUARE = 126, + RAYGUI_ICON_WAVE_TRIANGULAR = 127, + RAYGUI_ICON_CROSS_SMALL = 128, + RAYGUI_ICON_PLAYER_PREVIOUS = 129, + RAYGUI_ICON_PLAYER_PLAY_BACK = 130, + RAYGUI_ICON_PLAYER_PLAY = 131, + RAYGUI_ICON_PLAYER_PAUSE = 132, + RAYGUI_ICON_PLAYER_STOP = 133, + RAYGUI_ICON_PLAYER_NEXT = 134, + RAYGUI_ICON_PLAYER_RECORD = 135, + RAYGUI_ICON_MAGNET = 136, + RAYGUI_ICON_LOCK_CLOSE = 137, + RAYGUI_ICON_LOCK_OPEN = 138, + RAYGUI_ICON_CLOCK = 139, + RAYGUI_ICON_TOOLS = 140, + RAYGUI_ICON_GEAR = 141, + RAYGUI_ICON_GEAR_BIG = 142, + RAYGUI_ICON_BIN = 143, + RAYGUI_ICON_HAND_POINTER = 144, + RAYGUI_ICON_LASER = 145, + RAYGUI_ICON_COIN = 146, + RAYGUI_ICON_EXPLOSION = 147, + RAYGUI_ICON_1UP = 148, + RAYGUI_ICON_PLAYER = 149, + RAYGUI_ICON_PLAYER_JUMP = 150, + RAYGUI_ICON_KEY = 151, + RAYGUI_ICON_DEMON = 152, + RAYGUI_ICON_TEXT_POPUP = 153, + RAYGUI_ICON_GEAR_EX = 154, + RAYGUI_ICON_CRACK = 155, + RAYGUI_ICON_CRACK_POINTS = 156, + RAYGUI_ICON_STAR = 157, + RAYGUI_ICON_DOOR = 158, + RAYGUI_ICON_EXIT = 159, + RAYGUI_ICON_MODE_2D = 160, + RAYGUI_ICON_MODE_3D = 161, + RAYGUI_ICON_CUBE = 162, + RAYGUI_ICON_CUBE_FACE_TOP = 163, + RAYGUI_ICON_CUBE_FACE_LEFT = 164, + RAYGUI_ICON_CUBE_FACE_FRONT = 165, + RAYGUI_ICON_CUBE_FACE_BOTTOM = 166, + RAYGUI_ICON_CUBE_FACE_RIGHT = 167, + RAYGUI_ICON_CUBE_FACE_BACK = 168, + RAYGUI_ICON_CAMERA = 169, + RAYGUI_ICON_SPECIAL = 170, + RAYGUI_ICON_LINK_NET = 171, + RAYGUI_ICON_LINK_BOXES = 172, + RAYGUI_ICON_LINK_MULTI = 173, + RAYGUI_ICON_LINK = 174, + RAYGUI_ICON_LINK_BROKE = 175, + RAYGUI_ICON_TEXT_NOTES = 176, + RAYGUI_ICON_NOTEBOOK = 177, + RAYGUI_ICON_SUITCASE = 178, + RAYGUI_ICON_SUITCASE_ZIP = 179, + RAYGUI_ICON_MAILBOX = 180, + RAYGUI_ICON_MONITOR = 181, + RAYGUI_ICON_PRINTER = 182, + RAYGUI_ICON_PHOTO_CAMERA = 183, + RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184, + RAYGUI_ICON_HOUSE = 185, + RAYGUI_ICON_HEART = 186, + RAYGUI_ICON_CORNER = 187, + RAYGUI_ICON_VERTICAL_BARS = 188, + RAYGUI_ICON_VERTICAL_BARS_FILL = 189, + RAYGUI_ICON_LIFE_BARS = 190, + RAYGUI_ICON_INFO = 191, + RAYGUI_ICON_CROSSLINE = 192, + RAYGUI_ICON_HELP = 193, + RAYGUI_ICON_FILETYPE_ALPHA = 194, + RAYGUI_ICON_FILETYPE_HOME = 195, + RAYGUI_ICON_LAYERS_VISIBLE = 196, + RAYGUI_ICON_LAYERS = 197, + RAYGUI_ICON_WINDOW = 198, + RAYGUI_ICON_HIDPI = 199, + RAYGUI_ICON_200 = 200, + RAYGUI_ICON_201 = 201, + RAYGUI_ICON_202 = 202, + RAYGUI_ICON_203 = 203, + RAYGUI_ICON_204 = 204, + RAYGUI_ICON_205 = 205, + RAYGUI_ICON_206 = 206, + RAYGUI_ICON_207 = 207, + RAYGUI_ICON_208 = 208, + RAYGUI_ICON_209 = 209, + RAYGUI_ICON_210 = 210, + RAYGUI_ICON_211 = 211, + RAYGUI_ICON_212 = 212, + RAYGUI_ICON_213 = 213, + RAYGUI_ICON_214 = 214, + RAYGUI_ICON_215 = 215, + RAYGUI_ICON_216 = 216, + RAYGUI_ICON_217 = 217, + RAYGUI_ICON_218 = 218, + RAYGUI_ICON_219 = 219, + RAYGUI_ICON_220 = 220, + RAYGUI_ICON_221 = 221, + RAYGUI_ICON_222 = 222, + RAYGUI_ICON_223 = 223, + RAYGUI_ICON_224 = 224, + RAYGUI_ICON_225 = 225, + RAYGUI_ICON_226 = 226, + RAYGUI_ICON_227 = 227, + RAYGUI_ICON_228 = 228, + RAYGUI_ICON_229 = 229, + RAYGUI_ICON_230 = 230, + RAYGUI_ICON_231 = 231, + RAYGUI_ICON_232 = 232, + RAYGUI_ICON_233 = 233, + RAYGUI_ICON_234 = 234, + RAYGUI_ICON_235 = 235, + RAYGUI_ICON_236 = 236, + RAYGUI_ICON_237 = 237, + RAYGUI_ICON_238 = 238, + RAYGUI_ICON_239 = 239, + RAYGUI_ICON_240 = 240, + RAYGUI_ICON_241 = 241, + RAYGUI_ICON_242 = 242, + RAYGUI_ICON_243 = 243, + RAYGUI_ICON_244 = 244, + RAYGUI_ICON_245 = 245, + RAYGUI_ICON_246 = 246, + RAYGUI_ICON_247 = 247, + RAYGUI_ICON_248 = 248, + RAYGUI_ICON_249 = 249, + RAYGUI_ICON_250 = 250, + RAYGUI_ICON_251 = 251, + RAYGUI_ICON_252 = 252, + RAYGUI_ICON_253 = 253, + RAYGUI_ICON_254 = 254, + RAYGUI_ICON_255 = 255, +} guiIconName; \ No newline at end of file diff --git a/raylib-sys/config.h b/raylib-sys/binding/config.h similarity index 100% rename from raylib-sys/config.h rename to raylib-sys/binding/config.h diff --git a/raylib-sys/binding/raygui.h b/raylib-sys/binding/raygui.h new file mode 100644 index 00000000..e5e79388 --- /dev/null +++ b/raylib-sys/binding/raygui.h @@ -0,0 +1,4409 @@ +/******************************************************************************************* +* +* raygui v3.1 - A simple and easy-to-use immediate-mode gui library +* +* DESCRIPTION: +* +* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also +* available as a standalone library, as long as input and drawing functions are provided. +* +* Controls provided: +* +* # Container/separators Controls +* - WindowBox +* - GroupBox +* - Line +* - Panel +* - ScrollPanel +* +* # Basic Controls +* - Label +* - Button +* - LabelButton --> Label +* - Toggle +* - ToggleGroup --> Toggle +* - CheckBox +* - ComboBox +* - DropdownBox +* - TextBox +* - TextBoxMulti +* - ValueBox --> TextBox +* - Spinner --> Button, ValueBox +* - Slider +* - SliderBar --> Slider +* - ProgressBar +* - StatusBar +* - ScrollBar // TODO: Really? Do we need it? We have GuiScrollPanel() +* - DummyRec +* - Grid +* +* # Advance Controls +* - ListView +* - ColorPicker --> ColorPanel, ColorBarHue +* - MessageBox --> Window, Label, Button +* - TextInputBox --> Window, Label, TextBox, Button +* +* It also provides a set of functions for styling the controls based on its properties (size, color). +* +* +* RAYGUI STYLE (guiStyle): +* +* raygui uses a global data array for all gui style properties (allocated on data segment by default), +* when a new style is loaded, it is loaded over the global style... but a default gui style could always be +* recovered with GuiLoadStyleDefault() function, that overwrites the current style to the default one +* +* The global style array size is fixed and depends on the number of controls and properties: +* +* static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)]; +* +* guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB +* +* Note that the first set of BASE properties (by default guiStyle[0..15]) belong to the generic style +* used for all controls, when any of those base values is set, it is automatically populated to all +* controls, so, specific control values overwriting generic style should be set after base values. +* +* After the first BASE set we have the EXTENDED properties (by default guiStyle[16..23]), those +* properties are actually common to all controls and can not be overwritten individually (like BASE ones) +* Some of those properties are: TEXT_SIZE, TEXT_SPACING, LINE_COLOR, BACKGROUND_COLOR +* +* Custom control properties can be defined using the EXTENDED properties for each independent control. +* +* TOOL: rGuiStyler is a visual tool to customize raygui style. +* +* +* RAYGUI ICONS (guiIcons): +* +* raygui could use a global array containing icons data (allocated on data segment by default), +* a custom icons set could be loaded over this array using GuiLoadIcons(), but loaded icons set +* must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS will be loaded +* +* Every icon is codified in binary form, using 1 bit per pixel, so, every 16x16 icon +* requires 8 integers (16*16/32) to be stored in memory. +* +* When the icon is draw, actually one quad per pixel is drawn if the bit for that pixel is set. +* +* The global icons array size is fixed and depends on the number of icons and size: +* +* static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS]; +* +* guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB +* +* TOOL: rGuiIcons is a visual tool to customize raygui icons. +* +* +* CONFIGURATION: +* +* #define RAYGUI_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. +* +* #define RAYGUI_STANDALONE +* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined +* internally in the library and input management and drawing functions must be provided by +* the user (check library implementation for further details). +* +* #define RAYGUI_NO_ICONS +* Avoid including embedded ricons data (256 icons, 16x16 pixels, 1-bit per pixel, 2KB) +* +* #define RAYGUI_CUSTOM_ICONS +* Includes custom ricons.h header defining a set of custom icons, +* this file can be generated using rGuiIcons tool +* +* +* VERSIONS HISTORY: +* 3.1 (12-Jan-2021) REVIEWED: Default style for consistency (aligned with rGuiLayout v2.5 tool) +* REVIEWED: GuiLoadStyle() to support compressed font atlas image data and unload previous textures +* REVIEWED: External icons usage logic +* REVIEWED: GuiLine() for centered alignment when including text +* RENAMED: Multiple controls properties definitions to prepend RAYGUI_ +* RENAMED: RICON_ references to RAYGUI_ICON_ for library consistency +* Projects updated and multiple tweaks +* 3.0 (04-Nov-2021) Integrated ricons data to avoid external file +* REDESIGNED: GuiTextBoxMulti() +* REMOVED: GuiImageButton*() +* Multiple minor tweaks and bugs corrected +* 2.9 (17-Mar-2021) REMOVED: Tooltip API +* 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() +* 2.7 (20-Feb-2020) ADDED: Possible tooltips API +* 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() +* REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() +* REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() +* Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties +* ADDED: 8 new custom styles ready to use +* Multiple minor tweaks and bugs corrected +* 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() +* 2.3 (29-Apr-2019) ADDED: rIcons auxiliar library and support for it, multiple controls reviewed +* Refactor all controls drawing mechanism to use control state +* 2.2 (05-Feb-2019) ADDED: GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls +* 2.1 (26-Dec-2018) REDESIGNED: GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string +* REDESIGNED: Style system (breaking change) +* 2.0 (08-Nov-2018) ADDED: Support controls guiLock and custom fonts +* REVIEWED: GuiComboBox(), GuiListView()... +* 1.9 (09-Oct-2018) REVIEWED: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... +* 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout +* 1.5 (21-Jun-2017) Working in an improved styles system +* 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) +* 1.3 (12-Jun-2017) Complete redesign of style system +* 1.1 (01-Jun-2017) Complete review of the library +* 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. +* 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. +* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. +* +* +* CONTRIBUTORS: +* +* Ramon Santamaria: Supervision, review, redesign, update and maintenance +* Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) +* Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) +* Adria Arranz: Testing and Implementation of additional controls (2018) +* Jordi Jorba: Testing and Implementation of additional controls (2018) +* Albert Martos: Review and testing of the library (2015) +* Ian Eito: Review and testing of the library (2015) +* Kevin Gato: Initial implementation of basic components (2014) +* Daniel Nicolas: Initial implementation of basic components (2014) +* +* +* LICENSE: zlib/libpng +* +* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5) +* +* 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. +* +**********************************************************************************************/ + +#ifndef RAYGUI_H +#define RAYGUI_H + +#define RAYGUI_VERSION "3.1" + +/// NOTE: This is where we load in from the subdir +#if !defined(RAYGUI_STANDALONE) +#include "../raylib/src/raylib.h" +#endif + +// Function specifiers in case library is build/used as a shared library (Windows) +// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll +#if defined(_WIN32) +#if defined(BUILD_LIBTYPE_SHARED) + #define RAYGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) + #elif defined(USE_LIBTYPE_SHARED) + #define RAYGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) + #endif +#endif + +// Function specifiers definition +#ifndef RAYGUIAPI +#define RAYGUIAPI // Functions defined as 'extern' by default (implicit specifiers) +#endif + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +// Allow custom memory allocators +#ifndef RAYGUI_MALLOC +#define RAYGUI_MALLOC(sz) malloc(sz) +#endif +#ifndef RAYGUI_CALLOC +#define RAYGUI_CALLOC(n,sz) calloc(n,sz) +#endif +#ifndef RAYGUI_FREE +#define RAYGUI_FREE(p) free(p) +#endif + +// Simple log system to avoid printf() calls if required +// NOTE: Avoiding those calls, also avoids const strings memory usage +#define RAYGUI_SUPPORT_LOG_INFO +#if defined(RAYGUI_SUPPORT_LOG_INFO) +#define RAYGUI_LOG(...) printf(__VA_ARGS__) +#else +#define RAYGUI_LOG(...) +#endif + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +// NOTE: Some types are required for RAYGUI_STANDALONE usage +//---------------------------------------------------------------------------------- +#if defined(RAYGUI_STANDALONE) +#ifndef __cplusplus + // Boolean type + #ifndef true + typedef enum { false, true } bool; + #endif + #endif + + // Vector2 type + typedef struct Vector2 { + float x; + float y; + } Vector2; + + // Vector3 type // -- ConvertHSVtoRGB(), ConvertRGBtoHSV() + typedef struct Vector3 { + float x; + float y; + float z; + } Vector3; + + // Color type, RGBA (32bit) + typedef struct Color { + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; + } Color; + + // Rectangle type + typedef struct Rectangle { + float x; + float y; + float width; + float height; + } Rectangle; + + // TODO: Texture2D type is very coupled to raylib, required by Font type + // It should be redesigned to be provided by user + typedef struct Texture2D { + unsigned int id; // OpenGL texture id + int width; // Texture base width + int height; // Texture base height + int mipmaps; // Mipmap levels, 1 by default + int format; // Data format (PixelFormat type) + } Texture2D; + + // GlyphInfo, font characters glyphs info + typedef struct GlyphInfo { + int value; // Character value (Unicode) + int offsetX; // Character offset X when drawing + int offsetY; // Character offset Y when drawing + int advanceX; // Character advance position X + Image image; // Character image data + } GlyphInfo; + + // TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() + // It should be redesigned to be provided by user + typedef struct Font { + int baseSize; // Base size (default chars height) + int glyphCount; // Number of characters + Texture2D texture; // Characters texture atlas + Rectangle *recs; // Characters rectangles in texture + GlyphInfo *chars; // Characters info data + } Font; +#endif + +// Style property +typedef struct GuiStyleProp { + unsigned short controlId; + unsigned short propertyId; + int propertyValue; +} GuiStyleProp; + +// Gui control state +typedef enum { + GUI_STATE_NORMAL = 0, + GUI_STATE_FOCUSED, + GUI_STATE_PRESSED, + GUI_STATE_DISABLED, +} GuiControlState; + +// Gui control text alignment +typedef enum { + GUI_TEXT_ALIGN_LEFT = 0, + GUI_TEXT_ALIGN_CENTER, + GUI_TEXT_ALIGN_RIGHT, +} GuiTextAlignment; + +// Gui controls +typedef enum { + DEFAULT = 0, // Generic control -> populates to all controls when set + LABEL, // Used also for: LABELBUTTON + BUTTON, + TOGGLE, // Used also for: TOGGLEGROUP + SLIDER, // Used also for: SLIDERBAR + PROGRESSBAR, + CHECKBOX, + COMBOBOX, + DROPDOWNBOX, + TEXTBOX, // Used also for: TEXTBOXMULTI + VALUEBOX, + SPINNER, + LISTVIEW, + COLORPICKER, + SCROLLBAR, + STATUSBAR +} GuiControl; + +// Gui base properties for every control +// NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties) +typedef enum { + BORDER_COLOR_NORMAL = 0, + BASE_COLOR_NORMAL, + TEXT_COLOR_NORMAL, + BORDER_COLOR_FOCUSED, + BASE_COLOR_FOCUSED, + TEXT_COLOR_FOCUSED, + BORDER_COLOR_PRESSED, + BASE_COLOR_PRESSED, + TEXT_COLOR_PRESSED, + BORDER_COLOR_DISABLED, + BASE_COLOR_DISABLED, + TEXT_COLOR_DISABLED, + BORDER_WIDTH, + TEXT_PADDING, + TEXT_ALIGNMENT, + RESERVED +} GuiControlProperty; + +// Gui extended properties depend on control +// NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default 8 properties) + +// DEFAULT extended properties +// NOTE: Those properties are actually common to all controls +typedef enum { + TEXT_SIZE = 16, + TEXT_SPACING, + LINE_COLOR, + BACKGROUND_COLOR, +} GuiDefaultProperty; + +// Label +//typedef enum { } GuiLabelProperty; + +// Button +//typedef enum { } GuiButtonProperty; + +// Toggle/ToggleGroup +typedef enum { + GROUP_PADDING = 16, +} GuiToggleProperty; + +// Slider/SliderBar +typedef enum { + SLIDER_WIDTH = 16, + SLIDER_PADDING +} GuiSliderProperty; + +// ProgressBar +typedef enum { + PROGRESS_PADDING = 16, +} GuiProgressBarProperty; + +// CheckBox +typedef enum { + CHECK_PADDING = 16 +} GuiCheckBoxProperty; + +// ComboBox +typedef enum { + COMBO_BUTTON_WIDTH = 16, + COMBO_BUTTON_PADDING +} GuiComboBoxProperty; + +// DropdownBox +typedef enum { + ARROW_PADDING = 16, + DROPDOWN_ITEMS_PADDING +} GuiDropdownBoxProperty; + +// TextBox/TextBoxMulti/ValueBox/Spinner +typedef enum { + TEXT_INNER_PADDING = 16, + TEXT_LINES_PADDING, + COLOR_SELECTED_FG, + COLOR_SELECTED_BG +} GuiTextBoxProperty; + +// Spinner +typedef enum { + SPIN_BUTTON_WIDTH = 16, + SPIN_BUTTON_PADDING, +} GuiSpinnerProperty; + +// ScrollBar +typedef enum { + ARROWS_SIZE = 16, + ARROWS_VISIBLE, + SCROLL_SLIDER_PADDING, + SCROLL_SLIDER_SIZE, + SCROLL_PADDING, + SCROLL_SPEED, +} GuiScrollBarProperty; + +// ScrollBar side +typedef enum { + SCROLLBAR_LEFT_SIDE = 0, + SCROLLBAR_RIGHT_SIDE +} GuiScrollBarSide; + +// ListView +typedef enum { + LIST_ITEMS_HEIGHT = 16, + LIST_ITEMS_PADDING, + SCROLLBAR_WIDTH, + SCROLLBAR_SIDE, +} GuiListViewProperty; + +// ColorPicker +typedef enum { + COLOR_SELECTOR_SIZE = 16, + HUEBAR_WIDTH, // Right hue bar width + HUEBAR_PADDING, // Right hue bar separation from panel + HUEBAR_SELECTOR_HEIGHT, // Right hue bar selector height + HUEBAR_SELECTOR_OVERFLOW // Right hue bar selector overflow +} GuiColorPickerProperty; + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +// ... + +//---------------------------------------------------------------------------------- +// Module Functions Declaration +//---------------------------------------------------------------------------------- + +#if defined(__cplusplus) +extern "C" { // Prevents name mangling of functions +#endif + +// Global gui state control functions +RAYGUIAPI void GuiEnable(void); // Enable gui controls (global state) +RAYGUIAPI void GuiDisable(void); // Disable gui controls (global state) +RAYGUIAPI void GuiLock(void); // Lock gui controls (global state) +RAYGUIAPI void GuiUnlock(void); // Unlock gui controls (global state) +RAYGUIAPI bool GuiIsLocked(void); // Check if gui is locked (global state) +RAYGUIAPI void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f +RAYGUIAPI void GuiSetState(int state); // Set gui state (global state) +RAYGUIAPI int GuiGetState(void); // Get gui state (global state) + +// Font set/get functions +RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state) +RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state) + +// Style set/get functions +RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property +RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property + +// Container/separator controls, useful for controls organization +RAYGUIAPI bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed +RAYGUIAPI void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name +RAYGUIAPI void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text +RAYGUIAPI void GuiPanel(Rectangle bounds); // Panel control, useful to group controls +RAYGUIAPI Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll); // Scroll Panel control + +// Basic controls set +RAYGUIAPI void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text +RAYGUIAPI bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked +RAYGUIAPI bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked +RAYGUIAPI bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active +RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index +RAYGUIAPI bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active +RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index +RAYGUIAPI bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item +RAYGUIAPI bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value +RAYGUIAPI bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers +RAYGUIAPI bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text +RAYGUIAPI bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines +RAYGUIAPI float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value +RAYGUIAPI float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value +RAYGUIAPI float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value +RAYGUIAPI void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text +RAYGUIAPI void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders +RAYGUIAPI int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control +RAYGUIAPI Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs); // Grid control + + +// Advance controls set +RAYGUIAPI int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index +RAYGUIAPI int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters +RAYGUIAPI int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message +RAYGUIAPI int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text); // Text Input Box control, ask for text +RAYGUIAPI Color GuiColorPicker(Rectangle bounds, Color color); // Color Picker control (multiple color controls) +RAYGUIAPI Color GuiColorPanel(Rectangle bounds, Color color); // Color Panel control +RAYGUIAPI float GuiColorBarAlpha(Rectangle bounds, float alpha); // Color Bar Alpha control +RAYGUIAPI float GuiColorBarHue(Rectangle bounds, float value); // Color Bar Hue control + +// Styles loading functions +RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) +RAYGUIAPI void GuiLoadStyleDefault(void); // Load style default over global style + +// Icons functionality +RAYGUIAPI const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) +#if !defined(RAYGUI_NO_ICONS) +RAYGUIAPI void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); + +RAYGUIAPI unsigned int *GuiGetIcons(void); // Get full icons data pointer +RAYGUIAPI unsigned int *GuiGetIconData(int iconId); // Get icon bit data +RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data + +RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value +RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value +RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value +#endif + +#if defined(__cplusplus) +} // Prevents name mangling of functions +#endif + +#endif // RAYGUI_H + +/*********************************************************************************** +* +* RAYGUI IMPLEMENTATION +* +************************************************************************************/ + +#if defined(RAYGUI_IMPLEMENTATION) + +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy() +#include // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()] +#include // Required for: roundf() [GuiColorPicker()] + +#ifdef __cplusplus + #define RAYGUI_CLITERAL(name) name +#else + #define RAYGUI_CLITERAL(name) (name) +#endif + +#if !defined(RAYGUI_NO_ICONS) && !defined(RAYGUI_CUSTOM_ICONS) + +// Embedded raygui icons, no external file provided +#define RAYGUI_ICON_SIZE 16 // Size of icons (squared) +#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons +#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id + +// Icons data is defined by bit array (every bit represents one pixel) +// Those arrays are stored as unsigned int data arrays, so every array +// element defines 32 pixels (bits) of information +// Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels) +#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32) + +//---------------------------------------------------------------------------------- +// Icons enumeration +//---------------------------------------------------------------------------------- + +typedef enum { + RAYGUI_ICON_NONE = 0, + RAYGUI_ICON_FOLDER_FILE_OPEN = 1, + RAYGUI_ICON_FILE_SAVE_CLASSIC = 2, + RAYGUI_ICON_FOLDER_OPEN = 3, + RAYGUI_ICON_FOLDER_SAVE = 4, + RAYGUI_ICON_FILE_OPEN = 5, + RAYGUI_ICON_FILE_SAVE = 6, + RAYGUI_ICON_FILE_EXPORT = 7, + RAYGUI_ICON_FILE_NEW = 8, + RAYGUI_ICON_FILE_DELETE = 9, + RAYGUI_ICON_FILETYPE_TEXT = 10, + RAYGUI_ICON_FILETYPE_AUDIO = 11, + RAYGUI_ICON_FILETYPE_IMAGE = 12, + RAYGUI_ICON_FILETYPE_PLAY = 13, + RAYGUI_ICON_FILETYPE_VIDEO = 14, + RAYGUI_ICON_FILETYPE_INFO = 15, + RAYGUI_ICON_FILE_COPY = 16, + RAYGUI_ICON_FILE_CUT = 17, + RAYGUI_ICON_FILE_PASTE = 18, + RAYGUI_ICON_CURSOR_HAND = 19, + RAYGUI_ICON_CURSOR_POINTER = 20, + RAYGUI_ICON_CURSOR_CLASSIC = 21, + RAYGUI_ICON_PENCIL = 22, + RAYGUI_ICON_PENCIL_BIG = 23, + RAYGUI_ICON_BRUSH_CLASSIC = 24, + RAYGUI_ICON_BRUSH_PAINTER = 25, + RAYGUI_ICON_WATER_DROP = 26, + RAYGUI_ICON_COLOR_PICKER = 27, + RAYGUI_ICON_RUBBER = 28, + RAYGUI_ICON_COLOR_BUCKET = 29, + RAYGUI_ICON_TEXT_T = 30, + RAYGUI_ICON_TEXT_A = 31, + RAYGUI_ICON_SCALE = 32, + RAYGUI_ICON_RESIZE = 33, + RAYGUI_ICON_FILTER_POINT = 34, + RAYGUI_ICON_FILTER_BILINEAR = 35, + RAYGUI_ICON_CROP = 36, + RAYGUI_ICON_CROP_ALPHA = 37, + RAYGUI_ICON_SQUARE_TOGGLE = 38, + RAYGUI_ICON_SYMMETRY = 39, + RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40, + RAYGUI_ICON_SYMMETRY_VERTICAL = 41, + RAYGUI_ICON_LENS = 42, + RAYGUI_ICON_LENS_BIG = 43, + RAYGUI_ICON_EYE_ON = 44, + RAYGUI_ICON_EYE_OFF = 45, + RAYGUI_ICON_FILTER_TOP = 46, + RAYGUI_ICON_FILTER = 47, + RAYGUI_ICON_TARGET_POINT = 48, + RAYGUI_ICON_TARGET_SMALL = 49, + RAYGUI_ICON_TARGET_BIG = 50, + RAYGUI_ICON_TARGET_MOVE = 51, + RAYGUI_ICON_CURSOR_MOVE = 52, + RAYGUI_ICON_CURSOR_SCALE = 53, + RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54, + RAYGUI_ICON_CURSOR_SCALE_LEFT = 55, + RAYGUI_ICON_UNDO = 56, + RAYGUI_ICON_REDO = 57, + RAYGUI_ICON_REREDO = 58, + RAYGUI_ICON_MUTATE = 59, + RAYGUI_ICON_ROTATE = 60, + RAYGUI_ICON_REPEAT = 61, + RAYGUI_ICON_SHUFFLE = 62, + RAYGUI_ICON_EMPTYBOX = 63, + RAYGUI_ICON_TARGET = 64, + RAYGUI_ICON_TARGET_SMALL_FILL = 65, + RAYGUI_ICON_TARGET_BIG_FILL = 66, + RAYGUI_ICON_TARGET_MOVE_FILL = 67, + RAYGUI_ICON_CURSOR_MOVE_FILL = 68, + RAYGUI_ICON_CURSOR_SCALE_FILL = 69, + RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70, + RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71, + RAYGUI_ICON_UNDO_FILL = 72, + RAYGUI_ICON_REDO_FILL = 73, + RAYGUI_ICON_REREDO_FILL = 74, + RAYGUI_ICON_MUTATE_FILL = 75, + RAYGUI_ICON_ROTATE_FILL = 76, + RAYGUI_ICON_REPEAT_FILL = 77, + RAYGUI_ICON_SHUFFLE_FILL = 78, + RAYGUI_ICON_EMPTYBOX_SMALL = 79, + RAYGUI_ICON_BOX = 80, + RAYGUI_ICON_BOX_TOP = 81, + RAYGUI_ICON_BOX_TOP_RIGHT = 82, + RAYGUI_ICON_BOX_RIGHT = 83, + RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84, + RAYGUI_ICON_BOX_BOTTOM = 85, + RAYGUI_ICON_BOX_BOTTOM_LEFT = 86, + RAYGUI_ICON_BOX_LEFT = 87, + RAYGUI_ICON_BOX_TOP_LEFT = 88, + RAYGUI_ICON_BOX_CENTER = 89, + RAYGUI_ICON_BOX_CIRCLE_MASK = 90, + RAYGUI_ICON_POT = 91, + RAYGUI_ICON_ALPHA_MULTIPLY = 92, + RAYGUI_ICON_ALPHA_CLEAR = 93, + RAYGUI_ICON_DITHERING = 94, + RAYGUI_ICON_MIPMAPS = 95, + RAYGUI_ICON_BOX_GRID = 96, + RAYGUI_ICON_GRID = 97, + RAYGUI_ICON_BOX_CORNERS_SMALL = 98, + RAYGUI_ICON_BOX_CORNERS_BIG = 99, + RAYGUI_ICON_FOUR_BOXES = 100, + RAYGUI_ICON_GRID_FILL = 101, + RAYGUI_ICON_BOX_MULTISIZE = 102, + RAYGUI_ICON_ZOOM_SMALL = 103, + RAYGUI_ICON_ZOOM_MEDIUM = 104, + RAYGUI_ICON_ZOOM_BIG = 105, + RAYGUI_ICON_ZOOM_ALL = 106, + RAYGUI_ICON_ZOOM_CENTER = 107, + RAYGUI_ICON_BOX_DOTS_SMALL = 108, + RAYGUI_ICON_BOX_DOTS_BIG = 109, + RAYGUI_ICON_BOX_CONCENTRIC = 110, + RAYGUI_ICON_BOX_GRID_BIG = 111, + RAYGUI_ICON_OK_TICK = 112, + RAYGUI_ICON_CROSS = 113, + RAYGUI_ICON_ARROW_LEFT = 114, + RAYGUI_ICON_ARROW_RIGHT = 115, + RAYGUI_ICON_ARROW_DOWN = 116, + RAYGUI_ICON_ARROW_UP = 117, + RAYGUI_ICON_ARROW_LEFT_FILL = 118, + RAYGUI_ICON_ARROW_RIGHT_FILL = 119, + RAYGUI_ICON_ARROW_DOWN_FILL = 120, + RAYGUI_ICON_ARROW_UP_FILL = 121, + RAYGUI_ICON_AUDIO = 122, + RAYGUI_ICON_FX = 123, + RAYGUI_ICON_WAVE = 124, + RAYGUI_ICON_WAVE_SINUS = 125, + RAYGUI_ICON_WAVE_SQUARE = 126, + RAYGUI_ICON_WAVE_TRIANGULAR = 127, + RAYGUI_ICON_CROSS_SMALL = 128, + RAYGUI_ICON_PLAYER_PREVIOUS = 129, + RAYGUI_ICON_PLAYER_PLAY_BACK = 130, + RAYGUI_ICON_PLAYER_PLAY = 131, + RAYGUI_ICON_PLAYER_PAUSE = 132, + RAYGUI_ICON_PLAYER_STOP = 133, + RAYGUI_ICON_PLAYER_NEXT = 134, + RAYGUI_ICON_PLAYER_RECORD = 135, + RAYGUI_ICON_MAGNET = 136, + RAYGUI_ICON_LOCK_CLOSE = 137, + RAYGUI_ICON_LOCK_OPEN = 138, + RAYGUI_ICON_CLOCK = 139, + RAYGUI_ICON_TOOLS = 140, + RAYGUI_ICON_GEAR = 141, + RAYGUI_ICON_GEAR_BIG = 142, + RAYGUI_ICON_BIN = 143, + RAYGUI_ICON_HAND_POINTER = 144, + RAYGUI_ICON_LASER = 145, + RAYGUI_ICON_COIN = 146, + RAYGUI_ICON_EXPLOSION = 147, + RAYGUI_ICON_1UP = 148, + RAYGUI_ICON_PLAYER = 149, + RAYGUI_ICON_PLAYER_JUMP = 150, + RAYGUI_ICON_KEY = 151, + RAYGUI_ICON_DEMON = 152, + RAYGUI_ICON_TEXT_POPUP = 153, + RAYGUI_ICON_GEAR_EX = 154, + RAYGUI_ICON_CRACK = 155, + RAYGUI_ICON_CRACK_POINTS = 156, + RAYGUI_ICON_STAR = 157, + RAYGUI_ICON_DOOR = 158, + RAYGUI_ICON_EXIT = 159, + RAYGUI_ICON_MODE_2D = 160, + RAYGUI_ICON_MODE_3D = 161, + RAYGUI_ICON_CUBE = 162, + RAYGUI_ICON_CUBE_FACE_TOP = 163, + RAYGUI_ICON_CUBE_FACE_LEFT = 164, + RAYGUI_ICON_CUBE_FACE_FRONT = 165, + RAYGUI_ICON_CUBE_FACE_BOTTOM = 166, + RAYGUI_ICON_CUBE_FACE_RIGHT = 167, + RAYGUI_ICON_CUBE_FACE_BACK = 168, + RAYGUI_ICON_CAMERA = 169, + RAYGUI_ICON_SPECIAL = 170, + RAYGUI_ICON_LINK_NET = 171, + RAYGUI_ICON_LINK_BOXES = 172, + RAYGUI_ICON_LINK_MULTI = 173, + RAYGUI_ICON_LINK = 174, + RAYGUI_ICON_LINK_BROKE = 175, + RAYGUI_ICON_TEXT_NOTES = 176, + RAYGUI_ICON_NOTEBOOK = 177, + RAYGUI_ICON_SUITCASE = 178, + RAYGUI_ICON_SUITCASE_ZIP = 179, + RAYGUI_ICON_MAILBOX = 180, + RAYGUI_ICON_MONITOR = 181, + RAYGUI_ICON_PRINTER = 182, + RAYGUI_ICON_PHOTO_CAMERA = 183, + RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184, + RAYGUI_ICON_HOUSE = 185, + RAYGUI_ICON_HEART = 186, + RAYGUI_ICON_CORNER = 187, + RAYGUI_ICON_VERTICAL_BARS = 188, + RAYGUI_ICON_VERTICAL_BARS_FILL = 189, + RAYGUI_ICON_LIFE_BARS = 190, + RAYGUI_ICON_INFO = 191, + RAYGUI_ICON_CROSSLINE = 192, + RAYGUI_ICON_HELP = 193, + RAYGUI_ICON_FILETYPE_ALPHA = 194, + RAYGUI_ICON_FILETYPE_HOME = 195, + RAYGUI_ICON_LAYERS_VISIBLE = 196, + RAYGUI_ICON_LAYERS = 197, + RAYGUI_ICON_WINDOW = 198, + RAYGUI_ICON_HIDPI = 199, + RAYGUI_ICON_200 = 200, + RAYGUI_ICON_201 = 201, + RAYGUI_ICON_202 = 202, + RAYGUI_ICON_203 = 203, + RAYGUI_ICON_204 = 204, + RAYGUI_ICON_205 = 205, + RAYGUI_ICON_206 = 206, + RAYGUI_ICON_207 = 207, + RAYGUI_ICON_208 = 208, + RAYGUI_ICON_209 = 209, + RAYGUI_ICON_210 = 210, + RAYGUI_ICON_211 = 211, + RAYGUI_ICON_212 = 212, + RAYGUI_ICON_213 = 213, + RAYGUI_ICON_214 = 214, + RAYGUI_ICON_215 = 215, + RAYGUI_ICON_216 = 216, + RAYGUI_ICON_217 = 217, + RAYGUI_ICON_218 = 218, + RAYGUI_ICON_219 = 219, + RAYGUI_ICON_220 = 220, + RAYGUI_ICON_221 = 221, + RAYGUI_ICON_222 = 222, + RAYGUI_ICON_223 = 223, + RAYGUI_ICON_224 = 224, + RAYGUI_ICON_225 = 225, + RAYGUI_ICON_226 = 226, + RAYGUI_ICON_227 = 227, + RAYGUI_ICON_228 = 228, + RAYGUI_ICON_229 = 229, + RAYGUI_ICON_230 = 230, + RAYGUI_ICON_231 = 231, + RAYGUI_ICON_232 = 232, + RAYGUI_ICON_233 = 233, + RAYGUI_ICON_234 = 234, + RAYGUI_ICON_235 = 235, + RAYGUI_ICON_236 = 236, + RAYGUI_ICON_237 = 237, + RAYGUI_ICON_238 = 238, + RAYGUI_ICON_239 = 239, + RAYGUI_ICON_240 = 240, + RAYGUI_ICON_241 = 241, + RAYGUI_ICON_242 = 242, + RAYGUI_ICON_243 = 243, + RAYGUI_ICON_244 = 244, + RAYGUI_ICON_245 = 245, + RAYGUI_ICON_246 = 246, + RAYGUI_ICON_247 = 247, + RAYGUI_ICON_248 = 248, + RAYGUI_ICON_249 = 249, + RAYGUI_ICON_250 = 250, + RAYGUI_ICON_251 = 251, + RAYGUI_ICON_252 = 252, + RAYGUI_ICON_253 = 253, + RAYGUI_ICON_254 = 254, + RAYGUI_ICON_255 = 255, +} guiIconName; + +//---------------------------------------------------------------------------------- +// Icons data for all gui possible icons (allocated on data segment by default) +// +// NOTE 1: Every icon is codified in binary form, using 1 bit per pixel, so, +// every 16x16 icon requires 8 integers (16*16/32) to be stored +// +// NOTE 2: A different icon set could be loaded over this array using GuiLoadIcons(), +// but loaded icons set must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS +// +// guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB +//---------------------------------------------------------------------------------- +static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_NONE + 0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // RAYGUI_ICON_FOLDER_FILE_OPEN + 0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // RAYGUI_ICON_FILE_SAVE_CLASSIC + 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024002, 0x44424282, 0x793e4102, 0x00000100, // RAYGUI_ICON_FOLDER_OPEN + 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024102, 0x44424102, 0x793e4282, 0x00000000, // RAYGUI_ICON_FOLDER_SAVE + 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x24442284, 0x21042104, 0x20042104, 0x00003ffc, // RAYGUI_ICON_FILE_OPEN + 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x21042104, 0x22842444, 0x20042104, 0x00003ffc, // RAYGUI_ICON_FILE_SAVE + 0x3ff00000, 0x201c2010, 0x00042004, 0x20041004, 0x20844784, 0x00841384, 0x20042784, 0x00003ffc, // RAYGUI_ICON_FILE_EXPORT + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x22042204, 0x22042f84, 0x20042204, 0x00003ffc, // RAYGUI_ICON_FILE_NEW + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x25042884, 0x25042204, 0x20042884, 0x00003ffc, // RAYGUI_ICON_FILE_DELETE + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_TEXT + 0x3ff00000, 0x201c2010, 0x27042004, 0x244424c4, 0x26442444, 0x20642664, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_AUDIO + 0x3ff00000, 0x201c2010, 0x26042604, 0x20042004, 0x35442884, 0x2414222c, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_IMAGE + 0x3ff00000, 0x201c2010, 0x20c42004, 0x22442144, 0x22442444, 0x20c42144, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_PLAY + 0x3ff00000, 0x3ffc2ff0, 0x3f3c2ff4, 0x3dbc2eb4, 0x3dbc2bb4, 0x3f3c2eb4, 0x3ffc2ff4, 0x00002ff4, // RAYGUI_ICON_FILETYPE_VIDEO + 0x3ff00000, 0x201c2010, 0x21842184, 0x21842004, 0x21842184, 0x21842184, 0x20042184, 0x00003ffc, // RAYGUI_ICON_FILETYPE_INFO + 0x0ff00000, 0x381c0810, 0x28042804, 0x28042804, 0x28042804, 0x28042804, 0x20102ffc, 0x00003ff0, // RAYGUI_ICON_FILE_COPY + 0x00000000, 0x701c0000, 0x079c1e14, 0x55a000f0, 0x079c00f0, 0x701c1e14, 0x00000000, 0x00000000, // RAYGUI_ICON_FILE_CUT + 0x01c00000, 0x13e41bec, 0x3f841004, 0x204420c4, 0x20442044, 0x20442044, 0x207c2044, 0x00003fc0, // RAYGUI_ICON_FILE_PASTE + 0x00000000, 0x3aa00fe0, 0x2abc2aa0, 0x2aa42aa4, 0x20042aa4, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_CURSOR_HAND + 0x00000000, 0x003c000c, 0x030800c8, 0x30100c10, 0x10202020, 0x04400840, 0x01800280, 0x00000000, // RAYGUI_ICON_CURSOR_POINTER + 0x00000000, 0x00180000, 0x01f00078, 0x03e007f0, 0x07c003e0, 0x04000e40, 0x00000000, 0x00000000, // RAYGUI_ICON_CURSOR_CLASSIC + 0x00000000, 0x04000000, 0x11000a00, 0x04400a80, 0x01100220, 0x00580088, 0x00000038, 0x00000000, // RAYGUI_ICON_PENCIL + 0x04000000, 0x15000a00, 0x50402880, 0x14102820, 0x05040a08, 0x015c028c, 0x007c00bc, 0x00000000, // RAYGUI_ICON_PENCIL_BIG + 0x01c00000, 0x01400140, 0x01400140, 0x0ff80140, 0x0ff80808, 0x0aa80808, 0x0aa80aa8, 0x00000ff8, // RAYGUI_ICON_BRUSH_CLASSIC + 0x1ffc0000, 0x5ffc7ffe, 0x40004000, 0x00807f80, 0x01c001c0, 0x01c001c0, 0x01c001c0, 0x00000080, // RAYGUI_ICON_BRUSH_PAINTER + 0x00000000, 0x00800000, 0x01c00080, 0x03e001c0, 0x07f003e0, 0x036006f0, 0x000001c0, 0x00000000, // RAYGUI_ICON_WATER_DROP + 0x00000000, 0x3e003800, 0x1f803f80, 0x0c201e40, 0x02080c10, 0x00840104, 0x00380044, 0x00000000, // RAYGUI_ICON_COLOR_PICKER + 0x00000000, 0x07800300, 0x1fe00fc0, 0x3f883fd0, 0x0e021f04, 0x02040402, 0x00f00108, 0x00000000, // RAYGUI_ICON_RUBBER + 0x00c00000, 0x02800140, 0x08200440, 0x20081010, 0x2ffe3004, 0x03f807fc, 0x00e001f0, 0x00000040, // RAYGUI_ICON_COLOR_BUCKET + 0x00000000, 0x21843ffc, 0x01800180, 0x01800180, 0x01800180, 0x01800180, 0x03c00180, 0x00000000, // RAYGUI_ICON_TEXT_T + 0x00800000, 0x01400180, 0x06200340, 0x0c100620, 0x1ff80c10, 0x380c1808, 0x70067004, 0x0000f80f, // RAYGUI_ICON_TEXT_A + 0x78000000, 0x50004000, 0x00004800, 0x03c003c0, 0x03c003c0, 0x00100000, 0x0002000a, 0x0000000e, // RAYGUI_ICON_SCALE + 0x75560000, 0x5e004002, 0x54001002, 0x41001202, 0x408200fe, 0x40820082, 0x40820082, 0x00006afe, // RAYGUI_ICON_RESIZE + 0x00000000, 0x3f003f00, 0x3f003f00, 0x3f003f00, 0x00400080, 0x001c0020, 0x001c001c, 0x00000000, // RAYGUI_ICON_FILTER_POINT + 0x6d800000, 0x00004080, 0x40804080, 0x40800000, 0x00406d80, 0x001c0020, 0x001c001c, 0x00000000, // RAYGUI_ICON_FILTER_BILINEAR + 0x40080000, 0x1ffe2008, 0x14081008, 0x11081208, 0x10481088, 0x10081028, 0x10047ff8, 0x00001002, // RAYGUI_ICON_CROP + 0x00100000, 0x3ffc0010, 0x2ab03550, 0x22b02550, 0x20b02150, 0x20302050, 0x2000fff0, 0x00002000, // RAYGUI_ICON_CROP_ALPHA + 0x40000000, 0x1ff82000, 0x04082808, 0x01082208, 0x00482088, 0x00182028, 0x35542008, 0x00000002, // RAYGUI_ICON_SQUARE_TOGGLE + 0x00000000, 0x02800280, 0x06c006c0, 0x0ea00ee0, 0x1e901eb0, 0x3e883e98, 0x7efc7e8c, 0x00000000, // RAYGUI_ICON_SIMMETRY + 0x01000000, 0x05600100, 0x1d480d50, 0x7d423d44, 0x3d447d42, 0x0d501d48, 0x01000560, 0x00000100, // RAYGUI_ICON_SIMMETRY_HORIZONTAL + 0x01800000, 0x04200240, 0x10080810, 0x00001ff8, 0x00007ffe, 0x0ff01ff8, 0x03c007e0, 0x00000180, // RAYGUI_ICON_SIMMETRY_VERTICAL + 0x00000000, 0x010800f0, 0x02040204, 0x02040204, 0x07f00308, 0x1c000e00, 0x30003800, 0x00000000, // RAYGUI_ICON_LENS + 0x00000000, 0x061803f0, 0x08240c0c, 0x08040814, 0x0c0c0804, 0x23f01618, 0x18002400, 0x00000000, // RAYGUI_ICON_LENS_BIG + 0x00000000, 0x00000000, 0x1c7007c0, 0x638e3398, 0x1c703398, 0x000007c0, 0x00000000, 0x00000000, // RAYGUI_ICON_EYE_ON + 0x00000000, 0x10002000, 0x04700fc0, 0x610e3218, 0x1c703098, 0x001007a0, 0x00000008, 0x00000000, // RAYGUI_ICON_EYE_OFF + 0x00000000, 0x00007ffc, 0x40047ffc, 0x10102008, 0x04400820, 0x02800280, 0x02800280, 0x00000100, // RAYGUI_ICON_FILTER_TOP + 0x00000000, 0x40027ffe, 0x10082004, 0x04200810, 0x02400240, 0x02400240, 0x01400240, 0x000000c0, // RAYGUI_ICON_FILTER + 0x00800000, 0x00800080, 0x00000080, 0x3c9e0000, 0x00000000, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_POINT + 0x00800000, 0x00800080, 0x00800080, 0x3f7e01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_SMALL + 0x00800000, 0x00800080, 0x03e00080, 0x3e3e0220, 0x03e00220, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_BIG + 0x01000000, 0x04400280, 0x01000100, 0x43842008, 0x43849ab2, 0x01002008, 0x04400100, 0x01000280, // RAYGUI_ICON_TARGET_MOVE + 0x01000000, 0x04400280, 0x01000100, 0x41042108, 0x41049ff2, 0x01002108, 0x04400100, 0x01000280, // RAYGUI_ICON_CURSOR_MOVE + 0x781e0000, 0x500a4002, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x4002500a, 0x0000781e, // RAYGUI_ICON_CURSOR_SCALE + 0x00000000, 0x20003c00, 0x24002800, 0x01000200, 0x00400080, 0x00140024, 0x003c0004, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_RIGHT + 0x00000000, 0x0004003c, 0x00240014, 0x00800040, 0x02000100, 0x28002400, 0x3c002000, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_LEFT + 0x00000000, 0x00100020, 0x10101fc8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RAYGUI_ICON_UNDO + 0x00000000, 0x08000400, 0x080813f8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RAYGUI_ICON_REDO + 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3f902020, 0x00400020, 0x00000000, // RAYGUI_ICON_REREDO + 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3fc82010, 0x00200010, 0x00000000, // RAYGUI_ICON_MUTATE + 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18101020, 0x00100fc8, 0x00000020, // RAYGUI_ICON_ROTATE + 0x00000000, 0x04000200, 0x240429fc, 0x20042204, 0x20442004, 0x3f942024, 0x00400020, 0x00000000, // RAYGUI_ICON_REPEAT + 0x00000000, 0x20001000, 0x22104c0e, 0x00801120, 0x11200040, 0x4c0e2210, 0x10002000, 0x00000000, // RAYGUI_ICON_SHUFFLE + 0x7ffe0000, 0x50024002, 0x44024802, 0x41024202, 0x40424082, 0x40124022, 0x4002400a, 0x00007ffe, // RAYGUI_ICON_EMPTYBOX + 0x00800000, 0x03e00080, 0x08080490, 0x3c9e0808, 0x08080808, 0x03e00490, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET + 0x00800000, 0x00800080, 0x00800080, 0x3ffe01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_SMALL_FILL + 0x00800000, 0x00800080, 0x03e00080, 0x3ffe03e0, 0x03e003e0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_BIG_FILL + 0x01000000, 0x07c00380, 0x01000100, 0x638c2008, 0x638cfbbe, 0x01002008, 0x07c00100, 0x01000380, // RAYGUI_ICON_TARGET_MOVE_FILL + 0x01000000, 0x07c00380, 0x01000100, 0x610c2108, 0x610cfffe, 0x01002108, 0x07c00100, 0x01000380, // RAYGUI_ICON_CURSOR_MOVE_FILL + 0x781e0000, 0x6006700e, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x700e6006, 0x0000781e, // RAYGUI_ICON_CURSOR_SCALE_FILL + 0x00000000, 0x38003c00, 0x24003000, 0x01000200, 0x00400080, 0x000c0024, 0x003c001c, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_RIGHT + 0x00000000, 0x001c003c, 0x0024000c, 0x00800040, 0x02000100, 0x30002400, 0x3c003800, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_LEFT + 0x00000000, 0x00300020, 0x10301ff8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RAYGUI_ICON_UNDO_FILL + 0x00000000, 0x0c000400, 0x0c081ff8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RAYGUI_ICON_REDO_FILL + 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3ff02060, 0x00400060, 0x00000000, // RAYGUI_ICON_REREDO_FILL + 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3ff82030, 0x00200030, 0x00000000, // RAYGUI_ICON_MUTATE_FILL + 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18301020, 0x00300ff8, 0x00000020, // RAYGUI_ICON_ROTATE_FILL + 0x00000000, 0x06000200, 0x26042ffc, 0x20042204, 0x20442004, 0x3ff42064, 0x00400060, 0x00000000, // RAYGUI_ICON_REPEAT_FILL + 0x00000000, 0x30001000, 0x32107c0e, 0x00801120, 0x11200040, 0x7c0e3210, 0x10003000, 0x00000000, // RAYGUI_ICON_SHUFFLE_FILL + 0x00000000, 0x30043ffc, 0x24042804, 0x21042204, 0x20442084, 0x20142024, 0x3ffc200c, 0x00000000, // RAYGUI_ICON_EMPTYBOX_SMALL + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX + 0x00000000, 0x23c43ffc, 0x23c423c4, 0x200423c4, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP + 0x00000000, 0x3e043ffc, 0x3e043e04, 0x20043e04, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x3e043e04, 0x3e043e04, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x3e042004, 0x3e043e04, 0x3ffc3e04, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x23c42004, 0x23c423c4, 0x3ffc23c4, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x207c2004, 0x207c207c, 0x3ffc207c, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM_LEFT + 0x00000000, 0x20043ffc, 0x20042004, 0x207c207c, 0x207c207c, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_LEFT + 0x00000000, 0x207c3ffc, 0x207c207c, 0x2004207c, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP_LEFT + 0x00000000, 0x20043ffc, 0x20042004, 0x23c423c4, 0x23c423c4, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_CIRCLE_MASK + 0x7ffe0000, 0x40024002, 0x47e24182, 0x4ff247e2, 0x47e24ff2, 0x418247e2, 0x40024002, 0x00007ffe, // RAYGUI_ICON_BOX_CENTER + 0x7fff0000, 0x40014001, 0x40014001, 0x49555ddd, 0x4945495d, 0x400149c5, 0x40014001, 0x00007fff, // RAYGUI_ICON_POT + 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x404e40ce, 0x48125432, 0x4006540e, 0x00007ffe, // RAYGUI_ICON_ALPHA_MULTIPLY + 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x5c4e40ce, 0x44124432, 0x40065c0e, 0x00007ffe, // RAYGUI_ICON_ALPHA_CLEAR + 0x7ffe0000, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x00007ffe, // RAYGUI_ICON_DITHERING + 0x07fe0000, 0x1ffa0002, 0x7fea000a, 0x402a402a, 0x5b2a512a, 0x5128552a, 0x40205128, 0x00007fe0, // RAYGUI_ICON_MIPMAPS + 0x00000000, 0x1ff80000, 0x12481248, 0x12481ff8, 0x1ff81248, 0x12481248, 0x00001ff8, 0x00000000, // RAYGUI_ICON_BOX_GRID + 0x12480000, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x00001248, // RAYGUI_ICON_GRID + 0x00000000, 0x1c380000, 0x1c3817e8, 0x08100810, 0x08100810, 0x17e81c38, 0x00001c38, 0x00000000, // RAYGUI_ICON_BOX_CORNERS_SMALL + 0x700e0000, 0x700e5ffa, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x5ffa700e, 0x0000700e, // RAYGUI_ICON_BOX_CORNERS_BIG + 0x3f7e0000, 0x21422142, 0x21422142, 0x00003f7e, 0x21423f7e, 0x21422142, 0x3f7e2142, 0x00000000, // RAYGUI_ICON_FOUR_BOXES + 0x00000000, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x00000000, // RAYGUI_ICON_GRID_FILL + 0x7ffe0000, 0x7ffe7ffe, 0x77fe7000, 0x77fe77fe, 0x777e7700, 0x777e777e, 0x777e777e, 0x0000777e, // RAYGUI_ICON_BOX_MULTISIZE + 0x781e0000, 0x40024002, 0x00004002, 0x01800000, 0x00000180, 0x40020000, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_SMALL + 0x781e0000, 0x40024002, 0x00004002, 0x03c003c0, 0x03c003c0, 0x40020000, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_MEDIUM + 0x781e0000, 0x40024002, 0x07e04002, 0x07e007e0, 0x07e007e0, 0x400207e0, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_BIG + 0x781e0000, 0x5ffa4002, 0x1ff85ffa, 0x1ff81ff8, 0x1ff81ff8, 0x5ffa1ff8, 0x40025ffa, 0x0000781e, // RAYGUI_ICON_ZOOM_ALL + 0x00000000, 0x2004381c, 0x00002004, 0x00000000, 0x00000000, 0x20040000, 0x381c2004, 0x00000000, // RAYGUI_ICON_ZOOM_CENTER + 0x00000000, 0x1db80000, 0x10081008, 0x10080000, 0x00001008, 0x10081008, 0x00001db8, 0x00000000, // RAYGUI_ICON_BOX_DOTS_SMALL + 0x35560000, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x35562002, 0x00000000, // RAYGUI_ICON_BOX_DOTS_BIG + 0x7ffe0000, 0x40024002, 0x48124ff2, 0x49924812, 0x48124992, 0x4ff24812, 0x40024002, 0x00007ffe, // RAYGUI_ICON_BOX_CONCENTRIC + 0x00000000, 0x10841ffc, 0x10841084, 0x1ffc1084, 0x10841084, 0x10841084, 0x00001ffc, 0x00000000, // RAYGUI_ICON_BOX_GRID_BIG + 0x00000000, 0x00000000, 0x10000000, 0x04000800, 0x01040200, 0x00500088, 0x00000020, 0x00000000, // RAYGUI_ICON_OK_TICK + 0x00000000, 0x10080000, 0x04200810, 0x01800240, 0x02400180, 0x08100420, 0x00001008, 0x00000000, // RAYGUI_ICON_CROSS + 0x00000000, 0x02000000, 0x00800100, 0x00200040, 0x00200010, 0x00800040, 0x02000100, 0x00000000, // RAYGUI_ICON_ARROW_LEFT + 0x00000000, 0x00400000, 0x01000080, 0x04000200, 0x04000800, 0x01000200, 0x00400080, 0x00000000, // RAYGUI_ICON_ARROW_RIGHT + 0x00000000, 0x00000000, 0x00000000, 0x08081004, 0x02200410, 0x00800140, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_DOWN + 0x00000000, 0x00000000, 0x01400080, 0x04100220, 0x10040808, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_UP + 0x00000000, 0x02000000, 0x03800300, 0x03e003c0, 0x03e003f0, 0x038003c0, 0x02000300, 0x00000000, // RAYGUI_ICON_ARROW_LEFT_FILL + 0x00000000, 0x00400000, 0x01c000c0, 0x07c003c0, 0x07c00fc0, 0x01c003c0, 0x004000c0, 0x00000000, // RAYGUI_ICON_ARROW_RIGHT_FILL + 0x00000000, 0x00000000, 0x00000000, 0x0ff81ffc, 0x03e007f0, 0x008001c0, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_DOWN_FILL + 0x00000000, 0x00000000, 0x01c00080, 0x07f003e0, 0x1ffc0ff8, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_UP_FILL + 0x00000000, 0x18a008c0, 0x32881290, 0x24822686, 0x26862482, 0x12903288, 0x08c018a0, 0x00000000, // RAYGUI_ICON_AUDIO + 0x00000000, 0x04800780, 0x004000c0, 0x662000f0, 0x08103c30, 0x130a0e18, 0x0000318e, 0x00000000, // RAYGUI_ICON_FX + 0x00000000, 0x00800000, 0x08880888, 0x2aaa0a8a, 0x0a8a2aaa, 0x08880888, 0x00000080, 0x00000000, // RAYGUI_ICON_WAVE + 0x00000000, 0x00600000, 0x01080090, 0x02040108, 0x42044204, 0x24022402, 0x00001800, 0x00000000, // RAYGUI_ICON_WAVE_SINUS + 0x00000000, 0x07f80000, 0x04080408, 0x04080408, 0x04080408, 0x7c0e0408, 0x00000000, 0x00000000, // RAYGUI_ICON_WAVE_SQUARE + 0x00000000, 0x00000000, 0x00a00040, 0x22084110, 0x08021404, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_WAVE_TRIANGULAR + 0x00000000, 0x00000000, 0x04200000, 0x01800240, 0x02400180, 0x00000420, 0x00000000, 0x00000000, // RAYGUI_ICON_CROSS_SMALL + 0x00000000, 0x18380000, 0x12281428, 0x10a81128, 0x112810a8, 0x14281228, 0x00001838, 0x00000000, // RAYGUI_ICON_PLAYER_PREVIOUS + 0x00000000, 0x18000000, 0x11801600, 0x10181060, 0x10601018, 0x16001180, 0x00001800, 0x00000000, // RAYGUI_ICON_PLAYER_PLAY_BACK + 0x00000000, 0x00180000, 0x01880068, 0x18080608, 0x06081808, 0x00680188, 0x00000018, 0x00000000, // RAYGUI_ICON_PLAYER_PLAY + 0x00000000, 0x1e780000, 0x12481248, 0x12481248, 0x12481248, 0x12481248, 0x00001e78, 0x00000000, // RAYGUI_ICON_PLAYER_PAUSE + 0x00000000, 0x1ff80000, 0x10081008, 0x10081008, 0x10081008, 0x10081008, 0x00001ff8, 0x00000000, // RAYGUI_ICON_PLAYER_STOP + 0x00000000, 0x1c180000, 0x14481428, 0x15081488, 0x14881508, 0x14281448, 0x00001c18, 0x00000000, // RAYGUI_ICON_PLAYER_NEXT + 0x00000000, 0x03c00000, 0x08100420, 0x10081008, 0x10081008, 0x04200810, 0x000003c0, 0x00000000, // RAYGUI_ICON_PLAYER_RECORD + 0x00000000, 0x0c3007e0, 0x13c81818, 0x14281668, 0x14281428, 0x1c381c38, 0x08102244, 0x00000000, // RAYGUI_ICON_MAGNET + 0x07c00000, 0x08200820, 0x3ff80820, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RAYGUI_ICON_LOCK_CLOSE + 0x07c00000, 0x08000800, 0x3ff80800, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RAYGUI_ICON_LOCK_OPEN + 0x01c00000, 0x0c180770, 0x3086188c, 0x60832082, 0x60034781, 0x30062002, 0x0c18180c, 0x01c00770, // RAYGUI_ICON_CLOCK + 0x0a200000, 0x1b201b20, 0x04200e20, 0x04200420, 0x04700420, 0x0e700e70, 0x0e700e70, 0x04200e70, // RAYGUI_ICON_TOOLS + 0x01800000, 0x3bdc318c, 0x0ff01ff8, 0x7c3e1e78, 0x1e787c3e, 0x1ff80ff0, 0x318c3bdc, 0x00000180, // RAYGUI_ICON_GEAR + 0x01800000, 0x3ffc318c, 0x1c381ff8, 0x781e1818, 0x1818781e, 0x1ff81c38, 0x318c3ffc, 0x00000180, // RAYGUI_ICON_GEAR_BIG + 0x00000000, 0x08080ff8, 0x08081ffc, 0x0aa80aa8, 0x0aa80aa8, 0x0aa80aa8, 0x08080aa8, 0x00000ff8, // RAYGUI_ICON_BIN + 0x00000000, 0x00000000, 0x20043ffc, 0x08043f84, 0x04040f84, 0x04040784, 0x000007fc, 0x00000000, // RAYGUI_ICON_HAND_POINTER + 0x00000000, 0x24400400, 0x00001480, 0x6efe0e00, 0x00000e00, 0x24401480, 0x00000400, 0x00000000, // RAYGUI_ICON_LASER + 0x00000000, 0x03c00000, 0x08300460, 0x11181118, 0x11181118, 0x04600830, 0x000003c0, 0x00000000, // RAYGUI_ICON_COIN + 0x00000000, 0x10880080, 0x06c00810, 0x366c07e0, 0x07e00240, 0x00001768, 0x04200240, 0x00000000, // RAYGUI_ICON_EXPLOSION + 0x00000000, 0x3d280000, 0x2528252c, 0x3d282528, 0x05280528, 0x05e80528, 0x00000000, 0x00000000, // RAYGUI_ICON_1UP + 0x01800000, 0x03c003c0, 0x018003c0, 0x0ff007e0, 0x0bd00bd0, 0x0a500bd0, 0x02400240, 0x02400240, // RAYGUI_ICON_PLAYER + 0x01800000, 0x03c003c0, 0x118013c0, 0x03c81ff8, 0x07c003c8, 0x04400440, 0x0c080478, 0x00000000, // RAYGUI_ICON_PLAYER_JUMP + 0x3ff80000, 0x30183ff8, 0x30183018, 0x3ff83ff8, 0x03000300, 0x03c003c0, 0x03e00300, 0x000003e0, // RAYGUI_ICON_KEY + 0x3ff80000, 0x3ff83ff8, 0x33983ff8, 0x3ff83398, 0x3ff83ff8, 0x00000540, 0x0fe00aa0, 0x00000fe0, // RAYGUI_ICON_DEMON + 0x00000000, 0x0ff00000, 0x20041008, 0x25442004, 0x10082004, 0x06000bf0, 0x00000300, 0x00000000, // RAYGUI_ICON_TEXT_POPUP + 0x00000000, 0x11440000, 0x07f00be8, 0x1c1c0e38, 0x1c1c0c18, 0x07f00e38, 0x11440be8, 0x00000000, // RAYGUI_ICON_GEAR_EX + 0x00000000, 0x20080000, 0x0c601010, 0x07c00fe0, 0x07c007c0, 0x0c600fe0, 0x20081010, 0x00000000, // RAYGUI_ICON_CRACK + 0x00000000, 0x20080000, 0x0c601010, 0x04400fe0, 0x04405554, 0x0c600fe0, 0x20081010, 0x00000000, // RAYGUI_ICON_CRACK_POINTS + 0x00000000, 0x00800080, 0x01c001c0, 0x1ffc3ffe, 0x03e007f0, 0x07f003e0, 0x0c180770, 0x00000808, // RAYGUI_ICON_STAR + 0x0ff00000, 0x08180810, 0x08100818, 0x0a100810, 0x08180810, 0x08100818, 0x08100810, 0x00001ff8, // RAYGUI_ICON_DOOR + 0x0ff00000, 0x08100810, 0x08100810, 0x10100010, 0x4f902010, 0x10102010, 0x08100010, 0x00000ff0, // RAYGUI_ICON_EXIT + 0x00040000, 0x001f000e, 0x0ef40004, 0x12f41284, 0x0ef41214, 0x10040004, 0x7ffc3004, 0x10003000, // RAYGUI_ICON_MODE_2D + 0x78040000, 0x501f600e, 0x0ef44004, 0x12f41284, 0x0ef41284, 0x10140004, 0x7ffc300c, 0x10003000, // RAYGUI_ICON_MODE_3D + 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE + 0x7fe00000, 0x5ff87ff0, 0x47fe4ffc, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_TOP + 0x7fe00000, 0x50386030, 0x47fe483c, 0x443e443e, 0x443e443e, 0x241e75fe, 0x0c06140e, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_LEFT + 0x7fe00000, 0x50286030, 0x47fe4804, 0x47fe47fe, 0x47fe47fe, 0x27fe77fe, 0x0ffe17fe, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_FRONT + 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x3ff27fe2, 0x0ffe1ffa, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_BOTTOM + 0x7fe00000, 0x70286030, 0x7ffe7804, 0x7c227c02, 0x7c227c22, 0x3c127de2, 0x0c061c0a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_RIGHT + 0x7fe00000, 0x7fe87ff0, 0x7ffe7fe4, 0x7fe27fe2, 0x7fe27fe2, 0x24127fe2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_BACK + 0x00000000, 0x2a0233fe, 0x22022602, 0x22022202, 0x2a022602, 0x00a033fe, 0x02080110, 0x00000000, // RAYGUI_ICON_CAMERA + 0x00000000, 0x200c3ffc, 0x000c000c, 0x3ffc000c, 0x30003000, 0x30003000, 0x3ffc3004, 0x00000000, // RAYGUI_ICON_SPECIAL + 0x00000000, 0x0022003e, 0x012201e2, 0x0100013e, 0x01000100, 0x79000100, 0x4f004900, 0x00007800, // RAYGUI_ICON_LINK_NET + 0x00000000, 0x44007c00, 0x45004600, 0x00627cbe, 0x00620022, 0x45007cbe, 0x44004600, 0x00007c00, // RAYGUI_ICON_LINK_BOXES + 0x00000000, 0x0044007c, 0x0010007c, 0x3f100010, 0x3f1021f0, 0x3f100010, 0x3f0021f0, 0x00000000, // RAYGUI_ICON_LINK_MULTI + 0x00000000, 0x0044007c, 0x00440044, 0x0010007c, 0x00100010, 0x44107c10, 0x440047f0, 0x00007c00, // RAYGUI_ICON_LINK + 0x00000000, 0x0044007c, 0x00440044, 0x0000007c, 0x00000010, 0x44007c10, 0x44004550, 0x00007c00, // RAYGUI_ICON_LINK_BROKE + 0x02a00000, 0x22a43ffc, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RAYGUI_ICON_TEXT_NOTES + 0x3ffc0000, 0x20042004, 0x245e27c4, 0x27c42444, 0x2004201e, 0x201e2004, 0x20042004, 0x00003ffc, // RAYGUI_ICON_NOTEBOOK + 0x00000000, 0x07e00000, 0x04200420, 0x24243ffc, 0x24242424, 0x24242424, 0x3ffc2424, 0x00000000, // RAYGUI_ICON_SUITCASE + 0x00000000, 0x0fe00000, 0x08200820, 0x40047ffc, 0x7ffc5554, 0x40045554, 0x7ffc4004, 0x00000000, // RAYGUI_ICON_SUITCASE_ZIP + 0x00000000, 0x20043ffc, 0x3ffc2004, 0x13c81008, 0x100813c8, 0x10081008, 0x1ff81008, 0x00000000, // RAYGUI_ICON_MAILBOX + 0x00000000, 0x40027ffe, 0x5ffa5ffa, 0x5ffa5ffa, 0x40025ffa, 0x03c07ffe, 0x1ff81ff8, 0x00000000, // RAYGUI_ICON_MONITOR + 0x0ff00000, 0x6bfe7ffe, 0x7ffe7ffe, 0x68167ffe, 0x08106816, 0x08100810, 0x0ff00810, 0x00000000, // RAYGUI_ICON_PRINTER + 0x3ff80000, 0xfffe2008, 0x870a8002, 0x904a888a, 0x904a904a, 0x870a888a, 0xfffe8002, 0x00000000, // RAYGUI_ICON_PHOTO_CAMERA + 0x0fc00000, 0xfcfe0cd8, 0x8002fffe, 0x84428382, 0x84428442, 0x80028382, 0xfffe8002, 0x00000000, // RAYGUI_ICON_PHOTO_CAMERA_FLASH + 0x00000000, 0x02400180, 0x08100420, 0x20041008, 0x23c42004, 0x22442244, 0x3ffc2244, 0x00000000, // RAYGUI_ICON_HOUSE + 0x00000000, 0x1c700000, 0x3ff83ef8, 0x3ff83ff8, 0x0fe01ff0, 0x038007c0, 0x00000100, 0x00000000, // RAYGUI_ICON_HEART + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0xe000c000, // RAYGUI_ICON_CORNER + 0x00000000, 0x14001c00, 0x15c01400, 0x15401540, 0x155c1540, 0x15541554, 0x1ddc1554, 0x00000000, // RAYGUI_ICON_VERTICAL_BARS + 0x00000000, 0x03000300, 0x1b001b00, 0x1b601b60, 0x1b6c1b60, 0x1b6c1b6c, 0x1b6c1b6c, 0x00000000, // RAYGUI_ICON_VERTICAL_BARS_FILL + 0x00000000, 0x00000000, 0x403e7ffe, 0x7ffe403e, 0x7ffe0000, 0x43fe43fe, 0x00007ffe, 0x00000000, // RAYGUI_ICON_LIFE_BARS + 0x7ffc0000, 0x43844004, 0x43844284, 0x43844004, 0x42844284, 0x42844284, 0x40044384, 0x00007ffc, // RAYGUI_ICON_INFO + 0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // RAYGUI_ICON_CROSSLINE + 0x00000000, 0x1ff01ff0, 0x18301830, 0x1f001830, 0x03001f00, 0x00000300, 0x03000300, 0x00000000, // RAYGUI_ICON_HELP + 0x3ff00000, 0x2abc3550, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x00003ffc, // RAYGUI_ICON_FILETYPE_ALPHA + 0x3ff00000, 0x201c2010, 0x22442184, 0x28142424, 0x29942814, 0x2ff42994, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_HOME + 0x07fe0000, 0x04020402, 0x7fe20402, 0x44224422, 0x44224422, 0x402047fe, 0x40204020, 0x00007fe0, // RAYGUI_ICON_LAYERS_VISIBLE + 0x07fe0000, 0x04020402, 0x7c020402, 0x44024402, 0x44024402, 0x402047fe, 0x40204020, 0x00007fe0, // RAYGUI_ICON_LAYERS + 0x00000000, 0x40027ffe, 0x7ffe4002, 0x40024002, 0x40024002, 0x40024002, 0x7ffe4002, 0x00000000, // RAYGUI_ICON_WINDOW + 0x09100000, 0x09f00910, 0x09100910, 0x00000910, 0x24a2779e, 0x27a224a2, 0x709e20a2, 0x00000000, // RAYGUI_ICON_HIDPI + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_200 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_201 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_202 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_203 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_204 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_205 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_206 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_207 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_208 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_209 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_210 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_211 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_212 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_213 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_214 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_215 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_216 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_217 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_218 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_219 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_220 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_221 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_222 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_223 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_224 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_225 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_226 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_227 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_228 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_229 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_230 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_231 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_232 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_233 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_234 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_235 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_236 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_237 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_238 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_239 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_240 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_241 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_242 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_243 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_244 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_245 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_246 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_247 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_248 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_249 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_250 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_251 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_252 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_253 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_254 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_255 +}; + +#endif // !RAYGUI_NO_ICONS && !RAYGUI_CUSTOM_ICONS + +#ifndef RAYGUI_ICON_SIZE + #define RAYGUI_ICON_SIZE 0 +#endif + +#define RAYGUI_MAX_CONTROLS 16 // Maximum number of standard controls +#define RAYGUI_MAX_PROPS_BASE 16 // Maximum number of standard properties +#define RAYGUI_MAX_PROPS_EXTENDED 8 // Maximum number of extended properties + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- +// Gui control property style color element +typedef enum { BORDER = 0, BASE, TEXT, OTHER } GuiPropertyElement; + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +static GuiControlState guiState = GUI_STATE_NORMAL; + +static Font guiFont = { 0 }; // Gui current font (WARNING: highly coupled to raylib) +static bool guiLocked = false; // Gui lock state (no inputs processed) +static float guiAlpha = 1.0f; // Gui element transpacency on drawing + +//---------------------------------------------------------------------------------- +// Style data array for all gui style properties (allocated on data segment by default) +// +// NOTE 1: First set of BASE properties are generic to all controls but could be individually +// overwritten per control, first set of EXTENDED properties are generic to all controls and +// can not be overwritten individually but custom EXTENDED properties can be used by control +// +// NOTE 2: A new style set could be loaded over this array using GuiLoadStyle(), +// but default gui style could always be recovered with GuiLoadStyleDefault() +// +// guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB +//---------------------------------------------------------------------------------- +static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)] = { 0 }; + +static bool guiStyleLoaded = false; // Style loaded flag for lazy style initialization + +//---------------------------------------------------------------------------------- +// Standalone Mode Functions Declaration +// +// NOTE: raygui depend on some raylib input and drawing functions +// To use raygui as standalone library, below functions must be defined by the user +//---------------------------------------------------------------------------------- +#if defined(RAYGUI_STANDALONE) + +#define KEY_RIGHT 262 +#define KEY_LEFT 263 +#define KEY_DOWN 264 +#define KEY_UP 265 +#define KEY_BACKSPACE 259 +#define KEY_ENTER 257 + +#define MOUSE_LEFT_BUTTON 0 + +// Input required functions +//------------------------------------------------------------------------------- +static Vector2 GetMousePosition(void); +static float GetMouseWheelMove(void); +static bool IsMouseButtonDown(int button); +static bool IsMouseButtonPressed(int button); +static bool IsMouseButtonReleased(int button); + +static bool IsKeyDown(int key); +static bool IsKeyPressed(int key); +static int GetCharPressed(void); // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() +//------------------------------------------------------------------------------- + +// Drawing required functions +//------------------------------------------------------------------------------- +static void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle(), GuiDrawIcon() + +static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // -- GuiColorPicker() +//------------------------------------------------------------------------------- + +// Text required functions +//------------------------------------------------------------------------------- +static Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // -- GuiLoadStyle() +static Font GetFontDefault(void); // -- GuiLoadStyleDefault() +static Texture2D LoadTextureFromImage(Image image); // -- GuiLoadStyle() +static void SetShapesTexture(Texture2D tex, Rectangle rec); // -- GuiLoadStyle() +static char *LoadFileText(const char *fileName); // -- GuiLoadStyle() +static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() + +static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // -- GetTextWidth(), GuiTextBoxMulti() +static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() +//------------------------------------------------------------------------------- + +// raylib functions already implemented in raygui +//------------------------------------------------------------------------------- +static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value +static int ColorToInt(Color color); // Returns hexadecimal value for a Color +static Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +static const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' +static const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +static int TextToInteger(const char *text); // Get integer value from text +static int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded text +static const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode codepoint into UTF-8 text (char array size returned as parameter) + +static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw rectangle vertical gradient +//------------------------------------------------------------------------------- + +#endif // RAYGUI_STANDALONE + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static int GetTextWidth(const char *text); // Gui get text width using default font +static Rectangle GetTextBounds(int control, Rectangle bounds); // Get text bounds considering control bounds +static const char *GetTextIcon(const char *text, int *iconId); // Get text icon if provided and move text cursor + +static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint); // Gui draw text using default font +static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color); // Gui draw rectangle using default raygui style + +static const char **GuiTextSplit(const char *text, int *count, int *textRow); // Split controls text into multiple strings +static Vector3 ConvertHSVtoRGB(Vector3 hsv); // Convert color data from HSV to RGB +static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color data from RGB to HSV + +//---------------------------------------------------------------------------------- +// Gui Setup Functions Definition +//---------------------------------------------------------------------------------- +// Enable gui global state +// NOTE: We check for GUI_STATE_DISABLED to avoid messing custom global state setups +void GuiEnable(void) { if (guiState == GUI_STATE_DISABLED) guiState = GUI_STATE_NORMAL; } + +// Disable gui global state +// NOTE: We check for GUI_STATE_NORMAL to avoid messing custom global state setups +void GuiDisable(void) { if (guiState == GUI_STATE_NORMAL) guiState = GUI_STATE_DISABLED; } + +// Lock gui global state +void GuiLock(void) { guiLocked = true; } + +// Unlock gui global state +void GuiUnlock(void) { guiLocked = false; } + +// Check if gui is locked (global state) +bool GuiIsLocked(void) { return guiLocked; } + +// Set gui controls alpha global state +void GuiFade(float alpha) +{ + if (alpha < 0.0f) alpha = 0.0f; + else if (alpha > 1.0f) alpha = 1.0f; + + guiAlpha = alpha; +} + +// Set gui state (global state) +void GuiSetState(int state) { guiState = (GuiControlState)state; } + +// Get gui state (global state) +int GuiGetState(void) { return guiState; } + +// Set custom gui font +// NOTE: Font loading/unloading is external to raygui +void GuiSetFont(Font font) +{ + if (font.texture.id > 0) + { + // NOTE: If we try to setup a font but default style has not been + // lazily loaded before, it will be overwritten, so we need to force + // default style loading first + if (!guiStyleLoaded) GuiLoadStyleDefault(); + + guiFont = font; + GuiSetStyle(DEFAULT, TEXT_SIZE, font.baseSize); + } +} + +// Get custom gui font +Font GuiGetFont(void) +{ + return guiFont; +} + +// Set control style property value +void GuiSetStyle(int control, int property, int value) +{ + if (!guiStyleLoaded) GuiLoadStyleDefault(); + guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; + + // Default properties are propagated to all controls + if ((control == 0) && (property < RAYGUI_MAX_PROPS_BASE)) + { + for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) guiStyle[i*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; + } +} + +// Get control style property value +int GuiGetStyle(int control, int property) +{ + if (!guiStyleLoaded) GuiLoadStyleDefault(); + return guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property]; +} + +//---------------------------------------------------------------------------------- +// Gui Controls Functions Definition +//---------------------------------------------------------------------------------- + +// Window Box control +bool GuiWindowBox(Rectangle bounds, const char *title) +{ + // Window title bar height (including borders) + // NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() + #if !defined(RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT) + #define RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT 24 + #endif + + //GuiControlState state = guiState; + bool clicked = false; + + int statusBarHeight = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT; + + Rectangle statusBar = { bounds.x, bounds.y, bounds.width, (float)statusBarHeight }; + if (bounds.height < statusBarHeight*2.0f) bounds.height = statusBarHeight*2.0f; + + Rectangle windowPanel = { bounds.x, bounds.y + (float)statusBarHeight - 1, bounds.width, bounds.height - (float)statusBarHeight + 1 }; + Rectangle closeButtonRec = { statusBar.x + statusBar.width - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - 20, + statusBar.y + statusBarHeight/2.0f - 18.0f/2.0f, 18, 18 }; + + // Update control + //-------------------------------------------------------------------- + // NOTE: Logic is directly managed by button + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiStatusBar(statusBar, title); // Draw window header as status bar + GuiPanel(windowPanel); // Draw window base + + // Draw window close button + int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); + int tempTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, BORDER_WIDTH, 1); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); +#if defined(RAYGUI_NO_ICONS) + clicked = GuiButton(closeButtonRec, "x"); +#else + clicked = GuiButton(closeButtonRec, GuiIconText(RAYGUI_ICON_CROSS_SMALL, NULL)); +#endif + GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlignment); + //-------------------------------------------------------------------- + + return clicked; +} + +// Group Box control with text name +void GuiGroupBox(Rectangle bounds, const char *text) +{ + #if !defined(RAYGUI_GROUPBOX_LINE_THICK) + #define RAYGUI_GROUPBOX_LINE_THICK 1 + #endif + #if !defined(RAYGUI_GROUPBOX_TEXT_PADDING) + #define RAYGUI_GROUPBOX_TEXT_PADDING 10 + #endif + + GuiControlState state = guiState; + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + + GuiLine(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, bounds.width, 1 }, text); + //-------------------------------------------------------------------- +} + +// Line control +void GuiLine(Rectangle bounds, const char *text) +{ + #if !defined(RAYGUI_LINE_TEXT_PADDING) + #define RAYGUI_LINE_TEXT_PADDING 8 + #endif + + GuiControlState state = guiState; + + Color color = Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha); + + // Draw control + //-------------------------------------------------------------------- + if (text == NULL) GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height/2, bounds.width, 1 }, 0, BLANK, color); + else + { + Rectangle textBounds = { 0 }; + textBounds.width = (float)GetTextWidth(text); + textBounds.height = bounds.height; + textBounds.x = bounds.x + RAYGUI_LINE_TEXT_PADDING; + textBounds.y = bounds.y; + + // Draw line with embedded text label: "--- text --------------" + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height/2, RAYGUI_LINE_TEXT_PADDING - 2, 1 }, 0, BLANK, color); + GuiLabel(textBounds, text); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + RAYGUI_LINE_TEXT_PADDING + textBounds.width + 4, bounds.y + bounds.height/2, bounds.width - textBounds.width - RAYGUI_LINE_TEXT_PADDING - 4, 1 }, 0, BLANK, color); + } + //-------------------------------------------------------------------- +} + +// Panel control +void GuiPanel(Rectangle bounds) +{ + #if !defined(RAYGUI_PANEL_BORDER_WIDTH) + #define RAYGUI_PANEL_BORDER_WIDTH 1 + #endif + + GuiControlState state = guiState; + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED: LINE_COLOR)), guiAlpha), + Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BASE_COLOR_DISABLED : BACKGROUND_COLOR)), guiAlpha)); + //-------------------------------------------------------------------- +} + +// Scroll Panel control +Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) +{ + GuiControlState state = guiState; + + Vector2 scrollPos = { 0.0f, 0.0f }; + if (scroll != NULL) scrollPos = *scroll; + + bool hasHorizontalScrollBar = (content.width > bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH))? true : false; + bool hasVerticalScrollBar = (content.height > bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH))? true : false; + + // Recheck to account for the other scrollbar being visible + if (!hasHorizontalScrollBar) hasHorizontalScrollBar = (hasVerticalScrollBar && (content.width > (bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH))))? true : false; + if (!hasVerticalScrollBar) hasVerticalScrollBar = (hasHorizontalScrollBar && (content.height > (bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH))))? true : false; + + const int horizontalScrollBarWidth = hasHorizontalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; + const int verticalScrollBarWidth = hasVerticalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; + const Rectangle horizontalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth }; + const Rectangle verticalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) }; + + // Calculate view area (area without the scrollbars) + Rectangle view = (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? + RAYGUI_CLITERAL(Rectangle){ bounds.x + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth } : + RAYGUI_CLITERAL(Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth }; + + // Clip view area to the actual content size + if (view.width > content.width) view.width = content.width; + if (view.height > content.height) view.height = content.height; + + const float horizontalMin = hasHorizontalScrollBar? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH); + const float horizontalMax = hasHorizontalScrollBar? content.width - bounds.width + (float)verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)verticalScrollBarWidth : 0) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); + const float verticalMin = hasVerticalScrollBar? (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); + const float verticalMax = hasVerticalScrollBar? content.height - bounds.height + (float)horizontalScrollBarWidth + (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check button state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + + if (hasHorizontalScrollBar) + { + if (IsKeyDown(KEY_RIGHT)) scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_LEFT)) scrollPos.x += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + } + + if (hasVerticalScrollBar) + { + if (IsKeyDown(KEY_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + } + + float wheelMove = GetMouseWheelMove(); + + // Horizontal scroll (Shift + Mouse wheel) + if (hasHorizontalScrollBar && (IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT))) scrollPos.x += wheelMove*20; + else scrollPos.y += wheelMove*20; // Vertical scroll + } + } + + // Normalize scroll values + if (scrollPos.x > -horizontalMin) scrollPos.x = -horizontalMin; + if (scrollPos.x < -horizontalMax) scrollPos.x = -horizontalMax; + if (scrollPos.y > -verticalMin) scrollPos.y = -verticalMin; + if (scrollPos.y < -verticalMax) scrollPos.y = -verticalMax; + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + + // Save size of the scrollbar slider + const int slider = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); + + // Draw horizontal scrollbar if visible + if (hasHorizontalScrollBar) + { + // Change scrollbar slider size to show the diff in size between the content width and the widget width + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth)/(int)content.width)*((int)bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth))); + scrollPos.x = (float)-GuiScrollBar(horizontalScrollBar, (int)-scrollPos.x, (int)horizontalMin, (int)horizontalMax); + } + + // Draw vertical scrollbar if visible + if (hasVerticalScrollBar) + { + // Change scrollbar slider size to show the diff in size between the content height and the widget height + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth)/(int)content.height)*((int)bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth))); + scrollPos.y = (float)-GuiScrollBar(verticalScrollBar, (int)-scrollPos.y, (int)verticalMin, (int)verticalMax); + } + + // Draw detail corner rectangle if both scroll bars are visible + if (hasHorizontalScrollBar && hasVerticalScrollBar) + { + Rectangle corner = { (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) + 2) : (horizontalScrollBar.x + horizontalScrollBar.width + 2), verticalScrollBar.y + verticalScrollBar.height + 2, (float)horizontalScrollBarWidth - 4, (float)verticalScrollBarWidth - 4 }; + GuiDrawRectangle(corner, 0, BLANK, Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT + (state*3))), guiAlpha)); + } + + // Draw scrollbar lines depending on current state + GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + (state*3))), guiAlpha), BLANK); + + // Set scrollbar slider size back to the way it was before + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, slider); + //-------------------------------------------------------------------- + + if (scroll != NULL) *scroll = scrollPos; + + return view; +} + +// Label control +void GuiLabel(Rectangle bounds, const char *text) +{ + GuiControlState state = guiState; + + // Update control + //-------------------------------------------------------------------- + // ... + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, (state == GUI_STATE_DISABLED)? TEXT_COLOR_DISABLED : TEXT_COLOR_NORMAL)), guiAlpha)); + //-------------------------------------------------------------------- +} + +// Button control, returns true when clicked +bool GuiButton(Rectangle bounds, const char *text) +{ + GuiControlState state = guiState; + bool pressed = false; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check button state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state*3))), guiAlpha)); + GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state*3))), guiAlpha)); + //------------------------------------------------------------------ + + return pressed; +} + +// Label button control +bool GuiLabelButton(Rectangle bounds, const char *text) +{ + GuiControlState state = guiState; + bool pressed = false; + + // NOTE: We force bounds.width to be all text + float textWidth = MeasureTextEx(guiFont, text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)).x; + if (bounds.width < textWidth) bounds.width = textWidth; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check checkbox state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + //-------------------------------------------------------------------- + + return pressed; +} + +// Toggle Button control, returns true when active +bool GuiToggle(Rectangle bounds, const char *text, bool active) +{ + GuiControlState state = guiState; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check toggle button state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + { + state = GUI_STATE_NORMAL; + active = !active; + } + else state = GUI_STATE_FOCUSED; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (state == GUI_STATE_NORMAL) + { + GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, (active? BORDER_COLOR_PRESSED : (BORDER + state*3)))), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, (active? BASE_COLOR_PRESSED : (BASE + state*3)))), guiAlpha)); + GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, (active? TEXT_COLOR_PRESSED : (TEXT + state*3)))), guiAlpha)); + } + else + { + GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, BASE + state*3)), guiAlpha)); + GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, TEXT + state*3)), guiAlpha)); + } + //-------------------------------------------------------------------- + + return active; +} + +// Toggle Group control, returns toggled button index +int GuiToggleGroup(Rectangle bounds, const char *text, int active) +{ + #if !defined(RAYGUI_TOGGLEGROUP_MAX_ELEMENTS) + #define RAYGUI_TOGGLEGROUP_MAX_ELEMENTS 32 + #endif + + float initBoundsX = bounds.x; + + // Get substrings items from text (items pointers) + int rows[RAYGUI_TOGGLEGROUP_MAX_ELEMENTS] = { 0 }; + int itemCount = 0; + const char **items = GuiTextSplit(text, &itemCount, rows); + + int prevRow = rows[0]; + + for (int i = 0; i < itemCount; i++) + { + if (prevRow != rows[i]) + { + bounds.x = initBoundsX; + bounds.y += (bounds.height + GuiGetStyle(TOGGLE, GROUP_PADDING)); + prevRow = rows[i]; + } + + if (i == active) GuiToggle(bounds, items[i], true); + else if (GuiToggle(bounds, items[i], false) == true) active = i; + + bounds.x += (bounds.width + GuiGetStyle(TOGGLE, GROUP_PADDING)); + } + + return active; +} + +// Check Box control, returns true when active +bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) +{ + GuiControlState state = guiState; + + Rectangle textBounds = { 0 }; + + if (text != NULL) + { + textBounds.width = (float)GetTextWidth(text); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x + bounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + if (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(CHECKBOX, TEXT_PADDING); + } + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + Rectangle totalBounds = { + (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT)? textBounds.x : bounds.x, + bounds.y, + bounds.width + textBounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING), + bounds.height, + }; + + // Check checkbox state + if (CheckCollisionPointRec(mousePoint, totalBounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) checked = !checked; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(CHECKBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(CHECKBOX, BORDER + (state*3))), guiAlpha), BLANK); + + if (checked) + { + Rectangle check = { bounds.x + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), + bounds.y + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), + bounds.width - 2*(GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)), + bounds.height - 2*(GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)) }; + GuiDrawRectangle(check, 0, BLANK, Fade(GetColor(GuiGetStyle(CHECKBOX, TEXT + state*3)), guiAlpha)); + } + + GuiDrawText(text, textBounds, (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + //-------------------------------------------------------------------- + + return checked; +} + +// Combo Box control, returns selected item index +int GuiComboBox(Rectangle bounds, const char *text, int active) +{ + GuiControlState state = guiState; + + bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING)); + + Rectangle selector = { (float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING), + (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height }; + + // Get substrings items from text (items pointers, lengths and count) + int itemCount = 0; + const char **items = GuiTextSplit(text, &itemCount, NULL); + + if (active < 0) active = 0; + else if (active > itemCount - 1) active = itemCount - 1; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked && (itemCount > 1)) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds) || + CheckCollisionPointRec(mousePoint, selector)) + { + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + active += 1; + if (active >= itemCount) active = 0; + } + + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + // Draw combo box main + GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state*3))), guiAlpha)); + GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state*3))), guiAlpha)); + + // Draw selector using a custom button + // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values + int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); + int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, BORDER_WIDTH, 1); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + + GuiButton(selector, TextFormat("%i/%i", active + 1, itemCount)); + + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); + GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); + //-------------------------------------------------------------------- + + return active; +} + +// Dropdown Box control +// NOTE: Returns mouse click +bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode) +{ + GuiControlState state = guiState; + int itemSelected = *active; + int itemFocused = -1; + + // Get substrings items from text (items pointers, lengths and count) + int itemCount = 0; + const char **items = GuiTextSplit(text, &itemCount, NULL); + + Rectangle boundsOpen = bounds; + boundsOpen.height = (itemCount + 1)*(bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + + Rectangle itemBounds = bounds; + + bool pressed = false; // Check mouse button pressed + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && (editMode || !guiLocked) && (itemCount > 1)) + { + Vector2 mousePoint = GetMousePosition(); + + if (editMode) + { + state = GUI_STATE_PRESSED; + + // Check if mouse has been pressed or released outside limits + if (!CheckCollisionPointRec(mousePoint, boundsOpen)) + { + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + } + + // Check if already selected item has been pressed again + if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + + // Check focused and selected item + for (int i = 0; i < itemCount; i++) + { + // Update item rectangle y position for next item + itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + + if (CheckCollisionPointRec(mousePoint, itemBounds)) + { + itemFocused = i; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + { + itemSelected = i; + pressed = true; // Item selected, change to editMode = false + } + break; + } + } + + itemBounds = bounds; + } + else + { + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + pressed = true; + state = GUI_STATE_PRESSED; + } + else state = GUI_STATE_FOCUSED; + } + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (editMode) GuiPanel(boundsOpen); + + GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state*3)), guiAlpha)); + GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state*3)), guiAlpha)); + + if (editMode) + { + // Draw visible items + for (int i = 0; i < itemCount; i++) + { + // Update item rectangle y position for next item + itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + + if (i == itemSelected) + { + GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_PRESSED)), guiAlpha)); + GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_PRESSED)), guiAlpha)); + } + else if (i == itemFocused) + { + GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_FOCUSED)), guiAlpha)); + GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_FOCUSED)), guiAlpha)); + } + else GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha)); + } + } + + // Draw arrows (using icon if available) +#if defined(RAYGUI_NO_ICONS) + GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); +#else + GuiDrawText("#120#", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 6, 10, 10 }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); // RAYGUI_ICON_ARROW_DOWN_FILL +#endif + //-------------------------------------------------------------------- + + *active = itemSelected; + return pressed; +} + +// Text Box control, updates input text +// NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) +bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) +{ + GuiControlState state = guiState; + bool pressed = false; + + Rectangle cursor = { + bounds.x + GuiGetStyle(TEXTBOX, TEXT_PADDING) + GetTextWidth(text) + 2, + bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE), + 4, + (float)GuiGetStyle(DEFAULT, TEXT_SIZE)*2 + }; + + if (cursor.height > bounds.height) cursor.height = bounds.height - GuiGetStyle(TEXTBOX, BORDER_WIDTH)*2; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (editMode) + { + state = GUI_STATE_PRESSED; + + int key = GetCharPressed(); // Returns codepoint as Unicode + int keyCount = (int)strlen(text); + + // Only allow keys in range [32..125] + if (keyCount < (textSize - 1)) + { + float maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)*2)); + + if ((GetTextWidth(text) < (maxWidth - GuiGetStyle(DEFAULT, TEXT_SIZE))) && (key >= 32)) + { + int byteSize = 0; + const char *textUTF8 = CodepointToUTF8(key, &byteSize); + + for (int i = 0; i < byteSize; i++) + { + text[keyCount] = textUTF8[i]; + keyCount++; + } + + text[keyCount] = '\0'; + } + } + + // Delete text + if (keyCount > 0) + { + if (IsKeyPressed(KEY_BACKSPACE)) + { + keyCount--; + text[keyCount] = '\0'; + if (keyCount < 0) keyCount = 0; + } + } + + if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true; + + // Check text alignment to position cursor properly + int textAlignment = GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT); + if (textAlignment == GUI_TEXT_ALIGN_CENTER) cursor.x = bounds.x + GetTextWidth(text)/2 + bounds.width/2 + 1; + else if (textAlignment == GUI_TEXT_ALIGN_RIGHT) cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING); + } + else + { + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = GUI_STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + } + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (state == GUI_STATE_PRESSED) + { + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); + } + else if (state == GUI_STATE_DISABLED) + { + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); + } + else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK); + + GuiDrawText(text, GetTextBounds(TEXTBOX, bounds), GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state*3))), guiAlpha)); + + // Draw cursor + if (editMode) GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); + //-------------------------------------------------------------------- + + return pressed; +} + +// Spinner control, returns selected value +bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) +{ + GuiControlState state = guiState; + + bool pressed = false; + int tempValue = *value; + + Rectangle spinner = { bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING), bounds.y, + bounds.width - 2*(GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING)), bounds.height }; + Rectangle leftButtonBound = { (float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height }; + Rectangle rightButtonBound = { (float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height }; + + Rectangle textBounds = { 0 }; + if (text != NULL) + { + textBounds.width = (float)GetTextWidth(text); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x + bounds.width + GuiGetStyle(SPINNER, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING); + } + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check spinner state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + } + } + +#if defined(RAYGUI_NO_ICONS) + if (GuiButton(leftButtonBound, "<")) tempValue--; + if (GuiButton(rightButtonBound, ">")) tempValue++; +#else + if (GuiButton(leftButtonBound, GuiIconText(RAYGUI_ICON_ARROW_LEFT_FILL, NULL))) tempValue--; + if (GuiButton(rightButtonBound, GuiIconText(RAYGUI_ICON_ARROW_RIGHT_FILL, NULL))) tempValue++; +#endif + + if (!editMode) + { + if (tempValue < minValue) tempValue = minValue; + if (tempValue > maxValue) tempValue = maxValue; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + // TODO: Set Spinner properties for ValueBox + pressed = GuiValueBox(spinner, NULL, &tempValue, minValue, maxValue, editMode); + + // Draw value selector custom buttons + // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values + int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); + int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH)); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + + + + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); + GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); + + // Draw text label if provided + GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + //-------------------------------------------------------------------- + + *value = tempValue; + return pressed; +} + +// Value Box control, updates input text with numbers +// NOTE: Requires static variables: frameCounter +bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) +{ + #if !defined(RAYGUI_VALUEBOX_MAX_CHARS) + #define RAYGUI_VALUEBOX_MAX_CHARS 32 + #endif + + GuiControlState state = guiState; + bool pressed = false; + + char textValue[RAYGUI_VALUEBOX_MAX_CHARS + 1] = "\0"; + sprintf(textValue, "%i", *value); + + Rectangle textBounds = { 0 }; + if (text != NULL) + { + textBounds.width = (float)GetTextWidth(text); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x + bounds.width + GuiGetStyle(VALUEBOX, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING); + } + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + bool valueHasChanged = false; + + if (editMode) + { + state = GUI_STATE_PRESSED; + + int keyCount = (int)strlen(textValue); + + // Only allow keys in range [48..57] + if (keyCount < RAYGUI_VALUEBOX_MAX_CHARS) + { + if (GetTextWidth(textValue) < bounds.width) + { + int key = GetCharPressed(); + if ((key >= 48) && (key <= 57)) + { + textValue[keyCount] = (char)key; + keyCount++; + valueHasChanged = true; + } + } + } + + // Delete text + if (keyCount > 0) + { + if (IsKeyPressed(KEY_BACKSPACE)) + { + keyCount--; + textValue[keyCount] = '\0'; + if (keyCount < 0) keyCount = 0; + valueHasChanged = true; + } + } + + if (valueHasChanged) *value = TextToInteger(textValue); + + if (*value > maxValue) *value = maxValue; + else if (*value < minValue) *value = minValue; + + if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true; + } + else + { + if (*value > maxValue) *value = maxValue; + else if (*value < minValue) *value = minValue; + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = GUI_STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + } + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + Color baseColor = BLANK; + if (state == GUI_STATE_PRESSED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED)); + else if (state == GUI_STATE_DISABLED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED)); + + // WARNING: BLANK color does not work properly with Fade() + GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state*3))), guiAlpha), baseColor); + GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state*3))), guiAlpha)); + + // Draw cursor + if (editMode) + { + // NOTE: ValueBox internal text is always centered + Rectangle cursor = { bounds.x + GetTextWidth(textValue)/2 + bounds.width/2 + 2, bounds.y + 2*GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4*GuiGetStyle(VALUEBOX, BORDER_WIDTH) }; + GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha)); + } + + // Draw text label if provided + GuiDrawText(text, textBounds, (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + //-------------------------------------------------------------------- + + return pressed; +} + +// Text Box control with multiple lines +bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) +{ + GuiControlState state = guiState; + bool pressed = false; + + Rectangle textAreaBounds = { + bounds.x + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), + bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), + bounds.width - 2*(GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)), + bounds.height - 2*(GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)) + }; + + // Cursor position, [x, y] values should be updated + Rectangle cursor = { 0, -1, 4, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) + 2 }; + + float scaleFactor = (float)GuiGetStyle(DEFAULT, TEXT_SIZE)/(float)guiFont.baseSize; // Character rectangle scaling factor + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (editMode) + { + state = GUI_STATE_PRESSED; + + // We get an Unicode codepoint + int codepoint = GetCharPressed(); + int textLength = (int)strlen(text); // Length in bytes (UTF-8 string) + + // Introduce characters + if (textLength < (textSize - 1)) + { + if (IsKeyPressed(KEY_ENTER)) + { + text[textLength] = '\n'; + textLength++; + } + else if (codepoint >= 32) + { + // Supports Unicode inputs -> Encoded to UTF-8 + int charUTF8Length = 0; + const char *charEncoded = CodepointToUTF8(codepoint, &charUTF8Length); + memcpy(text + textLength, charEncoded, charUTF8Length); + textLength += charUTF8Length; + } + } + + // Delete characters + if (textLength > 0) + { + if (IsKeyPressed(KEY_BACKSPACE)) + { + if ((unsigned char)text[textLength - 1] < 127) + { + // Remove ASCII equivalent character (1 byte) + textLength--; + text[textLength] = '\0'; + } + else + { + // Remove latest UTF-8 unicode character introduced (n bytes) + int charUTF8Length = 0; + while (((unsigned char)text[textLength - 1 - charUTF8Length] & 0b01000000) == 0) charUTF8Length++; + + textLength -= (charUTF8Length + 1); + text[textLength] = '\0'; + } + } + } + + // Exit edit mode + if (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + } + else + { + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = GUI_STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + } + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (state == GUI_STATE_PRESSED) + { + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); + } + else if (state == GUI_STATE_DISABLED) + { + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); + } + else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK); + + int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap + Vector2 cursorPos = { textAreaBounds.x, textAreaBounds.y }; + + //int lastSpacePos = 0; + //int lastSpaceWidth = 0; + //int lastSpaceCursorPos = 0; + + for (int i = 0, codepointLength = 0; text[i] != '\0'; i += codepointLength) + { + int codepoint = GetCodepoint(text + i, &codepointLength); + int index = GetGlyphIndex(guiFont, codepoint); // If requested codepoint is not found, we get '?' (0x3f) + Rectangle atlasRec = guiFont.recs[index]; + GlyphInfo glyphInfo = guiFont.glyphs[index]; // Glyph measures + + if ((codepointLength == 1) && (codepoint == '\n')) + { + cursorPos.y += (guiFont.baseSize*scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_PADDING)); // Line feed + cursorPos.x = textAreaBounds.x; // Carriage return + } + else + { + if (wrapMode == 1) + { + int glyphWidth = 0; + if (glyphInfo.advanceX != 0) glyphWidth += glyphInfo.advanceX; + else glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); + + // Jump line if the end of the text box area has been reached + if ((cursorPos.x + (glyphWidth*scaleFactor)) > (textAreaBounds.x + textAreaBounds.width)) + { + cursorPos.y += (guiFont.baseSize*scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_PADDING)); // Line feed + cursorPos.x = textAreaBounds.x; // Carriage return + } + } + else if (wrapMode == 2) + { + /* + if ((codepointLength == 1) && (codepoint == ' ')) + { + lastSpacePos = i; + lastSpaceWidth = 0; + lastSpaceCursorPos = cursorPos.x; + } + + // Jump line if last word reaches end of text box area + if ((lastSpaceCursorPos + lastSpaceWidth) > (textAreaBounds.x + textAreaBounds.width)) + { + cursorPos.y += 12; // Line feed + cursorPos.x = textAreaBounds.x; // Carriage return + } + */ + } + + // Draw current character glyph + DrawTextCodepoint(guiFont, codepoint, cursorPos, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state*3))), guiAlpha)); + + int glyphWidth = 0; + if (glyphInfo.advanceX != 0) glyphWidth += glyphInfo.advanceX; + else glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); + + cursorPos.x += (glyphWidth*scaleFactor + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + //if (i > lastSpacePos) lastSpaceWidth += (atlasRec.width + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + } + } + + cursor.x = cursorPos.x; + cursor.y = cursorPos.y; + + // Draw cursor position considering text glyphs + if (editMode) GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); + //-------------------------------------------------------------------- + + return pressed; +} + +// Slider control with pro parameters +// NOTE: Other GuiSlider*() controls use this one +float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue, int sliderWidth) +{ + GuiControlState state = guiState; + + int sliderValue = (int)(((value - minValue)/(maxValue - minValue))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))); + + Rectangle slider = { bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING), + 0, bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING) }; + + if (sliderWidth > 0) // Slider + { + slider.x += (sliderValue - sliderWidth/2); + slider.width = (float)sliderWidth; + } + else if (sliderWidth == 0) // SliderBar + { + slider.x += GuiGetStyle(SLIDER, BORDER_WIDTH); + slider.width = (float)sliderValue; + } + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + state = GUI_STATE_PRESSED; + + // Get equivalent value and slider position from mousePoint.x + value = ((maxValue - minValue)*(mousePoint.x - (float)(bounds.x + sliderWidth/2)))/(float)(bounds.width - sliderWidth) + minValue; + + if (sliderWidth > 0) slider.x = mousePoint.x - slider.width/2; // Slider + else if (sliderWidth == 0) slider.width = (float)sliderValue; // SliderBar + } + else state = GUI_STATE_FOCUSED; + } + + if (value > maxValue) value = maxValue; + else if (value < minValue) value = minValue; + } + + // Bar limits check + if (sliderWidth > 0) // Slider + { + if (slider.x <= (bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH))) slider.x = bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH); + else if ((slider.x + slider.width) >= (bounds.x + bounds.width)) slider.x = bounds.x + bounds.width - slider.width - GuiGetStyle(SLIDER, BORDER_WIDTH); + } + else if (sliderWidth == 0) // SliderBar + { + if (slider.width > bounds.width) slider.width = bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH); + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + + // Draw slider internal bar (depends on state) + if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha)); + else if (state == GUI_STATE_FOCUSED) GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha)); + + // Draw left/right text if provided + if (textLeft != NULL) + { + Rectangle textBounds = { 0 }; + textBounds.width = (float)GetTextWidth(textLeft); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SLIDER, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + + GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha)); + } + + if (textRight != NULL) + { + Rectangle textBounds = { 0 }; + textBounds.width = (float)GetTextWidth(textRight); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x + bounds.width + GuiGetStyle(SLIDER, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + + GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha)); + } + //-------------------------------------------------------------------- + + return value; +} + +// Slider control extended, returns selected value and has text +float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) +{ + return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, GuiGetStyle(SLIDER, SLIDER_WIDTH)); +} + +// Slider Bar control extended, returns selected value +float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) +{ + return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, 0); +} + +// Progress Bar control extended, shows current progress value +float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) +{ + GuiControlState state = guiState; + + Rectangle progress = { bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), + bounds.y + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) + GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING), 0, + bounds.height - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) - 2*GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING) }; + + // Update control + //-------------------------------------------------------------------- + if (state != GUI_STATE_DISABLED) progress.width = ((float)(value/(maxValue - minValue))*(float)(bounds.width - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(PROGRESSBAR, BORDER + (state*3))), guiAlpha), BLANK); + + // Draw slider internal progress bar (depends on state) + if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)), guiAlpha)); + else if (state == GUI_STATE_FOCUSED) GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT_COLOR_FOCUSED)), guiAlpha)); + + // Draw left/right text if provided + if (textLeft != NULL) + { + Rectangle textBounds = { 0 }; + textBounds.width = (float)GetTextWidth(textLeft); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x - textBounds.width - GuiGetStyle(PROGRESSBAR, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + + GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state*3))), guiAlpha)); + } + + if (textRight != NULL) + { + Rectangle textBounds = { 0 }; + textBounds.width = (float)GetTextWidth(textRight); + textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + textBounds.x = bounds.x + bounds.width + GuiGetStyle(PROGRESSBAR, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + + GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state*3))), guiAlpha)); + } + //-------------------------------------------------------------------- + + return value; +} + +// Status Bar control +void GuiStatusBar(Rectangle bounds, const char *text) +{ + GuiControlState state = guiState; + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(STATUSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? BORDER_COLOR_NORMAL : BORDER_COLOR_DISABLED)), guiAlpha), + Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawText(text, GetTextBounds(STATUSBAR, bounds), GuiGetStyle(STATUSBAR, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); + //-------------------------------------------------------------------- +} + +// Dummy rectangle control, intended for placeholding +void GuiDummyRec(Rectangle bounds, const char *text) +{ + GuiControlState state = guiState; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check button state + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + else state = GUI_STATE_FOCUSED; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawText(text, GetTextBounds(DEFAULT, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(BUTTON, (state != GUI_STATE_DISABLED)? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); + //------------------------------------------------------------------ +} + +// Scroll Bar control +int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) +{ + GuiControlState state = guiState; + + // Is the scrollbar horizontal or vertical? + bool isVertical = (bounds.width > bounds.height)? false : true; + + // The size (width or height depending on scrollbar type) of the spinner buttons + const int spinnerSize = GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)? (isVertical? (int)bounds.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH) : (int)bounds.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH)) : 0; + + // Arrow buttons [<] [>] [∧] [∨] + Rectangle arrowUpLeft = { 0 }; + Rectangle arrowDownRight = { 0 }; + + // Actual area of the scrollbar excluding the arrow buttons + Rectangle scrollbar = { 0 }; + + // Slider bar that moves --[///]----- + Rectangle slider = { 0 }; + + // Normalize value + if (value > maxValue) value = maxValue; + if (value < minValue) value = minValue; + + const int range = maxValue - minValue; + int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); + + // Calculate rectangles for all of the components + arrowUpLeft = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize }; + + if (isVertical) + { + arrowDownRight = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + bounds.height - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; + scrollbar = RAYGUI_CLITERAL(Rectangle){ bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING)), bounds.height - arrowUpLeft.height - arrowDownRight.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH) }; + sliderSize = (sliderSize >= scrollbar.height)? ((int)scrollbar.height - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar + slider = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)scrollbar.y + (int)(((float)(value - minValue)/range)*(scrollbar.height - sliderSize)), (float)bounds.width - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)), (float)sliderSize }; + } + else + { + arrowDownRight = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + bounds.width - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; + scrollbar = RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x + arrowUpLeft.width, bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), bounds.width - arrowUpLeft.width - arrowDownRight.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH), bounds.height - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING))}; + sliderSize = (sliderSize >= scrollbar.width)? ((int)scrollbar.width - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar + slider = RAYGUI_CLITERAL(Rectangle){ (float)scrollbar.x + (int)(((float)(value - minValue)/range)*(scrollbar.width - sliderSize)), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)sliderSize, (float)bounds.height - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)) }; + } + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = GUI_STATE_FOCUSED; + + // Handle mouse wheel + int wheel = (int)GetMouseWheelMove(); + if (wheel != 0) value += wheel; + + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + if (CheckCollisionPointRec(mousePoint, arrowUpLeft)) value -= range/GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + else if (CheckCollisionPointRec(mousePoint, arrowDownRight)) value += range/GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + + state = GUI_STATE_PRESSED; + } + else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + if (!isVertical) + { + Rectangle scrollArea = { arrowUpLeft.x + arrowUpLeft.width, arrowUpLeft.y, scrollbar.width, bounds.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; + if (CheckCollisionPointRec(mousePoint, scrollArea)) value = (int)(((float)(mousePoint.x - scrollArea.x - slider.width/2)*range)/(scrollArea.width - slider.width) + minValue); + } + else + { + Rectangle scrollArea = { arrowUpLeft.x, arrowUpLeft.y+arrowUpLeft.height, bounds.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH), scrollbar.height}; + if (CheckCollisionPointRec(mousePoint, scrollArea)) value = (int)(((float)(mousePoint.y - scrollArea.y - slider.height/2)*range)/(scrollArea.height - slider.height) + minValue); + } + } + } + + // Normalize value + if (value > maxValue) value = maxValue; + if (value < minValue) value = minValue; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(SCROLLBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha)); // Draw the background + + GuiDrawRectangle(scrollbar, 0, BLANK, Fade(GetColor(GuiGetStyle(BUTTON, BASE_COLOR_NORMAL)), guiAlpha)); // Draw the scrollbar active area background + GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BORDER + state*3)), guiAlpha)); // Draw the slider bar + + // Draw arrows (using icon if available) + if (GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)) + { +#if defined(RAYGUI_NO_ICONS) + GuiDrawText(isVertical? "^" : "<", RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x, arrowUpLeft.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); + GuiDrawText(isVertical? "v" : ">", RAYGUI_CLITERAL(Rectangle){ arrowDownRight.x, arrowDownRight.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); +#else + GuiDrawText(isVertical? "#121#" : "#118#", RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x, arrowUpLeft.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state*3)), guiAlpha)); // RAYGUI_ICON_ARROW_UP_FILL / RAYGUI_ICON_ARROW_LEFT_FILL + GuiDrawText(isVertical? "#120#" : "#119#", RAYGUI_CLITERAL(Rectangle){ arrowDownRight.x, arrowDownRight.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, + GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state*3)), guiAlpha)); // RAYGUI_ICON_ARROW_DOWN_FILL / RAYGUI_ICON_ARROW_RIGHT_FILL +#endif + } + //-------------------------------------------------------------------- + + return value; +} + +// List View control +int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active) +{ + int itemCount = 0; + const char **items = NULL; + + if (text != NULL) items = GuiTextSplit(text, &itemCount, NULL); + + return GuiListViewEx(bounds, items, itemCount, NULL, scrollIndex, active); +} + +// List View control with extended parameters +int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active) +{ + GuiControlState state = guiState; + int itemFocused = (focus == NULL)? -1 : *focus; + int itemSelected = active; + + // Check if we need a scroll bar + bool useScrollBar = false; + if ((GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING))*count > bounds.height) useScrollBar = true; + + // Define base item rectangle [0] + Rectangle itemBounds = { 0 }; + itemBounds.x = bounds.x + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING); + itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); + itemBounds.width = bounds.width - 2*GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) - GuiGetStyle(DEFAULT, BORDER_WIDTH); + itemBounds.height = (float)GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT); + if (useScrollBar) itemBounds.width -= GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH); + + // Get items on the list + int visibleItems = (int)bounds.height/(GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); + if (visibleItems > count) visibleItems = count; + + int startIndex = (scrollIndex == NULL)? 0 : *scrollIndex; + if ((startIndex < 0) || (startIndex > (count - visibleItems))) startIndex = 0; + int endIndex = startIndex + visibleItems; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + // Check mouse inside list view + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = GUI_STATE_FOCUSED; + + // Check focused and selected item + for (int i = 0; i < visibleItems; i++) + { + if (CheckCollisionPointRec(mousePoint, itemBounds)) + { + itemFocused = startIndex + i; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + if (itemSelected == (startIndex + i)) itemSelected = -1; + else itemSelected = startIndex + i; + } + break; + } + + // Update item rectangle y position for next item + itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); + } + + if (useScrollBar) + { + int wheelMove = (int)GetMouseWheelMove(); + startIndex -= wheelMove; + + if (startIndex < 0) startIndex = 0; + else if (startIndex > (count - visibleItems)) startIndex = count - visibleItems; + + endIndex = startIndex + visibleItems; + if (endIndex > count) endIndex = count; + } + } + else itemFocused = -1; + + // Reset item rectangle y to [0] + itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), guiAlpha), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + + // Draw visible items + for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) + { + if (state == GUI_STATE_DISABLED) + { + if ((startIndex + i) == itemSelected) GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_DISABLED)), guiAlpha)); + + GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_DISABLED)), guiAlpha)); + } + else + { + if ((startIndex + i) == itemSelected) + { + // Draw item selected + GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_PRESSED)), guiAlpha)); + GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_PRESSED)), guiAlpha)); + } + else if ((startIndex + i) == itemFocused) + { + // Draw item focused + GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_FOCUSED)), guiAlpha)); + GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_FOCUSED)), guiAlpha)); + } + else + { + // Draw item normal + GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_NORMAL)), guiAlpha)); + } + } + + // Update item rectangle y position for next item + itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); + } + + if (useScrollBar) + { + Rectangle scrollBarBounds = { + bounds.x + bounds.width - GuiGetStyle(LISTVIEW, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), + bounds.y + GuiGetStyle(LISTVIEW, BORDER_WIDTH), (float)GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), + bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) + }; + + // Calculate percentage of visible items and apply same percentage to scrollbar + float percentVisible = (float)(endIndex - startIndex)/count; + float sliderSize = bounds.height*percentVisible; + + int prevSliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); // Save default slider size + int prevScrollSpeed = GuiGetStyle(SCROLLBAR, SCROLL_SPEED); // Save default scroll speed + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)sliderSize); // Change slider size + GuiSetStyle(SCROLLBAR, SCROLL_SPEED, count - visibleItems); // Change scroll speed + + startIndex = GuiScrollBar(scrollBarBounds, startIndex, 0, count - visibleItems); + + GuiSetStyle(SCROLLBAR, SCROLL_SPEED, prevScrollSpeed); // Reset scroll speed to default + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, prevSliderSize); // Reset slider size to default + } + //-------------------------------------------------------------------- + + if (focus != NULL) *focus = itemFocused; + if (scrollIndex != NULL) *scrollIndex = startIndex; + + return itemSelected; +} + +// Color Panel control +Color GuiColorPanel(Rectangle bounds, Color color) +{ + const Color colWhite = { 255, 255, 255, 255 }; + const Color colBlack = { 0, 0, 0, 255 }; + + GuiControlState state = guiState; + Vector2 pickerSelector = { 0 }; + + Vector3 vcolor = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; + Vector3 hsv = ConvertRGBtoHSV(vcolor); + + pickerSelector.x = bounds.x + (float)hsv.y*bounds.width; // HSV: Saturation + pickerSelector.y = bounds.y + (1.0f - (float)hsv.z)*bounds.height; // HSV: Value + + float hue = -1.0f; + Vector3 maxHue = { hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f }; + Vector3 rgbHue = ConvertHSVtoRGB(maxHue); + Color maxHueCol = { (unsigned char)(255.0f*rgbHue.x), + (unsigned char)(255.0f*rgbHue.y), + (unsigned char)(255.0f*rgbHue.z), 255 }; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + state = GUI_STATE_PRESSED; + pickerSelector = mousePoint; + + // Calculate color from picker + Vector2 colorPick = { pickerSelector.x - bounds.x, pickerSelector.y - bounds.y }; + + colorPick.x /= (float)bounds.width; // Get normalized value on x + colorPick.y /= (float)bounds.height; // Get normalized value on y + + hsv.y = colorPick.x; + hsv.z = 1.0f - colorPick.y; + + Vector3 rgb = ConvertHSVtoRGB(hsv); + + // NOTE: Vector3ToColor() only available on raylib 1.8.1 + color = RAYGUI_CLITERAL(Color){ (unsigned char)(255.0f*rgb.x), + (unsigned char)(255.0f*rgb.y), + (unsigned char)(255.0f*rgb.z), + (unsigned char)(255.0f*(float)color.a/255.0f) }; + + } + else state = GUI_STATE_FOCUSED; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (state != GUI_STATE_DISABLED) + { + DrawRectangleGradientEx(bounds, Fade(colWhite, guiAlpha), Fade(colWhite, guiAlpha), Fade(maxHueCol, guiAlpha), Fade(maxHueCol, guiAlpha)); + DrawRectangleGradientEx(bounds, Fade(colBlack, 0), Fade(colBlack, guiAlpha), Fade(colBlack, guiAlpha), Fade(colBlack, 0)); + + // Draw color picker: selector + Rectangle selector = { pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) }; + GuiDrawRectangle(selector, 0, BLANK, Fade(colWhite, guiAlpha)); + } + else + { + DrawRectangleGradientEx(bounds, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.6f), guiAlpha)); + } + + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + //-------------------------------------------------------------------- + + return color; +} + +// Color Bar Alpha control +// NOTE: Returns alpha value normalized [0..1] +float GuiColorBarAlpha(Rectangle bounds, float alpha) +{ + #if !defined(RAYGUI_COLORBARALPHA_CHECKED_SIZE) + #define RAYGUI_COLORBARALPHA_CHECKED_SIZE 10 + #endif + + GuiControlState state = guiState; + Rectangle selector = { (float)bounds.x + alpha*bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)/2, (float)bounds.y - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT), (float)bounds.height + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW)*2 }; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds) || + CheckCollisionPointRec(mousePoint, selector)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + state = GUI_STATE_PRESSED; + + alpha = (mousePoint.x - bounds.x)/bounds.width; + if (alpha <= 0.0f) alpha = 0.0f; + if (alpha >= 1.0f) alpha = 1.0f; + //selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; + } + else state = GUI_STATE_FOCUSED; + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + + // Draw alpha bar: checked background + if (state != GUI_STATE_DISABLED) + { + int checksX = (int)bounds.width/RAYGUI_COLORBARALPHA_CHECKED_SIZE; + int checksY = (int)bounds.height/RAYGUI_COLORBARALPHA_CHECKED_SIZE; + + for (int x = 0; x < checksX; x++) + { + for (int y = 0; y < checksY; y++) + { + Rectangle check = { bounds.x + x*RAYGUI_COLORBARALPHA_CHECKED_SIZE, bounds.y + y*RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE }; + GuiDrawRectangle(check, 0, BLANK, ((x + y)%2)? Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.4f), guiAlpha) : Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.4f), guiAlpha)); + } + } + + DrawRectangleGradientEx(bounds, RAYGUI_CLITERAL(Color){ 255, 255, 255, 0 }, RAYGUI_CLITERAL(Color){ 255, 255, 255, 0 }, Fade(RAYGUI_CLITERAL(Color){ 0, 0, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color){ 0, 0, 0, 255 }, guiAlpha)); + } + else DrawRectangleGradientEx(bounds, Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); + + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + + // Draw alpha bar: selector + GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha)); + //-------------------------------------------------------------------- + + return alpha; +} + +// Color Bar Hue control +// Returns hue value normalized [0..1] +// NOTE: Other similar bars (for reference): +// Color GuiColorBarSat() [WHITE->color] +// Color GuiColorBarValue() [BLACK->color], HSV/HSL +// float GuiColorBarLuminance() [BLACK->WHITE] +float GuiColorBarHue(Rectangle bounds, float hue) +{ + GuiControlState state = guiState; + Rectangle selector = { (float)bounds.x - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y + hue/360.0f*bounds.height - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)/2, (float)bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW)*2, (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) }; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds) || + CheckCollisionPointRec(mousePoint, selector)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + state = GUI_STATE_PRESSED; + + hue = (mousePoint.y - bounds.y)*360/bounds.height; + if (hue <= 0.0f) hue = 0.0f; + if (hue >= 359.0f) hue = 359.0f; + + } + else state = GUI_STATE_FOCUSED; + + /*if (IsKeyDown(KEY_UP)) + { + hue -= 2.0f; + if (hue <= 0.0f) hue = 0.0f; + } + else if (IsKeyDown(KEY_DOWN)) + { + hue += 2.0f; + if (hue >= 360.0f) hue = 360.0f; + }*/ + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (state != GUI_STATE_DISABLED) + { + // Draw hue bar:color bars + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 255, 0, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + bounds.height/6), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 255, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 0, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 2*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 255, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 3*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 0, 255, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 4*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 0, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 255, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 5*(bounds.height/6)), (int)bounds.width, (int)(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 0, 255 }, guiAlpha)); + } + else DrawRectangleGradientV((int)bounds.x, (int)bounds.y, (int)bounds.width, (int)bounds.height, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); + + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + + // Draw hue bar: selector + GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha)); + //-------------------------------------------------------------------- + + return hue; +} + +// Color Picker control +// NOTE: It's divided in multiple controls: +// Color GuiColorPanel(Rectangle bounds, Color color) +// float GuiColorBarAlpha(Rectangle bounds, float alpha) +// float GuiColorBarHue(Rectangle bounds, float value) +// NOTE: bounds define GuiColorPanel() size +Color GuiColorPicker(Rectangle bounds, Color color) +{ + color = GuiColorPanel(bounds, color); + + Rectangle boundsHue = { (float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height }; + //Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; + + Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){ color.r/255.0f, color.g/255.0f, color.b/255.0f }); + hsv.x = GuiColorBarHue(boundsHue, hsv.x); + //color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); + Vector3 rgb = ConvertHSVtoRGB(hsv); + + color = RAYGUI_CLITERAL(Color){ (unsigned char)roundf(rgb.x*255.0f), (unsigned char)roundf(rgb.y*255.0f), (unsigned char)roundf(rgb.z*255.0f), color.a }; + + return color; +} + +// Message Box control +int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons) +{ + #if !defined(RAYGUI_MESSAGEBOX_BUTTON_HEIGHT) + #define RAYGUI_MESSAGEBOX_BUTTON_HEIGHT 24 + #endif + #if !defined(RAYGUI_MESSAGEBOX_BUTTON_PADDING) + #define RAYGUI_MESSAGEBOX_BUTTON_PADDING 12 + #endif + + int clicked = -1; // Returns clicked button from buttons list, 0 refers to closed window button + + int buttonCount = 0; + const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); + Rectangle buttonBounds = { 0 }; + buttonBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING; + buttonBounds.y = bounds.y + bounds.height - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING; + buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; + buttonBounds.height = RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; + + Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); + + Rectangle textBounds = { 0 }; + textBounds.x = bounds.x + bounds.width/2 - textSize.x/2; + textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + (bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING)/2 - textSize.y/2; + textBounds.width = textSize.x; + textBounds.height = textSize.y; + + // Draw control + //-------------------------------------------------------------------- + if (GuiWindowBox(bounds, title)) clicked = 0; + + int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiLabel(textBounds, message); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); + + prevTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + + for (int i = 0; i < buttonCount; i++) + { + if (GuiButton(buttonBounds, buttonsText[i])) clicked = i + 1; + buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); + } + + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevTextAlignment); + //-------------------------------------------------------------------- + + return clicked; +} + +// Text Input Box control, ask for text +int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text) +{ + #if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT) + #define RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT 24 + #endif + #if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_PADDING) + #define RAYGUI_TEXTINPUTBOX_BUTTON_PADDING 10 + #endif + #if !defined(RAYGUI_TEXTINPUTBOX_HEIGHT) + #define RAYGUI_TEXTINPUTBOX_HEIGHT 24 + #endif + #if !defined(RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH) + #define RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH 256 + #endif + + // Used to enable text edit mode + // WARNING: No more than one GuiTextInputBox() should be open at the same time + static bool textEditMode = false; + + int btnIndex = -1; + + int buttonCount = 0; + const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); + Rectangle buttonBounds = { 0 }; + buttonBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + buttonBounds.y = bounds.y + bounds.height - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + buttonBounds.width = (bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; + buttonBounds.height = RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT; + + int messageInputHeight = (int)bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - 2*RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + + Rectangle textBounds = { 0 }; + if (message != NULL) + { + Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); + + textBounds.x = bounds.x + bounds.width/2 - textSize.x/2; + textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight/4 - textSize.y/2; + textBounds.width = textSize.x; + textBounds.height = textSize.y; + } + + Rectangle textBoxBounds = { 0 }; + textBoxBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + textBoxBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_TEXTINPUTBOX_HEIGHT/2; + if (message == NULL) textBoxBounds.y += messageInputHeight/2; + else textBoxBounds.y += (messageInputHeight/2 + messageInputHeight/4); + textBoxBounds.width = bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING*2; + textBoxBounds.height = RAYGUI_TEXTINPUTBOX_HEIGHT; + + // Draw control + //-------------------------------------------------------------------- + if (GuiWindowBox(bounds, title)) btnIndex = 0; + + // Draw message if available + if (message != NULL) + { + int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiLabel(textBounds, message); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); + } + + if (GuiTextBox(textBoxBounds, text, RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH, textEditMode)) textEditMode = !textEditMode; + + int prevBtnTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + + for (int i = 0; i < buttonCount; i++) + { + if (GuiButton(buttonBounds, buttonsText[i])) btnIndex = i + 1; + buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); + } + + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevBtnTextAlignment); + //-------------------------------------------------------------------- + + return btnIndex; +} + +// Grid control +// NOTE: Returns grid mouse-hover selected cell +// About drawing lines at subpixel spacing, simple put, not easy solution: +// https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster +Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs) +{ + // Grid lines alpha amount + #if !defined(RAYGUI_GRID_ALPHA) + #define RAYGUI_GRID_ALPHA 0.15f + #endif + + GuiControlState state = guiState; + Vector2 mousePoint = GetMousePosition(); + Vector2 currentCell = { -1, -1 }; + + int linesV = ((int)(bounds.width/spacing))*subdivs + 1; + int linesH = ((int)(bounds.height/spacing))*subdivs + 1; + + // Update control + //-------------------------------------------------------------------- + if ((state != GUI_STATE_DISABLED) && !guiLocked) + { + if (CheckCollisionPointRec(mousePoint, bounds)) + { + // NOTE: Cell values must be rounded to int + currentCell.x = (int)((mousePoint.x - bounds.x)/spacing); + currentCell.y = (int)((mousePoint.y - bounds.y)/spacing); + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (state) + { + case GUI_STATE_NORMAL: + { + if (subdivs > 0) + { + // Draw vertical grid lines + for (int i = 0; i < linesV; i++) + { + Rectangle lineV = { bounds.x + spacing*i/subdivs, bounds.y, 1, bounds.height }; + GuiDrawRectangle(lineV, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA*4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); + } + + // Draw horizontal grid lines + for (int i = 0; i < linesH; i++) + { + Rectangle lineH = { bounds.x, bounds.y + spacing*i/subdivs, bounds.width, 1 }; + GuiDrawRectangle(lineH, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA*4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); + } + } + } break; + default: break; + } + + return currentCell; +} + +//---------------------------------------------------------------------------------- +// Styles loading functions +//---------------------------------------------------------------------------------- + +// Load raygui style file (.rgs) +// NOTE: By default a binary file is expected, that file could contain a custom font, +// in that case, custom font image atlas is GRAY+ALPHA and pixel data can be compressed (DEFLATE) +void GuiLoadStyle(const char *fileName) +{ + #define MAX_LINE_BUFFER_SIZE 256 + + bool tryBinary = false; + + // Try reading the files as text file first + FILE *rgsFile = fopen(fileName, "rt"); + + if (rgsFile != NULL) + { + char buffer[MAX_LINE_BUFFER_SIZE] = { 0 }; + fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); + + if (buffer[0] == '#') + { + int controlId = 0; + int propertyId = 0; + unsigned int propertyValue = 0; + + while (!feof(rgsFile)) + { + switch (buffer[0]) + { + case 'p': + { + // Style property: p + + sscanf(buffer, "p %d %d 0x%x", &controlId, &propertyId, &propertyValue); + GuiSetStyle(controlId, propertyId, (int)propertyValue); + + } break; + case 'f': + { + // Style font: f + + int fontSize = 0; + char charmapFileName[256] = { 0 }; + char fontFileName[256] = { 0 }; + sscanf(buffer, "f %d %s %[^\r\n]s", &fontSize, charmapFileName, fontFileName); + + Font font = { 0 }; + + if (charmapFileName[0] != '0') + { + // Load characters from charmap file, + // expected '\n' separated list of integer values + char *charValues = LoadFileText(charmapFileName); + if (charValues != NULL) + { + int glyphCount = 0; + const char **chars = TextSplit(charValues, '\n', &glyphCount); + + int *values = (int *)RAYGUI_MALLOC(glyphCount*sizeof(int)); + for (int i = 0; i < glyphCount; i++) values[i] = TextToInteger(chars[i]); + + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); + font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, glyphCount); + if (font.texture.id == 0) font = GetFontDefault(); + + RAYGUI_FREE(values); + } + } + else + { + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); + font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); + if (font.texture.id == 0) font = GetFontDefault(); + } + + if ((font.texture.id > 0) && (font.glyphCount > 0)) GuiSetFont(font); + + } break; + default: break; + } + + fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); + } + } + else tryBinary = true; + + fclose(rgsFile); + } + + if (tryBinary) + { + rgsFile = fopen(fileName, "rb"); + + if (rgsFile == NULL) return; + + char signature[5] = { 0 }; + short version = 0; + short reserved = 0; + int propertyCount = 0; + + fread(signature, 1, 4, rgsFile); + fread(&version, 1, sizeof(short), rgsFile); + fread(&reserved, 1, sizeof(short), rgsFile); + fread(&propertyCount, 1, sizeof(int), rgsFile); + + if ((signature[0] == 'r') && + (signature[1] == 'G') && + (signature[2] == 'S') && + (signature[3] == ' ')) + { + short controlId = 0; + short propertyId = 0; + int propertyValue = 0; + + for (int i = 0; i < propertyCount; i++) + { + fread(&controlId, 1, sizeof(short), rgsFile); + fread(&propertyId, 1, sizeof(short), rgsFile); + fread(&propertyValue, 1, sizeof(int), rgsFile); + + if (controlId == 0) // DEFAULT control + { + // If a DEFAULT property is loaded, it is propagated to all controls + // NOTE: All DEFAULT properties should be defined first in the file + GuiSetStyle(0, (int)propertyId, propertyValue); + + if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) GuiSetStyle(i, (int)propertyId, propertyValue); + } + else GuiSetStyle((int)controlId, (int)propertyId, propertyValue); + } + + // Font loading is highly dependant on raylib API to load font data and image +#if !defined(RAYGUI_STANDALONE) + // Load custom font if available + int fontDataSize = 0; + fread(&fontDataSize, 1, sizeof(int), rgsFile); + + if (fontDataSize > 0) + { + Font font = { 0 }; + int fontType = 0; // 0-Normal, 1-SDF + Rectangle whiteRec = { 0 }; + + fread(&font.baseSize, 1, sizeof(int), rgsFile); + fread(&font.glyphCount, 1, sizeof(int), rgsFile); + fread(&fontType, 1, sizeof(int), rgsFile); + + // Load font white rectangle + fread(&whiteRec, 1, sizeof(Rectangle), rgsFile); + + // Load font image parameters + int fontImageUncompSize = 0; + int fontImageCompSize = 0; + fread(&fontImageUncompSize, 1, sizeof(int), rgsFile); + fread(&fontImageCompSize, 1, sizeof(int), rgsFile); + + Image imFont = { 0 }; + imFont.mipmaps = 1; + fread(&imFont.width, 1, sizeof(int), rgsFile); + fread(&imFont.height, 1, sizeof(int), rgsFile); + fread(&imFont.format, 1, sizeof(int), rgsFile); + + if (fontImageCompSize < fontImageUncompSize) + { + // Compressed font atlas image data (DEFLATE), it requires DecompressData() + int dataUncompSize = 0; + unsigned char *compData = (unsigned char *)RAYGUI_MALLOC(fontImageCompSize); + fread(compData, 1, fontImageCompSize, rgsFile); + imFont.data = DecompressData(compData, fontImageCompSize, &dataUncompSize); + + // Security check, dataUncompSize must match the provided fontImageUncompSize + if (dataUncompSize != fontImageUncompSize) RAYGUI_LOG("WARNING: Uncompressed font atlas image data could be corrupted"); + + RAYGUI_FREE(compData); + } + else + { + // Font atlas image data is not compressed + imFont.data = (unsigned char *)RAYGUI_MALLOC(fontImageUncompSize); + fread(imFont.data, 1, fontImageUncompSize, rgsFile); + } + + if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); + font.texture = LoadTextureFromImage(imFont); + if (font.texture.id == 0) font = GetFontDefault(); + + RAYGUI_FREE(imFont.data); + + // Load font recs data + font.recs = (Rectangle *)RAYGUI_CALLOC(font.glyphCount, sizeof(Rectangle)); + for (int i = 0; i < font.glyphCount; i++) fread(&font.recs[i], 1, sizeof(Rectangle), rgsFile); + + // Load font chars info data + font.glyphs = (GlyphInfo *)RAYGUI_CALLOC(font.glyphCount, sizeof(GlyphInfo)); + for (int i = 0; i < font.glyphCount; i++) + { + fread(&font.glyphs[i].value, 1, sizeof(int), rgsFile); + fread(&font.glyphs[i].offsetX, 1, sizeof(int), rgsFile); + fread(&font.glyphs[i].offsetY, 1, sizeof(int), rgsFile); + fread(&font.glyphs[i].advanceX, 1, sizeof(int), rgsFile); + } + + GuiSetFont(font); + + // Set font texture source rectangle to be used as white texture to draw shapes + // NOTE: This way, all gui can be draw using a single draw call + if ((whiteRec.width != 0) && (whiteRec.height != 0)) SetShapesTexture(font.texture, whiteRec); + } +#endif + } + + fclose(rgsFile); + } +} + +// Load style default over global style +void GuiLoadStyleDefault(void) +{ + // We set this variable first to avoid cyclic function calls + // when calling GuiSetStyle() and GuiGetStyle() + guiStyleLoaded = true; + + // Initialize default LIGHT style property values + GuiSetStyle(DEFAULT, BORDER_COLOR_NORMAL, 0x838383ff); + GuiSetStyle(DEFAULT, BASE_COLOR_NORMAL, 0xc9c9c9ff); + GuiSetStyle(DEFAULT, TEXT_COLOR_NORMAL, 0x686868ff); + GuiSetStyle(DEFAULT, BORDER_COLOR_FOCUSED, 0x5bb2d9ff); + GuiSetStyle(DEFAULT, BASE_COLOR_FOCUSED, 0xc9effeff); + GuiSetStyle(DEFAULT, TEXT_COLOR_FOCUSED, 0x6c9bbcff); + GuiSetStyle(DEFAULT, BORDER_COLOR_PRESSED, 0x0492c7ff); + GuiSetStyle(DEFAULT, BASE_COLOR_PRESSED, 0x97e8ffff); + GuiSetStyle(DEFAULT, TEXT_COLOR_PRESSED, 0x368bafff); + GuiSetStyle(DEFAULT, BORDER_COLOR_DISABLED, 0xb5c1c2ff); + GuiSetStyle(DEFAULT, BASE_COLOR_DISABLED, 0xe6e9e9ff); + GuiSetStyle(DEFAULT, TEXT_COLOR_DISABLED, 0xaeb7b8ff); + GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); // WARNING: Some controls use other values + GuiSetStyle(DEFAULT, TEXT_PADDING, 0); // WARNING: Some controls use other values + GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); // WARNING: Some controls use other values + + // Initialize control-specific property values + // NOTE: Those properties are in default list but require specific values by control type + GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(BUTTON, BORDER_WIDTH, 2); + GuiSetStyle(SLIDER, TEXT_PADDING, 4); + GuiSetStyle(CHECKBOX, TEXT_PADDING, 4); + GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_RIGHT); + GuiSetStyle(TEXTBOX, TEXT_PADDING, 4); + GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(VALUEBOX, TEXT_PADDING, 4); + GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(SPINNER, TEXT_PADDING, 4); + GuiSetStyle(SPINNER, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(STATUSBAR, TEXT_PADDING, 8); + GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + + // Initialize extended property values + // NOTE: By default, extended property values are initialized to 0 + GuiSetStyle(DEFAULT, TEXT_SIZE, 10); // DEFAULT, shared by all controls + GuiSetStyle(DEFAULT, TEXT_SPACING, 1); // DEFAULT, shared by all controls + GuiSetStyle(DEFAULT, LINE_COLOR, 0x90abb5ff); // DEFAULT specific property + GuiSetStyle(DEFAULT, BACKGROUND_COLOR, 0xf5f5f5ff); // DEFAULT specific property + GuiSetStyle(TOGGLE, GROUP_PADDING, 2); + GuiSetStyle(SLIDER, SLIDER_WIDTH, 16); + GuiSetStyle(SLIDER, SLIDER_PADDING, 1); + GuiSetStyle(PROGRESSBAR, PROGRESS_PADDING, 1); + GuiSetStyle(CHECKBOX, CHECK_PADDING, 1); + GuiSetStyle(COMBOBOX, COMBO_BUTTON_WIDTH, 32); + GuiSetStyle(COMBOBOX, COMBO_BUTTON_PADDING, 2); + GuiSetStyle(DROPDOWNBOX, ARROW_PADDING, 16); + GuiSetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING, 2); + GuiSetStyle(TEXTBOX, TEXT_LINES_PADDING, 4); + GuiSetStyle(TEXTBOX, TEXT_INNER_PADDING, 4); + GuiSetStyle(TEXTBOX, COLOR_SELECTED_FG, 0xf0fffeff); + GuiSetStyle(TEXTBOX, COLOR_SELECTED_BG, 0x839affe0); + GuiSetStyle(SPINNER, SPIN_BUTTON_WIDTH, 24); + GuiSetStyle(SPINNER, SPIN_BUTTON_PADDING, 2); + GuiSetStyle(SCROLLBAR, BORDER_WIDTH, 0); + GuiSetStyle(SCROLLBAR, ARROWS_VISIBLE, 0); + GuiSetStyle(SCROLLBAR, ARROWS_SIZE, 6); + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING, 0); + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, 16); + GuiSetStyle(SCROLLBAR, SCROLL_PADDING, 0); + GuiSetStyle(SCROLLBAR, SCROLL_SPEED, 12); + GuiSetStyle(LISTVIEW, LIST_ITEMS_HEIGHT, 24); + GuiSetStyle(LISTVIEW, LIST_ITEMS_PADDING, 2); + GuiSetStyle(LISTVIEW, SCROLLBAR_WIDTH, 12); + GuiSetStyle(LISTVIEW, SCROLLBAR_SIDE, SCROLLBAR_RIGHT_SIDE); + GuiSetStyle(COLORPICKER, COLOR_SELECTOR_SIZE, 8); + GuiSetStyle(COLORPICKER, HUEBAR_WIDTH, 16); + GuiSetStyle(COLORPICKER, HUEBAR_PADDING, 8); + GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT, 8); + GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW, 2); + + guiFont = GetFontDefault(); // Initialize default font +} + +// Get text with icon id prepended +// NOTE: Useful to add icons by name id (enum) instead of +// a number that can change between ricon versions +const char *GuiIconText(int iconId, const char *text) +{ +#if defined(RAYGUI_NO_ICONS) + return NULL; +#else + static char buffer[1024] = { 0 }; + memset(buffer, 0, 1024); + + sprintf(buffer, "#%03i#", iconId); + + if (text != NULL) + { + for (int i = 5; i < 1024; i++) + { + buffer[i] = text[i - 5]; + if (text[i - 5] == '\0') break; + } + } + + return buffer; +#endif +} + +#if !defined(RAYGUI_NO_ICONS) + +// Get full icons data pointer +unsigned int *GuiGetIcons(void) { return guiIcons; } + +// Load raygui icons file (.rgi) +// NOTE: In case nameIds are required, they can be requested with loadIconsName, +// they are returned as a guiIconsName[iconCount][RAYGUI_ICON_MAX_NAME_LENGTH], +// WARNING: guiIconsName[]][] memory should be manually freed! +char **GuiLoadIcons(const char *fileName, bool loadIconsName) +{ + // Style File Structure (.rgi) + // ------------------------------------------------------ + // Offset | Size | Type | Description + // ------------------------------------------------------ + // 0 | 4 | char | Signature: "rGI " + // 4 | 2 | short | Version: 100 + // 6 | 2 | short | reserved + + // 8 | 2 | short | Num icons (N) + // 10 | 2 | short | Icons size (Options: 16, 32, 64) (S) + + // Icons name id (32 bytes per name id) + // foreach (icon) + // { + // 12+32*i | 32 | char | Icon NameId + // } + + // Icons data: One bit per pixel, stored as unsigned int array (depends on icon size) + // S*S pixels/32bit per unsigned int = K unsigned int per icon + // foreach (icon) + // { + // ... | K | unsigned int | Icon Data + // } + + FILE *rgiFile = fopen(fileName, "rb"); + + char **guiIconsName = NULL; + + if (rgiFile != NULL) + { + char signature[5] = { 0 }; + short version = 0; + short reserved = 0; + short iconCount = 0; + short iconSize = 0; + + fread(signature, 1, 4, rgiFile); + fread(&version, 1, sizeof(short), rgiFile); + fread(&reserved, 1, sizeof(short), rgiFile); + fread(&iconCount, 1, sizeof(short), rgiFile); + fread(&iconSize, 1, sizeof(short), rgiFile); + + if ((signature[0] == 'r') && + (signature[1] == 'G') && + (signature[2] == 'I') && + (signature[3] == ' ')) + { + if (loadIconsName) + { + guiIconsName = (char **)RAYGUI_MALLOC(iconCount*sizeof(char **)); + for (int i = 0; i < iconCount; i++) + { + guiIconsName[i] = (char *)RAYGUI_MALLOC(RAYGUI_ICON_MAX_NAME_LENGTH); + fread(guiIconsName[i], RAYGUI_ICON_MAX_NAME_LENGTH, 1, rgiFile); + } + } + else fseek(rgiFile, iconCount*RAYGUI_ICON_MAX_NAME_LENGTH, SEEK_CUR); + + // Read icons data directly over guiIcons data array + fread(guiIcons, iconCount*(iconSize*iconSize/32), sizeof(unsigned int), rgiFile); + } + + fclose(rgiFile); + } + + return guiIconsName; +} + +// Draw selected icon using rectangles pixel-by-pixel +void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color) +{ + #define BIT_CHECK(a,b) ((a) & (1<<(b))) + + for (int i = 0, y = 0; i < RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32; i++) + { + for (int k = 0; k < 32; k++) + { + if (BIT_CHECK(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + i], k)) + { + #if !defined(RAYGUI_STANDALONE) + DrawRectangle(posX + (k%RAYGUI_ICON_SIZE)*pixelSize, posY + y*pixelSize, pixelSize, pixelSize, color); + #endif + } + + if ((k == 15) || (k == 31)) y++; + } + } +} + +// Get icon bit data +// NOTE: Bit data array grouped as unsigned int (ICON_SIZE*ICON_SIZE/32 elements) +unsigned int *GuiGetIconData(int iconId) +{ + static unsigned int iconData[RAYGUI_ICON_DATA_ELEMENTS] = { 0 }; + memset(iconData, 0, RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); + + if (iconId < RAYGUI_ICON_MAX_ICONS) memcpy(iconData, &guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS], RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); + + return iconData; +} + +// Set icon bit data +// NOTE: Data must be provided as unsigned int array (ICON_SIZE*ICON_SIZE/32 elements) +void GuiSetIconData(int iconId, unsigned int *data) +{ + if (iconId < RAYGUI_ICON_MAX_ICONS) memcpy(&guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS], data, RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); +} + +// Set icon pixel value +void GuiSetIconPixel(int iconId, int x, int y) +{ + #define BIT_SET(a,b) ((a) |= (1<<(b))) + + // This logic works for any RAYGUI_ICON_SIZE pixels icons, + // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element + BIT_SET(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + y/(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)], x + (y%(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)*RAYGUI_ICON_SIZE)); +} + +// Clear icon pixel value +void GuiClearIconPixel(int iconId, int x, int y) +{ + #define BIT_CLEAR(a,b) ((a) &= ~((1)<<(b))) + + // This logic works for any RAYGUI_ICON_SIZE pixels icons, + // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element + BIT_CLEAR(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + y/(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)], x + (y%(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)*RAYGUI_ICON_SIZE)); +} + +// Check icon pixel value +bool GuiCheckIconPixel(int iconId, int x, int y) +{ + #define BIT_CHECK(a,b) ((a) & (1<<(b))) + + return (BIT_CHECK(guiIcons[iconId*8 + y/2], x + (y%2*16))); +} +#endif // !RAYGUI_NO_ICONS + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- +// Gui get text width using default font +// NOTE: Icon is not considered here +static int GetTextWidth(const char *text) +{ + Vector2 size = { 0 }; + + if ((text != NULL) && (text[0] != '\0')) + { + size = MeasureTextEx(guiFont, text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + } + + return (int)size.x; +} + +// Get text bounds considering control bounds +static Rectangle GetTextBounds(int control, Rectangle bounds) +{ + Rectangle textBounds = bounds; + + textBounds.x = bounds.x + GuiGetStyle(control, BORDER_WIDTH); + textBounds.y = bounds.y + GuiGetStyle(control, BORDER_WIDTH); + textBounds.width = bounds.width - 2*GuiGetStyle(control, BORDER_WIDTH); + textBounds.height = bounds.height - 2*GuiGetStyle(control, BORDER_WIDTH); + + // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT + switch (control) + { + case COMBOBOX: bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_PADDING)); break; + case VALUEBOX: break; // NOTE: ValueBox text value always centered, text padding applies to label + default: + { + if (GuiGetStyle(control, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) textBounds.x -= GuiGetStyle(control, TEXT_PADDING); + else textBounds.x += GuiGetStyle(control, TEXT_PADDING); + } break; + } + + // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?) + // More special cases (label on side): CHECKBOX, SLIDER, VALUEBOX, SPINNER + + return textBounds; +} + +// Get text icon if provided and move text cursor +// NOTE: We support up to 999 values for iconId +static const char *GetTextIcon(const char *text, int *iconId) +{ +#if !defined(RAYGUI_NO_ICONS) + *iconId = -1; + if (text[0] == '#') // Maybe we have an icon! + { + char iconValue[4] = { 0 }; // Maximum length for icon value: 3 digits + '\0' + + int pos = 1; + while ((pos < 4) && (text[pos] >= '0') && (text[pos] <= '9')) + { + iconValue[pos - 1] = text[pos]; + pos++; + } + + if (text[pos] == '#') + { + *iconId = TextToInteger(iconValue); + + // Move text pointer after icon + // WARNING: If only icon provided, it could point to EOL character: '\0' + if (*iconId >= 0) text += (pos + 1); + } + } +#endif + + return text; +} + +// Gui draw text using default font +static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint) +{ + #define TEXT_VALIGN_PIXEL_OFFSET(h) ((int)h%2) // Vertical alignment for pixel perfect + + #if !defined(RAYGUI_ICON_TEXT_PADDING) + #define RAYGUI_ICON_TEXT_PADDING 4 + #endif + + if ((text != NULL) && (text[0] != '\0')) + { + int iconId = 0; + text = GetTextIcon(text, &iconId); // Check text for icon and move cursor + + // Get text position depending on alignment and iconId + //--------------------------------------------------------------------------------- + + + Vector2 position = { bounds.x, bounds.y }; + + // NOTE: We get text size after icon has been processed + int textWidth = GetTextWidth(text); + int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); + + // If text requires an icon, add size to measure + if (iconId >= 0) + { + textWidth += RAYGUI_ICON_SIZE; + + // WARNING: If only icon provided, text could be pointing to EOF character: '\0' + if ((text != NULL) && (text[0] != '\0')) textWidth += RAYGUI_ICON_TEXT_PADDING; + } + + // Check guiTextAlign global variables + switch (alignment) + { + case GUI_TEXT_ALIGN_LEFT: + { + position.x = bounds.x; + position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } break; + case GUI_TEXT_ALIGN_CENTER: + { + position.x = bounds.x + bounds.width/2 - textWidth/2; + position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } break; + case GUI_TEXT_ALIGN_RIGHT: + { + position.x = bounds.x + bounds.width - textWidth; + position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } break; + default: break; + } + + // NOTE: Make sure we get pixel-perfect coordinates, + // In case of decimals we got weird text positioning + position.x = (float)((int)position.x); + position.y = (float)((int)position.y); + //--------------------------------------------------------------------------------- + + // Draw text (with icon if available) + //--------------------------------------------------------------------------------- +#if !defined(RAYGUI_NO_ICONS) + if (iconId >= 0) + { + // NOTE: We consider icon height, probably different than text size + GuiDrawIcon(iconId, (int)position.x, (int)(bounds.y + bounds.height/2 - RAYGUI_ICON_SIZE/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height)), 1, tint); + position.x += (RAYGUI_ICON_SIZE + RAYGUI_ICON_TEXT_PADDING); + } +#endif + DrawTextEx(guiFont, text, position, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING), tint); + //--------------------------------------------------------------------------------- + } +} + +// Gui draw rectangle using default raygui plain style with borders +static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color) +{ + if (color.a > 0) + { + // Draw rectangle filled with color + DrawRectangle((int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, color); + } + + if (borderWidth > 0) + { + // Draw rectangle border lines with color + DrawRectangle((int)rec.x, (int)rec.y, (int)rec.width, borderWidth, borderColor); + DrawRectangle((int)rec.x, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2*borderWidth, borderColor); + DrawRectangle((int)rec.x + (int)rec.width - borderWidth, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2*borderWidth, borderColor); + DrawRectangle((int)rec.x, (int)rec.y + (int)rec.height - borderWidth, (int)rec.width, borderWidth, borderColor); + } +} + +// Split controls text into multiple strings +// Also check for multiple columns (required by GuiToggleGroup()) +static const char **GuiTextSplit(const char *text, int *count, int *textRow) +{ + // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) + // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, + // all used memory is static... it has some limitations: + // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ELEMENTS + // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE + // NOTE: Those definitions could be externally provided if required + + #if !defined(RAYGUI_TEXTSPLIT_MAX_ELEMENTS) + #define RAYGUI_TEXTSPLIT_MAX_ELEMENTS 128 + #endif + #if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) + #define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 + #endif + + static const char *result[RAYGUI_TEXTSPLIT_MAX_ELEMENTS] = { NULL }; + static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = { 0 }; + memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); + + result[0] = buffer; + int counter = 1; + + if (textRow != NULL) textRow[0] = 0; + + // Count how many substrings we have on text and point to every one + for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) + { + buffer[i] = text[i]; + if (buffer[i] == '\0') break; + else if ((buffer[i] == ';') || (buffer[i] == '\n')) + { + result[counter] = buffer + i + 1; + + if (textRow != NULL) + { + if (buffer[i] == '\n') textRow[counter] = textRow[counter - 1] + 1; + else textRow[counter] = textRow[counter - 1]; + } + + buffer[i] = '\0'; // Set an end of string at this point + + counter++; + if (counter == RAYGUI_TEXTSPLIT_MAX_ELEMENTS) break; + } + } + + *count = counter; + + return result; +} + +// Convert color data from RGB to HSV +// NOTE: Color data should be passed normalized +static Vector3 ConvertRGBtoHSV(Vector3 rgb) +{ + Vector3 hsv = { 0 }; + float min = 0.0f; + float max = 0.0f; + float delta = 0.0f; + + min = (rgb.x < rgb.y)? rgb.x : rgb.y; + min = (min < rgb.z)? min : rgb.z; + + max = (rgb.x > rgb.y)? rgb.x : rgb.y; + max = (max > rgb.z)? max : rgb.z; + + hsv.z = max; // Value + delta = max - min; + + if (delta < 0.00001f) + { + hsv.y = 0.0f; + hsv.x = 0.0f; // Undefined, maybe NAN? + return hsv; + } + + if (max > 0.0f) + { + // NOTE: If max is 0, this divide would cause a crash + hsv.y = (delta/max); // Saturation + } + else + { + // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined + hsv.y = 0.0f; + hsv.x = 0.0f; // Undefined, maybe NAN? + return hsv; + } + + // NOTE: Comparing float values could not work properly + if (rgb.x >= max) hsv.x = (rgb.y - rgb.z)/delta; // Between yellow & magenta + else + { + if (rgb.y >= max) hsv.x = 2.0f + (rgb.z - rgb.x)/delta; // Between cyan & yellow + else hsv.x = 4.0f + (rgb.x - rgb.y)/delta; // Between magenta & cyan + } + + hsv.x *= 60.0f; // Convert to degrees + + if (hsv.x < 0.0f) hsv.x += 360.0f; + + return hsv; +} + +// Convert color data from HSV to RGB +// NOTE: Color data should be passed normalized +static Vector3 ConvertHSVtoRGB(Vector3 hsv) +{ + Vector3 rgb = { 0 }; + float hh = 0.0f, p = 0.0f, q = 0.0f, t = 0.0f, ff = 0.0f; + long i = 0; + + // NOTE: Comparing float values could not work properly + if (hsv.y <= 0.0f) + { + rgb.x = hsv.z; + rgb.y = hsv.z; + rgb.z = hsv.z; + return rgb; + } + + hh = hsv.x; + if (hh >= 360.0f) hh = 0.0f; + hh /= 60.0f; + + i = (long)hh; + ff = hh - i; + p = hsv.z*(1.0f - hsv.y); + q = hsv.z*(1.0f - (hsv.y*ff)); + t = hsv.z*(1.0f - (hsv.y*(1.0f - ff))); + + switch (i) + { + case 0: + { + rgb.x = hsv.z; + rgb.y = t; + rgb.z = p; + } break; + case 1: + { + rgb.x = q; + rgb.y = hsv.z; + rgb.z = p; + } break; + case 2: + { + rgb.x = p; + rgb.y = hsv.z; + rgb.z = t; + } break; + case 3: + { + rgb.x = p; + rgb.y = q; + rgb.z = hsv.z; + } break; + case 4: + { + rgb.x = t; + rgb.y = p; + rgb.z = hsv.z; + } break; + case 5: + default: + { + rgb.x = hsv.z; + rgb.y = p; + rgb.z = q; + } break; + } + + return rgb; +} + +#if defined(RAYGUI_STANDALONE) +// Returns a Color struct from hexadecimal value +static Color GetColor(int hexValue) +{ + Color color; + + color.r = (unsigned char)(hexValue >> 24) & 0xFF; + color.g = (unsigned char)(hexValue >> 16) & 0xFF; + color.b = (unsigned char)(hexValue >> 8) & 0xFF; + color.a = (unsigned char)hexValue & 0xFF; + + return color; +} + +// Returns hexadecimal value for a Color +static int ColorToInt(Color color) +{ + return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); +} + +// Check if point is inside rectangle +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) +{ + bool collision = false; + + if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && + (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; + + return collision; +} + +// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f +static Color Fade(Color color, float alpha) +{ + if (alpha < 0.0f) alpha = 0.0f; + else if (alpha > 1.0f) alpha = 1.0f; + + Color result = { color.r, color.g, color.b, (unsigned char)(255.0f*alpha) }; + + return result; +} + +// Formatting of text with variables to 'embed' +static const char *TextFormat(const char *text, ...) +{ + #if !defined(RAYGUI_TEXTFORMAT_MAX_SIZE) + #define RAYGUI_TEXTFORMAT_MAX_SIZE 256 + #endif + + static char buffer[RAYGUI_TEXTFORMAT_MAX_SIZE]; + + va_list args; + va_start(args, text); + vsprintf(buffer, text, args); + va_end(args); + + return buffer; +} + +// Draw rectangle with vertical gradient fill color +// NOTE: This function is only used by GuiColorPicker() +static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2) +{ + Rectangle bounds = { (float)posX, (float)posY, (float)width, (float)height }; + DrawRectangleGradientEx(bounds, color1, color2, color2, color1); +} + +// Split string into multiple strings +const char **TextSplit(const char *text, char delimiter, int *count) +{ + // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) + // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, + // all used memory is static... it has some limitations: + // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ELEMENTS + // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE + + #if !defined(RAYGUI_TEXTSPLIT_MAX_ELEMENTS) + #define RAYGUI_TEXTSPLIT_MAX_ELEMENTS 128 + #endif + #if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) + #define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 + #endif + + static const char *result[RAYGUI_TEXTSPLIT_MAX_ELEMENTS] = { NULL }; + static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = { 0 }; + memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); + + result[0] = buffer; + int counter = 0; + + if (text != NULL) + { + counter = 1; + + // Count how many substrings we have on text and point to every one + for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) + { + buffer[i] = text[i]; + if (buffer[i] == '\0') break; + else if (buffer[i] == delimiter) + { + buffer[i] = '\0'; // Set an end of string at this point + result[counter] = buffer + i + 1; + counter++; + + if (counter == RAYGUI_TEXTSPLIT_MAX_ELEMENTS) break; + } + } + } + + *count = counter; + return result; +} + +// Get integer value from text +// NOTE: This function replaces atoi() [stdlib.h] +static int TextToInteger(const char *text) +{ + int value = 0; + int sign = 1; + + if ((text[0] == '+') || (text[0] == '-')) + { + if (text[0] == '-') sign = -1; + text++; + } + + for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) value = value*10 + (int)(text[i] - '0'); + + return value*sign; +} + +// Encode codepoint into UTF-8 text (char array size returned as parameter) +static const char *CodepointToUTF8(int codepoint, int *byteSize) +{ + static char utf8[6] = { 0 }; + int size = 0; + + if (codepoint <= 0x7f) + { + utf8[0] = (char)codepoint; + size = 1; + } + else if (codepoint <= 0x7ff) + { + utf8[0] = (char)(((codepoint >> 6) & 0x1f) | 0xc0); + utf8[1] = (char)((codepoint & 0x3f) | 0x80); + size = 2; + } + else if (codepoint <= 0xffff) + { + utf8[0] = (char)(((codepoint >> 12) & 0x0f) | 0xe0); + utf8[1] = (char)(((codepoint >> 6) & 0x3f) | 0x80); + utf8[2] = (char)((codepoint & 0x3f) | 0x80); + size = 3; + } + else if (codepoint <= 0x10ffff) + { + utf8[0] = (char)(((codepoint >> 18) & 0x07) | 0xf0); + utf8[1] = (char)(((codepoint >> 12) & 0x3f) | 0x80); + utf8[2] = (char)(((codepoint >> 6) & 0x3f) | 0x80); + utf8[3] = (char)((codepoint & 0x3f) | 0x80); + size = 4; + } + + *byteSize = size; + + return utf8; +} + +// Get next codepoint in a UTF-8 encoded text, scanning until '\0' is found +// When a invalid UTF-8 byte is encountered we exit as soon as possible and a '?'(0x3f) codepoint is returned +// Total number of bytes processed are returned as a parameter +// NOTE: the standard says U+FFFD should be returned in case of errors +// but that character is not supported by the default font in raylib +static int GetCodepoint(const char *text, int *bytesProcessed) +{ +/* + UTF-8 specs from https://www.ietf.org/rfc/rfc3629.txt + + Char. number range | UTF-8 octet sequence + (hexadecimal) | (binary) + --------------------+--------------------------------------------- + 0000 0000-0000 007F | 0xxxxxxx + 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx +*/ + // NOTE: on decode errors we return as soon as possible + + int code = 0x3f; // Codepoint (defaults to '?') + int octet = (unsigned char)(text[0]); // The first UTF8 octet + *bytesProcessed = 1; + + if (octet <= 0x7f) + { + // Only one octet (ASCII range x00-7F) + code = text[0]; + } + else if ((octet & 0xe0) == 0xc0) + { + // Two octets + + // [0]xC2-DF [1]UTF8-tail(x80-BF) + unsigned char octet1 = text[1]; + + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + + if ((octet >= 0xc2) && (octet <= 0xdf)) + { + code = ((octet & 0x1f) << 6) | (octet1 & 0x3f); + *bytesProcessed = 2; + } + } + else if ((octet & 0xf0) == 0xe0) + { + // Three octets + unsigned char octet1 = text[1]; + unsigned char octet2 = '\0'; + + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + + octet2 = text[2]; + + if ((octet2 == '\0') || ((octet2 >> 6) != 2)) { *bytesProcessed = 3; return code; } // Unexpected sequence + + // [0]xE0 [1]xA0-BF [2]UTF8-tail(x80-BF) + // [0]xE1-EC [1]UTF8-tail [2]UTF8-tail(x80-BF) + // [0]xED [1]x80-9F [2]UTF8-tail(x80-BF) + // [0]xEE-EF [1]UTF8-tail [2]UTF8-tail(x80-BF) + + if (((octet == 0xe0) && !((octet1 >= 0xa0) && (octet1 <= 0xbf))) || + ((octet == 0xed) && !((octet1 >= 0x80) && (octet1 <= 0x9f)))) { *bytesProcessed = 2; return code; } + + if ((octet >= 0xe0) && (0 <= 0xef)) + { + code = ((octet & 0xf) << 12) | ((octet1 & 0x3f) << 6) | (octet2 & 0x3f); + *bytesProcessed = 3; + } + } + else if ((octet & 0xf8) == 0xf0) + { + // Four octets + if (octet > 0xf4) return code; + + unsigned char octet1 = text[1]; + unsigned char octet2 = '\0'; + unsigned char octet3 = '\0'; + + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + + octet2 = text[2]; + + if ((octet2 == '\0') || ((octet2 >> 6) != 2)) { *bytesProcessed = 3; return code; } // Unexpected sequence + + octet3 = text[3]; + + if ((octet3 == '\0') || ((octet3 >> 6) != 2)) { *bytesProcessed = 4; return code; } // Unexpected sequence + + // [0]xF0 [1]x90-BF [2]UTF8-tail [3]UTF8-tail + // [0]xF1-F3 [1]UTF8-tail [2]UTF8-tail [3]UTF8-tail + // [0]xF4 [1]x80-8F [2]UTF8-tail [3]UTF8-tail + + if (((octet == 0xf0) && !((octet1 >= 0x90) && (octet1 <= 0xbf))) || + ((octet == 0xf4) && !((octet1 >= 0x80) && (octet1 <= 0x8f)))) { *bytesProcessed = 2; return code; } // Unexpected sequence + + if (octet >= 0xf0) + { + code = ((octet & 0x7) << 18) | ((octet1 & 0x3f) << 12) | ((octet2 & 0x3f) << 6) | (octet3 & 0x3f); + *bytesProcessed = 4; + } + } + + if (code > 0x10ffff) code = 0x3f; // Codepoints after U+10ffff are invalid + + return code; +} +#endif // RAYGUI_STANDALONE + +#endif // RAYGUI_IMPLEMENTATION \ No newline at end of file diff --git a/raylib-sys/rgui_wrapper.c b/raylib-sys/binding/rgui_wrapper.c similarity index 80% rename from raylib-sys/rgui_wrapper.c rename to raylib-sys/binding/rgui_wrapper.c index 5cb3597a..6dfdf59b 100644 --- a/raylib-sys/rgui_wrapper.c +++ b/raylib-sys/binding/rgui_wrapper.c @@ -1,5 +1,4 @@ -#include "raylib.h" -#define RICONS_IMPLEMENTATION +#include "../raylib/src/raylib.h" #define RAYGUI_IMPLEMENTATION #define RAYGUI_SUPPORT_ICONS #define RLGL_IMPLEMENTATION diff --git a/raylib-sys/rgui_wrapper.cpp b/raylib-sys/binding/rgui_wrapper.cpp similarity index 88% rename from raylib-sys/rgui_wrapper.cpp rename to raylib-sys/binding/rgui_wrapper.cpp index fa21f0fe..57b76db6 100644 --- a/raylib-sys/rgui_wrapper.cpp +++ b/raylib-sys/binding/rgui_wrapper.cpp @@ -1,5 +1,4 @@ -#include "raylib.h" -#define RICONS_IMPLEMENTATION +#include "../raylib/src/raylib.h" #define RAYGUI_IMPLEMENTATION #define RAYGUI_SUPPORT_ICONS #define RLGL_IMPLEMENTATION diff --git a/raylib-sys/rgui_wrapper.h b/raylib-sys/binding/rgui_wrapper.h similarity index 100% rename from raylib-sys/rgui_wrapper.h rename to raylib-sys/binding/rgui_wrapper.h diff --git a/raylib-sys/bindings_linux.rs b/raylib-sys/bindings_linux.rs deleted file mode 100644 index 4b854986..00000000 --- a/raylib-sys/bindings_linux.rs +++ /dev/null @@ -1,8198 +0,0 @@ -/* automatically generated by rust-bindgen 0.59.1 */ - -pub const RAYGUI_VERSION: &'static [u8; 8usize] = b"2.6-dev\0"; -pub const __GNUC_VA_LIST: u32 = 1; -pub const PI: f64 = 3.141592653589793; -pub const DEG2RAD: f64 = 0.017453292519943295; -pub const RAD2DEG: f64 = 57.29577951308232; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: 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 = 31; -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 __LONG_DOUBLE_USES_FLOAT128: u32 = 0; -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_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const _STDLIB_H: u32 = 1; -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 NUM_CONTROLS: u32 = 16; -pub const NUM_PROPS_DEFAULT: u32 = 16; -pub const NUM_PROPS_EXTENDED: u32 = 8; -pub const TEXTEDIT_CURSOR_BLINK_FRAMES: u32 = 20; -pub const RICON_MAX_ICONS: u32 = 256; -pub const RICON_SIZE: u32 = 16; -pub const RICON_MAX_NAME_LENGTH: u32 = 32; -pub const RICON_DATA_ELEMENTS: u32 = 8; -pub const _STDIO_H: u32 = 1; -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 __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: 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 _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 FOPEN_MAX: u32 = 16; -pub const _STRING_H: u32 = 1; -pub const _MATH_H: u32 = 1; -pub const _BITS_LIBM_SIMD_DECL_STUBS_H: u32 = 1; -pub const __FP_LOGB0_IS_MIN: u32 = 1; -pub const __FP_LOGBNAN_IS_MIN: u32 = 1; -pub const FP_ILOGB0: i32 = -2147483648; -pub const FP_ILOGBNAN: i32 = -2147483648; -pub const __MATH_DECLARING_DOUBLE: u32 = 1; -pub const __MATH_DECLARING_FLOATN: u32 = 0; -pub const __MATH_DECLARE_LDOUBLE: u32 = 1; -pub const FP_NAN: u32 = 0; -pub const FP_INFINITE: u32 = 1; -pub const FP_ZERO: u32 = 2; -pub const FP_SUBNORMAL: u32 = 3; -pub const FP_NORMAL: u32 = 4; -pub const MATH_ERRNO: u32 = 1; -pub const MATH_ERREXCEPT: u32 = 2; -pub const math_errhandling: u32 = 3; -pub const WINDOW_STATUSBAR_HEIGHT: u32 = 22; -pub const GROUPBOX_LINE_THICK: u32 = 1; -pub const GROUPBOX_TEXT_PADDING: u32 = 10; -pub const LINE_TEXT_PADDING: u32 = 10; -pub const PANEL_BORDER_WIDTH: u32 = 1; -pub const TOGGLEGROUP_MAX_ELEMENTS: u32 = 32; -pub const VALUEBOX_MAX_CHARS: u32 = 32; -pub const COLORBARALPHA_CHECKED_SIZE: u32 = 10; -pub const MESSAGEBOX_BUTTON_HEIGHT: u32 = 24; -pub const MESSAGEBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_BUTTON_HEIGHT: u32 = 24; -pub const TEXTINPUTBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_HEIGHT: u32 = 30; -pub const TEXTINPUTBOX_MAX_TEXT_LENGTH: u32 = 256; -pub const GRID_COLOR_ALPHA: f64 = 0.15; -pub const ICON_TEXT_PADDING: u32 = 4; -pub const TEXTSPLIT_MAX_TEXT_LENGTH: u32 = 1024; -pub const TEXTSPLIT_MAX_TEXT_ELEMENTS: u32 = 128; -pub const MAX_MATERIAL_MAPS: u32 = 12; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector2 { - pub x: f32, - pub y: f32, -} -#[test] -fn bindgen_test_layout_Vector2() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(Vector2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(y) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector3 { - pub x: f32, - pub y: f32, - pub z: f32, -} -#[test] -fn bindgen_test_layout_Vector3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(Vector3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(z) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector4 { - pub x: f32, - pub y: f32, - pub z: f32, - pub w: f32, -} -#[test] -fn bindgen_test_layout_Vector4() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Vector4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector4)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(z) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(w) - ) - ); -} -pub type Quaternion = Vector4; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Matrix { - pub m0: f32, - pub m4: f32, - pub m8: f32, - pub m12: f32, - pub m1: f32, - pub m5: f32, - pub m9: f32, - pub m13: f32, - pub m2: f32, - pub m6: f32, - pub m10: f32, - pub m14: f32, - pub m3: f32, - pub m7: f32, - pub m11: f32, - pub m15: f32, -} -#[test] -fn bindgen_test_layout_Matrix() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(Matrix)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Matrix)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m4 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m8 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m12 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m12) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m5 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m9 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m13 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m13) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m2 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m6 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m10 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m10) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m14 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m14) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m3 as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m7 as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m7) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m11 as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m11) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m15 as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m15) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Color { - pub r: ::std::os::raw::c_uchar, - pub g: ::std::os::raw::c_uchar, - pub b: ::std::os::raw::c_uchar, - pub a: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_Color() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(Color)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Color)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, - 1usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(g)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 2usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 3usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(a)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rectangle { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, -} -#[test] -fn bindgen_test_layout_Rectangle() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Rectangle)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Rectangle)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(height) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Image { - pub data: *mut ::std::os::raw::c_void, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Image() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Image)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Image)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(format) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Texture { - pub id: ::std::os::raw::c_uint, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Texture() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(Texture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Texture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(format) - ) - ); -} -pub type Texture2D = Texture; -pub type TextureCubemap = Texture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderTexture { - pub id: ::std::os::raw::c_uint, - pub texture: Texture, - pub depth: Texture, -} -#[test] -fn bindgen_test_layout_RenderTexture() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(RenderTexture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RenderTexture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).depth as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(depth) - ) - ); -} -pub type RenderTexture2D = RenderTexture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NPatchInfo { - pub source: Rectangle, - pub left: ::std::os::raw::c_int, - pub top: ::std::os::raw::c_int, - pub right: ::std::os::raw::c_int, - pub bottom: ::std::os::raw::c_int, - pub layout: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NPatchInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(NPatchInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(NPatchInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).left as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).top as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).right as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bottom as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(bottom) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).layout as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(layout) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CharInfo { - pub value: ::std::os::raw::c_int, - pub offsetX: ::std::os::raw::c_int, - pub offsetY: ::std::os::raw::c_int, - pub advanceX: ::std::os::raw::c_int, - pub image: Image, -} -#[test] -fn bindgen_test_layout_CharInfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CharInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CharInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetX as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetY as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).advanceX as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(advanceX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).image as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(image) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Font { - pub baseSize: ::std::os::raw::c_int, - pub charsCount: ::std::os::raw::c_int, - pub charsPadding: ::std::os::raw::c_int, - pub texture: Texture2D, - pub recs: *mut Rectangle, - pub chars: *mut CharInfo, -} -#[test] -fn bindgen_test_layout_Font() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Font)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Font)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).baseSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(baseSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsPadding as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsPadding) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).recs as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(recs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chars as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(chars) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera3D { - pub position: Vector3, - pub target: Vector3, - pub up: Vector3, - pub fovy: f32, - pub projection: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Camera3D() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(Camera3D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera3D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).up as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(up) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fovy as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(fovy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(projection) - ) - ); -} -pub type Camera = Camera3D; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera2D { - pub offset: Vector2, - pub target: Vector2, - pub rotation: f32, - pub zoom: f32, -} -#[test] -fn bindgen_test_layout_Camera2D() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Camera2D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera2D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).zoom as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(zoom) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Mesh { - pub vertexCount: ::std::os::raw::c_int, - pub triangleCount: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub texcoords2: *mut f32, - pub normals: *mut f32, - pub tangents: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_ushort, - pub animVertices: *mut f32, - pub animNormals: *mut f32, - pub boneIds: *mut ::std::os::raw::c_int, - pub boneWeights: *mut f32, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: *mut ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Mesh() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(Mesh)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Mesh)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).triangleCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(triangleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normals as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(normals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tangents as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(tangents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animVertices as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animVertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animNormals as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animNormals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneIds as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneIds) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneWeights as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneWeights) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Shader { - pub id: ::std::os::raw::c_uint, - pub locs: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Shader() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Shader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Shader)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).locs as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(locs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MaterialMap { - pub texture: Texture2D, - pub color: Color, - pub value: f32, -} -#[test] -fn bindgen_test_layout_MaterialMap() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(MaterialMap)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MaterialMap)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(color) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(value) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Material { - pub shader: Shader, - pub maps: *mut MaterialMap, - pub params: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_Material() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Material)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Material)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).shader as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(shader) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).maps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(maps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).params as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(params) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Transform { - pub translation: Vector3, - pub rotation: Quaternion, - pub scale: Vector3, -} -#[test] -fn bindgen_test_layout_Transform() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Transform)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Transform)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).translation as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(translation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(scale) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoneInfo { - pub name: [::std::os::raw::c_char; 32usize], - pub parent: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_BoneInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(BoneInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoneInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(parent) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Model { - pub transform: Matrix, - pub meshCount: ::std::os::raw::c_int, - pub materialCount: ::std::os::raw::c_int, - pub meshes: *mut Mesh, - pub materials: *mut Material, - pub meshMaterial: *mut ::std::os::raw::c_int, - pub boneCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub bindPose: *mut Transform, -} -#[test] -fn bindgen_test_layout_Model() { - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Model)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).transform as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshCount as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materialCount as *const _ as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materialCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshes as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshes) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materials as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materials) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshMaterial as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshMaterial) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bindPose as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bindPose) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ModelAnimation { - pub boneCount: ::std::os::raw::c_int, - pub frameCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub framePoses: *mut *mut Transform, -} -#[test] -fn bindgen_test_layout_ModelAnimation() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ModelAnimation)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ModelAnimation)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).frameCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(frameCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).framePoses as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(framePoses) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Ray { - pub position: Vector3, - pub direction: Vector3, -} -#[test] -fn bindgen_test_layout_Ray() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Ray)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Ray)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).direction as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(direction) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RayHitInfo { - pub hit: bool, - pub distance: f32, - pub position: Vector3, - pub normal: Vector3, -} -#[test] -fn bindgen_test_layout_RayHitInfo() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RayHitInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RayHitInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hit as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(hit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(distance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normal as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(normal) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoundingBox { - pub min: Vector3, - pub max: Vector3, -} -#[test] -fn bindgen_test_layout_BoundingBox() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(BoundingBox)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoundingBox)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(min) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(max) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wave { - pub sampleCount: ::std::os::raw::c_uint, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, - pub data: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Wave() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Wave)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Wave)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(channels) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rAudioBuffer { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AudioStream { - pub buffer: *mut rAudioBuffer, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_AudioStream() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(AudioStream)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AudioStream)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(channels) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Sound { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Sound() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(Sound)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Sound)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(sampleCount) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Music { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, - pub looping: bool, - pub ctxType: ::std::os::raw::c_int, - pub ctxData: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Music() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Music)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Music)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).looping as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(looping) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxType as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxType) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxData as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxData) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrDeviceInfo { - pub hResolution: ::std::os::raw::c_int, - pub vResolution: ::std::os::raw::c_int, - pub hScreenSize: f32, - pub vScreenSize: f32, - pub vScreenCenter: f32, - pub eyeToScreenDistance: f32, - pub lensSeparationDistance: f32, - pub interpupillaryDistance: f32, - pub lensDistortionValues: [f32; 4usize], - pub chromaAbCorrection: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_VrDeviceInfo() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hResolution as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vResolution as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hScreenSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenCenter as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eyeToScreenDistance as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(eyeToScreenDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensSeparationDistance as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensSeparationDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).interpupillaryDistance as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(interpupillaryDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensDistortionValues as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensDistortionValues) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chromaAbCorrection as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(chromaAbCorrection) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrStereoConfig { - pub projection: [Matrix; 2usize], - pub viewOffset: [Matrix; 2usize], - pub leftLensCenter: [f32; 2usize], - pub rightLensCenter: [f32; 2usize], - pub leftScreenCenter: [f32; 2usize], - pub rightScreenCenter: [f32; 2usize], - pub scale: [f32; 2usize], - pub scaleIn: [f32; 2usize], -} -#[test] -fn bindgen_test_layout_VrStereoConfig() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!("Size of: ", stringify!(VrStereoConfig)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrStereoConfig)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(projection) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).viewOffset as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(viewOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftLensCenter as *const _ as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rightLensCenter as *const _ as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftScreenCenter as *const _ as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rightScreenCenter as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightScreenCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scale) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scaleIn as *const _ as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scaleIn) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ConfigFlags { - FLAG_VSYNC_HINT = 64, - FLAG_FULLSCREEN_MODE = 2, - FLAG_WINDOW_RESIZABLE = 4, - FLAG_WINDOW_UNDECORATED = 8, - FLAG_WINDOW_HIDDEN = 128, - FLAG_WINDOW_MINIMIZED = 512, - FLAG_WINDOW_MAXIMIZED = 1024, - FLAG_WINDOW_UNFOCUSED = 2048, - FLAG_WINDOW_TOPMOST = 4096, - FLAG_WINDOW_ALWAYS_RUN = 256, - FLAG_WINDOW_TRANSPARENT = 16, - FLAG_WINDOW_HIGHDPI = 8192, - FLAG_MSAA_4X_HINT = 32, - FLAG_INTERLACED_HINT = 65536, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TraceLogLevel { - LOG_ALL = 0, - LOG_TRACE = 1, - LOG_DEBUG = 2, - LOG_INFO = 3, - LOG_WARNING = 4, - LOG_ERROR = 5, - LOG_FATAL = 6, - LOG_NONE = 7, -} -impl KeyboardKey { - pub const KEY_MENU: KeyboardKey = KeyboardKey::KEY_R; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum KeyboardKey { - KEY_NULL = 0, - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, - KEY_BACK = 4, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MouseButton { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MouseCursor { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, - MOUSE_CURSOR_RESIZE_NS = 6, - MOUSE_CURSOR_RESIZE_NWSE = 7, - MOUSE_CURSOR_RESIZE_NESW = 8, - MOUSE_CURSOR_RESIZE_ALL = 9, - MOUSE_CURSOR_NOT_ALLOWED = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GamepadButton { - GAMEPAD_BUTTON_UNKNOWN = 0, - GAMEPAD_BUTTON_LEFT_FACE_UP = 1, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2, - GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3, - GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4, - GAMEPAD_BUTTON_RIGHT_FACE_UP = 5, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8, - GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9, - GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12, - GAMEPAD_BUTTON_MIDDLE_LEFT = 13, - GAMEPAD_BUTTON_MIDDLE = 14, - GAMEPAD_BUTTON_MIDDLE_RIGHT = 15, - GAMEPAD_BUTTON_LEFT_THUMB = 16, - GAMEPAD_BUTTON_RIGHT_THUMB = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GamepadAxis { - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - GAMEPAD_AXIS_LEFT_TRIGGER = 4, - GAMEPAD_AXIS_RIGHT_TRIGGER = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MaterialMapIndex { - MATERIAL_MAP_ALBEDO = 0, - MATERIAL_MAP_METALNESS = 1, - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION = 4, - MATERIAL_MAP_EMISSION = 5, - MATERIAL_MAP_HEIGHT = 6, - MATERIAL_MAP_BRDG = 7, - MATERIAL_MAP_CUBEMAP = 8, - MATERIAL_MAP_IRRADIANCE = 9, - MATERIAL_MAP_PREFILTER = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ShaderLocationIndex { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01 = 1, - SHADER_LOC_VERTEX_TEXCOORD02 = 2, - SHADER_LOC_VERTEX_NORMAL = 3, - SHADER_LOC_VERTEX_TANGENT = 4, - SHADER_LOC_VERTEX_COLOR = 5, - SHADER_LOC_MATRIX_MVP = 6, - SHADER_LOC_MATRIX_VIEW = 7, - SHADER_LOC_MATRIX_PROJECTION = 8, - SHADER_LOC_MATRIX_MODEL = 9, - SHADER_LOC_MATRIX_NORMAL = 10, - SHADER_LOC_VECTOR_VIEW = 11, - SHADER_LOC_COLOR_DIFFUSE = 12, - SHADER_LOC_COLOR_SPECULAR = 13, - SHADER_LOC_COLOR_AMBIENT = 14, - SHADER_LOC_MAP_ALBEDO = 15, - SHADER_LOC_MAP_METALNESS = 16, - SHADER_LOC_MAP_NORMAL = 17, - SHADER_LOC_MAP_ROUGHNESS = 18, - SHADER_LOC_MAP_OCCLUSION = 19, - SHADER_LOC_MAP_EMISSION = 20, - SHADER_LOC_MAP_HEIGHT = 21, - SHADER_LOC_MAP_CUBEMAP = 22, - SHADER_LOC_MAP_IRRADIANCE = 23, - SHADER_LOC_MAP_PREFILTER = 24, - SHADER_LOC_MAP_BRDF = 25, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ShaderUniformDataType { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2 = 1, - SHADER_UNIFORM_VEC3 = 2, - SHADER_UNIFORM_VEC4 = 3, - SHADER_UNIFORM_INT = 4, - SHADER_UNIFORM_IVEC2 = 5, - SHADER_UNIFORM_IVEC3 = 6, - SHADER_UNIFORM_IVEC4 = 7, - SHADER_UNIFORM_SAMPLER2D = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PixelFormat { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2, - PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3, - PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4, - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5, - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6, - PIXELFORMAT_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7, - PIXELFORMAT_UNCOMPRESSED_R32 = 8, - PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9, - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10, - PIXELFORMAT_COMPRESSED_DXT1_RGB = 11, - PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12, - PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13, - PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14, - PIXELFORMAT_COMPRESSED_ETC1_RGB = 15, - PIXELFORMAT_COMPRESSED_ETC2_RGB = 16, - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17, - PIXELFORMAT_COMPRESSED_PVRT_RGB = 18, - PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19, - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20, - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TextureFilter { - TEXTURE_FILTER_POINT = 0, - TEXTURE_FILTER_BILINEAR = 1, - TEXTURE_FILTER_TRILINEAR = 2, - TEXTURE_FILTER_ANISOTROPIC_4X = 3, - TEXTURE_FILTER_ANISOTROPIC_8X = 4, - TEXTURE_FILTER_ANISOTROPIC_16X = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TextureWrap { - TEXTURE_WRAP_REPEAT = 0, - TEXTURE_WRAP_CLAMP = 1, - TEXTURE_WRAP_MIRROR_REPEAT = 2, - TEXTURE_WRAP_MIRROR_CLAMP = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CubemapLayout { - CUBEMAP_LAYOUT_AUTO_DETECT = 0, - CUBEMAP_LAYOUT_LINE_VERTICAL = 1, - CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2, - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3, - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4, - CUBEMAP_LAYOUT_PANORAMA = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum FontType { - FONT_DEFAULT = 0, - FONT_BITMAP = 1, - FONT_SDF = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum BlendMode { - BLEND_ALPHA = 0, - BLEND_ADDITIVE = 1, - BLEND_MULTIPLIED = 2, - BLEND_ADD_COLORS = 3, - BLEND_SUBTRACT_COLORS = 4, - BLEND_CUSTOM = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum Gestures { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CameraMode { - CAMERA_CUSTOM = 0, - CAMERA_FREE = 1, - CAMERA_ORBITAL = 2, - CAMERA_FIRST_PERSON = 3, - CAMERA_THIRD_PERSON = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CameraProjection { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum NPatchLayout { - NPATCH_NINE_PATCH = 0, - NPATCH_THREE_PATCH_VERTICAL = 1, - NPATCH_THREE_PATCH_HORIZONTAL = 2, -} -pub type TraceLogCallback = ::std::option::Option< - unsafe extern "C" fn( - logLevel: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - args: *mut __va_list_tag, - ), ->; -pub type LoadFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar, ->; -pub type SaveFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool, ->; -pub type LoadFileTextCallback = ::std::option::Option< - unsafe extern "C" fn(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char, ->; -pub type SaveFileTextCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool, ->; -extern "C" { - pub fn InitWindow( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn WindowShouldClose() -> bool; -} -extern "C" { - pub fn CloseWindow(); -} -extern "C" { - pub fn IsWindowReady() -> bool; -} -extern "C" { - pub fn IsWindowFullscreen() -> bool; -} -extern "C" { - pub fn IsWindowHidden() -> bool; -} -extern "C" { - pub fn IsWindowMinimized() -> bool; -} -extern "C" { - pub fn IsWindowMaximized() -> bool; -} -extern "C" { - pub fn IsWindowFocused() -> bool; -} -extern "C" { - pub fn IsWindowResized() -> bool; -} -extern "C" { - pub fn IsWindowState(flag: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn SetWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ClearWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ToggleFullscreen(); -} -extern "C" { - pub fn MaximizeWindow(); -} -extern "C" { - pub fn MinimizeWindow(); -} -extern "C" { - pub fn RestoreWindow(); -} -extern "C" { - pub fn SetWindowIcon(image: Image); -} -extern "C" { - pub fn SetWindowTitle(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetWindowPosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMonitor(monitor: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMinSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetWindowHandle() -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn GetScreenWidth() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetScreenHeight() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCurrentMonitor() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPosition(monitor: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GetMonitorWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorRefreshRate(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetWindowPosition() -> Vector2; -} -extern "C" { - pub fn GetWindowScaleDPI() -> Vector2; -} -extern "C" { - pub fn GetMonitorName(monitor: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn SetClipboardText(text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GetClipboardText() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ShowCursor(); -} -extern "C" { - pub fn HideCursor(); -} -extern "C" { - pub fn IsCursorHidden() -> bool; -} -extern "C" { - pub fn EnableCursor(); -} -extern "C" { - pub fn DisableCursor(); -} -extern "C" { - pub fn IsCursorOnScreen() -> bool; -} -extern "C" { - pub fn ClearBackground(color: Color); -} -extern "C" { - pub fn BeginDrawing(); -} -extern "C" { - pub fn EndDrawing(); -} -extern "C" { - pub fn BeginMode2D(camera: Camera2D); -} -extern "C" { - pub fn EndMode2D(); -} -extern "C" { - pub fn BeginMode3D(camera: Camera3D); -} -extern "C" { - pub fn EndMode3D(); -} -extern "C" { - pub fn BeginTextureMode(target: RenderTexture2D); -} -extern "C" { - pub fn EndTextureMode(); -} -extern "C" { - pub fn BeginShaderMode(shader: Shader); -} -extern "C" { - pub fn EndShaderMode(); -} -extern "C" { - pub fn BeginBlendMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn EndBlendMode(); -} -extern "C" { - pub fn BeginScissorMode( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn EndScissorMode(); -} -extern "C" { - pub fn BeginVrStereoMode(config: VrStereoConfig); -} -extern "C" { - pub fn EndVrStereoMode(); -} -extern "C" { - pub fn LoadVrStereoConfig(device: VrDeviceInfo) -> VrStereoConfig; -} -extern "C" { - pub fn UnloadVrStereoConfig(config: VrStereoConfig); -} -extern "C" { - pub fn LoadShader( - vsFileName: *const ::std::os::raw::c_char, - fsFileName: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn LoadShaderFromMemory( - vsCode: *const ::std::os::raw::c_char, - fsCode: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn GetShaderLocation( - shader: Shader, - uniformName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetShaderLocationAttrib( - shader: Shader, - attribName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn SetShaderValue( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueV( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueMatrix(shader: Shader, locIndex: ::std::os::raw::c_int, mat: Matrix); -} -extern "C" { - pub fn SetShaderValueTexture( - shader: Shader, - locIndex: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn UnloadShader(shader: Shader); -} -extern "C" { - pub fn GetMouseRay(mousePosition: Vector2, camera: Camera) -> Ray; -} -extern "C" { - pub fn GetCameraMatrix(camera: Camera) -> Matrix; -} -extern "C" { - pub fn GetCameraMatrix2D(camera: Camera2D) -> Matrix; -} -extern "C" { - pub fn GetWorldToScreen(position: Vector3, camera: Camera) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreenEx( - position: Vector3, - camera: Camera, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn SetTargetFPS(fps: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetFPS() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFrameTime() -> f32; -} -extern "C" { - pub fn GetTime() -> f64; -} -extern "C" { - pub fn GetRandomValue( - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TakeScreenshot(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetConfigFlags(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn TraceLog(logLevel: ::std::os::raw::c_int, text: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn SetTraceLogLevel(logLevel: ::std::os::raw::c_int); -} -extern "C" { - pub fn MemAlloc(size: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemRealloc( - ptr: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemFree(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn SetTraceLogCallback(callback: TraceLogCallback); -} -extern "C" { - pub fn SetLoadFileDataCallback(callback: LoadFileDataCallback); -} -extern "C" { - pub fn SetSaveFileDataCallback(callback: SaveFileDataCallback); -} -extern "C" { - pub fn SetLoadFileTextCallback(callback: LoadFileTextCallback); -} -extern "C" { - pub fn SetSaveFileTextCallback(callback: SaveFileTextCallback); -} -extern "C" { - pub fn LoadFileData( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn UnloadFileData(data: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileData( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool; -} -extern "C" { - pub fn LoadFileText(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn UnloadFileText(text: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileText( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn FileExists(fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn DirectoryExists(dirPath: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileExtension( - fileName: *const ::std::os::raw::c_char, - ext: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetFileExtension( - fileName: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileName(filePath: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileNameWithoutExt( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryPath( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetPrevDirectoryPath( - dirPath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetWorkingDirectory() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryFiles( - dirPath: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDirectoryFiles(); -} -extern "C" { - pub fn ChangeDirectory(dir: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileDropped() -> bool; -} -extern "C" { - pub fn GetDroppedFiles(count: *mut ::std::os::raw::c_int) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDroppedFiles(); -} -extern "C" { - pub fn GetFileModTime(fileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn CompressData( - data: *mut ::std::os::raw::c_uchar, - dataLength: ::std::os::raw::c_int, - compDataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn DecompressData( - compData: *mut ::std::os::raw::c_uchar, - compDataLength: ::std::os::raw::c_int, - dataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn SaveStorageValue(position: ::std::os::raw::c_uint, value: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn LoadStorageValue(position: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn OpenURL(url: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn IsKeyPressed(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyDown(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyReleased(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyUp(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn SetExitKey(key: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetKeyPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCharPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsGamepadAvailable(gamepad: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsGamepadName( - gamepad: ::std::os::raw::c_int, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetGamepadName(gamepad: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn IsGamepadButtonPressed( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonDown( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonReleased( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonUp(gamepad: ::std::os::raw::c_int, button: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn GetGamepadButtonPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisCount(gamepad: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisMovement( - gamepad: ::std::os::raw::c_int, - axis: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn SetGamepadMappings(mappings: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsMouseButtonPressed(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonDown(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonReleased(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonUp(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetMouseX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMouseY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMousePosition() -> Vector2; -} -extern "C" { - pub fn SetMousePosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseOffset(offsetX: ::std::os::raw::c_int, offsetY: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseScale(scaleX: f32, scaleY: f32); -} -extern "C" { - pub fn GetMouseWheelMove() -> f32; -} -extern "C" { - pub fn SetMouseCursor(cursor: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetTouchX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPosition(index: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn SetGesturesEnabled(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsGestureDetected(gesture: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetGestureDetected() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPointsCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGestureHoldDuration() -> f32; -} -extern "C" { - pub fn GetGestureDragVector() -> Vector2; -} -extern "C" { - pub fn GetGestureDragAngle() -> f32; -} -extern "C" { - pub fn GetGesturePinchVector() -> Vector2; -} -extern "C" { - pub fn GetGesturePinchAngle() -> f32; -} -extern "C" { - pub fn SetCameraMode(camera: Camera, mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn UpdateCamera(camera: *mut Camera); -} -extern "C" { - pub fn SetCameraPanControl(keyPan: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraAltControl(keyAlt: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraSmoothZoomControl(keySmoothZoom: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraMoveControls( - keyFront: ::std::os::raw::c_int, - keyBack: ::std::os::raw::c_int, - keyRight: ::std::os::raw::c_int, - keyLeft: ::std::os::raw::c_int, - keyUp: ::std::os::raw::c_int, - keyDown: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShapesTexture(texture: Texture2D, source: Rectangle); -} -extern "C" { - pub fn DrawPixel(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawPixelV(position: Vector2, color: Color); -} -extern "C" { - pub fn DrawLine( - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawLineV(startPos: Vector2, endPos: Vector2, color: Color); -} -extern "C" { - pub fn DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezierQuad( - startPos: Vector2, - endPos: Vector2, - controlPos: Vector2, - thick: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawLineStrip(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawCircle( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSector( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSectorLines( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleGradient( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawCircleV(center: Vector2, radius: f32, color: Color); -} -extern "C" { - pub fn DrawCircleLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipse( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipseLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawRing( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRingLines( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangle( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleV(position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRectangleRec(rec: Rectangle, color: Color); -} -extern "C" { - pub fn DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color); -} -extern "C" { - pub fn DrawRectangleGradientV( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientH( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientEx( - rec: Rectangle, - col1: Color, - col2: Color, - col3: Color, - col4: Color, - ); -} -extern "C" { - pub fn DrawRectangleLines( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleLinesEx(rec: Rectangle, lineThick: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawRectangleRounded( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleRoundedLines( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - lineThick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleFan(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip( - points: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPoly( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawPolyLines( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionCircles( - center1: Vector2, - radius1: f32, - center2: Vector2, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointRec(point: Vector2, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionPointTriangle( - point: Vector2, - p1: Vector2, - p2: Vector2, - p3: Vector2, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionLines( - startPos1: Vector2, - endPos1: Vector2, - startPos2: Vector2, - endPos2: Vector2, - collisionPoint: *mut Vector2, - ) -> bool; -} -extern "C" { - pub fn GetCollisionRec(rec1: Rectangle, rec2: Rectangle) -> Rectangle; -} -extern "C" { - pub fn LoadImage(fileName: *const ::std::os::raw::c_char) -> Image; -} -extern "C" { - pub fn LoadImageRaw( - fileName: *const ::std::os::raw::c_char, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - headerSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageAnim( - fileName: *const ::std::os::raw::c_char, - frames: *mut ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadImage(image: Image); -} -extern "C" { - pub fn ExportImage(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportImageAsCode(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GenImageColor( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientV( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - top: Color, - bottom: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientH( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - left: Color, - right: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientRadial( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - density: f32, - inner: Color, - outer: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageChecked( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - checksX: ::std::os::raw::c_int, - checksY: ::std::os::raw::c_int, - col1: Color, - col2: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageWhiteNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - factor: f32, - ) -> Image; -} -extern "C" { - pub fn GenImagePerlinNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - scale: f32, - ) -> Image; -} -extern "C" { - pub fn GenImageCellular( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - tileSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn ImageCopy(image: Image) -> Image; -} -extern "C" { - pub fn ImageFromImage(image: Image, rec: Rectangle) -> Image; -} -extern "C" { - pub fn ImageText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn ImageTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - tint: Color, - ) -> Image; -} -extern "C" { - pub fn ImageFormat(image: *mut Image, newFormat: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageToPOT(image: *mut Image, fill: Color); -} -extern "C" { - pub fn ImageCrop(image: *mut Image, crop: Rectangle); -} -extern "C" { - pub fn ImageAlphaCrop(image: *mut Image, threshold: f32); -} -extern "C" { - pub fn ImageAlphaClear(image: *mut Image, color: Color, threshold: f32); -} -extern "C" { - pub fn ImageAlphaMask(image: *mut Image, alphaMask: Image); -} -extern "C" { - pub fn ImageAlphaPremultiply(image: *mut Image); -} -extern "C" { - pub fn ImageResize( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeNN( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeCanvas( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - fill: Color, - ); -} -extern "C" { - pub fn ImageMipmaps(image: *mut Image); -} -extern "C" { - pub fn ImageDither( - image: *mut Image, - rBpp: ::std::os::raw::c_int, - gBpp: ::std::os::raw::c_int, - bBpp: ::std::os::raw::c_int, - aBpp: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageFlipVertical(image: *mut Image); -} -extern "C" { - pub fn ImageFlipHorizontal(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCW(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCCW(image: *mut Image); -} -extern "C" { - pub fn ImageColorTint(image: *mut Image, color: Color); -} -extern "C" { - pub fn ImageColorInvert(image: *mut Image); -} -extern "C" { - pub fn ImageColorGrayscale(image: *mut Image); -} -extern "C" { - pub fn ImageColorContrast(image: *mut Image, contrast: f32); -} -extern "C" { - pub fn ImageColorBrightness(image: *mut Image, brightness: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageColorReplace(image: *mut Image, color: Color, replace: Color); -} -extern "C" { - pub fn LoadImageColors(image: Image) -> *mut Color; -} -extern "C" { - pub fn LoadImagePalette( - image: Image, - maxPaletteSize: ::std::os::raw::c_int, - colorsCount: *mut ::std::os::raw::c_int, - ) -> *mut Color; -} -extern "C" { - pub fn UnloadImageColors(colors: *mut Color); -} -extern "C" { - pub fn UnloadImagePalette(colors: *mut Color); -} -extern "C" { - pub fn GetImageAlphaBorder(image: Image, threshold: f32) -> Rectangle; -} -extern "C" { - pub fn ImageClearBackground(dst: *mut Image, color: Color); -} -extern "C" { - pub fn ImageDrawPixel( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawPixelV(dst: *mut Image, position: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawLine( - dst: *mut Image, - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawLineV(dst: *mut Image, start: Vector2, end: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawCircle( - dst: *mut Image, - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawCircleV( - dst: *mut Image, - center: Vector2, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangle( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangleV(dst: *mut Image, position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleRec(dst: *mut Image, rec: Rectangle, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleLines( - dst: *mut Image, - rec: Rectangle, - thick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDraw( - dst: *mut Image, - src: Image, - srcRec: Rectangle, - dstRec: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn ImageDrawText( - dst: *mut Image, - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawTextEx( - dst: *mut Image, - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn LoadTexture(fileName: *const ::std::os::raw::c_char) -> Texture2D; -} -extern "C" { - pub fn LoadTextureFromImage(image: Image) -> Texture2D; -} -extern "C" { - pub fn LoadTextureCubemap(image: Image, layout: ::std::os::raw::c_int) -> TextureCubemap; -} -extern "C" { - pub fn LoadRenderTexture( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> RenderTexture2D; -} -extern "C" { - pub fn UnloadTexture(texture: Texture2D); -} -extern "C" { - pub fn UnloadRenderTexture(target: RenderTexture2D); -} -extern "C" { - pub fn UpdateTexture(texture: Texture2D, pixels: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn UpdateTextureRec( - texture: Texture2D, - rec: Rectangle, - pixels: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn GetTextureData(texture: Texture2D) -> Image; -} -extern "C" { - pub fn GetScreenData() -> Image; -} -extern "C" { - pub fn GenTextureMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn SetTextureFilter(texture: Texture2D, filter: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTextureWrap(texture: Texture2D, wrap: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawTexture( - texture: Texture2D, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureV(texture: Texture2D, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureEx( - texture: Texture2D, - position: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureRec(texture: Texture2D, source: Rectangle, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureQuad( - texture: Texture2D, - tiling: Vector2, - offset: Vector2, - quad: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureTiled( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePro( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureNPatch( - texture: Texture2D, - nPatchInfo: NPatchInfo, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePoly( - texture: Texture2D, - center: Vector2, - points: *mut Vector2, - texcoords: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn Fade(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorToInt(color: Color) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ColorNormalize(color: Color) -> Vector4; -} -extern "C" { - pub fn ColorFromNormalized(normalized: Vector4) -> Color; -} -extern "C" { - pub fn ColorToHSV(color: Color) -> Vector3; -} -extern "C" { - pub fn ColorFromHSV(hue: f32, saturation: f32, value: f32) -> Color; -} -extern "C" { - pub fn ColorAlpha(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorAlphaBlend(dst: Color, src: Color, tint: Color) -> Color; -} -extern "C" { - pub fn GetColor(hexValue: ::std::os::raw::c_int) -> Color; -} -extern "C" { - pub fn GetPixelColor( - srcPtr: *mut ::std::os::raw::c_void, - format: ::std::os::raw::c_int, - ) -> Color; -} -extern "C" { - pub fn SetPixelColor( - dstPtr: *mut ::std::os::raw::c_void, - color: Color, - format: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GetPixelDataSize( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFontDefault() -> Font; -} -extern "C" { - pub fn LoadFont(fileName: *const ::std::os::raw::c_char) -> Font; -} -extern "C" { - pub fn LoadFontEx( - fileName: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontFromImage(image: Image, key: Color, firstChar: ::std::os::raw::c_int) -> Font; -} -extern "C" { - pub fn LoadFontFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontData( - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - type_: ::std::os::raw::c_int, - ) -> *mut CharInfo; -} -extern "C" { - pub fn GenImageFontAtlas( - chars: *const CharInfo, - recs: *mut *mut Rectangle, - charsCount: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - padding: ::std::os::raw::c_int, - packMethod: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadFontData(chars: *mut CharInfo, charsCount: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadFont(font: Font); -} -extern "C" { - pub fn DrawFPS(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawText( - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRec( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRecEx( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - selectStart: ::std::os::raw::c_int, - selectLength: ::std::os::raw::c_int, - selectTint: Color, - selectBackTint: Color, - ); -} -extern "C" { - pub fn DrawTextCodepoint( - font: Font, - codepoint: ::std::os::raw::c_int, - position: Vector2, - fontSize: f32, - tint: Color, - ); -} -extern "C" { - pub fn MeasureText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn MeasureTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - ) -> Vector2; -} -extern "C" { - pub fn GetGlyphIndex(font: Font, codepoint: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextCopy( - dst: *mut ::std::os::raw::c_char, - src: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextIsEqual( - text1: *const ::std::os::raw::c_char, - text2: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TextLength(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn TextFormat(text: *const ::std::os::raw::c_char, ...) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSubtext( - text: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextReplace( - text: *mut ::std::os::raw::c_char, - replace: *const ::std::os::raw::c_char, - by: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextInsert( - text: *const ::std::os::raw::c_char, - insert: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextJoin( - textList: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - delimiter: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSplit( - text: *const ::std::os::raw::c_char, - delimiter: ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextAppend( - text: *mut ::std::os::raw::c_char, - append: *const ::std::os::raw::c_char, - position: *mut ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TextFindIndex( - text: *const ::std::os::raw::c_char, - find: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUpper(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToLower(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToPascal(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToInteger(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUtf8( - codepoints: *mut ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn GetCodepoints( - text: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCodepointsCount(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetNextCodepoint( - text: *const ::std::os::raw::c_char, - bytesProcessed: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn CodepointToUtf8( - codepoint: ::std::os::raw::c_int, - byteLength: *mut ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color); -} -extern "C" { - pub fn DrawPoint3D(position: Vector3, color: Color); -} -extern "C" { - pub fn DrawCircle3D( - center: Vector3, - radius: f32, - rotationAxis: Vector3, - rotationAngle: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip3D( - points: *mut Vector3, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeWiresV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeTexture( - texture: Texture2D, - position: Vector3, - width: f32, - height: f32, - length: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawSphere(centerPos: Vector3, radius: f32, color: Color); -} -extern "C" { - pub fn DrawSphereEx( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawSphereWires( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinder( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinderWires( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPlane(centerPos: Vector3, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRay(ray: Ray, color: Color); -} -extern "C" { - pub fn DrawGrid(slices: ::std::os::raw::c_int, spacing: f32); -} -extern "C" { - pub fn LoadModel(fileName: *const ::std::os::raw::c_char) -> Model; -} -extern "C" { - pub fn LoadModelFromMesh(mesh: Mesh) -> Model; -} -extern "C" { - pub fn UnloadModel(model: Model); -} -extern "C" { - pub fn UnloadModelKeepMeshes(model: Model); -} -extern "C" { - pub fn UploadMesh(mesh: *mut Mesh, dynamic: bool); -} -extern "C" { - pub fn UpdateMeshBuffer( - mesh: Mesh, - index: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - dataSize: ::std::os::raw::c_int, - offset: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn DrawMesh(mesh: Mesh, material: Material, transform: Matrix); -} -extern "C" { - pub fn DrawMeshInstanced( - mesh: Mesh, - material: Material, - transforms: *mut Matrix, - instances: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadMesh(mesh: Mesh); -} -extern "C" { - pub fn ExportMesh(mesh: Mesh, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn LoadMaterials( - fileName: *const ::std::os::raw::c_char, - materialCount: *mut ::std::os::raw::c_int, - ) -> *mut Material; -} -extern "C" { - pub fn LoadMaterialDefault() -> Material; -} -extern "C" { - pub fn UnloadMaterial(material: Material); -} -extern "C" { - pub fn SetMaterialTexture( - material: *mut Material, - mapType: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn SetModelMeshMaterial( - model: *mut Model, - meshId: ::std::os::raw::c_int, - materialId: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadModelAnimations( - fileName: *const ::std::os::raw::c_char, - animsCount: *mut ::std::os::raw::c_int, - ) -> *mut ModelAnimation; -} -extern "C" { - pub fn UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadModelAnimation(anim: ModelAnimation); -} -extern "C" { - pub fn UnloadModelAnimations(animations: *mut ModelAnimation, count: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsModelAnimationValid(model: Model, anim: ModelAnimation) -> bool; -} -extern "C" { - pub fn GenMeshPoly(sides: ::std::os::raw::c_int, radius: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshPlane( - width: f32, - length: f32, - resX: ::std::os::raw::c_int, - resZ: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCube(width: f32, height: f32, length: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHemiSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCylinder(radius: f32, height: f32, slices: ::std::os::raw::c_int) -> Mesh; -} -extern "C" { - pub fn GenMeshTorus( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshKnot( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHeightmap(heightmap: Image, size: Vector3) -> Mesh; -} -extern "C" { - pub fn GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3) -> Mesh; -} -extern "C" { - pub fn MeshBoundingBox(mesh: Mesh) -> BoundingBox; -} -extern "C" { - pub fn MeshTangents(mesh: *mut Mesh); -} -extern "C" { - pub fn MeshBinormals(mesh: *mut Mesh); -} -extern "C" { - pub fn DrawModel(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelWiresEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawBoundingBox(box_: BoundingBox, color: Color); -} -extern "C" { - pub fn DrawBillboard( - camera: Camera, - texture: Texture2D, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawBillboardRec( - camera: Camera, - texture: Texture2D, - source: Rectangle, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn CheckCollisionSpheres( - center1: Vector3, - radius1: f32, - center2: Vector3, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxSphere(box_: BoundingBox, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphere(ray: Ray, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphereEx( - ray: Ray, - center: Vector3, - radius: f32, - collisionPoint: *mut Vector3, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionRayBox(ray: Ray, box_: BoundingBox) -> bool; -} -extern "C" { - pub fn GetCollisionRayMesh(ray: Ray, mesh: Mesh, transform: Matrix) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayModel(ray: Ray, model: Model) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayGround(ray: Ray, groundHeight: f32) -> RayHitInfo; -} -extern "C" { - pub fn InitAudioDevice(); -} -extern "C" { - pub fn CloseAudioDevice(); -} -extern "C" { - pub fn IsAudioDeviceReady() -> bool; -} -extern "C" { - pub fn SetMasterVolume(volume: f32); -} -extern "C" { - pub fn LoadWave(fileName: *const ::std::os::raw::c_char) -> Wave; -} -extern "C" { - pub fn LoadWaveFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Wave; -} -extern "C" { - pub fn LoadSound(fileName: *const ::std::os::raw::c_char) -> Sound; -} -extern "C" { - pub fn LoadSoundFromWave(wave: Wave) -> Sound; -} -extern "C" { - pub fn UpdateSound( - sound: Sound, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadWave(wave: Wave); -} -extern "C" { - pub fn UnloadSound(sound: Sound); -} -extern "C" { - pub fn ExportWave(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportWaveAsCode(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn PlaySound(sound: Sound); -} -extern "C" { - pub fn StopSound(sound: Sound); -} -extern "C" { - pub fn PauseSound(sound: Sound); -} -extern "C" { - pub fn ResumeSound(sound: Sound); -} -extern "C" { - pub fn PlaySoundMulti(sound: Sound); -} -extern "C" { - pub fn StopSoundMulti(); -} -extern "C" { - pub fn GetSoundsPlaying() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsSoundPlaying(sound: Sound) -> bool; -} -extern "C" { - pub fn SetSoundVolume(sound: Sound, volume: f32); -} -extern "C" { - pub fn SetSoundPitch(sound: Sound, pitch: f32); -} -extern "C" { - pub fn WaveFormat( - wave: *mut Wave, - sampleRate: ::std::os::raw::c_int, - sampleSize: ::std::os::raw::c_int, - channels: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn WaveCopy(wave: Wave) -> Wave; -} -extern "C" { - pub fn WaveCrop( - wave: *mut Wave, - initSample: ::std::os::raw::c_int, - finalSample: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadWaveSamples(wave: Wave) -> *mut f32; -} -extern "C" { - pub fn UnloadWaveSamples(samples: *mut f32); -} -extern "C" { - pub fn LoadMusicStream(fileName: *const ::std::os::raw::c_char) -> Music; -} -extern "C" { - pub fn LoadMusicStreamFromMemory( - fileType: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Music; -} -extern "C" { - pub fn UnloadMusicStream(music: Music); -} -extern "C" { - pub fn PlayMusicStream(music: Music); -} -extern "C" { - pub fn IsMusicPlaying(music: Music) -> bool; -} -extern "C" { - pub fn UpdateMusicStream(music: Music); -} -extern "C" { - pub fn StopMusicStream(music: Music); -} -extern "C" { - pub fn PauseMusicStream(music: Music); -} -extern "C" { - pub fn ResumeMusicStream(music: Music); -} -extern "C" { - pub fn SetMusicVolume(music: Music, volume: f32); -} -extern "C" { - pub fn SetMusicPitch(music: Music, pitch: f32); -} -extern "C" { - pub fn GetMusicTimeLength(music: Music) -> f32; -} -extern "C" { - pub fn GetMusicTimePlayed(music: Music) -> f32; -} -extern "C" { - pub fn InitAudioStream( - sampleRate: ::std::os::raw::c_uint, - sampleSize: ::std::os::raw::c_uint, - channels: ::std::os::raw::c_uint, - ) -> AudioStream; -} -extern "C" { - pub fn UpdateAudioStream( - stream: AudioStream, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn CloseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamProcessed(stream: AudioStream) -> bool; -} -extern "C" { - pub fn PlayAudioStream(stream: AudioStream); -} -extern "C" { - pub fn PauseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn ResumeAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamPlaying(stream: AudioStream) -> bool; -} -extern "C" { - pub fn StopAudioStream(stream: AudioStream); -} -extern "C" { - pub fn SetAudioStreamVolume(stream: AudioStream, volume: f32); -} -extern "C" { - pub fn SetAudioStreamPitch(stream: AudioStream, pitch: f32); -} -extern "C" { - pub fn SetAudioStreamBufferSizeDefault(size: ::std::os::raw::c_int); -} -pub type size_t = ::std::os::raw::c_ulong; -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, -} -#[test] -fn bindgen_test_layout_div_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn __ctype_get_mb_cur_max() -> size_t; -} -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 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 rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); -} -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 free(__ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn aligned_alloc(__alignment: size_t, __size: size_t) -> *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 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 system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -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: size_t, - __size: size_t, - __compar: __compar_fn_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nmemb: size_t, - __size: size_t, - __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 mblen(__s: *const ::std::os::raw::c_char, __n: size_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbtowc( - __pwc: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: size_t, - ) -> ::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: size_t, - ) -> size_t; -} -extern "C" { - pub fn wcstombs( - __s: *mut ::std::os::raw::c_char, - __pwcs: *const wchar_t, - __n: size_t, - ) -> size_t; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GuiStyleProp { - pub controlId: ::std::os::raw::c_ushort, - pub propertyId: ::std::os::raw::c_ushort, - pub propertyValue: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_GuiStyleProp() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GuiStyleProp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GuiStyleProp)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).controlId as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(controlId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyId as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyValue) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControlState { - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED = 1, - GUI_STATE_PRESSED = 2, - GUI_STATE_DISABLED = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiTextAlignment { - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER = 1, - GUI_TEXT_ALIGN_RIGHT = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControl { - DEFAULT = 0, - LABEL = 1, - BUTTON = 2, - TOGGLE = 3, - SLIDER = 4, - PROGRESSBAR = 5, - CHECKBOX = 6, - COMBOBOX = 7, - DROPDOWNBOX = 8, - TEXTBOX = 9, - VALUEBOX = 10, - SPINNER = 11, - LISTVIEW = 12, - COLORPICKER = 13, - SCROLLBAR = 14, - STATUSBAR = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControlProperty { - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL = 1, - TEXT_COLOR_NORMAL = 2, - BORDER_COLOR_FOCUSED = 3, - BASE_COLOR_FOCUSED = 4, - TEXT_COLOR_FOCUSED = 5, - BORDER_COLOR_PRESSED = 6, - BASE_COLOR_PRESSED = 7, - TEXT_COLOR_PRESSED = 8, - BORDER_COLOR_DISABLED = 9, - BASE_COLOR_DISABLED = 10, - TEXT_COLOR_DISABLED = 11, - BORDER_WIDTH = 12, - TEXT_PADDING = 13, - TEXT_ALIGNMENT = 14, - RESERVED = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiDefaultProperty { - TEXT_SIZE = 16, - TEXT_SPACING = 17, - LINE_COLOR = 18, - BACKGROUND_COLOR = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiToggleProperty { - GROUP_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiSliderProperty { - SLIDER_WIDTH = 16, - SLIDER_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiProgressBarProperty { - PROGRESS_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiCheckBoxProperty { - CHECK_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiComboBoxProperty { - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiDropdownBoxProperty { - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiTextBoxProperty { - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING = 17, - COLOR_SELECTED_FG = 18, - COLOR_SELECTED_BG = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiSpinnerProperty { - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiScrollBarProperty { - ARROWS_SIZE = 16, - ARROWS_VISIBLE = 17, - SCROLL_SLIDER_PADDING = 18, - SCROLL_SLIDER_SIZE = 19, - SCROLL_PADDING = 20, - SCROLL_SPEED = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiScrollBarSide { - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiListViewProperty { - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING = 17, - SCROLLBAR_WIDTH = 18, - SCROLLBAR_SIDE = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiColorPickerProperty { - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH = 17, - HUEBAR_PADDING = 18, - HUEBAR_SELECTOR_HEIGHT = 19, - HUEBAR_SELECTOR_OVERFLOW = 20, -} -extern "C" { - pub fn GuiEnable(); -} -extern "C" { - pub fn GuiDisable(); -} -extern "C" { - pub fn GuiLock(); -} -extern "C" { - pub fn GuiUnlock(); -} -extern "C" { - pub fn GuiFade(alpha: f32); -} -extern "C" { - pub fn GuiSetState(state: ::std::os::raw::c_int); -} -extern "C" { - pub fn GuiGetState() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiSetFont(font: Font); -} -extern "C" { - pub fn GuiGetFont() -> Font; -} -extern "C" { - pub fn GuiSetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiGetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiEnableTooltip(); -} -extern "C" { - pub fn GuiDisableTooltip(); -} -extern "C" { - pub fn GuiSetTooltip(tooltip: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiClearTooltip(); -} -extern "C" { - pub fn GuiWindowBox(bounds: Rectangle, title: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiGroupBox(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLine(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiPanel(bounds: Rectangle); -} -extern "C" { - pub fn GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: *mut Vector2) - -> Rectangle; -} -extern "C" { - pub fn GuiLabel(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiLabelButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiImageButton( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - ) -> bool; -} -extern "C" { - pub fn GuiImageButtonEx( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - texSource: Rectangle, - ) -> bool; -} -extern "C" { - pub fn GuiToggle(bounds: Rectangle, text: *const ::std::os::raw::c_char, active: bool) -> bool; -} -extern "C" { - pub fn GuiToggleGroup( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiCheckBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - checked: bool, - ) -> bool; -} -extern "C" { - pub fn GuiComboBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiDropdownBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: *mut ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSpinner( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiValueBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBox( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBoxMulti( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSlider( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiSliderBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiProgressBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiStatusBar(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiDummyRec(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiScrollBar( - bounds: Rectangle, - value: ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiGrid(bounds: Rectangle, spacing: f32, subdivs: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GuiListView( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiListViewEx( - bounds: Rectangle, - text: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - focus: *mut ::std::os::raw::c_int, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiMessageBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiTextInputBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiColorPicker(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorPanel(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorBarAlpha(bounds: Rectangle, alpha: f32) -> f32; -} -extern "C" { - pub fn GuiColorBarHue(bounds: Rectangle, value: f32) -> f32; -} -extern "C" { - pub fn GuiLoadStyle(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLoadStyleDefault(); -} -extern "C" { - pub fn GuiIconText( - iconId: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GuiDrawIcon( - iconId: ::std::os::raw::c_int, - position: Vector2, - pixelSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn GuiGetIcons() -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiGetIconData(iconId: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiSetIconData(iconId: ::std::os::raw::c_int, data: *mut ::std::os::raw::c_uint); -} -extern "C" { - pub fn GuiSetIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiClearIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiCheckIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum guiIconName { - RICON_NONE = 0, - RICON_FOLDER_FILE_OPEN = 1, - RICON_FILE_SAVE_CLASSIC = 2, - RICON_FOLDER_OPEN = 3, - RICON_FOLDER_SAVE = 4, - RICON_FILE_OPEN = 5, - RICON_FILE_SAVE = 6, - RICON_FILE_EXPORT = 7, - RICON_FILE_NEW = 8, - RICON_FILE_DELETE = 9, - RICON_FILETYPE_TEXT = 10, - RICON_FILETYPE_AUDIO = 11, - RICON_FILETYPE_IMAGE = 12, - RICON_FILETYPE_PLAY = 13, - RICON_FILETYPE_VIDEO = 14, - RICON_FILETYPE_INFO = 15, - RICON_FILE_COPY = 16, - RICON_FILE_CUT = 17, - RICON_FILE_PASTE = 18, - RICON_CURSOR_HAND = 19, - RICON_CURSOR_POINTER = 20, - RICON_CURSOR_CLASSIC = 21, - RICON_PENCIL = 22, - RICON_PENCIL_BIG = 23, - RICON_BRUSH_CLASSIC = 24, - RICON_BRUSH_PAINTER = 25, - RICON_WATER_DROP = 26, - RICON_COLOR_PICKER = 27, - RICON_RUBBER = 28, - RICON_COLOR_BUCKET = 29, - RICON_TEXT_T = 30, - RICON_TEXT_A = 31, - RICON_SCALE = 32, - RICON_RESIZE = 33, - RICON_FILTER_POINT = 34, - RICON_FILTER_BILINEAR = 35, - RICON_CROP = 36, - RICON_CROP_ALPHA = 37, - RICON_SQUARE_TOGGLE = 38, - RICON_SYMMETRY = 39, - RICON_SYMMETRY_HORIZONTAL = 40, - RICON_SYMMETRY_VERTICAL = 41, - RICON_LENS = 42, - RICON_LENS_BIG = 43, - RICON_EYE_ON = 44, - RICON_EYE_OFF = 45, - RICON_FILTER_TOP = 46, - RICON_FILTER = 47, - RICON_TARGET_POINT = 48, - RICON_TARGET_SMALL = 49, - RICON_TARGET_BIG = 50, - RICON_TARGET_MOVE = 51, - RICON_CURSOR_MOVE = 52, - RICON_CURSOR_SCALE = 53, - RICON_CURSOR_SCALE_RIGHT = 54, - RICON_CURSOR_SCALE_LEFT = 55, - RICON_UNDO = 56, - RICON_REDO = 57, - RICON_REREDO = 58, - RICON_MUTATE = 59, - RICON_ROTATE = 60, - RICON_REPEAT = 61, - RICON_SHUFFLE = 62, - RICON_EMPTYBOX = 63, - RICON_TARGET = 64, - RICON_TARGET_SMALL_FILL = 65, - RICON_TARGET_BIG_FILL = 66, - RICON_TARGET_MOVE_FILL = 67, - RICON_CURSOR_MOVE_FILL = 68, - RICON_CURSOR_SCALE_FILL = 69, - RICON_CURSOR_SCALE_RIGHT_FILL = 70, - RICON_CURSOR_SCALE_LEFT_FILL = 71, - RICON_UNDO_FILL = 72, - RICON_REDO_FILL = 73, - RICON_REREDO_FILL = 74, - RICON_MUTATE_FILL = 75, - RICON_ROTATE_FILL = 76, - RICON_REPEAT_FILL = 77, - RICON_SHUFFLE_FILL = 78, - RICON_EMPTYBOX_SMALL = 79, - RICON_BOX = 80, - RICON_BOX_TOP = 81, - RICON_BOX_TOP_RIGHT = 82, - RICON_BOX_RIGHT = 83, - RICON_BOX_BOTTOM_RIGHT = 84, - RICON_BOX_BOTTOM = 85, - RICON_BOX_BOTTOM_LEFT = 86, - RICON_BOX_LEFT = 87, - RICON_BOX_TOP_LEFT = 88, - RICON_BOX_CENTER = 89, - RICON_BOX_CIRCLE_MASK = 90, - RICON_POT = 91, - RICON_ALPHA_MULTIPLY = 92, - RICON_ALPHA_CLEAR = 93, - RICON_DITHERING = 94, - RICON_MIPMAPS = 95, - RICON_BOX_GRID = 96, - RICON_GRID = 97, - RICON_BOX_CORNERS_SMALL = 98, - RICON_BOX_CORNERS_BIG = 99, - RICON_FOUR_BOXES = 100, - RICON_GRID_FILL = 101, - RICON_BOX_MULTISIZE = 102, - RICON_ZOOM_SMALL = 103, - RICON_ZOOM_MEDIUM = 104, - RICON_ZOOM_BIG = 105, - RICON_ZOOM_ALL = 106, - RICON_ZOOM_CENTER = 107, - RICON_BOX_DOTS_SMALL = 108, - RICON_BOX_DOTS_BIG = 109, - RICON_BOX_CONCENTRIC = 110, - RICON_BOX_GRID_BIG = 111, - RICON_OK_TICK = 112, - RICON_CROSS = 113, - RICON_ARROW_LEFT = 114, - RICON_ARROW_RIGHT = 115, - RICON_ARROW_BOTTOM = 116, - RICON_ARROW_TOP = 117, - RICON_ARROW_LEFT_FILL = 118, - RICON_ARROW_RIGHT_FILL = 119, - RICON_ARROW_BOTTOM_FILL = 120, - RICON_ARROW_TOP_FILL = 121, - RICON_AUDIO = 122, - RICON_FX = 123, - RICON_WAVE = 124, - RICON_WAVE_SINUS = 125, - RICON_WAVE_SQUARE = 126, - RICON_WAVE_TRIANGULAR = 127, - RICON_CROSS_SMALL = 128, - RICON_PLAYER_PREVIOUS = 129, - RICON_PLAYER_PLAY_BACK = 130, - RICON_PLAYER_PLAY = 131, - RICON_PLAYER_PAUSE = 132, - RICON_PLAYER_STOP = 133, - RICON_PLAYER_NEXT = 134, - RICON_PLAYER_RECORD = 135, - RICON_MAGNET = 136, - RICON_LOCK_CLOSE = 137, - RICON_LOCK_OPEN = 138, - RICON_CLOCK = 139, - RICON_TOOLS = 140, - RICON_GEAR = 141, - RICON_GEAR_BIG = 142, - RICON_BIN = 143, - RICON_HAND_POINTER = 144, - RICON_LASER = 145, - RICON_COIN = 146, - RICON_EXPLOSION = 147, - RICON_1UP = 148, - RICON_PLAYER = 149, - RICON_PLAYER_JUMP = 150, - RICON_KEY = 151, - RICON_DEMON = 152, - RICON_TEXT_POPUP = 153, - RICON_GEAR_EX = 154, - RICON_CRACK = 155, - RICON_CRACK_POINTS = 156, - RICON_STAR = 157, - RICON_DOOR = 158, - RICON_EXIT = 159, - RICON_MODE_2D = 160, - RICON_MODE_3D = 161, - RICON_CUBE = 162, - RICON_CUBE_FACE_TOP = 163, - RICON_CUBE_FACE_LEFT = 164, - RICON_CUBE_FACE_FRONT = 165, - RICON_CUBE_FACE_BOTTOM = 166, - RICON_CUBE_FACE_RIGHT = 167, - RICON_CUBE_FACE_BACK = 168, - RICON_CAMERA = 169, - RICON_SPECIAL = 170, - RICON_LINK_NET = 171, - RICON_LINK_BOXES = 172, - RICON_LINK_MULTI = 173, - RICON_LINK = 174, - RICON_LINK_BROKE = 175, - RICON_TEXT_NOTES = 176, - RICON_NOTEBOOK = 177, - RICON_SUITCASE = 178, - RICON_SUITCASE_ZIP = 179, - RICON_MAILBOX = 180, - RICON_MONITOR = 181, - RICON_PRINTER = 182, - RICON_PHOTO_CAMERA = 183, - RICON_PHOTO_CAMERA_FLASH = 184, - RICON_HOUSE = 185, - RICON_HEART = 186, - RICON_CORNER = 187, - RICON_VERTICAL_BARS = 188, - RICON_VERTICAL_BARS_FILL = 189, - RICON_LIFE_BARS = 190, - RICON_INFO = 191, - RICON_CROSSLINE = 192, - RICON_HELP = 193, - RICON_FILETYPE_ALPHA = 194, - RICON_FILETYPE_HOME = 195, - RICON_LAYERS_VISIBLE = 196, - RICON_LAYERS = 197, - RICON_WINDOW = 198, - RICON_HIDPI = 199, - RICON_200 = 200, - RICON_201 = 201, - RICON_202 = 202, - RICON_203 = 203, - RICON_204 = 204, - RICON_205 = 205, - RICON_206 = 206, - RICON_207 = 207, - RICON_208 = 208, - RICON_209 = 209, - RICON_210 = 210, - RICON_211 = 211, - RICON_212 = 212, - RICON_213 = 213, - RICON_214 = 214, - RICON_215 = 215, - RICON_216 = 216, - RICON_217 = 217, - RICON_218 = 218, - RICON_219 = 219, - RICON_220 = 220, - RICON_221 = 221, - RICON_222 = 222, - RICON_223 = 223, - RICON_224 = 224, - RICON_225 = 225, - RICON_226 = 226, - RICON_227 = 227, - RICON_228 = 228, - RICON_229 = 229, - RICON_230 = 230, - RICON_231 = 231, - RICON_232 = 232, - RICON_233 = 233, - RICON_234 = 234, - RICON_235 = 235, - RICON_236 = 236, - RICON_237 = 237, - RICON_238 = 238, - RICON_239 = 239, - RICON_240 = 240, - RICON_241 = 241, - RICON_242 = 242, - RICON_243 = 243, - RICON_244 = 244, - RICON_245 = 245, - RICON_246 = 246, - RICON_247 = 247, - RICON_248 = 248, - RICON_249 = 249, - RICON_250 = 250, - RICON_251 = 251, - RICON_252 = 252, - RICON_253 = 253, - RICON_254 = 254, - RICON_255 = 255, -} -extern "C" { - pub static mut guiIcons: [::std::os::raw::c_uint; 2048usize]; -} -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], -} -#[test] -fn bindgen_test_layout___fsid_t() { - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -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; -#[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], -} -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wch as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wchb as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__value as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__state as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} -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, -} -#[test] -fn bindgen_test_layout__G_fpos64_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos64_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos64_t>())).__state as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} -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: size_t, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._codecvt as *const _ as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._wide_data as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_list as *const _ as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_buf as *const _ as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -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 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 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 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 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: size_t, - ) -> ::std::os::raw::c_int; -} -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 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 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 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 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 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 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 perror(__s: *const ::std::os::raw::c_char); -} -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; -} -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 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; -} -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 strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -pub type float_t = f32; -pub type double_t = f64; -extern "C" { - pub fn __fpclassify(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbit(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinf(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finite(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnan(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsig(__x: f64, __y: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignaling(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acos(__x: f64) -> f64; -} -extern "C" { - pub fn __acos(__x: f64) -> f64; -} -extern "C" { - pub fn asin(__x: f64) -> f64; -} -extern "C" { - pub fn __asin(__x: f64) -> f64; -} -extern "C" { - pub fn atan(__x: f64) -> f64; -} -extern "C" { - pub fn __atan(__x: f64) -> f64; -} -extern "C" { - pub fn atan2(__y: f64, __x: f64) -> f64; -} -extern "C" { - pub fn __atan2(__y: f64, __x: f64) -> f64; -} -extern "C" { - pub fn cos(__x: f64) -> f64; -} -extern "C" { - pub fn __cos(__x: f64) -> f64; -} -extern "C" { - pub fn sin(__x: f64) -> f64; -} -extern "C" { - pub fn __sin(__x: f64) -> f64; -} -extern "C" { - pub fn tan(__x: f64) -> f64; -} -extern "C" { - pub fn __tan(__x: f64) -> f64; -} -extern "C" { - pub fn cosh(__x: f64) -> f64; -} -extern "C" { - pub fn __cosh(__x: f64) -> f64; -} -extern "C" { - pub fn sinh(__x: f64) -> f64; -} -extern "C" { - pub fn __sinh(__x: f64) -> f64; -} -extern "C" { - pub fn tanh(__x: f64) -> f64; -} -extern "C" { - pub fn __tanh(__x: f64) -> f64; -} -extern "C" { - pub fn acosh(__x: f64) -> f64; -} -extern "C" { - pub fn __acosh(__x: f64) -> f64; -} -extern "C" { - pub fn asinh(__x: f64) -> f64; -} -extern "C" { - pub fn __asinh(__x: f64) -> f64; -} -extern "C" { - pub fn atanh(__x: f64) -> f64; -} -extern "C" { - pub fn __atanh(__x: f64) -> f64; -} -extern "C" { - pub fn exp(__x: f64) -> f64; -} -extern "C" { - pub fn __exp(__x: f64) -> f64; -} -extern "C" { - pub fn frexp(__x: f64, __exponent: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __frexp(__x: f64, __exponent: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ldexp(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __ldexp(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn log(__x: f64) -> f64; -} -extern "C" { - pub fn __log(__x: f64) -> f64; -} -extern "C" { - pub fn log10(__x: f64) -> f64; -} -extern "C" { - pub fn __log10(__x: f64) -> f64; -} -extern "C" { - pub fn modf(__x: f64, __iptr: *mut f64) -> f64; -} -extern "C" { - pub fn __modf(__x: f64, __iptr: *mut f64) -> f64; -} -extern "C" { - pub fn expm1(__x: f64) -> f64; -} -extern "C" { - pub fn __expm1(__x: f64) -> f64; -} -extern "C" { - pub fn log1p(__x: f64) -> f64; -} -extern "C" { - pub fn __log1p(__x: f64) -> f64; -} -extern "C" { - pub fn logb(__x: f64) -> f64; -} -extern "C" { - pub fn __logb(__x: f64) -> f64; -} -extern "C" { - pub fn exp2(__x: f64) -> f64; -} -extern "C" { - pub fn __exp2(__x: f64) -> f64; -} -extern "C" { - pub fn log2(__x: f64) -> f64; -} -extern "C" { - pub fn __log2(__x: f64) -> f64; -} -extern "C" { - pub fn pow(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __pow(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn sqrt(__x: f64) -> f64; -} -extern "C" { - pub fn __sqrt(__x: f64) -> f64; -} -extern "C" { - pub fn hypot(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __hypot(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn cbrt(__x: f64) -> f64; -} -extern "C" { - pub fn __cbrt(__x: f64) -> f64; -} -extern "C" { - pub fn ceil(__x: f64) -> f64; -} -extern "C" { - pub fn __ceil(__x: f64) -> f64; -} -extern "C" { - pub fn fabs(__x: f64) -> f64; -} -extern "C" { - pub fn __fabs(__x: f64) -> f64; -} -extern "C" { - pub fn floor(__x: f64) -> f64; -} -extern "C" { - pub fn __floor(__x: f64) -> f64; -} -extern "C" { - pub fn fmod(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmod(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn copysign(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __copysign(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nan(__tagb: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn __nan(__tagb: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn erf(arg1: f64) -> f64; -} -extern "C" { - pub fn __erf(arg1: f64) -> f64; -} -extern "C" { - pub fn erfc(arg1: f64) -> f64; -} -extern "C" { - pub fn __erfc(arg1: f64) -> f64; -} -extern "C" { - pub fn lgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn __lgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn tgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn __tgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn rint(__x: f64) -> f64; -} -extern "C" { - pub fn __rint(__x: f64) -> f64; -} -extern "C" { - pub fn nextafter(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __nextafter(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nexttoward(__x: f64, __y: u128) -> f64; -} -extern "C" { - pub fn __nexttoward(__x: f64, __y: u128) -> f64; -} -extern "C" { - pub fn remainder(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __remainder(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn scalbn(__x: f64, __n: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __scalbn(__x: f64, __n: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ilogb(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogb(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalbln(__x: f64, __n: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn __scalbln(__x: f64, __n: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn nearbyint(__x: f64) -> f64; -} -extern "C" { - pub fn __nearbyint(__x: f64) -> f64; -} -extern "C" { - pub fn round(__x: f64) -> f64; -} -extern "C" { - pub fn __round(__x: f64) -> f64; -} -extern "C" { - pub fn trunc(__x: f64) -> f64; -} -extern "C" { - pub fn __trunc(__x: f64) -> f64; -} -extern "C" { - pub fn remquo(__x: f64, __y: f64, __quo: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __remquo(__x: f64, __y: f64, __quo: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn lrint(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrint(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrint(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrint(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lround(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lround(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llround(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llround(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdim(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fdim(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmax(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmax(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmin(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmin(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fma(__x: f64, __y: f64, __z: f64) -> f64; -} -extern "C" { - pub fn __fma(__x: f64, __y: f64, __z: f64) -> f64; -} -extern "C" { - pub fn __fpclassifyf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbitf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinff(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finitef(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnanf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsigf(__x: f32, __y: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignalingf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosf(__x: f32) -> f32; -} -extern "C" { - pub fn __acosf(__x: f32) -> f32; -} -extern "C" { - pub fn asinf(__x: f32) -> f32; -} -extern "C" { - pub fn __asinf(__x: f32) -> f32; -} -extern "C" { - pub fn atanf(__x: f32) -> f32; -} -extern "C" { - pub fn __atanf(__x: f32) -> f32; -} -extern "C" { - pub fn atan2f(__y: f32, __x: f32) -> f32; -} -extern "C" { - pub fn __atan2f(__y: f32, __x: f32) -> f32; -} -extern "C" { - pub fn cosf(__x: f32) -> f32; -} -extern "C" { - pub fn __cosf(__x: f32) -> f32; -} -extern "C" { - pub fn sinf(__x: f32) -> f32; -} -extern "C" { - pub fn __sinf(__x: f32) -> f32; -} -extern "C" { - pub fn tanf(__x: f32) -> f32; -} -extern "C" { - pub fn __tanf(__x: f32) -> f32; -} -extern "C" { - pub fn coshf(__x: f32) -> f32; -} -extern "C" { - pub fn __coshf(__x: f32) -> f32; -} -extern "C" { - pub fn sinhf(__x: f32) -> f32; -} -extern "C" { - pub fn __sinhf(__x: f32) -> f32; -} -extern "C" { - pub fn tanhf(__x: f32) -> f32; -} -extern "C" { - pub fn __tanhf(__x: f32) -> f32; -} -extern "C" { - pub fn acoshf(__x: f32) -> f32; -} -extern "C" { - pub fn __acoshf(__x: f32) -> f32; -} -extern "C" { - pub fn asinhf(__x: f32) -> f32; -} -extern "C" { - pub fn __asinhf(__x: f32) -> f32; -} -extern "C" { - pub fn atanhf(__x: f32) -> f32; -} -extern "C" { - pub fn __atanhf(__x: f32) -> f32; -} -extern "C" { - pub fn expf(__x: f32) -> f32; -} -extern "C" { - pub fn __expf(__x: f32) -> f32; -} -extern "C" { - pub fn frexpf(__x: f32, __exponent: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __frexpf(__x: f32, __exponent: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ldexpf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __ldexpf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn logf(__x: f32) -> f32; -} -extern "C" { - pub fn __logf(__x: f32) -> f32; -} -extern "C" { - pub fn log10f(__x: f32) -> f32; -} -extern "C" { - pub fn __log10f(__x: f32) -> f32; -} -extern "C" { - pub fn modff(__x: f32, __iptr: *mut f32) -> f32; -} -extern "C" { - pub fn __modff(__x: f32, __iptr: *mut f32) -> f32; -} -extern "C" { - pub fn expm1f(__x: f32) -> f32; -} -extern "C" { - pub fn __expm1f(__x: f32) -> f32; -} -extern "C" { - pub fn log1pf(__x: f32) -> f32; -} -extern "C" { - pub fn __log1pf(__x: f32) -> f32; -} -extern "C" { - pub fn logbf(__x: f32) -> f32; -} -extern "C" { - pub fn __logbf(__x: f32) -> f32; -} -extern "C" { - pub fn exp2f(__x: f32) -> f32; -} -extern "C" { - pub fn __exp2f(__x: f32) -> f32; -} -extern "C" { - pub fn log2f(__x: f32) -> f32; -} -extern "C" { - pub fn __log2f(__x: f32) -> f32; -} -extern "C" { - pub fn powf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __powf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn sqrtf(__x: f32) -> f32; -} -extern "C" { - pub fn __sqrtf(__x: f32) -> f32; -} -extern "C" { - pub fn hypotf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __hypotf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn cbrtf(__x: f32) -> f32; -} -extern "C" { - pub fn __cbrtf(__x: f32) -> f32; -} -extern "C" { - pub fn ceilf(__x: f32) -> f32; -} -extern "C" { - pub fn __ceilf(__x: f32) -> f32; -} -extern "C" { - pub fn fabsf(__x: f32) -> f32; -} -extern "C" { - pub fn __fabsf(__x: f32) -> f32; -} -extern "C" { - pub fn floorf(__x: f32) -> f32; -} -extern "C" { - pub fn __floorf(__x: f32) -> f32; -} -extern "C" { - pub fn fmodf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fmodf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn copysignf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __copysignf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn nanf(__tagb: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn __nanf(__tagb: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn erff(arg1: f32) -> f32; -} -extern "C" { - pub fn __erff(arg1: f32) -> f32; -} -extern "C" { - pub fn erfcf(arg1: f32) -> f32; -} -extern "C" { - pub fn __erfcf(arg1: f32) -> f32; -} -extern "C" { - pub fn lgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn __lgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn tgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn __tgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn rintf(__x: f32) -> f32; -} -extern "C" { - pub fn __rintf(__x: f32) -> f32; -} -extern "C" { - pub fn nextafterf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __nextafterf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn nexttowardf(__x: f32, __y: u128) -> f32; -} -extern "C" { - pub fn __nexttowardf(__x: f32, __y: u128) -> f32; -} -extern "C" { - pub fn remainderf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __remainderf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn scalbnf(__x: f32, __n: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __scalbnf(__x: f32, __n: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ilogbf(__x: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogbf(__x: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalblnf(__x: f32, __n: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn __scalblnf(__x: f32, __n: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn nearbyintf(__x: f32) -> f32; -} -extern "C" { - pub fn __nearbyintf(__x: f32) -> f32; -} -extern "C" { - pub fn roundf(__x: f32) -> f32; -} -extern "C" { - pub fn __roundf(__x: f32) -> f32; -} -extern "C" { - pub fn truncf(__x: f32) -> f32; -} -extern "C" { - pub fn __truncf(__x: f32) -> f32; -} -extern "C" { - pub fn remquof(__x: f32, __y: f32, __quo: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __remquof(__x: f32, __y: f32, __quo: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn lrintf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrintf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrintf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrintf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lroundf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lroundf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llroundf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llroundf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdimf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fdimf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmaxf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fmaxf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fminf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fminf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmaf(__x: f32, __y: f32, __z: f32) -> f32; -} -extern "C" { - pub fn __fmaf(__x: f32, __y: f32, __z: f32) -> f32; -} -extern "C" { - pub fn __fpclassifyl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbitl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinfl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finitel(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnanl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsigl(__x: u128, __y: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignalingl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosl(__x: u128) -> u128; -} -extern "C" { - pub fn __acosl(__x: u128) -> u128; -} -extern "C" { - pub fn asinl(__x: u128) -> u128; -} -extern "C" { - pub fn __asinl(__x: u128) -> u128; -} -extern "C" { - pub fn atanl(__x: u128) -> u128; -} -extern "C" { - pub fn __atanl(__x: u128) -> u128; -} -extern "C" { - pub fn atan2l(__y: u128, __x: u128) -> u128; -} -extern "C" { - pub fn __atan2l(__y: u128, __x: u128) -> u128; -} -extern "C" { - pub fn cosl(__x: u128) -> u128; -} -extern "C" { - pub fn __cosl(__x: u128) -> u128; -} -extern "C" { - pub fn sinl(__x: u128) -> u128; -} -extern "C" { - pub fn __sinl(__x: u128) -> u128; -} -extern "C" { - pub fn tanl(__x: u128) -> u128; -} -extern "C" { - pub fn __tanl(__x: u128) -> u128; -} -extern "C" { - pub fn coshl(__x: u128) -> u128; -} -extern "C" { - pub fn __coshl(__x: u128) -> u128; -} -extern "C" { - pub fn sinhl(__x: u128) -> u128; -} -extern "C" { - pub fn __sinhl(__x: u128) -> u128; -} -extern "C" { - pub fn tanhl(__x: u128) -> u128; -} -extern "C" { - pub fn __tanhl(__x: u128) -> u128; -} -extern "C" { - pub fn acoshl(__x: u128) -> u128; -} -extern "C" { - pub fn __acoshl(__x: u128) -> u128; -} -extern "C" { - pub fn asinhl(__x: u128) -> u128; -} -extern "C" { - pub fn __asinhl(__x: u128) -> u128; -} -extern "C" { - pub fn atanhl(__x: u128) -> u128; -} -extern "C" { - pub fn __atanhl(__x: u128) -> u128; -} -extern "C" { - pub fn expl(__x: u128) -> u128; -} -extern "C" { - pub fn __expl(__x: u128) -> u128; -} -extern "C" { - pub fn frexpl(__x: u128, __exponent: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __frexpl(__x: u128, __exponent: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn ldexpl(__x: u128, __exponent: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __ldexpl(__x: u128, __exponent: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn logl(__x: u128) -> u128; -} -extern "C" { - pub fn __logl(__x: u128) -> u128; -} -extern "C" { - pub fn log10l(__x: u128) -> u128; -} -extern "C" { - pub fn __log10l(__x: u128) -> u128; -} -extern "C" { - pub fn modfl(__x: u128, __iptr: *mut u128) -> u128; -} -extern "C" { - pub fn __modfl(__x: u128, __iptr: *mut u128) -> u128; -} -extern "C" { - pub fn expm1l(__x: u128) -> u128; -} -extern "C" { - pub fn __expm1l(__x: u128) -> u128; -} -extern "C" { - pub fn log1pl(__x: u128) -> u128; -} -extern "C" { - pub fn __log1pl(__x: u128) -> u128; -} -extern "C" { - pub fn logbl(__x: u128) -> u128; -} -extern "C" { - pub fn __logbl(__x: u128) -> u128; -} -extern "C" { - pub fn exp2l(__x: u128) -> u128; -} -extern "C" { - pub fn __exp2l(__x: u128) -> u128; -} -extern "C" { - pub fn log2l(__x: u128) -> u128; -} -extern "C" { - pub fn __log2l(__x: u128) -> u128; -} -extern "C" { - pub fn powl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __powl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn sqrtl(__x: u128) -> u128; -} -extern "C" { - pub fn __sqrtl(__x: u128) -> u128; -} -extern "C" { - pub fn hypotl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __hypotl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn cbrtl(__x: u128) -> u128; -} -extern "C" { - pub fn __cbrtl(__x: u128) -> u128; -} -extern "C" { - pub fn ceill(__x: u128) -> u128; -} -extern "C" { - pub fn __ceill(__x: u128) -> u128; -} -extern "C" { - pub fn fabsl(__x: u128) -> u128; -} -extern "C" { - pub fn __fabsl(__x: u128) -> u128; -} -extern "C" { - pub fn floorl(__x: u128) -> u128; -} -extern "C" { - pub fn __floorl(__x: u128) -> u128; -} -extern "C" { - pub fn fmodl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fmodl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn copysignl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __copysignl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn nanl(__tagb: *const ::std::os::raw::c_char) -> u128; -} -extern "C" { - pub fn __nanl(__tagb: *const ::std::os::raw::c_char) -> u128; -} -extern "C" { - pub fn erfl(arg1: u128) -> u128; -} -extern "C" { - pub fn __erfl(arg1: u128) -> u128; -} -extern "C" { - pub fn erfcl(arg1: u128) -> u128; -} -extern "C" { - pub fn __erfcl(arg1: u128) -> u128; -} -extern "C" { - pub fn lgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn __lgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn tgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn __tgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn rintl(__x: u128) -> u128; -} -extern "C" { - pub fn __rintl(__x: u128) -> u128; -} -extern "C" { - pub fn nextafterl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __nextafterl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn nexttowardl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __nexttowardl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn remainderl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __remainderl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn scalbnl(__x: u128, __n: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __scalbnl(__x: u128, __n: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn ilogbl(__x: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogbl(__x: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalblnl(__x: u128, __n: ::std::os::raw::c_long) -> u128; -} -extern "C" { - pub fn __scalblnl(__x: u128, __n: ::std::os::raw::c_long) -> u128; -} -extern "C" { - pub fn nearbyintl(__x: u128) -> u128; -} -extern "C" { - pub fn __nearbyintl(__x: u128) -> u128; -} -extern "C" { - pub fn roundl(__x: u128) -> u128; -} -extern "C" { - pub fn __roundl(__x: u128) -> u128; -} -extern "C" { - pub fn truncl(__x: u128) -> u128; -} -extern "C" { - pub fn __truncl(__x: u128) -> u128; -} -extern "C" { - pub fn remquol(__x: u128, __y: u128, __quo: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __remquol(__x: u128, __y: u128, __quo: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn lrintl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrintl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrintl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrintl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lroundl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lroundl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llroundl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llroundl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdiml(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fdiml(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fmaxl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fmaxl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fminl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fminl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fmal(__x: u128, __y: u128, __z: u128) -> u128; -} -extern "C" { - pub fn __fmal(__x: u128, __y: u128, __z: u128) -> u128; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_1 { - FP_NAN = 0, - FP_INFINITE = 1, - FP_ZERO = 2, - FP_SUBNORMAL = 3, - FP_NORMAL = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiPropertyElement { - BORDER = 0, - BASE = 1, - TEXT = 2, - OTHER = 3, -} -extern "C" { - pub static mut guiState: GuiControlState; -} -extern "C" { - pub static mut guiFont: Font; -} -pub const guiLocked: bool = false; -pub const guiAlpha: f32 = 1.0; -extern "C" { - pub static mut guiStyle: [::std::os::raw::c_uint; 384usize]; -} -pub const guiStyleLoaded: bool = false; -extern "C" { - pub static mut guiTooltip: *const ::std::os::raw::c_char; -} -pub const guiTooltipEnabled: bool = true; -extern "C" { - pub fn GuiSliderPro( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - sliderWidth: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn GuiColorPanelEx(bounds: Rectangle, color: Color, hue: f32) -> Color; -} -extern "C" { - pub fn GuiLoadIcons( - fileName: *const ::std::os::raw::c_char, - loadIconsName: bool, - ) -> *mut *mut ::std::os::raw::c_char; -} -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, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/raylib-sys/bindings_osx.rs b/raylib-sys/bindings_osx.rs deleted file mode 100644 index 29b712eb..00000000 --- a/raylib-sys/bindings_osx.rs +++ /dev/null @@ -1,18480 +0,0 @@ -/* automatically generated by rust-bindgen 0.59.1 */ - -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -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); - } - } -} -pub const RAYGUI_VERSION: &'static [u8; 8usize] = b"2.6-dev\0"; -pub const __GNUC_VA_LIST: u32 = 1; -pub const PI: f64 = 3.141592653589793; -pub const DEG2RAD: f64 = 0.017453292519943295; -pub const RAD2DEG: f64 = 57.29577951308232; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; -pub const __API_TO_BE_DEPRECATED: u32 = 100000; -pub const __MAC_10_0: u32 = 1000; -pub const __MAC_10_1: u32 = 1010; -pub const __MAC_10_2: u32 = 1020; -pub const __MAC_10_3: u32 = 1030; -pub const __MAC_10_4: u32 = 1040; -pub const __MAC_10_5: u32 = 1050; -pub const __MAC_10_6: u32 = 1060; -pub const __MAC_10_7: u32 = 1070; -pub const __MAC_10_8: u32 = 1080; -pub const __MAC_10_9: u32 = 1090; -pub const __MAC_10_10: u32 = 101000; -pub const __MAC_10_10_2: u32 = 101002; -pub const __MAC_10_10_3: u32 = 101003; -pub const __MAC_10_11: u32 = 101100; -pub const __MAC_10_11_2: u32 = 101102; -pub const __MAC_10_11_3: u32 = 101103; -pub const __MAC_10_11_4: u32 = 101104; -pub const __MAC_10_12: u32 = 101200; -pub const __MAC_10_12_1: u32 = 101201; -pub const __MAC_10_12_2: u32 = 101202; -pub const __MAC_10_12_4: u32 = 101204; -pub const __MAC_10_13: u32 = 101300; -pub const __MAC_10_13_1: u32 = 101301; -pub const __MAC_10_13_2: u32 = 101302; -pub const __MAC_10_13_4: u32 = 101304; -pub const __MAC_10_14: u32 = 101400; -pub const __MAC_10_14_1: u32 = 101401; -pub const __MAC_10_14_4: u32 = 101404; -pub const __MAC_10_15: u32 = 101500; -pub const __MAC_10_15_1: u32 = 101501; -pub const __MAC_10_15_4: u32 = 101504; -pub const __IPHONE_2_0: u32 = 20000; -pub const __IPHONE_2_1: u32 = 20100; -pub const __IPHONE_2_2: u32 = 20200; -pub const __IPHONE_3_0: u32 = 30000; -pub const __IPHONE_3_1: u32 = 30100; -pub const __IPHONE_3_2: u32 = 30200; -pub const __IPHONE_4_0: u32 = 40000; -pub const __IPHONE_4_1: u32 = 40100; -pub const __IPHONE_4_2: u32 = 40200; -pub const __IPHONE_4_3: u32 = 40300; -pub const __IPHONE_5_0: u32 = 50000; -pub const __IPHONE_5_1: u32 = 50100; -pub const __IPHONE_6_0: u32 = 60000; -pub const __IPHONE_6_1: u32 = 60100; -pub const __IPHONE_7_0: u32 = 70000; -pub const __IPHONE_7_1: u32 = 70100; -pub const __IPHONE_8_0: u32 = 80000; -pub const __IPHONE_8_1: u32 = 80100; -pub const __IPHONE_8_2: u32 = 80200; -pub const __IPHONE_8_3: u32 = 80300; -pub const __IPHONE_8_4: u32 = 80400; -pub const __IPHONE_9_0: u32 = 90000; -pub const __IPHONE_9_1: u32 = 90100; -pub const __IPHONE_9_2: u32 = 90200; -pub const __IPHONE_9_3: u32 = 90300; -pub const __IPHONE_10_0: u32 = 100000; -pub const __IPHONE_10_1: u32 = 100100; -pub const __IPHONE_10_2: u32 = 100200; -pub const __IPHONE_10_3: u32 = 100300; -pub const __IPHONE_11_0: u32 = 110000; -pub const __IPHONE_11_1: u32 = 110100; -pub const __IPHONE_11_2: u32 = 110200; -pub const __IPHONE_11_3: u32 = 110300; -pub const __IPHONE_11_4: u32 = 110400; -pub const __IPHONE_12_0: u32 = 120000; -pub const __IPHONE_12_1: u32 = 120100; -pub const __IPHONE_12_2: u32 = 120200; -pub const __IPHONE_12_3: u32 = 120300; -pub const __IPHONE_13_0: u32 = 130000; -pub const __IPHONE_13_1: u32 = 130100; -pub const __IPHONE_13_2: u32 = 130200; -pub const __IPHONE_13_3: u32 = 130300; -pub const __IPHONE_13_4: u32 = 130400; -pub const __IPHONE_13_5: u32 = 130500; -pub const __IPHONE_13_6: u32 = 130600; -pub const __TVOS_9_0: u32 = 90000; -pub const __TVOS_9_1: u32 = 90100; -pub const __TVOS_9_2: u32 = 90200; -pub const __TVOS_10_0: u32 = 100000; -pub const __TVOS_10_0_1: u32 = 100001; -pub const __TVOS_10_1: u32 = 100100; -pub const __TVOS_10_2: u32 = 100200; -pub const __TVOS_11_0: u32 = 110000; -pub const __TVOS_11_1: u32 = 110100; -pub const __TVOS_11_2: u32 = 110200; -pub const __TVOS_11_3: u32 = 110300; -pub const __TVOS_11_4: u32 = 110400; -pub const __TVOS_12_0: u32 = 120000; -pub const __TVOS_12_1: u32 = 120100; -pub const __TVOS_12_2: u32 = 120200; -pub const __TVOS_12_3: u32 = 120300; -pub const __TVOS_13_0: u32 = 130000; -pub const __TVOS_13_2: u32 = 130200; -pub const __TVOS_13_3: u32 = 130300; -pub const __TVOS_13_4: u32 = 130400; -pub const __WATCHOS_1_0: u32 = 10000; -pub const __WATCHOS_2_0: u32 = 20000; -pub const __WATCHOS_2_1: u32 = 20100; -pub const __WATCHOS_2_2: u32 = 20200; -pub const __WATCHOS_3_0: u32 = 30000; -pub const __WATCHOS_3_1: u32 = 30100; -pub const __WATCHOS_3_1_1: u32 = 30101; -pub const __WATCHOS_3_2: u32 = 30200; -pub const __WATCHOS_4_0: u32 = 40000; -pub const __WATCHOS_4_1: u32 = 40100; -pub const __WATCHOS_4_2: u32 = 40200; -pub const __WATCHOS_4_3: u32 = 40300; -pub const __WATCHOS_5_0: u32 = 50000; -pub const __WATCHOS_5_1: u32 = 50100; -pub const __WATCHOS_5_2: u32 = 50200; -pub const __WATCHOS_6_0: u32 = 60000; -pub const __WATCHOS_6_1: u32 = 60100; -pub const __WATCHOS_6_2: u32 = 60200; -pub const __DRIVERKIT_19_0: u32 = 190000; -pub const __MAC_OS_X_VERSION_MAX_ALLOWED: u32 = 101500; -pub const __ENABLE_LEGACY_MAC_AVAILABILITY: u32 = 1; -pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 0; -pub const __DARWIN_ONLY_VERS_1050: u32 = 0; -pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1; -pub const __DARWIN_UNIX03: u32 = 1; -pub const __DARWIN_64_BIT_INO_T: u32 = 1; -pub const __DARWIN_VERS_1050: u32 = 1; -pub const __DARWIN_NON_CANCELABLE: u32 = 0; -pub const __DARWIN_SUF_64_BIT_INO_T: &'static [u8; 9usize] = b"$INODE64\0"; -pub const __DARWIN_SUF_1050: &'static [u8; 6usize] = b"$1050\0"; -pub const __DARWIN_SUF_EXTSN: &'static [u8; 14usize] = b"$DARWIN_EXTSN\0"; -pub const __DARWIN_C_ANSI: u32 = 4096; -pub const __DARWIN_C_FULL: u32 = 900000; -pub const __DARWIN_C_LEVEL: u32 = 900000; -pub const __DARWIN_NO_LONG_LONG: u32 = 0; -pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1; -pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1; -pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3; -pub const __PTHREAD_SIZE__: u32 = 8176; -pub const __PTHREAD_ATTR_SIZE__: u32 = 56; -pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8; -pub const __PTHREAD_MUTEX_SIZE__: u32 = 56; -pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8; -pub const __PTHREAD_COND_SIZE__: u32 = 40; -pub const __PTHREAD_ONCE_SIZE__: u32 = 8; -pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192; -pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16; -pub const __DARWIN_WCHAR_MIN: i32 = -2147483648; -pub const _FORTIFY_SOURCE: u32 = 2; -pub const __DARWIN_NSIG: u32 = 32; -pub const NSIG: u32 = 32; -pub const _I386_SIGNAL_H_: u32 = 1; -pub const SIGHUP: u32 = 1; -pub const SIGINT: u32 = 2; -pub const SIGQUIT: u32 = 3; -pub const SIGILL: u32 = 4; -pub const SIGTRAP: u32 = 5; -pub const SIGABRT: u32 = 6; -pub const SIGIOT: u32 = 6; -pub const SIGEMT: u32 = 7; -pub const SIGFPE: u32 = 8; -pub const SIGKILL: u32 = 9; -pub const SIGBUS: u32 = 10; -pub const SIGSEGV: u32 = 11; -pub const SIGSYS: u32 = 12; -pub const SIGPIPE: u32 = 13; -pub const SIGALRM: u32 = 14; -pub const SIGTERM: u32 = 15; -pub const SIGURG: u32 = 16; -pub const SIGSTOP: u32 = 17; -pub const SIGTSTP: u32 = 18; -pub const SIGCONT: u32 = 19; -pub const SIGCHLD: u32 = 20; -pub const SIGTTIN: u32 = 21; -pub const SIGTTOU: u32 = 22; -pub const SIGIO: u32 = 23; -pub const SIGXCPU: u32 = 24; -pub const SIGXFSZ: u32 = 25; -pub const SIGVTALRM: u32 = 26; -pub const SIGPROF: u32 = 27; -pub const SIGWINCH: u32 = 28; -pub const SIGINFO: u32 = 29; -pub const SIGUSR1: u32 = 30; -pub const SIGUSR2: u32 = 31; -pub const FP_PREC_24B: u32 = 0; -pub const FP_PREC_53B: u32 = 2; -pub const FP_PREC_64B: u32 = 3; -pub const FP_RND_NEAR: u32 = 0; -pub const FP_RND_DOWN: u32 = 1; -pub const FP_RND_UP: u32 = 2; -pub const FP_CHOP: u32 = 3; -pub const FP_STATE_BYTES: u32 = 512; -pub const SIGEV_NONE: u32 = 0; -pub const SIGEV_SIGNAL: u32 = 1; -pub const SIGEV_THREAD: u32 = 3; -pub const ILL_NOOP: u32 = 0; -pub const ILL_ILLOPC: u32 = 1; -pub const ILL_ILLTRP: u32 = 2; -pub const ILL_PRVOPC: u32 = 3; -pub const ILL_ILLOPN: u32 = 4; -pub const ILL_ILLADR: u32 = 5; -pub const ILL_PRVREG: u32 = 6; -pub const ILL_COPROC: u32 = 7; -pub const ILL_BADSTK: u32 = 8; -pub const FPE_NOOP: u32 = 0; -pub const FPE_FLTDIV: u32 = 1; -pub const FPE_FLTOVF: u32 = 2; -pub const FPE_FLTUND: u32 = 3; -pub const FPE_FLTRES: u32 = 4; -pub const FPE_FLTINV: u32 = 5; -pub const FPE_FLTSUB: u32 = 6; -pub const FPE_INTDIV: u32 = 7; -pub const FPE_INTOVF: u32 = 8; -pub const SEGV_NOOP: u32 = 0; -pub const SEGV_MAPERR: u32 = 1; -pub const SEGV_ACCERR: u32 = 2; -pub const BUS_NOOP: u32 = 0; -pub const BUS_ADRALN: u32 = 1; -pub const BUS_ADRERR: u32 = 2; -pub const BUS_OBJERR: u32 = 3; -pub const TRAP_BRKPT: u32 = 1; -pub const TRAP_TRACE: u32 = 2; -pub const CLD_NOOP: u32 = 0; -pub const CLD_EXITED: u32 = 1; -pub const CLD_KILLED: u32 = 2; -pub const CLD_DUMPED: u32 = 3; -pub const CLD_TRAPPED: u32 = 4; -pub const CLD_STOPPED: u32 = 5; -pub const CLD_CONTINUED: u32 = 6; -pub const POLL_IN: u32 = 1; -pub const POLL_OUT: u32 = 2; -pub const POLL_MSG: u32 = 3; -pub const POLL_ERR: u32 = 4; -pub const POLL_PRI: u32 = 5; -pub const POLL_HUP: u32 = 6; -pub const SA_ONSTACK: u32 = 1; -pub const SA_RESTART: u32 = 2; -pub const SA_RESETHAND: u32 = 4; -pub const SA_NOCLDSTOP: u32 = 8; -pub const SA_NODEFER: u32 = 16; -pub const SA_NOCLDWAIT: u32 = 32; -pub const SA_SIGINFO: u32 = 64; -pub const SA_USERTRAMP: u32 = 256; -pub const SA_64REGSET: u32 = 512; -pub const SA_USERSPACE_MASK: u32 = 127; -pub const SIG_BLOCK: u32 = 1; -pub const SIG_UNBLOCK: u32 = 2; -pub const SIG_SETMASK: u32 = 3; -pub const SI_USER: u32 = 65537; -pub const SI_QUEUE: u32 = 65538; -pub const SI_TIMER: u32 = 65539; -pub const SI_ASYNCIO: u32 = 65540; -pub const SI_MESGQ: u32 = 65541; -pub const SS_ONSTACK: u32 = 1; -pub const SS_DISABLE: u32 = 4; -pub const MINSIGSTKSZ: u32 = 32768; -pub const SIGSTKSZ: u32 = 131072; -pub const SV_ONSTACK: u32 = 1; -pub const SV_INTERRUPT: u32 = 2; -pub const SV_RESETHAND: u32 = 4; -pub const SV_NODEFER: u32 = 16; -pub const SV_NOCLDSTOP: u32 = 8; -pub const SV_SIGINFO: u32 = 64; -pub const __WORDSIZE: u32 = 64; -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 INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT64_MIN: i64 = -9223372036854775808; -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_MAX: u64 = 9223372036854775807; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const UINTPTR_MAX: i32 = -1; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: i32 = -2147483648; -pub const WINT_MAX: u32 = 2147483647; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const PRIO_PROCESS: u32 = 0; -pub const PRIO_PGRP: u32 = 1; -pub const PRIO_USER: u32 = 2; -pub const PRIO_DARWIN_THREAD: u32 = 3; -pub const PRIO_DARWIN_PROCESS: u32 = 4; -pub const PRIO_MIN: i32 = -20; -pub const PRIO_MAX: u32 = 20; -pub const PRIO_DARWIN_BG: u32 = 4096; -pub const PRIO_DARWIN_NONUI: u32 = 4097; -pub const RUSAGE_SELF: u32 = 0; -pub const RUSAGE_CHILDREN: i32 = -1; -pub const RUSAGE_INFO_V0: u32 = 0; -pub const RUSAGE_INFO_V1: u32 = 1; -pub const RUSAGE_INFO_V2: u32 = 2; -pub const RUSAGE_INFO_V3: u32 = 3; -pub const RUSAGE_INFO_V4: u32 = 4; -pub const RUSAGE_INFO_CURRENT: u32 = 4; -pub const RLIMIT_CPU: u32 = 0; -pub const RLIMIT_FSIZE: u32 = 1; -pub const RLIMIT_DATA: u32 = 2; -pub const RLIMIT_STACK: u32 = 3; -pub const RLIMIT_CORE: u32 = 4; -pub const RLIMIT_AS: u32 = 5; -pub const RLIMIT_RSS: u32 = 5; -pub const RLIMIT_MEMLOCK: u32 = 6; -pub const RLIMIT_NPROC: u32 = 7; -pub const RLIMIT_NOFILE: u32 = 8; -pub const RLIM_NLIMITS: u32 = 9; -pub const _RLIMIT_POSIX_FLAG: u32 = 4096; -pub const RLIMIT_WAKEUPS_MONITOR: u32 = 1; -pub const RLIMIT_CPU_USAGE_MONITOR: u32 = 2; -pub const RLIMIT_THREAD_CPULIMITS: u32 = 3; -pub const RLIMIT_FOOTPRINT_INTERVAL: u32 = 4; -pub const WAKEMON_ENABLE: u32 = 1; -pub const WAKEMON_DISABLE: u32 = 2; -pub const WAKEMON_GET_PARAMS: u32 = 4; -pub const WAKEMON_SET_DEFAULTS: u32 = 8; -pub const WAKEMON_MAKE_FATAL: u32 = 16; -pub const CPUMON_MAKE_FATAL: u32 = 4096; -pub const FOOTPRINT_INTERVAL_RESET: u32 = 1; -pub const IOPOL_TYPE_DISK: u32 = 0; -pub const IOPOL_TYPE_VFS_ATIME_UPDATES: u32 = 2; -pub const IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES: u32 = 3; -pub const IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME: u32 = 4; -pub const IOPOL_SCOPE_PROCESS: u32 = 0; -pub const IOPOL_SCOPE_THREAD: u32 = 1; -pub const IOPOL_SCOPE_DARWIN_BG: u32 = 2; -pub const IOPOL_DEFAULT: u32 = 0; -pub const IOPOL_IMPORTANT: u32 = 1; -pub const IOPOL_PASSIVE: u32 = 2; -pub const IOPOL_THROTTLE: u32 = 3; -pub const IOPOL_UTILITY: u32 = 4; -pub const IOPOL_STANDARD: u32 = 5; -pub const IOPOL_APPLICATION: u32 = 5; -pub const IOPOL_NORMAL: u32 = 1; -pub const IOPOL_ATIME_UPDATES_DEFAULT: u32 = 0; -pub const IOPOL_ATIME_UPDATES_OFF: u32 = 1; -pub const IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT: u32 = 0; -pub const IOPOL_MATERIALIZE_DATALESS_FILES_OFF: u32 = 1; -pub const IOPOL_MATERIALIZE_DATALESS_FILES_ON: u32 = 2; -pub const IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT: u32 = 0; -pub const IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME: u32 = 1; -pub const WNOHANG: u32 = 1; -pub const WUNTRACED: u32 = 2; -pub const WCOREFLAG: u32 = 128; -pub const _WSTOPPED: u32 = 127; -pub const WEXITED: u32 = 4; -pub const WSTOPPED: u32 = 8; -pub const WCONTINUED: u32 = 16; -pub const WNOWAIT: u32 = 32; -pub const WAIT_ANY: i32 = -1; -pub const WAIT_MYPGRP: u32 = 0; -pub const _QUAD_HIGHWORD: u32 = 1; -pub const _QUAD_LOWWORD: u32 = 0; -pub const __DARWIN_LITTLE_ENDIAN: u32 = 1234; -pub const __DARWIN_BIG_ENDIAN: u32 = 4321; -pub const __DARWIN_PDP_ENDIAN: u32 = 3412; -pub const __DARWIN_BYTE_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 EXIT_FAILURE: u32 = 1; -pub const EXIT_SUCCESS: u32 = 0; -pub const RAND_MAX: u32 = 2147483647; -pub const NUM_CONTROLS: u32 = 16; -pub const NUM_PROPS_DEFAULT: u32 = 16; -pub const NUM_PROPS_EXTENDED: u32 = 8; -pub const TEXTEDIT_CURSOR_BLINK_FRAMES: u32 = 20; -pub const RICON_MAX_ICONS: u32 = 256; -pub const RICON_SIZE: u32 = 16; -pub const RICON_MAX_NAME_LENGTH: u32 = 32; -pub const RICON_DATA_ELEMENTS: u32 = 8; -pub const RENAME_SECLUDE: u32 = 1; -pub const RENAME_SWAP: u32 = 2; -pub const RENAME_EXCL: u32 = 4; -pub const __SLBF: u32 = 1; -pub const __SNBF: u32 = 2; -pub const __SRD: u32 = 4; -pub const __SWR: u32 = 8; -pub const __SRW: u32 = 16; -pub const __SEOF: u32 = 32; -pub const __SERR: u32 = 64; -pub const __SMBF: u32 = 128; -pub const __SAPP: u32 = 256; -pub const __SSTR: u32 = 512; -pub const __SOPT: u32 = 1024; -pub const __SNPT: u32 = 2048; -pub const __SOFF: u32 = 4096; -pub const __SMOD: u32 = 8192; -pub const __SALC: u32 = 16384; -pub const __SIGN: u32 = 32768; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 1; -pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 1024; -pub const EOF: i32 = -1; -pub const FOPEN_MAX: u32 = 20; -pub const FILENAME_MAX: u32 = 1024; -pub const P_tmpdir: &'static [u8; 10usize] = b"/var/tmp/\0"; -pub const L_tmpnam: u32 = 1024; -pub const TMP_MAX: u32 = 308915776; -pub const SEEK_SET: u32 = 0; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const L_ctermid: u32 = 1024; -pub const _USE_FORTIFY_LEVEL: u32 = 2; -pub const __HAS_FIXED_CHK_PROTOTYPES: u32 = 1; -pub const FP_NAN: u32 = 1; -pub const FP_INFINITE: u32 = 2; -pub const FP_ZERO: u32 = 3; -pub const FP_NORMAL: u32 = 4; -pub const FP_SUBNORMAL: u32 = 5; -pub const FP_SUPERNORMAL: u32 = 6; -pub const FP_ILOGB0: i32 = -2147483648; -pub const FP_ILOGBNAN: i32 = -2147483648; -pub const MATH_ERRNO: u32 = 1; -pub const MATH_ERREXCEPT: u32 = 2; -pub const M_E: f64 = 2.718281828459045; -pub const M_LOG2E: f64 = 1.4426950408889634; -pub const M_LOG10E: f64 = 0.4342944819032518; -pub const M_LN2: f64 = 0.6931471805599453; -pub const M_LN10: f64 = 2.302585092994046; -pub const M_PI: f64 = 3.141592653589793; -pub const M_PI_2: f64 = 1.5707963267948966; -pub const M_PI_4: f64 = 0.7853981633974483; -pub const M_1_PI: f64 = 0.3183098861837907; -pub const M_2_PI: f64 = 0.6366197723675814; -pub const M_2_SQRTPI: f64 = 1.1283791670955126; -pub const M_SQRT2: f64 = 1.4142135623730951; -pub const M_SQRT1_2: f64 = 0.7071067811865476; -pub const FP_SNAN: u32 = 1; -pub const FP_QNAN: u32 = 1; -pub const DOMAIN: u32 = 1; -pub const SING: u32 = 2; -pub const OVERFLOW: u32 = 3; -pub const UNDERFLOW: u32 = 4; -pub const TLOSS: u32 = 5; -pub const PLOSS: u32 = 6; -pub const WINDOW_STATUSBAR_HEIGHT: u32 = 22; -pub const GROUPBOX_LINE_THICK: u32 = 1; -pub const GROUPBOX_TEXT_PADDING: u32 = 10; -pub const LINE_TEXT_PADDING: u32 = 10; -pub const PANEL_BORDER_WIDTH: u32 = 1; -pub const TOGGLEGROUP_MAX_ELEMENTS: u32 = 32; -pub const VALUEBOX_MAX_CHARS: u32 = 32; -pub const COLORBARALPHA_CHECKED_SIZE: u32 = 10; -pub const MESSAGEBOX_BUTTON_HEIGHT: u32 = 24; -pub const MESSAGEBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_BUTTON_HEIGHT: u32 = 24; -pub const TEXTINPUTBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_HEIGHT: u32 = 30; -pub const TEXTINPUTBOX_MAX_TEXT_LENGTH: u32 = 256; -pub const GRID_COLOR_ALPHA: f64 = 0.15; -pub const ICON_TEXT_PADDING: u32 = 4; -pub const TEXTSPLIT_MAX_TEXT_LENGTH: u32 = 1024; -pub const TEXTSPLIT_MAX_TEXT_ELEMENTS: u32 = 128; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector2 { - pub x: f32, - pub y: f32, -} -#[test] -fn bindgen_test_layout_Vector2() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(Vector2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(y) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector3 { - pub x: f32, - pub y: f32, - pub z: f32, -} -#[test] -fn bindgen_test_layout_Vector3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(Vector3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(z) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector4 { - pub x: f32, - pub y: f32, - pub z: f32, - pub w: f32, -} -#[test] -fn bindgen_test_layout_Vector4() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Vector4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector4)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(z) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(w) - ) - ); -} -pub type Quaternion = Vector4; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Matrix { - pub m0: f32, - pub m4: f32, - pub m8: f32, - pub m12: f32, - pub m1: f32, - pub m5: f32, - pub m9: f32, - pub m13: f32, - pub m2: f32, - pub m6: f32, - pub m10: f32, - pub m14: f32, - pub m3: f32, - pub m7: f32, - pub m11: f32, - pub m15: f32, -} -#[test] -fn bindgen_test_layout_Matrix() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(Matrix)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Matrix)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m4 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m8 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m12 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m12) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m5 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m9 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m13 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m13) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m2 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m6 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m10 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m10) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m14 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m14) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m3 as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m7 as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m7) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m11 as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m11) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m15 as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m15) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Color { - pub r: ::std::os::raw::c_uchar, - pub g: ::std::os::raw::c_uchar, - pub b: ::std::os::raw::c_uchar, - pub a: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_Color() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(Color)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Color)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, - 1usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(g)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 2usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 3usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(a)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rectangle { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, -} -#[test] -fn bindgen_test_layout_Rectangle() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Rectangle)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Rectangle)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(height) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Image { - pub data: *mut ::std::os::raw::c_void, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Image() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Image)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Image)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(format) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Texture { - pub id: ::std::os::raw::c_uint, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Texture() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(Texture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Texture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(format) - ) - ); -} -pub type Texture2D = Texture; -pub type TextureCubemap = Texture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderTexture { - pub id: ::std::os::raw::c_uint, - pub texture: Texture, - pub depth: Texture, -} -#[test] -fn bindgen_test_layout_RenderTexture() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(RenderTexture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RenderTexture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).depth as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(depth) - ) - ); -} -pub type RenderTexture2D = RenderTexture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NPatchInfo { - pub source: Rectangle, - pub left: ::std::os::raw::c_int, - pub top: ::std::os::raw::c_int, - pub right: ::std::os::raw::c_int, - pub bottom: ::std::os::raw::c_int, - pub layout: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NPatchInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(NPatchInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(NPatchInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).left as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).top as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).right as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bottom as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(bottom) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).layout as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(layout) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CharInfo { - pub value: ::std::os::raw::c_int, - pub offsetX: ::std::os::raw::c_int, - pub offsetY: ::std::os::raw::c_int, - pub advanceX: ::std::os::raw::c_int, - pub image: Image, -} -#[test] -fn bindgen_test_layout_CharInfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CharInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CharInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetX as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetY as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).advanceX as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(advanceX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).image as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(image) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Font { - pub baseSize: ::std::os::raw::c_int, - pub charsCount: ::std::os::raw::c_int, - pub charsPadding: ::std::os::raw::c_int, - pub texture: Texture2D, - pub recs: *mut Rectangle, - pub chars: *mut CharInfo, -} -#[test] -fn bindgen_test_layout_Font() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Font)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Font)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).baseSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(baseSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsPadding as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsPadding) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).recs as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(recs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chars as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(chars) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera3D { - pub position: Vector3, - pub target: Vector3, - pub up: Vector3, - pub fovy: f32, - pub projection: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Camera3D() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(Camera3D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera3D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).up as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(up) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fovy as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(fovy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(projection) - ) - ); -} -pub type Camera = Camera3D; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera2D { - pub offset: Vector2, - pub target: Vector2, - pub rotation: f32, - pub zoom: f32, -} -#[test] -fn bindgen_test_layout_Camera2D() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Camera2D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera2D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).zoom as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(zoom) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Mesh { - pub vertexCount: ::std::os::raw::c_int, - pub triangleCount: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub texcoords2: *mut f32, - pub normals: *mut f32, - pub tangents: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_ushort, - pub animVertices: *mut f32, - pub animNormals: *mut f32, - pub boneIds: *mut ::std::os::raw::c_int, - pub boneWeights: *mut f32, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: *mut ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Mesh() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(Mesh)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Mesh)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).triangleCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(triangleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normals as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(normals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tangents as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(tangents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animVertices as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animVertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animNormals as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animNormals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneIds as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneIds) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneWeights as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneWeights) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Shader { - pub id: ::std::os::raw::c_uint, - pub locs: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Shader() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Shader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Shader)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).locs as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(locs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MaterialMap { - pub texture: Texture2D, - pub color: Color, - pub value: f32, -} -#[test] -fn bindgen_test_layout_MaterialMap() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(MaterialMap)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MaterialMap)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(color) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(value) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Material { - pub shader: Shader, - pub maps: *mut MaterialMap, - pub params: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_Material() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Material)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Material)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).shader as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(shader) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).maps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(maps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).params as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(params) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Transform { - pub translation: Vector3, - pub rotation: Quaternion, - pub scale: Vector3, -} -#[test] -fn bindgen_test_layout_Transform() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Transform)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Transform)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).translation as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(translation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(scale) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoneInfo { - pub name: [::std::os::raw::c_char; 32usize], - pub parent: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_BoneInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(BoneInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoneInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(parent) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Model { - pub transform: Matrix, - pub meshCount: ::std::os::raw::c_int, - pub materialCount: ::std::os::raw::c_int, - pub meshes: *mut Mesh, - pub materials: *mut Material, - pub meshMaterial: *mut ::std::os::raw::c_int, - pub boneCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub bindPose: *mut Transform, -} -#[test] -fn bindgen_test_layout_Model() { - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Model)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).transform as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshCount as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materialCount as *const _ as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materialCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshes as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshes) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materials as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materials) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshMaterial as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshMaterial) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bindPose as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bindPose) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ModelAnimation { - pub boneCount: ::std::os::raw::c_int, - pub frameCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub framePoses: *mut *mut Transform, -} -#[test] -fn bindgen_test_layout_ModelAnimation() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ModelAnimation)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ModelAnimation)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).frameCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(frameCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).framePoses as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(framePoses) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Ray { - pub position: Vector3, - pub direction: Vector3, -} -#[test] -fn bindgen_test_layout_Ray() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Ray)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Ray)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).direction as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(direction) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RayHitInfo { - pub hit: bool, - pub distance: f32, - pub position: Vector3, - pub normal: Vector3, -} -#[test] -fn bindgen_test_layout_RayHitInfo() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RayHitInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RayHitInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hit as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(hit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(distance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normal as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(normal) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoundingBox { - pub min: Vector3, - pub max: Vector3, -} -#[test] -fn bindgen_test_layout_BoundingBox() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(BoundingBox)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoundingBox)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(min) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(max) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wave { - pub sampleCount: ::std::os::raw::c_uint, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, - pub data: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Wave() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Wave)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Wave)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(channels) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rAudioBuffer { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AudioStream { - pub buffer: *mut rAudioBuffer, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_AudioStream() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(AudioStream)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AudioStream)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(channels) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Sound { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Sound() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(Sound)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Sound)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(sampleCount) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Music { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, - pub looping: bool, - pub ctxType: ::std::os::raw::c_int, - pub ctxData: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Music() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Music)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Music)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).looping as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(looping) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxType as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxType) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxData as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxData) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrDeviceInfo { - pub hResolution: ::std::os::raw::c_int, - pub vResolution: ::std::os::raw::c_int, - pub hScreenSize: f32, - pub vScreenSize: f32, - pub vScreenCenter: f32, - pub eyeToScreenDistance: f32, - pub lensSeparationDistance: f32, - pub interpupillaryDistance: f32, - pub lensDistortionValues: [f32; 4usize], - pub chromaAbCorrection: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_VrDeviceInfo() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hResolution as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vResolution as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hScreenSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenCenter as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eyeToScreenDistance as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(eyeToScreenDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensSeparationDistance as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensSeparationDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).interpupillaryDistance as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(interpupillaryDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensDistortionValues as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensDistortionValues) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chromaAbCorrection as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(chromaAbCorrection) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrStereoConfig { - pub projection: [Matrix; 2usize], - pub viewOffset: [Matrix; 2usize], - pub leftLensCenter: [f32; 2usize], - pub rightLensCenter: [f32; 2usize], - pub leftScreenCenter: [f32; 2usize], - pub rightScreenCenter: [f32; 2usize], - pub scale: [f32; 2usize], - pub scaleIn: [f32; 2usize], -} -#[test] -fn bindgen_test_layout_VrStereoConfig() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!("Size of: ", stringify!(VrStereoConfig)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrStereoConfig)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(projection) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).viewOffset as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(viewOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftLensCenter as *const _ as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rightLensCenter as *const _ as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftScreenCenter as *const _ as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rightScreenCenter as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightScreenCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scale) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scaleIn as *const _ as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scaleIn) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ConfigFlags { - FLAG_VSYNC_HINT = 64, - FLAG_FULLSCREEN_MODE = 2, - FLAG_WINDOW_RESIZABLE = 4, - FLAG_WINDOW_UNDECORATED = 8, - FLAG_WINDOW_HIDDEN = 128, - FLAG_WINDOW_MINIMIZED = 512, - FLAG_WINDOW_MAXIMIZED = 1024, - FLAG_WINDOW_UNFOCUSED = 2048, - FLAG_WINDOW_TOPMOST = 4096, - FLAG_WINDOW_ALWAYS_RUN = 256, - FLAG_WINDOW_TRANSPARENT = 16, - FLAG_WINDOW_HIGHDPI = 8192, - FLAG_MSAA_4X_HINT = 32, - FLAG_INTERLACED_HINT = 65536, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TraceLogLevel { - LOG_ALL = 0, - LOG_TRACE = 1, - LOG_DEBUG = 2, - LOG_INFO = 3, - LOG_WARNING = 4, - LOG_ERROR = 5, - LOG_FATAL = 6, - LOG_NONE = 7, -} -impl KeyboardKey { - pub const KEY_MENU: KeyboardKey = KeyboardKey::KEY_R; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum KeyboardKey { - KEY_NULL = 0, - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, - KEY_BACK = 4, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MouseButton { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MouseCursor { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, - MOUSE_CURSOR_RESIZE_NS = 6, - MOUSE_CURSOR_RESIZE_NWSE = 7, - MOUSE_CURSOR_RESIZE_NESW = 8, - MOUSE_CURSOR_RESIZE_ALL = 9, - MOUSE_CURSOR_NOT_ALLOWED = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GamepadButton { - GAMEPAD_BUTTON_UNKNOWN = 0, - GAMEPAD_BUTTON_LEFT_FACE_UP = 1, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2, - GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3, - GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4, - GAMEPAD_BUTTON_RIGHT_FACE_UP = 5, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8, - GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9, - GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12, - GAMEPAD_BUTTON_MIDDLE_LEFT = 13, - GAMEPAD_BUTTON_MIDDLE = 14, - GAMEPAD_BUTTON_MIDDLE_RIGHT = 15, - GAMEPAD_BUTTON_LEFT_THUMB = 16, - GAMEPAD_BUTTON_RIGHT_THUMB = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GamepadAxis { - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - GAMEPAD_AXIS_LEFT_TRIGGER = 4, - GAMEPAD_AXIS_RIGHT_TRIGGER = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum MaterialMapIndex { - MATERIAL_MAP_ALBEDO = 0, - MATERIAL_MAP_METALNESS = 1, - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION = 4, - MATERIAL_MAP_EMISSION = 5, - MATERIAL_MAP_HEIGHT = 6, - MATERIAL_MAP_BRDG = 7, - MATERIAL_MAP_CUBEMAP = 8, - MATERIAL_MAP_IRRADIANCE = 9, - MATERIAL_MAP_PREFILTER = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ShaderLocationIndex { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01 = 1, - SHADER_LOC_VERTEX_TEXCOORD02 = 2, - SHADER_LOC_VERTEX_NORMAL = 3, - SHADER_LOC_VERTEX_TANGENT = 4, - SHADER_LOC_VERTEX_COLOR = 5, - SHADER_LOC_MATRIX_MVP = 6, - SHADER_LOC_MATRIX_VIEW = 7, - SHADER_LOC_MATRIX_PROJECTION = 8, - SHADER_LOC_MATRIX_MODEL = 9, - SHADER_LOC_MATRIX_NORMAL = 10, - SHADER_LOC_VECTOR_VIEW = 11, - SHADER_LOC_COLOR_DIFFUSE = 12, - SHADER_LOC_COLOR_SPECULAR = 13, - SHADER_LOC_COLOR_AMBIENT = 14, - SHADER_LOC_MAP_ALBEDO = 15, - SHADER_LOC_MAP_METALNESS = 16, - SHADER_LOC_MAP_NORMAL = 17, - SHADER_LOC_MAP_ROUGHNESS = 18, - SHADER_LOC_MAP_OCCLUSION = 19, - SHADER_LOC_MAP_EMISSION = 20, - SHADER_LOC_MAP_HEIGHT = 21, - SHADER_LOC_MAP_CUBEMAP = 22, - SHADER_LOC_MAP_IRRADIANCE = 23, - SHADER_LOC_MAP_PREFILTER = 24, - SHADER_LOC_MAP_BRDF = 25, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum ShaderUniformDataType { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2 = 1, - SHADER_UNIFORM_VEC3 = 2, - SHADER_UNIFORM_VEC4 = 3, - SHADER_UNIFORM_INT = 4, - SHADER_UNIFORM_IVEC2 = 5, - SHADER_UNIFORM_IVEC3 = 6, - SHADER_UNIFORM_IVEC4 = 7, - SHADER_UNIFORM_SAMPLER2D = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum PixelFormat { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2, - PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3, - PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4, - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5, - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6, - PIXELFORMAT_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7, - PIXELFORMAT_UNCOMPRESSED_R32 = 8, - PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9, - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10, - PIXELFORMAT_COMPRESSED_DXT1_RGB = 11, - PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12, - PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13, - PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14, - PIXELFORMAT_COMPRESSED_ETC1_RGB = 15, - PIXELFORMAT_COMPRESSED_ETC2_RGB = 16, - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17, - PIXELFORMAT_COMPRESSED_PVRT_RGB = 18, - PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19, - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20, - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TextureFilter { - TEXTURE_FILTER_POINT = 0, - TEXTURE_FILTER_BILINEAR = 1, - TEXTURE_FILTER_TRILINEAR = 2, - TEXTURE_FILTER_ANISOTROPIC_4X = 3, - TEXTURE_FILTER_ANISOTROPIC_8X = 4, - TEXTURE_FILTER_ANISOTROPIC_16X = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum TextureWrap { - TEXTURE_WRAP_REPEAT = 0, - TEXTURE_WRAP_CLAMP = 1, - TEXTURE_WRAP_MIRROR_REPEAT = 2, - TEXTURE_WRAP_MIRROR_CLAMP = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CubemapLayout { - CUBEMAP_LAYOUT_AUTO_DETECT = 0, - CUBEMAP_LAYOUT_LINE_VERTICAL = 1, - CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2, - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3, - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4, - CUBEMAP_LAYOUT_PANORAMA = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum FontType { - FONT_DEFAULT = 0, - FONT_BITMAP = 1, - FONT_SDF = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum BlendMode { - BLEND_ALPHA = 0, - BLEND_ADDITIVE = 1, - BLEND_MULTIPLIED = 2, - BLEND_ADD_COLORS = 3, - BLEND_SUBTRACT_COLORS = 4, - BLEND_CUSTOM = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum Gestures { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CameraMode { - CAMERA_CUSTOM = 0, - CAMERA_FREE = 1, - CAMERA_ORBITAL = 2, - CAMERA_FIRST_PERSON = 3, - CAMERA_THIRD_PERSON = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum CameraProjection { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum NPatchLayout { - NPATCH_NINE_PATCH = 0, - NPATCH_THREE_PATCH_VERTICAL = 1, - NPATCH_THREE_PATCH_HORIZONTAL = 2, -} -pub type TraceLogCallback = ::std::option::Option< - unsafe extern "C" fn( - logLevel: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - args: *mut __va_list_tag, - ), ->; -pub type LoadFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar, ->; -pub type SaveFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool, ->; -pub type LoadFileTextCallback = ::std::option::Option< - unsafe extern "C" fn(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char, ->; -pub type SaveFileTextCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool, ->; -extern "C" { - pub fn InitWindow( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn WindowShouldClose() -> bool; -} -extern "C" { - pub fn CloseWindow(); -} -extern "C" { - pub fn IsWindowReady() -> bool; -} -extern "C" { - pub fn IsWindowFullscreen() -> bool; -} -extern "C" { - pub fn IsWindowHidden() -> bool; -} -extern "C" { - pub fn IsWindowMinimized() -> bool; -} -extern "C" { - pub fn IsWindowMaximized() -> bool; -} -extern "C" { - pub fn IsWindowFocused() -> bool; -} -extern "C" { - pub fn IsWindowResized() -> bool; -} -extern "C" { - pub fn IsWindowState(flag: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn SetWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ClearWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ToggleFullscreen(); -} -extern "C" { - pub fn MaximizeWindow(); -} -extern "C" { - pub fn MinimizeWindow(); -} -extern "C" { - pub fn RestoreWindow(); -} -extern "C" { - pub fn SetWindowIcon(image: Image); -} -extern "C" { - pub fn SetWindowTitle(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetWindowPosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMonitor(monitor: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMinSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetWindowHandle() -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn GetScreenWidth() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetScreenHeight() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCurrentMonitor() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPosition(monitor: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GetMonitorWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorRefreshRate(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetWindowPosition() -> Vector2; -} -extern "C" { - pub fn GetWindowScaleDPI() -> Vector2; -} -extern "C" { - pub fn GetMonitorName(monitor: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn SetClipboardText(text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GetClipboardText() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ShowCursor(); -} -extern "C" { - pub fn HideCursor(); -} -extern "C" { - pub fn IsCursorHidden() -> bool; -} -extern "C" { - pub fn EnableCursor(); -} -extern "C" { - pub fn DisableCursor(); -} -extern "C" { - pub fn IsCursorOnScreen() -> bool; -} -extern "C" { - pub fn ClearBackground(color: Color); -} -extern "C" { - pub fn BeginDrawing(); -} -extern "C" { - pub fn EndDrawing(); -} -extern "C" { - pub fn BeginMode2D(camera: Camera2D); -} -extern "C" { - pub fn EndMode2D(); -} -extern "C" { - pub fn BeginMode3D(camera: Camera3D); -} -extern "C" { - pub fn EndMode3D(); -} -extern "C" { - pub fn BeginTextureMode(target: RenderTexture2D); -} -extern "C" { - pub fn EndTextureMode(); -} -extern "C" { - pub fn BeginShaderMode(shader: Shader); -} -extern "C" { - pub fn EndShaderMode(); -} -extern "C" { - pub fn BeginBlendMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn EndBlendMode(); -} -extern "C" { - pub fn BeginScissorMode( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn EndScissorMode(); -} -extern "C" { - pub fn BeginVrStereoMode(config: VrStereoConfig); -} -extern "C" { - pub fn EndVrStereoMode(); -} -extern "C" { - pub fn LoadVrStereoConfig(device: VrDeviceInfo) -> VrStereoConfig; -} -extern "C" { - pub fn UnloadVrStereoConfig(config: VrStereoConfig); -} -extern "C" { - pub fn LoadShader( - vsFileName: *const ::std::os::raw::c_char, - fsFileName: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn LoadShaderFromMemory( - vsCode: *const ::std::os::raw::c_char, - fsCode: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn GetShaderLocation( - shader: Shader, - uniformName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetShaderLocationAttrib( - shader: Shader, - attribName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn SetShaderValue( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueV( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueMatrix(shader: Shader, locIndex: ::std::os::raw::c_int, mat: Matrix); -} -extern "C" { - pub fn SetShaderValueTexture( - shader: Shader, - locIndex: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn UnloadShader(shader: Shader); -} -extern "C" { - pub fn GetMouseRay(mousePosition: Vector2, camera: Camera) -> Ray; -} -extern "C" { - pub fn GetCameraMatrix(camera: Camera) -> Matrix; -} -extern "C" { - pub fn GetCameraMatrix2D(camera: Camera2D) -> Matrix; -} -extern "C" { - pub fn GetWorldToScreen(position: Vector3, camera: Camera) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreenEx( - position: Vector3, - camera: Camera, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn SetTargetFPS(fps: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetFPS() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFrameTime() -> f32; -} -extern "C" { - pub fn GetTime() -> f64; -} -extern "C" { - pub fn GetRandomValue( - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TakeScreenshot(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetConfigFlags(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn TraceLog(logLevel: ::std::os::raw::c_int, text: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn SetTraceLogLevel(logLevel: ::std::os::raw::c_int); -} -extern "C" { - pub fn MemAlloc(size: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemRealloc( - ptr: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemFree(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn SetTraceLogCallback(callback: TraceLogCallback); -} -extern "C" { - pub fn SetLoadFileDataCallback(callback: LoadFileDataCallback); -} -extern "C" { - pub fn SetSaveFileDataCallback(callback: SaveFileDataCallback); -} -extern "C" { - pub fn SetLoadFileTextCallback(callback: LoadFileTextCallback); -} -extern "C" { - pub fn SetSaveFileTextCallback(callback: SaveFileTextCallback); -} -extern "C" { - pub fn LoadFileData( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn UnloadFileData(data: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileData( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool; -} -extern "C" { - pub fn LoadFileText(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn UnloadFileText(text: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileText( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn FileExists(fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn DirectoryExists(dirPath: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileExtension( - fileName: *const ::std::os::raw::c_char, - ext: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetFileExtension( - fileName: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileName(filePath: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileNameWithoutExt( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryPath( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetPrevDirectoryPath( - dirPath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetWorkingDirectory() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryFiles( - dirPath: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDirectoryFiles(); -} -extern "C" { - pub fn ChangeDirectory(dir: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileDropped() -> bool; -} -extern "C" { - pub fn GetDroppedFiles(count: *mut ::std::os::raw::c_int) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDroppedFiles(); -} -extern "C" { - pub fn GetFileModTime(fileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn CompressData( - data: *mut ::std::os::raw::c_uchar, - dataLength: ::std::os::raw::c_int, - compDataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn DecompressData( - compData: *mut ::std::os::raw::c_uchar, - compDataLength: ::std::os::raw::c_int, - dataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn SaveStorageValue(position: ::std::os::raw::c_uint, value: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn LoadStorageValue(position: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn OpenURL(url: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn IsKeyPressed(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyDown(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyReleased(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyUp(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn SetExitKey(key: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetKeyPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCharPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsGamepadAvailable(gamepad: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsGamepadName( - gamepad: ::std::os::raw::c_int, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetGamepadName(gamepad: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn IsGamepadButtonPressed( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonDown( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonReleased( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonUp(gamepad: ::std::os::raw::c_int, button: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn GetGamepadButtonPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisCount(gamepad: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisMovement( - gamepad: ::std::os::raw::c_int, - axis: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn SetGamepadMappings(mappings: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsMouseButtonPressed(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonDown(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonReleased(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonUp(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetMouseX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMouseY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMousePosition() -> Vector2; -} -extern "C" { - pub fn SetMousePosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseOffset(offsetX: ::std::os::raw::c_int, offsetY: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseScale(scaleX: f32, scaleY: f32); -} -extern "C" { - pub fn GetMouseWheelMove() -> f32; -} -extern "C" { - pub fn SetMouseCursor(cursor: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetTouchX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPosition(index: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn SetGesturesEnabled(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsGestureDetected(gesture: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetGestureDetected() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPointsCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGestureHoldDuration() -> f32; -} -extern "C" { - pub fn GetGestureDragVector() -> Vector2; -} -extern "C" { - pub fn GetGestureDragAngle() -> f32; -} -extern "C" { - pub fn GetGesturePinchVector() -> Vector2; -} -extern "C" { - pub fn GetGesturePinchAngle() -> f32; -} -extern "C" { - pub fn SetCameraMode(camera: Camera, mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn UpdateCamera(camera: *mut Camera); -} -extern "C" { - pub fn SetCameraPanControl(keyPan: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraAltControl(keyAlt: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraSmoothZoomControl(keySmoothZoom: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraMoveControls( - keyFront: ::std::os::raw::c_int, - keyBack: ::std::os::raw::c_int, - keyRight: ::std::os::raw::c_int, - keyLeft: ::std::os::raw::c_int, - keyUp: ::std::os::raw::c_int, - keyDown: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShapesTexture(texture: Texture2D, source: Rectangle); -} -extern "C" { - pub fn DrawPixel(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawPixelV(position: Vector2, color: Color); -} -extern "C" { - pub fn DrawLine( - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawLineV(startPos: Vector2, endPos: Vector2, color: Color); -} -extern "C" { - pub fn DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezierQuad( - startPos: Vector2, - endPos: Vector2, - controlPos: Vector2, - thick: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawLineStrip(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawCircle( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSector( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSectorLines( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleGradient( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawCircleV(center: Vector2, radius: f32, color: Color); -} -extern "C" { - pub fn DrawCircleLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipse( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipseLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawRing( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRingLines( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangle( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleV(position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRectangleRec(rec: Rectangle, color: Color); -} -extern "C" { - pub fn DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color); -} -extern "C" { - pub fn DrawRectangleGradientV( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientH( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientEx( - rec: Rectangle, - col1: Color, - col2: Color, - col3: Color, - col4: Color, - ); -} -extern "C" { - pub fn DrawRectangleLines( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleLinesEx(rec: Rectangle, lineThick: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawRectangleRounded( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleRoundedLines( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - lineThick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleFan(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip( - points: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPoly( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawPolyLines( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionCircles( - center1: Vector2, - radius1: f32, - center2: Vector2, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointRec(point: Vector2, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionPointTriangle( - point: Vector2, - p1: Vector2, - p2: Vector2, - p3: Vector2, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionLines( - startPos1: Vector2, - endPos1: Vector2, - startPos2: Vector2, - endPos2: Vector2, - collisionPoint: *mut Vector2, - ) -> bool; -} -extern "C" { - pub fn GetCollisionRec(rec1: Rectangle, rec2: Rectangle) -> Rectangle; -} -extern "C" { - pub fn LoadImage(fileName: *const ::std::os::raw::c_char) -> Image; -} -extern "C" { - pub fn LoadImageRaw( - fileName: *const ::std::os::raw::c_char, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - headerSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageAnim( - fileName: *const ::std::os::raw::c_char, - frames: *mut ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadImage(image: Image); -} -extern "C" { - pub fn ExportImage(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportImageAsCode(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GenImageColor( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientV( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - top: Color, - bottom: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientH( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - left: Color, - right: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientRadial( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - density: f32, - inner: Color, - outer: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageChecked( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - checksX: ::std::os::raw::c_int, - checksY: ::std::os::raw::c_int, - col1: Color, - col2: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageWhiteNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - factor: f32, - ) -> Image; -} -extern "C" { - pub fn GenImagePerlinNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - scale: f32, - ) -> Image; -} -extern "C" { - pub fn GenImageCellular( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - tileSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn ImageCopy(image: Image) -> Image; -} -extern "C" { - pub fn ImageFromImage(image: Image, rec: Rectangle) -> Image; -} -extern "C" { - pub fn ImageText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn ImageTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - tint: Color, - ) -> Image; -} -extern "C" { - pub fn ImageFormat(image: *mut Image, newFormat: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageToPOT(image: *mut Image, fill: Color); -} -extern "C" { - pub fn ImageCrop(image: *mut Image, crop: Rectangle); -} -extern "C" { - pub fn ImageAlphaCrop(image: *mut Image, threshold: f32); -} -extern "C" { - pub fn ImageAlphaClear(image: *mut Image, color: Color, threshold: f32); -} -extern "C" { - pub fn ImageAlphaMask(image: *mut Image, alphaMask: Image); -} -extern "C" { - pub fn ImageAlphaPremultiply(image: *mut Image); -} -extern "C" { - pub fn ImageResize( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeNN( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeCanvas( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - fill: Color, - ); -} -extern "C" { - pub fn ImageMipmaps(image: *mut Image); -} -extern "C" { - pub fn ImageDither( - image: *mut Image, - rBpp: ::std::os::raw::c_int, - gBpp: ::std::os::raw::c_int, - bBpp: ::std::os::raw::c_int, - aBpp: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageFlipVertical(image: *mut Image); -} -extern "C" { - pub fn ImageFlipHorizontal(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCW(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCCW(image: *mut Image); -} -extern "C" { - pub fn ImageColorTint(image: *mut Image, color: Color); -} -extern "C" { - pub fn ImageColorInvert(image: *mut Image); -} -extern "C" { - pub fn ImageColorGrayscale(image: *mut Image); -} -extern "C" { - pub fn ImageColorContrast(image: *mut Image, contrast: f32); -} -extern "C" { - pub fn ImageColorBrightness(image: *mut Image, brightness: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageColorReplace(image: *mut Image, color: Color, replace: Color); -} -extern "C" { - pub fn LoadImageColors(image: Image) -> *mut Color; -} -extern "C" { - pub fn LoadImagePalette( - image: Image, - maxPaletteSize: ::std::os::raw::c_int, - colorsCount: *mut ::std::os::raw::c_int, - ) -> *mut Color; -} -extern "C" { - pub fn UnloadImageColors(colors: *mut Color); -} -extern "C" { - pub fn UnloadImagePalette(colors: *mut Color); -} -extern "C" { - pub fn GetImageAlphaBorder(image: Image, threshold: f32) -> Rectangle; -} -extern "C" { - pub fn ImageClearBackground(dst: *mut Image, color: Color); -} -extern "C" { - pub fn ImageDrawPixel( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawPixelV(dst: *mut Image, position: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawLine( - dst: *mut Image, - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawLineV(dst: *mut Image, start: Vector2, end: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawCircle( - dst: *mut Image, - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawCircleV( - dst: *mut Image, - center: Vector2, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangle( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangleV(dst: *mut Image, position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleRec(dst: *mut Image, rec: Rectangle, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleLines( - dst: *mut Image, - rec: Rectangle, - thick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDraw( - dst: *mut Image, - src: Image, - srcRec: Rectangle, - dstRec: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn ImageDrawText( - dst: *mut Image, - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawTextEx( - dst: *mut Image, - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn LoadTexture(fileName: *const ::std::os::raw::c_char) -> Texture2D; -} -extern "C" { - pub fn LoadTextureFromImage(image: Image) -> Texture2D; -} -extern "C" { - pub fn LoadTextureCubemap(image: Image, layout: ::std::os::raw::c_int) -> TextureCubemap; -} -extern "C" { - pub fn LoadRenderTexture( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> RenderTexture2D; -} -extern "C" { - pub fn UnloadTexture(texture: Texture2D); -} -extern "C" { - pub fn UnloadRenderTexture(target: RenderTexture2D); -} -extern "C" { - pub fn UpdateTexture(texture: Texture2D, pixels: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn UpdateTextureRec( - texture: Texture2D, - rec: Rectangle, - pixels: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn GetTextureData(texture: Texture2D) -> Image; -} -extern "C" { - pub fn GetScreenData() -> Image; -} -extern "C" { - pub fn GenTextureMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn SetTextureFilter(texture: Texture2D, filter: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTextureWrap(texture: Texture2D, wrap: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawTexture( - texture: Texture2D, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureV(texture: Texture2D, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureEx( - texture: Texture2D, - position: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureRec(texture: Texture2D, source: Rectangle, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureQuad( - texture: Texture2D, - tiling: Vector2, - offset: Vector2, - quad: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureTiled( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePro( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureNPatch( - texture: Texture2D, - nPatchInfo: NPatchInfo, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePoly( - texture: Texture2D, - center: Vector2, - points: *mut Vector2, - texcoords: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn Fade(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorToInt(color: Color) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ColorNormalize(color: Color) -> Vector4; -} -extern "C" { - pub fn ColorFromNormalized(normalized: Vector4) -> Color; -} -extern "C" { - pub fn ColorToHSV(color: Color) -> Vector3; -} -extern "C" { - pub fn ColorFromHSV(hue: f32, saturation: f32, value: f32) -> Color; -} -extern "C" { - pub fn ColorAlpha(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorAlphaBlend(dst: Color, src: Color, tint: Color) -> Color; -} -extern "C" { - pub fn GetColor(hexValue: ::std::os::raw::c_int) -> Color; -} -extern "C" { - pub fn GetPixelColor( - srcPtr: *mut ::std::os::raw::c_void, - format: ::std::os::raw::c_int, - ) -> Color; -} -extern "C" { - pub fn SetPixelColor( - dstPtr: *mut ::std::os::raw::c_void, - color: Color, - format: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GetPixelDataSize( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFontDefault() -> Font; -} -extern "C" { - pub fn LoadFont(fileName: *const ::std::os::raw::c_char) -> Font; -} -extern "C" { - pub fn LoadFontEx( - fileName: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontFromImage(image: Image, key: Color, firstChar: ::std::os::raw::c_int) -> Font; -} -extern "C" { - pub fn LoadFontFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontData( - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - type_: ::std::os::raw::c_int, - ) -> *mut CharInfo; -} -extern "C" { - pub fn GenImageFontAtlas( - chars: *const CharInfo, - recs: *mut *mut Rectangle, - charsCount: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - padding: ::std::os::raw::c_int, - packMethod: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadFontData(chars: *mut CharInfo, charsCount: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadFont(font: Font); -} -extern "C" { - pub fn DrawFPS(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawText( - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRec( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRecEx( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - selectStart: ::std::os::raw::c_int, - selectLength: ::std::os::raw::c_int, - selectTint: Color, - selectBackTint: Color, - ); -} -extern "C" { - pub fn DrawTextCodepoint( - font: Font, - codepoint: ::std::os::raw::c_int, - position: Vector2, - fontSize: f32, - tint: Color, - ); -} -extern "C" { - pub fn MeasureText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn MeasureTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - ) -> Vector2; -} -extern "C" { - pub fn GetGlyphIndex(font: Font, codepoint: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextCopy( - dst: *mut ::std::os::raw::c_char, - src: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextIsEqual( - text1: *const ::std::os::raw::c_char, - text2: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TextLength(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn TextFormat(text: *const ::std::os::raw::c_char, ...) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSubtext( - text: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextReplace( - text: *mut ::std::os::raw::c_char, - replace: *const ::std::os::raw::c_char, - by: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextInsert( - text: *const ::std::os::raw::c_char, - insert: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextJoin( - textList: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - delimiter: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSplit( - text: *const ::std::os::raw::c_char, - delimiter: ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextAppend( - text: *mut ::std::os::raw::c_char, - append: *const ::std::os::raw::c_char, - position: *mut ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TextFindIndex( - text: *const ::std::os::raw::c_char, - find: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUpper(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToLower(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToPascal(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToInteger(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUtf8( - codepoints: *mut ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn GetCodepoints( - text: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCodepointsCount(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetNextCodepoint( - text: *const ::std::os::raw::c_char, - bytesProcessed: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn CodepointToUtf8( - codepoint: ::std::os::raw::c_int, - byteLength: *mut ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color); -} -extern "C" { - pub fn DrawPoint3D(position: Vector3, color: Color); -} -extern "C" { - pub fn DrawCircle3D( - center: Vector3, - radius: f32, - rotationAxis: Vector3, - rotationAngle: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip3D( - points: *mut Vector3, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeWiresV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeTexture( - texture: Texture2D, - position: Vector3, - width: f32, - height: f32, - length: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawSphere(centerPos: Vector3, radius: f32, color: Color); -} -extern "C" { - pub fn DrawSphereEx( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawSphereWires( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinder( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinderWires( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPlane(centerPos: Vector3, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRay(ray: Ray, color: Color); -} -extern "C" { - pub fn DrawGrid(slices: ::std::os::raw::c_int, spacing: f32); -} -extern "C" { - pub fn LoadModel(fileName: *const ::std::os::raw::c_char) -> Model; -} -extern "C" { - pub fn LoadModelFromMesh(mesh: Mesh) -> Model; -} -extern "C" { - pub fn UnloadModel(model: Model); -} -extern "C" { - pub fn UnloadModelKeepMeshes(model: Model); -} -extern "C" { - pub fn UploadMesh(mesh: *mut Mesh, dynamic: bool); -} -extern "C" { - pub fn UpdateMeshBuffer( - mesh: Mesh, - index: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - dataSize: ::std::os::raw::c_int, - offset: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn DrawMesh(mesh: Mesh, material: Material, transform: Matrix); -} -extern "C" { - pub fn DrawMeshInstanced( - mesh: Mesh, - material: Material, - transforms: *mut Matrix, - instances: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadMesh(mesh: Mesh); -} -extern "C" { - pub fn ExportMesh(mesh: Mesh, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn LoadMaterials( - fileName: *const ::std::os::raw::c_char, - materialCount: *mut ::std::os::raw::c_int, - ) -> *mut Material; -} -extern "C" { - pub fn LoadMaterialDefault() -> Material; -} -extern "C" { - pub fn UnloadMaterial(material: Material); -} -extern "C" { - pub fn SetMaterialTexture( - material: *mut Material, - mapType: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn SetModelMeshMaterial( - model: *mut Model, - meshId: ::std::os::raw::c_int, - materialId: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadModelAnimations( - fileName: *const ::std::os::raw::c_char, - animsCount: *mut ::std::os::raw::c_int, - ) -> *mut ModelAnimation; -} -extern "C" { - pub fn UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadModelAnimation(anim: ModelAnimation); -} -extern "C" { - pub fn UnloadModelAnimations(animations: *mut ModelAnimation, count: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsModelAnimationValid(model: Model, anim: ModelAnimation) -> bool; -} -extern "C" { - pub fn GenMeshPoly(sides: ::std::os::raw::c_int, radius: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshPlane( - width: f32, - length: f32, - resX: ::std::os::raw::c_int, - resZ: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCube(width: f32, height: f32, length: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHemiSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCylinder(radius: f32, height: f32, slices: ::std::os::raw::c_int) -> Mesh; -} -extern "C" { - pub fn GenMeshTorus( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshKnot( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHeightmap(heightmap: Image, size: Vector3) -> Mesh; -} -extern "C" { - pub fn GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3) -> Mesh; -} -extern "C" { - pub fn MeshBoundingBox(mesh: Mesh) -> BoundingBox; -} -extern "C" { - pub fn MeshTangents(mesh: *mut Mesh); -} -extern "C" { - pub fn MeshBinormals(mesh: *mut Mesh); -} -extern "C" { - pub fn DrawModel(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelWiresEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawBoundingBox(box_: BoundingBox, color: Color); -} -extern "C" { - pub fn DrawBillboard( - camera: Camera, - texture: Texture2D, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawBillboardRec( - camera: Camera, - texture: Texture2D, - source: Rectangle, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn CheckCollisionSpheres( - center1: Vector3, - radius1: f32, - center2: Vector3, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxSphere(box_: BoundingBox, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphere(ray: Ray, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphereEx( - ray: Ray, - center: Vector3, - radius: f32, - collisionPoint: *mut Vector3, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionRayBox(ray: Ray, box_: BoundingBox) -> bool; -} -extern "C" { - pub fn GetCollisionRayMesh(ray: Ray, mesh: Mesh, transform: Matrix) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayModel(ray: Ray, model: Model) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayGround(ray: Ray, groundHeight: f32) -> RayHitInfo; -} -extern "C" { - pub fn InitAudioDevice(); -} -extern "C" { - pub fn CloseAudioDevice(); -} -extern "C" { - pub fn IsAudioDeviceReady() -> bool; -} -extern "C" { - pub fn SetMasterVolume(volume: f32); -} -extern "C" { - pub fn LoadWave(fileName: *const ::std::os::raw::c_char) -> Wave; -} -extern "C" { - pub fn LoadWaveFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Wave; -} -extern "C" { - pub fn LoadSound(fileName: *const ::std::os::raw::c_char) -> Sound; -} -extern "C" { - pub fn LoadSoundFromWave(wave: Wave) -> Sound; -} -extern "C" { - pub fn UpdateSound( - sound: Sound, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadWave(wave: Wave); -} -extern "C" { - pub fn UnloadSound(sound: Sound); -} -extern "C" { - pub fn ExportWave(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportWaveAsCode(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn PlaySound(sound: Sound); -} -extern "C" { - pub fn StopSound(sound: Sound); -} -extern "C" { - pub fn PauseSound(sound: Sound); -} -extern "C" { - pub fn ResumeSound(sound: Sound); -} -extern "C" { - pub fn PlaySoundMulti(sound: Sound); -} -extern "C" { - pub fn StopSoundMulti(); -} -extern "C" { - pub fn GetSoundsPlaying() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsSoundPlaying(sound: Sound) -> bool; -} -extern "C" { - pub fn SetSoundVolume(sound: Sound, volume: f32); -} -extern "C" { - pub fn SetSoundPitch(sound: Sound, pitch: f32); -} -extern "C" { - pub fn WaveFormat( - wave: *mut Wave, - sampleRate: ::std::os::raw::c_int, - sampleSize: ::std::os::raw::c_int, - channels: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn WaveCopy(wave: Wave) -> Wave; -} -extern "C" { - pub fn WaveCrop( - wave: *mut Wave, - initSample: ::std::os::raw::c_int, - finalSample: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadWaveSamples(wave: Wave) -> *mut f32; -} -extern "C" { - pub fn UnloadWaveSamples(samples: *mut f32); -} -extern "C" { - pub fn LoadMusicStream(fileName: *const ::std::os::raw::c_char) -> Music; -} -extern "C" { - pub fn LoadMusicStreamFromMemory( - fileType: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Music; -} -extern "C" { - pub fn UnloadMusicStream(music: Music); -} -extern "C" { - pub fn PlayMusicStream(music: Music); -} -extern "C" { - pub fn IsMusicPlaying(music: Music) -> bool; -} -extern "C" { - pub fn UpdateMusicStream(music: Music); -} -extern "C" { - pub fn StopMusicStream(music: Music); -} -extern "C" { - pub fn PauseMusicStream(music: Music); -} -extern "C" { - pub fn ResumeMusicStream(music: Music); -} -extern "C" { - pub fn SetMusicVolume(music: Music, volume: f32); -} -extern "C" { - pub fn SetMusicPitch(music: Music, pitch: f32); -} -extern "C" { - pub fn GetMusicTimeLength(music: Music) -> f32; -} -extern "C" { - pub fn GetMusicTimePlayed(music: Music) -> f32; -} -extern "C" { - pub fn InitAudioStream( - sampleRate: ::std::os::raw::c_uint, - sampleSize: ::std::os::raw::c_uint, - channels: ::std::os::raw::c_uint, - ) -> AudioStream; -} -extern "C" { - pub fn UpdateAudioStream( - stream: AudioStream, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn CloseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamProcessed(stream: AudioStream) -> bool; -} -extern "C" { - pub fn PlayAudioStream(stream: AudioStream); -} -extern "C" { - pub fn PauseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn ResumeAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamPlaying(stream: AudioStream) -> bool; -} -extern "C" { - pub fn StopAudioStream(stream: AudioStream); -} -extern "C" { - pub fn SetAudioStreamVolume(stream: AudioStream, volume: f32); -} -extern "C" { - pub fn SetAudioStreamPitch(stream: AudioStream, pitch: f32); -} -extern "C" { - pub fn SetAudioStreamBufferSizeDefault(size: ::std::os::raw::c_int); -} -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_longlong; -pub type __uint64_t = ::std::os::raw::c_ulonglong; -pub type __darwin_intptr_t = ::std::os::raw::c_long; -pub type __darwin_natural_t = ::std::os::raw::c_uint; -pub type __darwin_ct_rune_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t { - pub __mbstate8: [::std::os::raw::c_char; 128usize], - pub _mbstateL: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout___mbstate_t() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 128usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 8usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__mbstate8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__mbstate8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>()))._mbstateL as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(_mbstateL) - ) - ); -} -pub type __darwin_mbstate_t = __mbstate_t; -pub type __darwin_ptrdiff_t = ::std::os::raw::c_long; -pub type __darwin_size_t = ::std::os::raw::c_ulong; -pub type __darwin_va_list = __builtin_va_list; -pub type __darwin_wchar_t = ::std::os::raw::c_int; -pub type __darwin_rune_t = __darwin_wchar_t; -pub type __darwin_wint_t = ::std::os::raw::c_int; -pub type __darwin_clock_t = ::std::os::raw::c_ulong; -pub type __darwin_socklen_t = __uint32_t; -pub type __darwin_ssize_t = ::std::os::raw::c_long; -pub type __darwin_time_t = ::std::os::raw::c_long; -pub type __darwin_blkcnt_t = __int64_t; -pub type __darwin_blksize_t = __int32_t; -pub type __darwin_dev_t = __int32_t; -pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint; -pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint; -pub type __darwin_gid_t = __uint32_t; -pub type __darwin_id_t = __uint32_t; -pub type __darwin_ino64_t = __uint64_t; -pub type __darwin_ino_t = __darwin_ino64_t; -pub type __darwin_mach_port_name_t = __darwin_natural_t; -pub type __darwin_mach_port_t = __darwin_mach_port_name_t; -pub type __darwin_mode_t = __uint16_t; -pub type __darwin_off_t = __int64_t; -pub type __darwin_pid_t = __int32_t; -pub type __darwin_sigset_t = __uint32_t; -pub type __darwin_suseconds_t = __int32_t; -pub type __darwin_uid_t = __uint32_t; -pub type __darwin_useconds_t = __uint32_t; -pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize]; -pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_pthread_handler_rec { - pub __routine: ::std::option::Option, - pub __arg: *mut ::std::os::raw::c_void, - pub __next: *mut __darwin_pthread_handler_rec, -} -#[test] -fn bindgen_test_layout___darwin_pthread_handler_rec() { - assert_eq!( - ::std::mem::size_of::<__darwin_pthread_handler_rec>(), - 24usize, - concat!("Size of: ", stringify!(__darwin_pthread_handler_rec)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_pthread_handler_rec>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__routine as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__routine) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__arg as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__arg) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__next as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__next) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_attr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 56usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_attr_t>(), - 64usize, - concat!("Size of: ", stringify!(_opaque_pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_attr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_attr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__opaque as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_attr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_cond_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 40usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_cond_t>(), - 48usize, - concat!("Size of: ", stringify!(_opaque_pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_cond_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_cond_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__opaque as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_cond_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_condattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_condattr_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_condattr_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_condattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__sig as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_condattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__opaque as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_condattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_mutex_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 56usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_mutex_t>(), - 64usize, - concat!("Size of: ", stringify!(_opaque_pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_mutex_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutex_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__opaque as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutex_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_mutexattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_mutexattr_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_mutexattr_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_mutexattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__sig as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutexattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__opaque as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutexattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_once_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_once_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_once_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_once_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_once_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_once_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_once_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__opaque as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_once_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_rwlock_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 192usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_rwlock_t>(), - 200usize, - concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_rwlock_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlock_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__opaque as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlock_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_rwlockattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 16usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_rwlockattr_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(), - 24usize, - concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__sig as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlockattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__opaque as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlockattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_t { - pub __sig: ::std::os::raw::c_long, - pub __cleanup_stack: *mut __darwin_pthread_handler_rec, - pub __opaque: [::std::os::raw::c_char; 8176usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_t() { - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_t>(), - 8192usize, - concat!("Size of: ", stringify!(_opaque_pthread_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__sig as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_opaque_pthread_t>())).__cleanup_stack as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__cleanup_stack) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__opaque as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__opaque) - ) - ); -} -pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t; -pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t; -pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t; -pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong; -pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t; -pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t; -pub type __darwin_pthread_once_t = _opaque_pthread_once_t; -pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; -pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t; -pub type __darwin_pthread_t = *mut _opaque_pthread_t; -pub type __darwin_nl_item = ::std::os::raw::c_int; -pub type __darwin_wctrans_t = ::std::os::raw::c_int; -pub type __darwin_wctype_t = __uint32_t; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum idtype_t { - P_ALL = 0, - P_PID = 1, - P_PGID = 2, -} -pub type pid_t = __darwin_pid_t; -pub type id_t = __darwin_id_t; -pub type sig_atomic_t = ::std::os::raw::c_int; -pub type u_int8_t = ::std::os::raw::c_uchar; -pub type u_int16_t = ::std::os::raw::c_ushort; -pub type u_int32_t = ::std::os::raw::c_uint; -pub type u_int64_t = ::std::os::raw::c_ulonglong; -pub type register_t = i64; -pub type user_addr_t = u_int64_t; -pub type user_size_t = u_int64_t; -pub type user_ssize_t = i64; -pub type user_long_t = i64; -pub type user_ulong_t = u_int64_t; -pub type user_time_t = i64; -pub type user_off_t = i64; -pub type syscall_arg_t = u_int64_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_i386_thread_state { - pub __eax: ::std::os::raw::c_uint, - pub __ebx: ::std::os::raw::c_uint, - pub __ecx: ::std::os::raw::c_uint, - pub __edx: ::std::os::raw::c_uint, - pub __edi: ::std::os::raw::c_uint, - pub __esi: ::std::os::raw::c_uint, - pub __ebp: ::std::os::raw::c_uint, - pub __esp: ::std::os::raw::c_uint, - pub __ss: ::std::os::raw::c_uint, - pub __eflags: ::std::os::raw::c_uint, - pub __eip: ::std::os::raw::c_uint, - pub __cs: ::std::os::raw::c_uint, - pub __ds: ::std::os::raw::c_uint, - pub __es: ::std::os::raw::c_uint, - pub __fs: ::std::os::raw::c_uint, - pub __gs: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___darwin_i386_thread_state() { - assert_eq!( - ::std::mem::size_of::<__darwin_i386_thread_state>(), - 64usize, - concat!("Size of: ", stringify!(__darwin_i386_thread_state)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_i386_thread_state>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_i386_thread_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__eax as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__eax) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__ebx as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__ebx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__ecx as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__ecx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__edx as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__edx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__edi as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__edi) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__esi as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__esi) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__ebp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__ebp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__esp as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__esp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__ss as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__eflags as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__eflags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__eip as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__eip) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__cs as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__cs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__ds as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__ds) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__es as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__fs as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__fs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_i386_thread_state>())).__gs as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_thread_state), - "::", - stringify!(__gs) - ) - ); -} -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_fp_control { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[test] -fn bindgen_test_layout___darwin_fp_control() { - assert_eq!( - ::std::mem::size_of::<__darwin_fp_control>(), - 2usize, - concat!("Size of: ", stringify!(__darwin_fp_control)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_fp_control>(), - 2usize, - concat!("Alignment of ", stringify!(__darwin_fp_control)) - ); -} -impl __darwin_fp_control { - #[inline] - pub fn __invalid(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set___invalid(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn __denorm(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set___denorm(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn __zdiv(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } - } - #[inline] - pub fn set___zdiv(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn __ovrfl(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set___ovrfl(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn __undfl(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set___undfl(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn __precis(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set___precis(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn __pc(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u16) } - } - #[inline] - pub fn set___pc(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 2u8, val as u64) - } - } - #[inline] - pub fn __rc(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 2u8) as u16) } - } - #[inline] - pub fn set___rc(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - __invalid: ::std::os::raw::c_ushort, - __denorm: ::std::os::raw::c_ushort, - __zdiv: ::std::os::raw::c_ushort, - __ovrfl: ::std::os::raw::c_ushort, - __undfl: ::std::os::raw::c_ushort, - __precis: ::std::os::raw::c_ushort, - __pc: ::std::os::raw::c_ushort, - __rc: ::std::os::raw::c_ushort, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let __invalid: u16 = unsafe { ::std::mem::transmute(__invalid) }; - __invalid as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let __denorm: u16 = unsafe { ::std::mem::transmute(__denorm) }; - __denorm as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let __zdiv: u16 = unsafe { ::std::mem::transmute(__zdiv) }; - __zdiv as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let __ovrfl: u16 = unsafe { ::std::mem::transmute(__ovrfl) }; - __ovrfl as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let __undfl: u16 = unsafe { ::std::mem::transmute(__undfl) }; - __undfl as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let __precis: u16 = unsafe { ::std::mem::transmute(__precis) }; - __precis as u64 - }); - __bindgen_bitfield_unit.set(8usize, 2u8, { - let __pc: u16 = unsafe { ::std::mem::transmute(__pc) }; - __pc as u64 - }); - __bindgen_bitfield_unit.set(10usize, 2u8, { - let __rc: u16 = unsafe { ::std::mem::transmute(__rc) }; - __rc as u64 - }); - __bindgen_bitfield_unit - } -} -pub type __darwin_fp_control_t = __darwin_fp_control; -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_fp_status { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[test] -fn bindgen_test_layout___darwin_fp_status() { - assert_eq!( - ::std::mem::size_of::<__darwin_fp_status>(), - 2usize, - concat!("Size of: ", stringify!(__darwin_fp_status)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_fp_status>(), - 2usize, - concat!("Alignment of ", stringify!(__darwin_fp_status)) - ); -} -impl __darwin_fp_status { - #[inline] - pub fn __invalid(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set___invalid(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn __denorm(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set___denorm(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn __zdiv(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } - } - #[inline] - pub fn set___zdiv(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn __ovrfl(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set___ovrfl(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn __undfl(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set___undfl(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn __precis(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set___precis(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn __stkflt(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } - } - #[inline] - pub fn set___stkflt(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn __errsumm(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } - } - #[inline] - pub fn set___errsumm(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn __c0(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } - } - #[inline] - pub fn set___c0(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn __c1(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } - } - #[inline] - pub fn set___c1(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn __c2(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) } - } - #[inline] - pub fn set___c2(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 1u8, val as u64) - } - } - #[inline] - pub fn __tos(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 3u8) as u16) } - } - #[inline] - pub fn set___tos(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(11usize, 3u8, val as u64) - } - } - #[inline] - pub fn __c3(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) } - } - #[inline] - pub fn set___c3(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(14usize, 1u8, val as u64) - } - } - #[inline] - pub fn __busy(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) } - } - #[inline] - pub fn set___busy(&mut self, val: ::std::os::raw::c_ushort) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(15usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - __invalid: ::std::os::raw::c_ushort, - __denorm: ::std::os::raw::c_ushort, - __zdiv: ::std::os::raw::c_ushort, - __ovrfl: ::std::os::raw::c_ushort, - __undfl: ::std::os::raw::c_ushort, - __precis: ::std::os::raw::c_ushort, - __stkflt: ::std::os::raw::c_ushort, - __errsumm: ::std::os::raw::c_ushort, - __c0: ::std::os::raw::c_ushort, - __c1: ::std::os::raw::c_ushort, - __c2: ::std::os::raw::c_ushort, - __tos: ::std::os::raw::c_ushort, - __c3: ::std::os::raw::c_ushort, - __busy: ::std::os::raw::c_ushort, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let __invalid: u16 = unsafe { ::std::mem::transmute(__invalid) }; - __invalid as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let __denorm: u16 = unsafe { ::std::mem::transmute(__denorm) }; - __denorm as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let __zdiv: u16 = unsafe { ::std::mem::transmute(__zdiv) }; - __zdiv as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let __ovrfl: u16 = unsafe { ::std::mem::transmute(__ovrfl) }; - __ovrfl as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let __undfl: u16 = unsafe { ::std::mem::transmute(__undfl) }; - __undfl as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let __precis: u16 = unsafe { ::std::mem::transmute(__precis) }; - __precis as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let __stkflt: u16 = unsafe { ::std::mem::transmute(__stkflt) }; - __stkflt as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let __errsumm: u16 = unsafe { ::std::mem::transmute(__errsumm) }; - __errsumm as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let __c0: u16 = unsafe { ::std::mem::transmute(__c0) }; - __c0 as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let __c1: u16 = unsafe { ::std::mem::transmute(__c1) }; - __c1 as u64 - }); - __bindgen_bitfield_unit.set(10usize, 1u8, { - let __c2: u16 = unsafe { ::std::mem::transmute(__c2) }; - __c2 as u64 - }); - __bindgen_bitfield_unit.set(11usize, 3u8, { - let __tos: u16 = unsafe { ::std::mem::transmute(__tos) }; - __tos as u64 - }); - __bindgen_bitfield_unit.set(14usize, 1u8, { - let __c3: u16 = unsafe { ::std::mem::transmute(__c3) }; - __c3 as u64 - }); - __bindgen_bitfield_unit.set(15usize, 1u8, { - let __busy: u16 = unsafe { ::std::mem::transmute(__busy) }; - __busy as u64 - }); - __bindgen_bitfield_unit - } -} -pub type __darwin_fp_status_t = __darwin_fp_status; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mmst_reg { - pub __mmst_reg: [::std::os::raw::c_char; 10usize], - pub __mmst_rsrv: [::std::os::raw::c_char; 6usize], -} -#[test] -fn bindgen_test_layout___darwin_mmst_reg() { - assert_eq!( - ::std::mem::size_of::<__darwin_mmst_reg>(), - 16usize, - concat!("Size of: ", stringify!(__darwin_mmst_reg)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mmst_reg>(), - 1usize, - concat!("Alignment of ", stringify!(__darwin_mmst_reg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mmst_reg>())).__mmst_reg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mmst_reg), - "::", - stringify!(__mmst_reg) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mmst_reg>())).__mmst_rsrv as *const _ as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mmst_reg), - "::", - stringify!(__mmst_rsrv) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_xmm_reg { - pub __xmm_reg: [::std::os::raw::c_char; 16usize], -} -#[test] -fn bindgen_test_layout___darwin_xmm_reg() { - assert_eq!( - ::std::mem::size_of::<__darwin_xmm_reg>(), - 16usize, - concat!("Size of: ", stringify!(__darwin_xmm_reg)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_xmm_reg>(), - 1usize, - concat!("Alignment of ", stringify!(__darwin_xmm_reg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_xmm_reg>())).__xmm_reg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_xmm_reg), - "::", - stringify!(__xmm_reg) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_ymm_reg { - pub __ymm_reg: [::std::os::raw::c_char; 32usize], -} -#[test] -fn bindgen_test_layout___darwin_ymm_reg() { - assert_eq!( - ::std::mem::size_of::<__darwin_ymm_reg>(), - 32usize, - concat!("Size of: ", stringify!(__darwin_ymm_reg)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_ymm_reg>(), - 1usize, - concat!("Alignment of ", stringify!(__darwin_ymm_reg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ymm_reg>())).__ymm_reg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ymm_reg), - "::", - stringify!(__ymm_reg) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_zmm_reg { - pub __zmm_reg: [::std::os::raw::c_char; 64usize], -} -#[test] -fn bindgen_test_layout___darwin_zmm_reg() { - assert_eq!( - ::std::mem::size_of::<__darwin_zmm_reg>(), - 64usize, - concat!("Size of: ", stringify!(__darwin_zmm_reg)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_zmm_reg>(), - 1usize, - concat!("Alignment of ", stringify!(__darwin_zmm_reg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_zmm_reg>())).__zmm_reg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_zmm_reg), - "::", - stringify!(__zmm_reg) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_opmask_reg { - pub __opmask_reg: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout___darwin_opmask_reg() { - assert_eq!( - ::std::mem::size_of::<__darwin_opmask_reg>(), - 8usize, - concat!("Size of: ", stringify!(__darwin_opmask_reg)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_opmask_reg>(), - 1usize, - concat!("Alignment of ", stringify!(__darwin_opmask_reg)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_opmask_reg>())).__opmask_reg as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_opmask_reg), - "::", - stringify!(__opmask_reg) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_i386_float_state { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 224usize], - pub __fpu_reserved1: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___darwin_i386_float_state() { - assert_eq!( - ::std::mem::size_of::<__darwin_i386_float_state>(), - 524usize, - concat!("Size of: ", stringify!(__darwin_i386_float_state)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_i386_float_state>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_i386_float_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_mxcsrmask as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_rsrv4 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_float_state>())).__fpu_reserved1 as *const _ - as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_float_state), - "::", - stringify!(__fpu_reserved1) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_i386_avx_state { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 224usize], - pub __fpu_reserved1: ::std::os::raw::c_int, - pub __avx_reserved1: [::std::os::raw::c_char; 64usize], - pub __fpu_ymmh0: __darwin_xmm_reg, - pub __fpu_ymmh1: __darwin_xmm_reg, - pub __fpu_ymmh2: __darwin_xmm_reg, - pub __fpu_ymmh3: __darwin_xmm_reg, - pub __fpu_ymmh4: __darwin_xmm_reg, - pub __fpu_ymmh5: __darwin_xmm_reg, - pub __fpu_ymmh6: __darwin_xmm_reg, - pub __fpu_ymmh7: __darwin_xmm_reg, -} -#[test] -fn bindgen_test_layout___darwin_i386_avx_state() { - assert_eq!( - ::std::mem::size_of::<__darwin_i386_avx_state>(), - 716usize, - concat!("Size of: ", stringify!(__darwin_i386_avx_state)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_i386_avx_state>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_i386_avx_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_reserved as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_mxcsrmask as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_rsrv4 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_reserved1 as *const _ as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__avx_reserved1 as *const _ as usize - }, - 524usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__avx_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh0 as *const _ as usize - }, - 588usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh1 as *const _ as usize - }, - 604usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh2 as *const _ as usize - }, - 620usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh3 as *const _ as usize - }, - 636usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh4 as *const _ as usize - }, - 652usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh5 as *const _ as usize - }, - 668usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh6 as *const _ as usize - }, - 684usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx_state>())).__fpu_ymmh7 as *const _ as usize - }, - 700usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx_state), - "::", - stringify!(__fpu_ymmh7) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_i386_avx512_state { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 224usize], - pub __fpu_reserved1: ::std::os::raw::c_int, - pub __avx_reserved1: [::std::os::raw::c_char; 64usize], - pub __fpu_ymmh0: __darwin_xmm_reg, - pub __fpu_ymmh1: __darwin_xmm_reg, - pub __fpu_ymmh2: __darwin_xmm_reg, - pub __fpu_ymmh3: __darwin_xmm_reg, - pub __fpu_ymmh4: __darwin_xmm_reg, - pub __fpu_ymmh5: __darwin_xmm_reg, - pub __fpu_ymmh6: __darwin_xmm_reg, - pub __fpu_ymmh7: __darwin_xmm_reg, - pub __fpu_k0: __darwin_opmask_reg, - pub __fpu_k1: __darwin_opmask_reg, - pub __fpu_k2: __darwin_opmask_reg, - pub __fpu_k3: __darwin_opmask_reg, - pub __fpu_k4: __darwin_opmask_reg, - pub __fpu_k5: __darwin_opmask_reg, - pub __fpu_k6: __darwin_opmask_reg, - pub __fpu_k7: __darwin_opmask_reg, - pub __fpu_zmmh0: __darwin_ymm_reg, - pub __fpu_zmmh1: __darwin_ymm_reg, - pub __fpu_zmmh2: __darwin_ymm_reg, - pub __fpu_zmmh3: __darwin_ymm_reg, - pub __fpu_zmmh4: __darwin_ymm_reg, - pub __fpu_zmmh5: __darwin_ymm_reg, - pub __fpu_zmmh6: __darwin_ymm_reg, - pub __fpu_zmmh7: __darwin_ymm_reg, -} -#[test] -fn bindgen_test_layout___darwin_i386_avx512_state() { - assert_eq!( - ::std::mem::size_of::<__darwin_i386_avx512_state>(), - 1036usize, - concat!("Size of: ", stringify!(__darwin_i386_avx512_state)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_i386_avx512_state>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_i386_avx512_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_mxcsrmask as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_rsrv4 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_reserved1 as *const _ - as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__avx_reserved1 as *const _ - as usize - }, - 524usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__avx_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh0 as *const _ as usize - }, - 588usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh1 as *const _ as usize - }, - 604usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh2 as *const _ as usize - }, - 620usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh3 as *const _ as usize - }, - 636usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh4 as *const _ as usize - }, - 652usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh5 as *const _ as usize - }, - 668usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh6 as *const _ as usize - }, - 684usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_ymmh7 as *const _ as usize - }, - 700usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_ymmh7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k0 as *const _ as usize - }, - 716usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k1 as *const _ as usize - }, - 724usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k2 as *const _ as usize - }, - 732usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k3 as *const _ as usize - }, - 740usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k4 as *const _ as usize - }, - 748usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k5 as *const _ as usize - }, - 756usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k6 as *const _ as usize - }, - 764usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_k7 as *const _ as usize - }, - 772usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_k7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh0 as *const _ as usize - }, - 780usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh1 as *const _ as usize - }, - 812usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh2 as *const _ as usize - }, - 844usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh3 as *const _ as usize - }, - 876usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh4 as *const _ as usize - }, - 908usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh5 as *const _ as usize - }, - 940usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh6 as *const _ as usize - }, - 972usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_avx512_state>())).__fpu_zmmh7 as *const _ as usize - }, - 1004usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_avx512_state), - "::", - stringify!(__fpu_zmmh7) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_i386_exception_state { - pub __trapno: __uint16_t, - pub __cpu: __uint16_t, - pub __err: __uint32_t, - pub __faultvaddr: __uint32_t, -} -#[test] -fn bindgen_test_layout___darwin_i386_exception_state() { - assert_eq!( - ::std::mem::size_of::<__darwin_i386_exception_state>(), - 12usize, - concat!("Size of: ", stringify!(__darwin_i386_exception_state)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_i386_exception_state>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_i386_exception_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_exception_state>())).__trapno as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_exception_state), - "::", - stringify!(__trapno) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_exception_state>())).__cpu as *const _ as usize - }, - 2usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_exception_state), - "::", - stringify!(__cpu) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_exception_state>())).__err as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_exception_state), - "::", - stringify!(__err) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_i386_exception_state>())).__faultvaddr as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_i386_exception_state), - "::", - stringify!(__faultvaddr) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_debug_state32 { - pub __dr0: ::std::os::raw::c_uint, - pub __dr1: ::std::os::raw::c_uint, - pub __dr2: ::std::os::raw::c_uint, - pub __dr3: ::std::os::raw::c_uint, - pub __dr4: ::std::os::raw::c_uint, - pub __dr5: ::std::os::raw::c_uint, - pub __dr6: ::std::os::raw::c_uint, - pub __dr7: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___darwin_x86_debug_state32() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_debug_state32>(), - 32usize, - concat!("Size of: ", stringify!(__darwin_x86_debug_state32)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_debug_state32>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_x86_debug_state32)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr0 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr1 as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr2 as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr3 as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr4 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr5 as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr6 as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state32>())).__dr7 as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state32), - "::", - stringify!(__dr7) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __x86_pagein_state { - pub __pagein_error: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___x86_pagein_state() { - assert_eq!( - ::std::mem::size_of::<__x86_pagein_state>(), - 4usize, - concat!("Size of: ", stringify!(__x86_pagein_state)) - ); - assert_eq!( - ::std::mem::align_of::<__x86_pagein_state>(), - 4usize, - concat!("Alignment of ", stringify!(__x86_pagein_state)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__x86_pagein_state>())).__pagein_error as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__x86_pagein_state), - "::", - stringify!(__pagein_error) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_thread_state64 { - pub __rax: __uint64_t, - pub __rbx: __uint64_t, - pub __rcx: __uint64_t, - pub __rdx: __uint64_t, - pub __rdi: __uint64_t, - pub __rsi: __uint64_t, - pub __rbp: __uint64_t, - pub __rsp: __uint64_t, - pub __r8: __uint64_t, - pub __r9: __uint64_t, - pub __r10: __uint64_t, - pub __r11: __uint64_t, - pub __r12: __uint64_t, - pub __r13: __uint64_t, - pub __r14: __uint64_t, - pub __r15: __uint64_t, - pub __rip: __uint64_t, - pub __rflags: __uint64_t, - pub __cs: __uint64_t, - pub __fs: __uint64_t, - pub __gs: __uint64_t, -} -#[test] -fn bindgen_test_layout___darwin_x86_thread_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_thread_state64>(), - 168usize, - concat!("Size of: ", stringify!(__darwin_x86_thread_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_thread_state64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_x86_thread_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rax as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rax) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rbx as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rbx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rcx as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rcx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rdx as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rdx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rdi as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rdi) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rsi as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rsi) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rbp as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rbp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rsp as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rsp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r8 as *const _ as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r9 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r10 as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r11 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r12 as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r13 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r14 as *const _ as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__r15 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__r15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rip as *const _ as usize - }, - 128usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__rflags as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__rflags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__cs as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__fs as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__fs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_state64>())).__gs as *const _ as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_state64), - "::", - stringify!(__gs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_thread_full_state64 { - pub __ss64: __darwin_x86_thread_state64, - pub __ds: __uint64_t, - pub __es: __uint64_t, - pub __ss: __uint64_t, - pub __gsbase: __uint64_t, -} -#[test] -fn bindgen_test_layout___darwin_x86_thread_full_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_thread_full_state64>(), - 200usize, - concat!("Size of: ", stringify!(__darwin_x86_thread_full_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_thread_full_state64>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__darwin_x86_thread_full_state64) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_full_state64>())).__ss64 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_full_state64), - "::", - stringify!(__ss64) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_full_state64>())).__ds as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_full_state64), - "::", - stringify!(__ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_full_state64>())).__es as *const _ as usize - }, - 176usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_full_state64), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_full_state64>())).__ss as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_full_state64), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_thread_full_state64>())).__gsbase as *const _ - as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_thread_full_state64), - "::", - stringify!(__gsbase) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_float_state64 { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_xmm8: __darwin_xmm_reg, - pub __fpu_xmm9: __darwin_xmm_reg, - pub __fpu_xmm10: __darwin_xmm_reg, - pub __fpu_xmm11: __darwin_xmm_reg, - pub __fpu_xmm12: __darwin_xmm_reg, - pub __fpu_xmm13: __darwin_xmm_reg, - pub __fpu_xmm14: __darwin_xmm_reg, - pub __fpu_xmm15: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 96usize], - pub __fpu_reserved1: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___darwin_x86_float_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_float_state64>(), - 524usize, - concat!("Size of: ", stringify!(__darwin_x86_float_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_float_state64>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_x86_float_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_mxcsrmask as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm8 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm9 as *const _ as usize - }, - 312usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm10 as *const _ as usize - }, - 328usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm11 as *const _ as usize - }, - 344usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm12 as *const _ as usize - }, - 360usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm13 as *const _ as usize - }, - 376usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm14 as *const _ as usize - }, - 392usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_xmm15 as *const _ as usize - }, - 408usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_xmm15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_rsrv4 as *const _ as usize - }, - 424usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_float_state64>())).__fpu_reserved1 as *const _ - as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_float_state64), - "::", - stringify!(__fpu_reserved1) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_avx_state64 { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_xmm8: __darwin_xmm_reg, - pub __fpu_xmm9: __darwin_xmm_reg, - pub __fpu_xmm10: __darwin_xmm_reg, - pub __fpu_xmm11: __darwin_xmm_reg, - pub __fpu_xmm12: __darwin_xmm_reg, - pub __fpu_xmm13: __darwin_xmm_reg, - pub __fpu_xmm14: __darwin_xmm_reg, - pub __fpu_xmm15: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 96usize], - pub __fpu_reserved1: ::std::os::raw::c_int, - pub __avx_reserved1: [::std::os::raw::c_char; 64usize], - pub __fpu_ymmh0: __darwin_xmm_reg, - pub __fpu_ymmh1: __darwin_xmm_reg, - pub __fpu_ymmh2: __darwin_xmm_reg, - pub __fpu_ymmh3: __darwin_xmm_reg, - pub __fpu_ymmh4: __darwin_xmm_reg, - pub __fpu_ymmh5: __darwin_xmm_reg, - pub __fpu_ymmh6: __darwin_xmm_reg, - pub __fpu_ymmh7: __darwin_xmm_reg, - pub __fpu_ymmh8: __darwin_xmm_reg, - pub __fpu_ymmh9: __darwin_xmm_reg, - pub __fpu_ymmh10: __darwin_xmm_reg, - pub __fpu_ymmh11: __darwin_xmm_reg, - pub __fpu_ymmh12: __darwin_xmm_reg, - pub __fpu_ymmh13: __darwin_xmm_reg, - pub __fpu_ymmh14: __darwin_xmm_reg, - pub __fpu_ymmh15: __darwin_xmm_reg, -} -#[test] -fn bindgen_test_layout___darwin_x86_avx_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_avx_state64>(), - 844usize, - concat!("Size of: ", stringify!(__darwin_x86_avx_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_avx_state64>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_x86_avx_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_reserved as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_mxcsrmask as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm8 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm9 as *const _ as usize - }, - 312usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm10 as *const _ as usize - }, - 328usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm11 as *const _ as usize - }, - 344usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm12 as *const _ as usize - }, - 360usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm13 as *const _ as usize - }, - 376usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm14 as *const _ as usize - }, - 392usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_xmm15 as *const _ as usize - }, - 408usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_xmm15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_rsrv4 as *const _ as usize - }, - 424usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_reserved1 as *const _ - as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__avx_reserved1 as *const _ - as usize - }, - 524usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__avx_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh0 as *const _ as usize - }, - 588usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh1 as *const _ as usize - }, - 604usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh2 as *const _ as usize - }, - 620usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh3 as *const _ as usize - }, - 636usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh4 as *const _ as usize - }, - 652usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh5 as *const _ as usize - }, - 668usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh6 as *const _ as usize - }, - 684usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh7 as *const _ as usize - }, - 700usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh8 as *const _ as usize - }, - 716usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh9 as *const _ as usize - }, - 732usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh10 as *const _ as usize - }, - 748usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh11 as *const _ as usize - }, - 764usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh12 as *const _ as usize - }, - 780usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh13 as *const _ as usize - }, - 796usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh14 as *const _ as usize - }, - 812usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx_state64>())).__fpu_ymmh15 as *const _ as usize - }, - 828usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx_state64), - "::", - stringify!(__fpu_ymmh15) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_avx512_state64 { - pub __fpu_reserved: [::std::os::raw::c_int; 2usize], - pub __fpu_fcw: __darwin_fp_control, - pub __fpu_fsw: __darwin_fp_status, - pub __fpu_ftw: __uint8_t, - pub __fpu_rsrv1: __uint8_t, - pub __fpu_fop: __uint16_t, - pub __fpu_ip: __uint32_t, - pub __fpu_cs: __uint16_t, - pub __fpu_rsrv2: __uint16_t, - pub __fpu_dp: __uint32_t, - pub __fpu_ds: __uint16_t, - pub __fpu_rsrv3: __uint16_t, - pub __fpu_mxcsr: __uint32_t, - pub __fpu_mxcsrmask: __uint32_t, - pub __fpu_stmm0: __darwin_mmst_reg, - pub __fpu_stmm1: __darwin_mmst_reg, - pub __fpu_stmm2: __darwin_mmst_reg, - pub __fpu_stmm3: __darwin_mmst_reg, - pub __fpu_stmm4: __darwin_mmst_reg, - pub __fpu_stmm5: __darwin_mmst_reg, - pub __fpu_stmm6: __darwin_mmst_reg, - pub __fpu_stmm7: __darwin_mmst_reg, - pub __fpu_xmm0: __darwin_xmm_reg, - pub __fpu_xmm1: __darwin_xmm_reg, - pub __fpu_xmm2: __darwin_xmm_reg, - pub __fpu_xmm3: __darwin_xmm_reg, - pub __fpu_xmm4: __darwin_xmm_reg, - pub __fpu_xmm5: __darwin_xmm_reg, - pub __fpu_xmm6: __darwin_xmm_reg, - pub __fpu_xmm7: __darwin_xmm_reg, - pub __fpu_xmm8: __darwin_xmm_reg, - pub __fpu_xmm9: __darwin_xmm_reg, - pub __fpu_xmm10: __darwin_xmm_reg, - pub __fpu_xmm11: __darwin_xmm_reg, - pub __fpu_xmm12: __darwin_xmm_reg, - pub __fpu_xmm13: __darwin_xmm_reg, - pub __fpu_xmm14: __darwin_xmm_reg, - pub __fpu_xmm15: __darwin_xmm_reg, - pub __fpu_rsrv4: [::std::os::raw::c_char; 96usize], - pub __fpu_reserved1: ::std::os::raw::c_int, - pub __avx_reserved1: [::std::os::raw::c_char; 64usize], - pub __fpu_ymmh0: __darwin_xmm_reg, - pub __fpu_ymmh1: __darwin_xmm_reg, - pub __fpu_ymmh2: __darwin_xmm_reg, - pub __fpu_ymmh3: __darwin_xmm_reg, - pub __fpu_ymmh4: __darwin_xmm_reg, - pub __fpu_ymmh5: __darwin_xmm_reg, - pub __fpu_ymmh6: __darwin_xmm_reg, - pub __fpu_ymmh7: __darwin_xmm_reg, - pub __fpu_ymmh8: __darwin_xmm_reg, - pub __fpu_ymmh9: __darwin_xmm_reg, - pub __fpu_ymmh10: __darwin_xmm_reg, - pub __fpu_ymmh11: __darwin_xmm_reg, - pub __fpu_ymmh12: __darwin_xmm_reg, - pub __fpu_ymmh13: __darwin_xmm_reg, - pub __fpu_ymmh14: __darwin_xmm_reg, - pub __fpu_ymmh15: __darwin_xmm_reg, - pub __fpu_k0: __darwin_opmask_reg, - pub __fpu_k1: __darwin_opmask_reg, - pub __fpu_k2: __darwin_opmask_reg, - pub __fpu_k3: __darwin_opmask_reg, - pub __fpu_k4: __darwin_opmask_reg, - pub __fpu_k5: __darwin_opmask_reg, - pub __fpu_k6: __darwin_opmask_reg, - pub __fpu_k7: __darwin_opmask_reg, - pub __fpu_zmmh0: __darwin_ymm_reg, - pub __fpu_zmmh1: __darwin_ymm_reg, - pub __fpu_zmmh2: __darwin_ymm_reg, - pub __fpu_zmmh3: __darwin_ymm_reg, - pub __fpu_zmmh4: __darwin_ymm_reg, - pub __fpu_zmmh5: __darwin_ymm_reg, - pub __fpu_zmmh6: __darwin_ymm_reg, - pub __fpu_zmmh7: __darwin_ymm_reg, - pub __fpu_zmmh8: __darwin_ymm_reg, - pub __fpu_zmmh9: __darwin_ymm_reg, - pub __fpu_zmmh10: __darwin_ymm_reg, - pub __fpu_zmmh11: __darwin_ymm_reg, - pub __fpu_zmmh12: __darwin_ymm_reg, - pub __fpu_zmmh13: __darwin_ymm_reg, - pub __fpu_zmmh14: __darwin_ymm_reg, - pub __fpu_zmmh15: __darwin_ymm_reg, - pub __fpu_zmm16: __darwin_zmm_reg, - pub __fpu_zmm17: __darwin_zmm_reg, - pub __fpu_zmm18: __darwin_zmm_reg, - pub __fpu_zmm19: __darwin_zmm_reg, - pub __fpu_zmm20: __darwin_zmm_reg, - pub __fpu_zmm21: __darwin_zmm_reg, - pub __fpu_zmm22: __darwin_zmm_reg, - pub __fpu_zmm23: __darwin_zmm_reg, - pub __fpu_zmm24: __darwin_zmm_reg, - pub __fpu_zmm25: __darwin_zmm_reg, - pub __fpu_zmm26: __darwin_zmm_reg, - pub __fpu_zmm27: __darwin_zmm_reg, - pub __fpu_zmm28: __darwin_zmm_reg, - pub __fpu_zmm29: __darwin_zmm_reg, - pub __fpu_zmm30: __darwin_zmm_reg, - pub __fpu_zmm31: __darwin_zmm_reg, -} -#[test] -fn bindgen_test_layout___darwin_x86_avx512_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_avx512_state64>(), - 2444usize, - concat!("Size of: ", stringify!(__darwin_x86_avx512_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_avx512_state64>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_x86_avx512_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_fcw as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_fcw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_fsw as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_fsw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ftw as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ftw) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_rsrv1 as *const _ as usize - }, - 13usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_rsrv1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_fop as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_fop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ip as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ip) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_cs as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_cs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_rsrv2 as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_rsrv2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_dp as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_dp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ds as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ds) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_rsrv3 as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_rsrv3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_mxcsr as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_mxcsr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_mxcsrmask as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_mxcsrmask) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm0 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm1 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm2 as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm3 as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm4 as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm5 as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm6 as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_stmm7 as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_stmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm0 as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm1 as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm2 as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm3 as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm4 as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm5 as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm6 as *const _ as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm7 as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm8 as *const _ as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm9 as *const _ as usize - }, - 312usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm10 as *const _ as usize - }, - 328usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm11 as *const _ as usize - }, - 344usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm12 as *const _ as usize - }, - 360usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm13 as *const _ as usize - }, - 376usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm14 as *const _ as usize - }, - 392usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_xmm15 as *const _ as usize - }, - 408usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_xmm15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_rsrv4 as *const _ as usize - }, - 424usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_rsrv4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_reserved1 as *const _ - as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__avx_reserved1 as *const _ - as usize - }, - 524usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__avx_reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh0 as *const _ as usize - }, - 588usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh1 as *const _ as usize - }, - 604usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh2 as *const _ as usize - }, - 620usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh3 as *const _ as usize - }, - 636usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh4 as *const _ as usize - }, - 652usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh5 as *const _ as usize - }, - 668usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh6 as *const _ as usize - }, - 684usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh7 as *const _ as usize - }, - 700usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh8 as *const _ as usize - }, - 716usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh9 as *const _ as usize - }, - 732usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh10 as *const _ - as usize - }, - 748usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh11 as *const _ - as usize - }, - 764usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh12 as *const _ - as usize - }, - 780usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh13 as *const _ - as usize - }, - 796usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh14 as *const _ - as usize - }, - 812usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_ymmh15 as *const _ - as usize - }, - 828usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_ymmh15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k0 as *const _ as usize - }, - 844usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k1 as *const _ as usize - }, - 852usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k2 as *const _ as usize - }, - 860usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k3 as *const _ as usize - }, - 868usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k4 as *const _ as usize - }, - 876usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k5 as *const _ as usize - }, - 884usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k6 as *const _ as usize - }, - 892usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_k7 as *const _ as usize - }, - 900usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_k7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh0 as *const _ as usize - }, - 908usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh1 as *const _ as usize - }, - 940usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh2 as *const _ as usize - }, - 972usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh3 as *const _ as usize - }, - 1004usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh4 as *const _ as usize - }, - 1036usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh5 as *const _ as usize - }, - 1068usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh6 as *const _ as usize - }, - 1100usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh7 as *const _ as usize - }, - 1132usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh7) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh8 as *const _ as usize - }, - 1164usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh8) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh9 as *const _ as usize - }, - 1196usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh9) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh10 as *const _ - as usize - }, - 1228usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh10) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh11 as *const _ - as usize - }, - 1260usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh11) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh12 as *const _ - as usize - }, - 1292usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh12) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh13 as *const _ - as usize - }, - 1324usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh13) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh14 as *const _ - as usize - }, - 1356usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh14) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmmh15 as *const _ - as usize - }, - 1388usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmmh15) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm16 as *const _ as usize - }, - 1420usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm16) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm17 as *const _ as usize - }, - 1484usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm17) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm18 as *const _ as usize - }, - 1548usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm18) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm19 as *const _ as usize - }, - 1612usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm19) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm20 as *const _ as usize - }, - 1676usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm20) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm21 as *const _ as usize - }, - 1740usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm21) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm22 as *const _ as usize - }, - 1804usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm22) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm23 as *const _ as usize - }, - 1868usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm23) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm24 as *const _ as usize - }, - 1932usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm24) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm25 as *const _ as usize - }, - 1996usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm25) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm26 as *const _ as usize - }, - 2060usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm26) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm27 as *const _ as usize - }, - 2124usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm27) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm28 as *const _ as usize - }, - 2188usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm28) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm29 as *const _ as usize - }, - 2252usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm29) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm30 as *const _ as usize - }, - 2316usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm30) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_avx512_state64>())).__fpu_zmm31 as *const _ as usize - }, - 2380usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_avx512_state64), - "::", - stringify!(__fpu_zmm31) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_exception_state64 { - pub __trapno: __uint16_t, - pub __cpu: __uint16_t, - pub __err: __uint32_t, - pub __faultvaddr: __uint64_t, -} -#[test] -fn bindgen_test_layout___darwin_x86_exception_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_exception_state64>(), - 16usize, - concat!("Size of: ", stringify!(__darwin_x86_exception_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_exception_state64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_x86_exception_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_exception_state64>())).__trapno as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_exception_state64), - "::", - stringify!(__trapno) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_exception_state64>())).__cpu as *const _ as usize - }, - 2usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_exception_state64), - "::", - stringify!(__cpu) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_exception_state64>())).__err as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_exception_state64), - "::", - stringify!(__err) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_exception_state64>())).__faultvaddr as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_exception_state64), - "::", - stringify!(__faultvaddr) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_debug_state64 { - pub __dr0: __uint64_t, - pub __dr1: __uint64_t, - pub __dr2: __uint64_t, - pub __dr3: __uint64_t, - pub __dr4: __uint64_t, - pub __dr5: __uint64_t, - pub __dr6: __uint64_t, - pub __dr7: __uint64_t, -} -#[test] -fn bindgen_test_layout___darwin_x86_debug_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_debug_state64>(), - 64usize, - concat!("Size of: ", stringify!(__darwin_x86_debug_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_debug_state64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_x86_debug_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr0 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr1 as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr2 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr3 as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr4 as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr5 as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr5) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr6 as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr6) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_debug_state64>())).__dr7 as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_debug_state64), - "::", - stringify!(__dr7) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_x86_cpmu_state64 { - pub __ctrs: [__uint64_t; 16usize], -} -#[test] -fn bindgen_test_layout___darwin_x86_cpmu_state64() { - assert_eq!( - ::std::mem::size_of::<__darwin_x86_cpmu_state64>(), - 128usize, - concat!("Size of: ", stringify!(__darwin_x86_cpmu_state64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_x86_cpmu_state64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_x86_cpmu_state64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_x86_cpmu_state64>())).__ctrs as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_x86_cpmu_state64), - "::", - stringify!(__ctrs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext32 { - pub __es: __darwin_i386_exception_state, - pub __ss: __darwin_i386_thread_state, - pub __fs: __darwin_i386_float_state, -} -#[test] -fn bindgen_test_layout___darwin_mcontext32() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext32>(), - 600usize, - concat!("Size of: ", stringify!(__darwin_mcontext32)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext32>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_mcontext32)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext32>())).__es as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext32), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext32>())).__ss as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext32), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext32>())).__fs as *const _ as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext32), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx32 { - pub __es: __darwin_i386_exception_state, - pub __ss: __darwin_i386_thread_state, - pub __fs: __darwin_i386_avx_state, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx32() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx32>(), - 792usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx32)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx32>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_mcontext_avx32)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx32>())).__es as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx32), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx32>())).__ss as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx32), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx32>())).__fs as *const _ as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx32), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx512_32 { - pub __es: __darwin_i386_exception_state, - pub __ss: __darwin_i386_thread_state, - pub __fs: __darwin_i386_avx512_state, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx512_32() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx512_32>(), - 1112usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx512_32)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx512_32>(), - 4usize, - concat!("Alignment of ", stringify!(__darwin_mcontext_avx512_32)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_32>())).__es as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_32), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_32>())).__ss as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_32), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_32>())).__fs as *const _ as usize - }, - 76usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_32), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext64 { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_state64, - pub __fs: __darwin_x86_float_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext64() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext64>(), - 712usize, - concat!("Size of: ", stringify!(__darwin_mcontext64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_mcontext64)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64>())).__es as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64>())).__ss as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64>())).__fs as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext64_full { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_full_state64, - pub __fs: __darwin_x86_float_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext64_full() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext64_full>(), - 744usize, - concat!("Size of: ", stringify!(__darwin_mcontext64_full)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext64_full>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_mcontext64_full)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64_full>())).__es as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64_full), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64_full>())).__ss as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64_full), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext64_full>())).__fs as *const _ as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext64_full), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx64 { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_state64, - pub __fs: __darwin_x86_avx_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx64() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx64>(), - 1032usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_mcontext_avx64)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx64>())).__es as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx64>())).__ss as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_mcontext_avx64>())).__fs as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx64_full { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_full_state64, - pub __fs: __darwin_x86_avx_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx64_full() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx64_full>(), - 1064usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx64_full)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx64_full>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_mcontext_avx64_full)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx64_full>())).__es as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64_full), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx64_full>())).__ss as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64_full), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx64_full>())).__fs as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx64_full), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx512_64 { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_state64, - pub __fs: __darwin_x86_avx512_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx512_64() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx512_64>(), - 2632usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx512_64)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx512_64>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_mcontext_avx512_64)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64>())).__es as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64>())).__ss as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64>())).__fs as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64), - "::", - stringify!(__fs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_mcontext_avx512_64_full { - pub __es: __darwin_x86_exception_state64, - pub __ss: __darwin_x86_thread_full_state64, - pub __fs: __darwin_x86_avx512_state64, -} -#[test] -fn bindgen_test_layout___darwin_mcontext_avx512_64_full() { - assert_eq!( - ::std::mem::size_of::<__darwin_mcontext_avx512_64_full>(), - 2664usize, - concat!("Size of: ", stringify!(__darwin_mcontext_avx512_64_full)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_mcontext_avx512_64_full>(), - 8usize, - concat!( - "Alignment of ", - stringify!(__darwin_mcontext_avx512_64_full) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64_full>())).__es as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64_full), - "::", - stringify!(__es) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64_full>())).__ss as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64_full), - "::", - stringify!(__ss) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__darwin_mcontext_avx512_64_full>())).__fs as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(__darwin_mcontext_avx512_64_full), - "::", - stringify!(__fs) - ) - ); -} -pub type mcontext_t = *mut __darwin_mcontext64; -pub type pthread_attr_t = __darwin_pthread_attr_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_sigaltstack { - pub ss_sp: *mut ::std::os::raw::c_void, - pub ss_size: __darwin_size_t, - pub ss_flags: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___darwin_sigaltstack() { - assert_eq!( - ::std::mem::size_of::<__darwin_sigaltstack>(), - 24usize, - concat!("Size of: ", stringify!(__darwin_sigaltstack)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_sigaltstack>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_sigaltstack)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_sigaltstack>())).ss_sp as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_sigaltstack), - "::", - stringify!(ss_sp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_sigaltstack>())).ss_size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_sigaltstack), - "::", - stringify!(ss_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_sigaltstack>())).ss_flags as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_sigaltstack), - "::", - stringify!(ss_flags) - ) - ); -} -pub type stack_t = __darwin_sigaltstack; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_ucontext { - pub uc_onstack: ::std::os::raw::c_int, - pub uc_sigmask: __darwin_sigset_t, - pub uc_stack: __darwin_sigaltstack, - pub uc_link: *mut __darwin_ucontext, - pub uc_mcsize: __darwin_size_t, - pub uc_mcontext: *mut __darwin_mcontext64, -} -#[test] -fn bindgen_test_layout___darwin_ucontext() { - assert_eq!( - ::std::mem::size_of::<__darwin_ucontext>(), - 56usize, - concat!("Size of: ", stringify!(__darwin_ucontext)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_ucontext>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_ucontext)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_onstack as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_onstack) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_sigmask as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_sigmask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_stack as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_stack) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_link as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_link) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_mcsize as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_mcsize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__darwin_ucontext>())).uc_mcontext as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__darwin_ucontext), - "::", - stringify!(uc_mcontext) - ) - ); -} -pub type ucontext_t = __darwin_ucontext; -pub type sigset_t = __darwin_sigset_t; -pub type size_t = __darwin_size_t; -pub type uid_t = __darwin_uid_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigval { - pub sival_int: ::std::os::raw::c_int, - pub sival_ptr: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_sigval() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(sigval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigval)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_int as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigval), - "::", - stringify!(sival_int) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sival_ptr as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigval), - "::", - stringify!(sival_ptr) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigevent { - pub sigev_notify: ::std::os::raw::c_int, - pub sigev_signo: ::std::os::raw::c_int, - pub sigev_value: sigval, - pub sigev_notify_function: ::std::option::Option, - pub sigev_notify_attributes: *mut pthread_attr_t, -} -#[test] -fn bindgen_test_layout_sigevent() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(sigevent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigevent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_notify) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_signo as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_signo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_value as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sigev_notify_function as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_notify_function) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).sigev_notify_attributes as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(sigevent), - "::", - stringify!(sigev_notify_attributes) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __siginfo { - pub si_signo: ::std::os::raw::c_int, - pub si_errno: ::std::os::raw::c_int, - pub si_code: ::std::os::raw::c_int, - pub si_pid: pid_t, - pub si_uid: uid_t, - pub si_status: ::std::os::raw::c_int, - pub si_addr: *mut ::std::os::raw::c_void, - pub si_value: sigval, - pub si_band: ::std::os::raw::c_long, - pub __pad: [::std::os::raw::c_ulong; 7usize], -} -#[test] -fn bindgen_test_layout___siginfo() { - assert_eq!( - ::std::mem::size_of::<__siginfo>(), - 104usize, - concat!("Size of: ", stringify!(__siginfo)) - ); - assert_eq!( - ::std::mem::align_of::<__siginfo>(), - 8usize, - concat!("Alignment of ", stringify!(__siginfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_signo as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_signo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_errno as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_errno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_code as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_code) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_pid as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_pid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_uid as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_uid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_status as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_status) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_addr as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_addr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_value as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).si_band as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(si_band) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__siginfo>())).__pad as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__siginfo), - "::", - stringify!(__pad) - ) - ); -} -pub type siginfo_t = __siginfo; -#[repr(C)] -#[derive(Copy, Clone)] -pub union __sigaction_u { - pub __sa_handler: ::std::option::Option, - pub __sa_sigaction: ::std::option::Option< - unsafe extern "C" fn( - arg1: ::std::os::raw::c_int, - arg2: *mut __siginfo, - arg3: *mut ::std::os::raw::c_void, - ), - >, -} -#[test] -fn bindgen_test_layout___sigaction_u() { - assert_eq!( - ::std::mem::size_of::<__sigaction_u>(), - 8usize, - concat!("Size of: ", stringify!(__sigaction_u)) - ); - assert_eq!( - ::std::mem::align_of::<__sigaction_u>(), - 8usize, - concat!("Alignment of ", stringify!(__sigaction_u)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction_u>())).__sa_handler as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigaction_u), - "::", - stringify!(__sa_handler) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction_u>())).__sa_sigaction as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigaction_u), - "::", - stringify!(__sa_sigaction) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __sigaction { - pub __sigaction_u: __sigaction_u, - pub sa_tramp: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - arg4: *mut siginfo_t, - arg5: *mut ::std::os::raw::c_void, - ), - >, - pub sa_mask: sigset_t, - pub sa_flags: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___sigaction() { - assert_eq!( - ::std::mem::size_of::<__sigaction>(), - 24usize, - concat!("Size of: ", stringify!(__sigaction)) - ); - assert_eq!( - ::std::mem::align_of::<__sigaction>(), - 8usize, - concat!("Alignment of ", stringify!(__sigaction)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction>())).__sigaction_u as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigaction), - "::", - stringify!(__sigaction_u) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction>())).sa_tramp as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sigaction), - "::", - stringify!(sa_tramp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction>())).sa_mask as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__sigaction), - "::", - stringify!(sa_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigaction>())).sa_flags as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__sigaction), - "::", - stringify!(sa_flags) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigaction { - pub __sigaction_u: __sigaction_u, - pub sa_mask: sigset_t, - pub sa_flags: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_sigaction() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(sigaction)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigaction)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__sigaction_u as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(__sigaction_u) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_mask as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(sa_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_flags as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(sigaction), - "::", - stringify!(sa_flags) - ) - ); -} -pub type sig_t = ::std::option::Option; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sigvec { - pub sv_handler: ::std::option::Option, - pub sv_mask: ::std::os::raw::c_int, - pub sv_flags: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_sigvec() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(sigvec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigvec)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sv_handler as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigvec), - "::", - stringify!(sv_handler) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sv_mask as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigvec), - "::", - stringify!(sv_mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sv_flags as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(sigvec), - "::", - stringify!(sv_flags) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sigstack { - pub ss_sp: *mut ::std::os::raw::c_char, - pub ss_onstack: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_sigstack() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(sigstack)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigstack)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_sp as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigstack), - "::", - stringify!(ss_sp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_onstack as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(sigstack), - "::", - stringify!(ss_onstack) - ) - ); -} -extern "C" { - pub fn signal( - arg1: ::std::os::raw::c_int, - arg2: ::std::option::Option, - ) -> ::std::option::Option< - unsafe extern "C" fn( - arg1: ::std::os::raw::c_int, - arg2: ::std::option::Option, - ), - >; -} -pub type int_least8_t = i8; -pub type int_least16_t = i16; -pub type int_least32_t = i32; -pub type int_least64_t = i64; -pub type uint_least8_t = u8; -pub type uint_least16_t = u16; -pub type uint_least32_t = u32; -pub type uint_least64_t = u64; -pub type int_fast8_t = i8; -pub type int_fast16_t = i16; -pub type int_fast32_t = i32; -pub type int_fast64_t = i64; -pub type uint_fast8_t = u8; -pub type uint_fast16_t = u16; -pub type uint_fast32_t = u32; -pub type uint_fast64_t = u64; -pub type intmax_t = ::std::os::raw::c_long; -pub type uintmax_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __darwin_time_t, - pub tv_usec: __darwin_suseconds_t, -} -#[test] -fn bindgen_test_layout_timeval() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timeval)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) - ); -} -pub type rlim_t = __uint64_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage { - pub ru_utime: timeval, - pub ru_stime: timeval, - pub ru_maxrss: ::std::os::raw::c_long, - pub ru_ixrss: ::std::os::raw::c_long, - pub ru_idrss: ::std::os::raw::c_long, - pub ru_isrss: ::std::os::raw::c_long, - pub ru_minflt: ::std::os::raw::c_long, - pub ru_majflt: ::std::os::raw::c_long, - pub ru_nswap: ::std::os::raw::c_long, - pub ru_inblock: ::std::os::raw::c_long, - pub ru_oublock: ::std::os::raw::c_long, - pub ru_msgsnd: ::std::os::raw::c_long, - pub ru_msgrcv: ::std::os::raw::c_long, - pub ru_nsignals: ::std::os::raw::c_long, - pub ru_nvcsw: ::std::os::raw::c_long, - pub ru_nivcsw: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_rusage() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(rusage)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_utime as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_utime) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_stime as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_stime) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_maxrss as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_maxrss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_ixrss as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_ixrss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_idrss as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_idrss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_isrss as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_isrss) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_minflt as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_minflt) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_majflt as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_majflt) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_nswap as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_nswap) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_inblock as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_inblock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_oublock as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_oublock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_msgsnd as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_msgsnd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_msgrcv as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_msgrcv) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_nsignals as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_nsignals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_nvcsw as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_nvcsw) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ru_nivcsw as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(rusage), - "::", - stringify!(ru_nivcsw) - ) - ); -} -pub type rusage_info_t = *mut ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage_info_v0 { - pub ri_uuid: [u8; 16usize], - pub ri_user_time: u64, - pub ri_system_time: u64, - pub ri_pkg_idle_wkups: u64, - pub ri_interrupt_wkups: u64, - pub ri_pageins: u64, - pub ri_wired_size: u64, - pub ri_resident_size: u64, - pub ri_phys_footprint: u64, - pub ri_proc_start_abstime: u64, - pub ri_proc_exit_abstime: u64, -} -#[test] -fn bindgen_test_layout_rusage_info_v0() { - assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(rusage_info_v0)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage_info_v0)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_uuid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_uuid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_user_time as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_user_time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_system_time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_pkg_idle_wkups as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interrupt_wkups as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_pageins as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_pageins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_wired_size as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_wired_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_resident_size as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_resident_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_phys_footprint as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_phys_footprint) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_start_abstime as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_proc_start_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_exit_abstime as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v0), - "::", - stringify!(ri_proc_exit_abstime) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage_info_v1 { - pub ri_uuid: [u8; 16usize], - pub ri_user_time: u64, - pub ri_system_time: u64, - pub ri_pkg_idle_wkups: u64, - pub ri_interrupt_wkups: u64, - pub ri_pageins: u64, - pub ri_wired_size: u64, - pub ri_resident_size: u64, - pub ri_phys_footprint: u64, - pub ri_proc_start_abstime: u64, - pub ri_proc_exit_abstime: u64, - pub ri_child_user_time: u64, - pub ri_child_system_time: u64, - pub ri_child_pkg_idle_wkups: u64, - pub ri_child_interrupt_wkups: u64, - pub ri_child_pageins: u64, - pub ri_child_elapsed_abstime: u64, -} -#[test] -fn bindgen_test_layout_rusage_info_v1() { - assert_eq!( - ::std::mem::size_of::(), - 144usize, - concat!("Size of: ", stringify!(rusage_info_v1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage_info_v1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_uuid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_uuid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_user_time as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_user_time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_system_time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_pkg_idle_wkups as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interrupt_wkups as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_pageins as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_pageins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_wired_size as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_wired_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_resident_size as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_resident_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_phys_footprint as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_phys_footprint) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_start_abstime as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_proc_start_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_exit_abstime as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_proc_exit_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_user_time as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_user_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_system_time as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_pkg_idle_wkups as *const _ as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_interrupt_wkups as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_child_pageins as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_pageins) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_elapsed_abstime as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v1), - "::", - stringify!(ri_child_elapsed_abstime) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage_info_v2 { - pub ri_uuid: [u8; 16usize], - pub ri_user_time: u64, - pub ri_system_time: u64, - pub ri_pkg_idle_wkups: u64, - pub ri_interrupt_wkups: u64, - pub ri_pageins: u64, - pub ri_wired_size: u64, - pub ri_resident_size: u64, - pub ri_phys_footprint: u64, - pub ri_proc_start_abstime: u64, - pub ri_proc_exit_abstime: u64, - pub ri_child_user_time: u64, - pub ri_child_system_time: u64, - pub ri_child_pkg_idle_wkups: u64, - pub ri_child_interrupt_wkups: u64, - pub ri_child_pageins: u64, - pub ri_child_elapsed_abstime: u64, - pub ri_diskio_bytesread: u64, - pub ri_diskio_byteswritten: u64, -} -#[test] -fn bindgen_test_layout_rusage_info_v2() { - assert_eq!( - ::std::mem::size_of::(), - 160usize, - concat!("Size of: ", stringify!(rusage_info_v2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage_info_v2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_uuid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_uuid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_user_time as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_user_time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_system_time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_pkg_idle_wkups as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interrupt_wkups as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_pageins as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_pageins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_wired_size as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_wired_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_resident_size as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_resident_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_phys_footprint as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_phys_footprint) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_start_abstime as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_proc_start_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_exit_abstime as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_proc_exit_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_user_time as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_user_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_system_time as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_pkg_idle_wkups as *const _ as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_interrupt_wkups as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_child_pageins as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_pageins) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_elapsed_abstime as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_child_elapsed_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_bytesread as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_diskio_bytesread) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_byteswritten as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v2), - "::", - stringify!(ri_diskio_byteswritten) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage_info_v3 { - pub ri_uuid: [u8; 16usize], - pub ri_user_time: u64, - pub ri_system_time: u64, - pub ri_pkg_idle_wkups: u64, - pub ri_interrupt_wkups: u64, - pub ri_pageins: u64, - pub ri_wired_size: u64, - pub ri_resident_size: u64, - pub ri_phys_footprint: u64, - pub ri_proc_start_abstime: u64, - pub ri_proc_exit_abstime: u64, - pub ri_child_user_time: u64, - pub ri_child_system_time: u64, - pub ri_child_pkg_idle_wkups: u64, - pub ri_child_interrupt_wkups: u64, - pub ri_child_pageins: u64, - pub ri_child_elapsed_abstime: u64, - pub ri_diskio_bytesread: u64, - pub ri_diskio_byteswritten: u64, - pub ri_cpu_time_qos_default: u64, - pub ri_cpu_time_qos_maintenance: u64, - pub ri_cpu_time_qos_background: u64, - pub ri_cpu_time_qos_utility: u64, - pub ri_cpu_time_qos_legacy: u64, - pub ri_cpu_time_qos_user_initiated: u64, - pub ri_cpu_time_qos_user_interactive: u64, - pub ri_billed_system_time: u64, - pub ri_serviced_system_time: u64, -} -#[test] -fn bindgen_test_layout_rusage_info_v3() { - assert_eq!( - ::std::mem::size_of::(), - 232usize, - concat!("Size of: ", stringify!(rusage_info_v3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage_info_v3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_uuid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_uuid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_user_time as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_user_time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_system_time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_pkg_idle_wkups as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interrupt_wkups as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_pageins as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_pageins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_wired_size as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_wired_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_resident_size as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_resident_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_phys_footprint as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_phys_footprint) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_start_abstime as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_proc_start_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_exit_abstime as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_proc_exit_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_user_time as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_user_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_system_time as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_pkg_idle_wkups as *const _ as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_interrupt_wkups as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_child_pageins as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_pageins) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_elapsed_abstime as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_child_elapsed_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_bytesread as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_diskio_bytesread) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_byteswritten as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_diskio_byteswritten) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_default as *const _ as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_default) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_maintenance as *const _ - as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_maintenance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_background as *const _ - as usize - }, - 176usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_background) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_utility as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_utility) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_legacy as *const _ as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_legacy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_user_initiated as *const _ - as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_user_initiated) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_user_interactive as *const _ - as usize - }, - 208usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_cpu_time_qos_user_interactive) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_billed_system_time as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_billed_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_serviced_system_time as *const _ as usize - }, - 224usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v3), - "::", - stringify!(ri_serviced_system_time) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rusage_info_v4 { - pub ri_uuid: [u8; 16usize], - pub ri_user_time: u64, - pub ri_system_time: u64, - pub ri_pkg_idle_wkups: u64, - pub ri_interrupt_wkups: u64, - pub ri_pageins: u64, - pub ri_wired_size: u64, - pub ri_resident_size: u64, - pub ri_phys_footprint: u64, - pub ri_proc_start_abstime: u64, - pub ri_proc_exit_abstime: u64, - pub ri_child_user_time: u64, - pub ri_child_system_time: u64, - pub ri_child_pkg_idle_wkups: u64, - pub ri_child_interrupt_wkups: u64, - pub ri_child_pageins: u64, - pub ri_child_elapsed_abstime: u64, - pub ri_diskio_bytesread: u64, - pub ri_diskio_byteswritten: u64, - pub ri_cpu_time_qos_default: u64, - pub ri_cpu_time_qos_maintenance: u64, - pub ri_cpu_time_qos_background: u64, - pub ri_cpu_time_qos_utility: u64, - pub ri_cpu_time_qos_legacy: u64, - pub ri_cpu_time_qos_user_initiated: u64, - pub ri_cpu_time_qos_user_interactive: u64, - pub ri_billed_system_time: u64, - pub ri_serviced_system_time: u64, - pub ri_logical_writes: u64, - pub ri_lifetime_max_phys_footprint: u64, - pub ri_instructions: u64, - pub ri_cycles: u64, - pub ri_billed_energy: u64, - pub ri_serviced_energy: u64, - pub ri_interval_max_phys_footprint: u64, - pub ri_runnable_time: u64, -} -#[test] -fn bindgen_test_layout_rusage_info_v4() { - assert_eq!( - ::std::mem::size_of::(), - 296usize, - concat!("Size of: ", stringify!(rusage_info_v4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rusage_info_v4)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_uuid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_uuid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_user_time as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_user_time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_system_time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_pkg_idle_wkups as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interrupt_wkups as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_pageins as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_pageins) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_wired_size as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_wired_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_resident_size as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_resident_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_phys_footprint as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_phys_footprint) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_start_abstime as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_proc_start_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_proc_exit_abstime as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_proc_exit_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_user_time as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_user_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_system_time as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_pkg_idle_wkups as *const _ as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_pkg_idle_wkups) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_interrupt_wkups as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_interrupt_wkups) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_child_pageins as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_pageins) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_child_elapsed_abstime as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_child_elapsed_abstime) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_bytesread as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_diskio_bytesread) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_diskio_byteswritten as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_diskio_byteswritten) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_default as *const _ as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_default) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_maintenance as *const _ - as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_maintenance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_background as *const _ - as usize - }, - 176usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_background) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_utility as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_utility) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_legacy as *const _ as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_legacy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_user_initiated as *const _ - as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_user_initiated) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_cpu_time_qos_user_interactive as *const _ - as usize - }, - 208usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cpu_time_qos_user_interactive) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_billed_system_time as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_billed_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_serviced_system_time as *const _ as usize - }, - 224usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_serviced_system_time) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_logical_writes as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_logical_writes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_lifetime_max_phys_footprint as *const _ - as usize - }, - 240usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_lifetime_max_phys_footprint) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_instructions as *const _ as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_instructions) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_cycles as *const _ as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_cycles) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_billed_energy as *const _ as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_billed_energy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_serviced_energy as *const _ as usize - }, - 272usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_serviced_energy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ri_interval_max_phys_footprint as *const _ - as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_interval_max_phys_footprint) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ri_runnable_time as *const _ as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(rusage_info_v4), - "::", - stringify!(ri_runnable_time) - ) - ); -} -pub type rusage_info_current = rusage_info_v4; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlimit { - pub rlim_cur: rlim_t, - pub rlim_max: rlim_t, -} -#[test] -fn bindgen_test_layout_rlimit() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(rlimit)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlimit)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rlim_cur as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlimit), - "::", - stringify!(rlim_cur) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rlim_max as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlimit), - "::", - stringify!(rlim_max) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct proc_rlimit_control_wakeupmon { - pub wm_flags: u32, - pub wm_rate: i32, -} -#[test] -fn bindgen_test_layout_proc_rlimit_control_wakeupmon() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(proc_rlimit_control_wakeupmon)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(proc_rlimit_control_wakeupmon)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).wm_flags as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(proc_rlimit_control_wakeupmon), - "::", - stringify!(wm_flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).wm_rate as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(proc_rlimit_control_wakeupmon), - "::", - stringify!(wm_rate) - ) - ); -} -extern "C" { - pub fn getpriority(arg1: ::std::os::raw::c_int, arg2: id_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getiopolicy_np( - arg1: ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getrlimit(arg1: ::std::os::raw::c_int, arg2: *mut rlimit) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getrusage(arg1: ::std::os::raw::c_int, arg2: *mut rusage) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setpriority( - arg1: ::std::os::raw::c_int, - arg2: id_t, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setiopolicy_np( - arg1: ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setrlimit(arg1: ::std::os::raw::c_int, arg2: *const rlimit) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union wait { - pub w_status: ::std::os::raw::c_int, - pub w_T: wait__bindgen_ty_1, - pub w_S: wait__bindgen_ty_2, -} -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Copy, Clone)] -pub struct wait__bindgen_ty_1 { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -#[test] -fn bindgen_test_layout_wait__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(wait__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(wait__bindgen_ty_1)) - ); -} -impl wait__bindgen_ty_1 { - #[inline] - pub fn w_Termsig(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } - } - #[inline] - pub fn set_w_Termsig(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 7u8, val as u64) - } - } - #[inline] - pub fn w_Coredump(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } - } - #[inline] - pub fn set_w_Coredump(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn w_Retcode(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } - } - #[inline] - pub fn set_w_Retcode(&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 w_Filler(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } - } - #[inline] - pub fn set_w_Filler(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - w_Termsig: ::std::os::raw::c_uint, - w_Coredump: ::std::os::raw::c_uint, - w_Retcode: ::std::os::raw::c_uint, - w_Filler: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 7u8, { - let w_Termsig: u32 = unsafe { ::std::mem::transmute(w_Termsig) }; - w_Termsig as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let w_Coredump: u32 = unsafe { ::std::mem::transmute(w_Coredump) }; - w_Coredump as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let w_Retcode: u32 = unsafe { ::std::mem::transmute(w_Retcode) }; - w_Retcode as u64 - }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let w_Filler: u32 = unsafe { ::std::mem::transmute(w_Filler) }; - w_Filler as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Copy, Clone)] -pub struct wait__bindgen_ty_2 { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -#[test] -fn bindgen_test_layout_wait__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(wait__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(wait__bindgen_ty_2)) - ); -} -impl wait__bindgen_ty_2 { - #[inline] - pub fn w_Stopval(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } - } - #[inline] - pub fn set_w_Stopval(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 8u8, val as u64) - } - } - #[inline] - pub fn w_Stopsig(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } - } - #[inline] - pub fn set_w_Stopsig(&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 w_Filler(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } - } - #[inline] - pub fn set_w_Filler(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - w_Stopval: ::std::os::raw::c_uint, - w_Stopsig: ::std::os::raw::c_uint, - w_Filler: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let w_Stopval: u32 = unsafe { ::std::mem::transmute(w_Stopval) }; - w_Stopval as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let w_Stopsig: u32 = unsafe { ::std::mem::transmute(w_Stopsig) }; - w_Stopsig as u64 - }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let w_Filler: u32 = unsafe { ::std::mem::transmute(w_Filler) }; - w_Filler as u64 - }); - __bindgen_bitfield_unit - } -} -#[test] -fn bindgen_test_layout_wait() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(wait)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(wait)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w_status as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(wait), - "::", - stringify!(w_status) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w_T as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(wait), "::", stringify!(w_T)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w_S as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(wait), "::", stringify!(w_S)) - ); -} -extern "C" { - pub fn wait(arg1: *mut ::std::os::raw::c_int) -> pid_t; -} -extern "C" { - pub fn waitpid( - arg1: pid_t, - arg2: *mut ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - ) -> pid_t; -} -extern "C" { - pub fn waitid( - arg1: idtype_t, - arg2: id_t, - arg3: *mut siginfo_t, - arg4: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wait3( - arg1: *mut ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - arg3: *mut rusage, - ) -> pid_t; -} -extern "C" { - pub fn wait4( - arg1: pid_t, - arg2: *mut ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - arg4: *mut rusage, - ) -> pid_t; -} -extern "C" { - pub fn alloca(arg1: size_t) -> *mut ::std::os::raw::c_void; -} -pub type ct_rune_t = __darwin_ct_rune_t; -pub type rune_t = __darwin_rune_t; -pub type wchar_t = __darwin_wchar_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct div_t { - pub quot: ::std::os::raw::c_int, - pub rem: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_div_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub static mut __mb_cur_max: ::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( - __count: ::std::os::raw::c_ulong, - __size: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn free(arg1: *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 valloc(arg1: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn aligned_alloc(__alignment: size_t, __size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn posix_memalign( - __memptr: *mut *mut ::std::os::raw::c_void, - __alignment: size_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn abort(); -} -extern "C" { - pub fn abs(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atexit(arg1: ::std::option::Option) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atof(arg1: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn atoi(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atol(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn atoll(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn bsearch( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: ::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 div(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int) -> div_t; -} -extern "C" { - pub fn exit(arg1: ::std::os::raw::c_int); -} -extern "C" { - pub fn getenv(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn labs(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn ldiv(arg1: ::std::os::raw::c_long, arg2: ::std::os::raw::c_long) -> ldiv_t; -} -extern "C" { - pub fn llabs(arg1: ::std::os::raw::c_longlong) -> ::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 mblen(__s: *const ::std::os::raw::c_char, __n: size_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbstowcs( - arg1: *mut wchar_t, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> size_t; -} -extern "C" { - pub fn mbtowc( - arg1: *mut wchar_t, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: ::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 rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(arg1: ::std::os::raw::c_uint); -} -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 strtof( - arg1: *const ::std::os::raw::c_char, - arg2: *mut *mut ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn strtol( - __str: *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 strtold( - arg1: *const ::std::os::raw::c_char, - arg2: *mut *mut ::std::os::raw::c_char, - ) -> u128; -} -extern "C" { - pub fn strtoll( - __str: *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 strtoul( - __str: *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 strtoull( - __str: *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 system(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcstombs( - arg1: *mut ::std::os::raw::c_char, - arg2: *const wchar_t, - arg3: size_t, - ) -> size_t; -} -extern "C" { - pub fn wctomb(arg1: *mut ::std::os::raw::c_char, arg2: wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _Exit(arg1: ::std::os::raw::c_int); -} -extern "C" { - pub fn a64l(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn drand48() -> f64; -} -extern "C" { - pub fn ecvt( - arg1: f64, - arg2: ::std::os::raw::c_int, - arg3: *mut ::std::os::raw::c_int, - arg4: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn erand48(arg1: *mut ::std::os::raw::c_ushort) -> f64; -} -extern "C" { - pub fn fcvt( - arg1: f64, - arg2: ::std::os::raw::c_int, - arg3: *mut ::std::os::raw::c_int, - arg4: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn gcvt( - arg1: f64, - arg2: ::std::os::raw::c_int, - arg3: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getsubopt( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *const *mut ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn grantpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn initstate( - arg1: ::std::os::raw::c_uint, - arg2: *mut ::std::os::raw::c_char, - arg3: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn jrand48(arg1: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn l64a(arg1: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn lcong48(arg1: *mut ::std::os::raw::c_ushort); -} -extern "C" { - pub fn lrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn mktemp(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn mkstemp(arg1: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nrand48(arg1: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn posix_openpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ptsname(arg1: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ptsname_r( - fildes: ::std::os::raw::c_int, - buffer: *mut ::std::os::raw::c_char, - buflen: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putenv(arg1: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn random() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn rand_r(arg1: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}_realpath$DARWIN_EXTSN"] - pub fn realpath( - arg1: *const ::std::os::raw::c_char, - arg2: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn seed48(arg1: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; -} -extern "C" { - pub fn setenv( - __name: *const ::std::os::raw::c_char, - __value: *const ::std::os::raw::c_char, - __overwrite: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setkey(arg1: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn setstate(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn srand48(arg1: ::std::os::raw::c_long); -} -extern "C" { - pub fn srandom(arg1: ::std::os::raw::c_uint); -} -extern "C" { - pub fn unlockpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unsetenv(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -pub type dev_t = __darwin_dev_t; -pub type mode_t = __darwin_mode_t; -extern "C" { - pub fn arc4random() -> u32; -} -extern "C" { - pub fn arc4random_addrandom(arg1: *mut ::std::os::raw::c_uchar, arg2: ::std::os::raw::c_int); -} -extern "C" { - pub fn arc4random_buf(__buf: *mut ::std::os::raw::c_void, __nbytes: size_t); -} -extern "C" { - pub fn arc4random_stir(); -} -extern "C" { - pub fn arc4random_uniform(__upper_bound: u32) -> u32; -} -extern "C" { - pub fn atexit_b(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn bsearch_b( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn cgetcap( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn cgetclose() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetent( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *mut *mut ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetfirst( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetmatch( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetnext( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetnum( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetset(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetstr( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn cgetustr( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}_daemon$1050"] - pub fn daemon( - arg1: ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn devname(arg1: dev_t, arg2: mode_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn devname_r( - arg1: dev_t, - arg2: mode_t, - buf: *mut ::std::os::raw::c_char, - len: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getbsize( - arg1: *mut ::std::os::raw::c_int, - arg2: *mut ::std::os::raw::c_long, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getloadavg(arg1: *mut f64, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getprogname() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn setprogname(arg1: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn heapsort( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: ::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, - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn heapsort_b( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mergesort( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: ::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, - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mergesort_b( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn psort( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: ::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 psort_b( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn psort_r( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - arg1: *mut ::std::os::raw::c_void, - __compar: ::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, - >, - ); -} -extern "C" { - pub fn qsort_b( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - __compar: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn qsort_r( - __base: *mut ::std::os::raw::c_void, - __nel: size_t, - __width: size_t, - arg1: *mut ::std::os::raw::c_void, - __compar: ::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, - >, - ); -} -extern "C" { - pub fn radixsort( - __base: *mut *const ::std::os::raw::c_uchar, - __nel: ::std::os::raw::c_int, - __table: *const ::std::os::raw::c_uchar, - __endbyte: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rpmatch(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sradixsort( - __base: *mut *const ::std::os::raw::c_uchar, - __nel: ::std::os::raw::c_int, - __table: *const ::std::os::raw::c_uchar, - __endbyte: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sranddev(); -} -extern "C" { - pub fn srandomdev(); -} -extern "C" { - pub fn reallocf( - __ptr: *mut ::std::os::raw::c_void, - __size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn strtoq( - __str: *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( - __str: *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 static mut suboptarg: *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GuiStyleProp { - pub controlId: ::std::os::raw::c_ushort, - pub propertyId: ::std::os::raw::c_ushort, - pub propertyValue: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_GuiStyleProp() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GuiStyleProp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GuiStyleProp)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).controlId as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(controlId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyId as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyValue) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControlState { - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED = 1, - GUI_STATE_PRESSED = 2, - GUI_STATE_DISABLED = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiTextAlignment { - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER = 1, - GUI_TEXT_ALIGN_RIGHT = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControl { - DEFAULT = 0, - LABEL = 1, - BUTTON = 2, - TOGGLE = 3, - SLIDER = 4, - PROGRESSBAR = 5, - CHECKBOX = 6, - COMBOBOX = 7, - DROPDOWNBOX = 8, - TEXTBOX = 9, - VALUEBOX = 10, - SPINNER = 11, - LISTVIEW = 12, - COLORPICKER = 13, - SCROLLBAR = 14, - STATUSBAR = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiControlProperty { - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL = 1, - TEXT_COLOR_NORMAL = 2, - BORDER_COLOR_FOCUSED = 3, - BASE_COLOR_FOCUSED = 4, - TEXT_COLOR_FOCUSED = 5, - BORDER_COLOR_PRESSED = 6, - BASE_COLOR_PRESSED = 7, - TEXT_COLOR_PRESSED = 8, - BORDER_COLOR_DISABLED = 9, - BASE_COLOR_DISABLED = 10, - TEXT_COLOR_DISABLED = 11, - BORDER_WIDTH = 12, - TEXT_PADDING = 13, - TEXT_ALIGNMENT = 14, - RESERVED = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiDefaultProperty { - TEXT_SIZE = 16, - TEXT_SPACING = 17, - LINE_COLOR = 18, - BACKGROUND_COLOR = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiToggleProperty { - GROUP_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiSliderProperty { - SLIDER_WIDTH = 16, - SLIDER_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiProgressBarProperty { - PROGRESS_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiCheckBoxProperty { - CHECK_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiComboBoxProperty { - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiDropdownBoxProperty { - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiTextBoxProperty { - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING = 17, - COLOR_SELECTED_FG = 18, - COLOR_SELECTED_BG = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiSpinnerProperty { - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiScrollBarProperty { - ARROWS_SIZE = 16, - ARROWS_VISIBLE = 17, - SCROLL_SLIDER_PADDING = 18, - SCROLL_SLIDER_SIZE = 19, - SCROLL_PADDING = 20, - SCROLL_SPEED = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiScrollBarSide { - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiListViewProperty { - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING = 17, - SCROLLBAR_WIDTH = 18, - SCROLLBAR_SIDE = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiColorPickerProperty { - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH = 17, - HUEBAR_PADDING = 18, - HUEBAR_SELECTOR_HEIGHT = 19, - HUEBAR_SELECTOR_OVERFLOW = 20, -} -extern "C" { - pub fn GuiEnable(); -} -extern "C" { - pub fn GuiDisable(); -} -extern "C" { - pub fn GuiLock(); -} -extern "C" { - pub fn GuiUnlock(); -} -extern "C" { - pub fn GuiFade(alpha: f32); -} -extern "C" { - pub fn GuiSetState(state: ::std::os::raw::c_int); -} -extern "C" { - pub fn GuiGetState() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiSetFont(font: Font); -} -extern "C" { - pub fn GuiGetFont() -> Font; -} -extern "C" { - pub fn GuiSetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiGetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiEnableTooltip(); -} -extern "C" { - pub fn GuiDisableTooltip(); -} -extern "C" { - pub fn GuiSetTooltip(tooltip: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiClearTooltip(); -} -extern "C" { - pub fn GuiWindowBox(bounds: Rectangle, title: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiGroupBox(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLine(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiPanel(bounds: Rectangle); -} -extern "C" { - pub fn GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: *mut Vector2) - -> Rectangle; -} -extern "C" { - pub fn GuiLabel(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiLabelButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiImageButton( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - ) -> bool; -} -extern "C" { - pub fn GuiImageButtonEx( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - texSource: Rectangle, - ) -> bool; -} -extern "C" { - pub fn GuiToggle(bounds: Rectangle, text: *const ::std::os::raw::c_char, active: bool) -> bool; -} -extern "C" { - pub fn GuiToggleGroup( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiCheckBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - checked: bool, - ) -> bool; -} -extern "C" { - pub fn GuiComboBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiDropdownBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: *mut ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSpinner( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiValueBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBox( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBoxMulti( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSlider( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiSliderBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiProgressBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiStatusBar(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiDummyRec(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiScrollBar( - bounds: Rectangle, - value: ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiGrid(bounds: Rectangle, spacing: f32, subdivs: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GuiListView( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiListViewEx( - bounds: Rectangle, - text: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - focus: *mut ::std::os::raw::c_int, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiMessageBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiTextInputBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiColorPicker(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorPanel(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorBarAlpha(bounds: Rectangle, alpha: f32) -> f32; -} -extern "C" { - pub fn GuiColorBarHue(bounds: Rectangle, value: f32) -> f32; -} -extern "C" { - pub fn GuiLoadStyle(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLoadStyleDefault(); -} -extern "C" { - pub fn GuiIconText( - iconId: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GuiDrawIcon( - iconId: ::std::os::raw::c_int, - position: Vector2, - pixelSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn GuiGetIcons() -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiGetIconData(iconId: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiSetIconData(iconId: ::std::os::raw::c_int, data: *mut ::std::os::raw::c_uint); -} -extern "C" { - pub fn GuiSetIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiClearIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiCheckIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum guiIconName { - RICON_NONE = 0, - RICON_FOLDER_FILE_OPEN = 1, - RICON_FILE_SAVE_CLASSIC = 2, - RICON_FOLDER_OPEN = 3, - RICON_FOLDER_SAVE = 4, - RICON_FILE_OPEN = 5, - RICON_FILE_SAVE = 6, - RICON_FILE_EXPORT = 7, - RICON_FILE_NEW = 8, - RICON_FILE_DELETE = 9, - RICON_FILETYPE_TEXT = 10, - RICON_FILETYPE_AUDIO = 11, - RICON_FILETYPE_IMAGE = 12, - RICON_FILETYPE_PLAY = 13, - RICON_FILETYPE_VIDEO = 14, - RICON_FILETYPE_INFO = 15, - RICON_FILE_COPY = 16, - RICON_FILE_CUT = 17, - RICON_FILE_PASTE = 18, - RICON_CURSOR_HAND = 19, - RICON_CURSOR_POINTER = 20, - RICON_CURSOR_CLASSIC = 21, - RICON_PENCIL = 22, - RICON_PENCIL_BIG = 23, - RICON_BRUSH_CLASSIC = 24, - RICON_BRUSH_PAINTER = 25, - RICON_WATER_DROP = 26, - RICON_COLOR_PICKER = 27, - RICON_RUBBER = 28, - RICON_COLOR_BUCKET = 29, - RICON_TEXT_T = 30, - RICON_TEXT_A = 31, - RICON_SCALE = 32, - RICON_RESIZE = 33, - RICON_FILTER_POINT = 34, - RICON_FILTER_BILINEAR = 35, - RICON_CROP = 36, - RICON_CROP_ALPHA = 37, - RICON_SQUARE_TOGGLE = 38, - RICON_SYMMETRY = 39, - RICON_SYMMETRY_HORIZONTAL = 40, - RICON_SYMMETRY_VERTICAL = 41, - RICON_LENS = 42, - RICON_LENS_BIG = 43, - RICON_EYE_ON = 44, - RICON_EYE_OFF = 45, - RICON_FILTER_TOP = 46, - RICON_FILTER = 47, - RICON_TARGET_POINT = 48, - RICON_TARGET_SMALL = 49, - RICON_TARGET_BIG = 50, - RICON_TARGET_MOVE = 51, - RICON_CURSOR_MOVE = 52, - RICON_CURSOR_SCALE = 53, - RICON_CURSOR_SCALE_RIGHT = 54, - RICON_CURSOR_SCALE_LEFT = 55, - RICON_UNDO = 56, - RICON_REDO = 57, - RICON_REREDO = 58, - RICON_MUTATE = 59, - RICON_ROTATE = 60, - RICON_REPEAT = 61, - RICON_SHUFFLE = 62, - RICON_EMPTYBOX = 63, - RICON_TARGET = 64, - RICON_TARGET_SMALL_FILL = 65, - RICON_TARGET_BIG_FILL = 66, - RICON_TARGET_MOVE_FILL = 67, - RICON_CURSOR_MOVE_FILL = 68, - RICON_CURSOR_SCALE_FILL = 69, - RICON_CURSOR_SCALE_RIGHT_FILL = 70, - RICON_CURSOR_SCALE_LEFT_FILL = 71, - RICON_UNDO_FILL = 72, - RICON_REDO_FILL = 73, - RICON_REREDO_FILL = 74, - RICON_MUTATE_FILL = 75, - RICON_ROTATE_FILL = 76, - RICON_REPEAT_FILL = 77, - RICON_SHUFFLE_FILL = 78, - RICON_EMPTYBOX_SMALL = 79, - RICON_BOX = 80, - RICON_BOX_TOP = 81, - RICON_BOX_TOP_RIGHT = 82, - RICON_BOX_RIGHT = 83, - RICON_BOX_BOTTOM_RIGHT = 84, - RICON_BOX_BOTTOM = 85, - RICON_BOX_BOTTOM_LEFT = 86, - RICON_BOX_LEFT = 87, - RICON_BOX_TOP_LEFT = 88, - RICON_BOX_CENTER = 89, - RICON_BOX_CIRCLE_MASK = 90, - RICON_POT = 91, - RICON_ALPHA_MULTIPLY = 92, - RICON_ALPHA_CLEAR = 93, - RICON_DITHERING = 94, - RICON_MIPMAPS = 95, - RICON_BOX_GRID = 96, - RICON_GRID = 97, - RICON_BOX_CORNERS_SMALL = 98, - RICON_BOX_CORNERS_BIG = 99, - RICON_FOUR_BOXES = 100, - RICON_GRID_FILL = 101, - RICON_BOX_MULTISIZE = 102, - RICON_ZOOM_SMALL = 103, - RICON_ZOOM_MEDIUM = 104, - RICON_ZOOM_BIG = 105, - RICON_ZOOM_ALL = 106, - RICON_ZOOM_CENTER = 107, - RICON_BOX_DOTS_SMALL = 108, - RICON_BOX_DOTS_BIG = 109, - RICON_BOX_CONCENTRIC = 110, - RICON_BOX_GRID_BIG = 111, - RICON_OK_TICK = 112, - RICON_CROSS = 113, - RICON_ARROW_LEFT = 114, - RICON_ARROW_RIGHT = 115, - RICON_ARROW_BOTTOM = 116, - RICON_ARROW_TOP = 117, - RICON_ARROW_LEFT_FILL = 118, - RICON_ARROW_RIGHT_FILL = 119, - RICON_ARROW_BOTTOM_FILL = 120, - RICON_ARROW_TOP_FILL = 121, - RICON_AUDIO = 122, - RICON_FX = 123, - RICON_WAVE = 124, - RICON_WAVE_SINUS = 125, - RICON_WAVE_SQUARE = 126, - RICON_WAVE_TRIANGULAR = 127, - RICON_CROSS_SMALL = 128, - RICON_PLAYER_PREVIOUS = 129, - RICON_PLAYER_PLAY_BACK = 130, - RICON_PLAYER_PLAY = 131, - RICON_PLAYER_PAUSE = 132, - RICON_PLAYER_STOP = 133, - RICON_PLAYER_NEXT = 134, - RICON_PLAYER_RECORD = 135, - RICON_MAGNET = 136, - RICON_LOCK_CLOSE = 137, - RICON_LOCK_OPEN = 138, - RICON_CLOCK = 139, - RICON_TOOLS = 140, - RICON_GEAR = 141, - RICON_GEAR_BIG = 142, - RICON_BIN = 143, - RICON_HAND_POINTER = 144, - RICON_LASER = 145, - RICON_COIN = 146, - RICON_EXPLOSION = 147, - RICON_1UP = 148, - RICON_PLAYER = 149, - RICON_PLAYER_JUMP = 150, - RICON_KEY = 151, - RICON_DEMON = 152, - RICON_TEXT_POPUP = 153, - RICON_GEAR_EX = 154, - RICON_CRACK = 155, - RICON_CRACK_POINTS = 156, - RICON_STAR = 157, - RICON_DOOR = 158, - RICON_EXIT = 159, - RICON_MODE_2D = 160, - RICON_MODE_3D = 161, - RICON_CUBE = 162, - RICON_CUBE_FACE_TOP = 163, - RICON_CUBE_FACE_LEFT = 164, - RICON_CUBE_FACE_FRONT = 165, - RICON_CUBE_FACE_BOTTOM = 166, - RICON_CUBE_FACE_RIGHT = 167, - RICON_CUBE_FACE_BACK = 168, - RICON_CAMERA = 169, - RICON_SPECIAL = 170, - RICON_LINK_NET = 171, - RICON_LINK_BOXES = 172, - RICON_LINK_MULTI = 173, - RICON_LINK = 174, - RICON_LINK_BROKE = 175, - RICON_TEXT_NOTES = 176, - RICON_NOTEBOOK = 177, - RICON_SUITCASE = 178, - RICON_SUITCASE_ZIP = 179, - RICON_MAILBOX = 180, - RICON_MONITOR = 181, - RICON_PRINTER = 182, - RICON_PHOTO_CAMERA = 183, - RICON_PHOTO_CAMERA_FLASH = 184, - RICON_HOUSE = 185, - RICON_HEART = 186, - RICON_CORNER = 187, - RICON_VERTICAL_BARS = 188, - RICON_VERTICAL_BARS_FILL = 189, - RICON_LIFE_BARS = 190, - RICON_INFO = 191, - RICON_CROSSLINE = 192, - RICON_HELP = 193, - RICON_FILETYPE_ALPHA = 194, - RICON_FILETYPE_HOME = 195, - RICON_LAYERS_VISIBLE = 196, - RICON_LAYERS = 197, - RICON_WINDOW = 198, - RICON_HIDPI = 199, - RICON_200 = 200, - RICON_201 = 201, - RICON_202 = 202, - RICON_203 = 203, - RICON_204 = 204, - RICON_205 = 205, - RICON_206 = 206, - RICON_207 = 207, - RICON_208 = 208, - RICON_209 = 209, - RICON_210 = 210, - RICON_211 = 211, - RICON_212 = 212, - RICON_213 = 213, - RICON_214 = 214, - RICON_215 = 215, - RICON_216 = 216, - RICON_217 = 217, - RICON_218 = 218, - RICON_219 = 219, - RICON_220 = 220, - RICON_221 = 221, - RICON_222 = 222, - RICON_223 = 223, - RICON_224 = 224, - RICON_225 = 225, - RICON_226 = 226, - RICON_227 = 227, - RICON_228 = 228, - RICON_229 = 229, - RICON_230 = 230, - RICON_231 = 231, - RICON_232 = 232, - RICON_233 = 233, - RICON_234 = 234, - RICON_235 = 235, - RICON_236 = 236, - RICON_237 = 237, - RICON_238 = 238, - RICON_239 = 239, - RICON_240 = 240, - RICON_241 = 241, - RICON_242 = 242, - RICON_243 = 243, - RICON_244 = 244, - RICON_245 = 245, - RICON_246 = 246, - RICON_247 = 247, - RICON_248 = 248, - RICON_249 = 249, - RICON_250 = 250, - RICON_251 = 251, - RICON_252 = 252, - RICON_253 = 253, - RICON_254 = 254, - RICON_255 = 255, -} -extern "C" { - pub static mut guiIcons: [::std::os::raw::c_uint; 2048usize]; -} -extern "C" { - pub fn renameat( - arg1: ::std::os::raw::c_int, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - arg4: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renamex_np( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renameatx_np( - arg1: ::std::os::raw::c_int, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - arg4: *const ::std::os::raw::c_char, - arg5: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -pub type fpos_t = __darwin_off_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sbuf { - pub _base: *mut ::std::os::raw::c_uchar, - pub _size: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___sbuf() { - assert_eq!( - ::std::mem::size_of::<__sbuf>(), - 16usize, - concat!("Size of: ", stringify!(__sbuf)) - ); - assert_eq!( - ::std::mem::align_of::<__sbuf>(), - 8usize, - concat!("Alignment of ", stringify!(__sbuf)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sbuf>()))._base as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sbuf>()))._size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sbuf), - "::", - stringify!(_size) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sFILEX { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sFILE { - pub _p: *mut ::std::os::raw::c_uchar, - pub _r: ::std::os::raw::c_int, - pub _w: ::std::os::raw::c_int, - pub _flags: ::std::os::raw::c_short, - pub _file: ::std::os::raw::c_short, - pub _bf: __sbuf, - pub _lbfsize: ::std::os::raw::c_int, - pub _cookie: *mut ::std::os::raw::c_void, - pub _close: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, - >, - pub _read: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - pub _seek: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: fpos_t, - arg3: ::std::os::raw::c_int, - ) -> fpos_t, - >, - pub _write: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - pub _ub: __sbuf, - pub _extra: *mut __sFILEX, - pub _ur: ::std::os::raw::c_int, - pub _ubuf: [::std::os::raw::c_uchar; 3usize], - pub _nbuf: [::std::os::raw::c_uchar; 1usize], - pub _lb: __sbuf, - pub _blksize: ::std::os::raw::c_int, - pub _offset: fpos_t, -} -#[test] -fn bindgen_test_layout___sFILE() { - assert_eq!( - ::std::mem::size_of::<__sFILE>(), - 152usize, - concat!("Size of: ", stringify!(__sFILE)) - ); - assert_eq!( - ::std::mem::align_of::<__sFILE>(), - 8usize, - concat!("Alignment of ", stringify!(__sFILE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._p as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_p) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._r as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_r) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._w as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_w) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._flags as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._file as *const _ as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_file) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._bf as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_bf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._lbfsize as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lbfsize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._cookie as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_cookie) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._close as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_close) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._read as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_read) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._seek as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_seek) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._write as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_write) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._ub as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ub) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._extra as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_extra) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._ur as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ur) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._ubuf as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_ubuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._nbuf as *const _ as usize }, - 119usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_nbuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._lb as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_lb) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._blksize as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_blksize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sFILE>()))._offset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(__sFILE), - "::", - stringify!(_offset) - ) - ); -} -pub type FILE = __sFILE; -extern "C" { - pub static mut __stdinp: *mut FILE; -} -extern "C" { - pub static mut __stdoutp: *mut FILE; -} -extern "C" { - pub static mut __stderrp: *mut FILE; -} -extern "C" { - pub fn clearerr(arg1: *mut FILE); -} -extern "C" { - pub fn fclose(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn feof(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - arg1: *mut ::std::os::raw::c_char, - arg2: ::std::os::raw::c_int, - arg3: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -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 fprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputs(arg1: *const ::std::os::raw::c_char, arg2: *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, - __nitems: ::std::os::raw::c_ulong, - __stream: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn freopen( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn fscanf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseek( - arg1: *mut FILE, - arg2: ::std::os::raw::c_long, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftell(arg1: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn fwrite( - __ptr: *const ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __nitems: ::std::os::raw::c_ulong, - __stream: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn getc(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gets(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn perror(arg1: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn remove(arg1: *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 rewind(arg1: *mut FILE); -} -extern "C" { - pub fn scanf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuf(arg1: *mut FILE, arg2: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn setvbuf( - arg1: *mut FILE, - arg2: *mut ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - arg4: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tmpfile() -> *mut FILE; -} -extern "C" { - pub fn tmpnam(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ungetc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf( - arg1: *const ::std::os::raw::c_char, - arg2: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf( - arg1: *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ctermid(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fdopen(arg1: ::std::os::raw::c_int, arg2: *const ::std::os::raw::c_char) -> *mut FILE; -} -extern "C" { - pub fn fileno(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pclose(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn popen( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn __srget(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __svfscanf( - arg1: *mut FILE, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __swbuf(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn flockfile(arg1: *mut FILE); -} -extern "C" { - pub fn ftrylockfile(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn funlockfile(arg1: *mut FILE); -} -extern "C" { - pub fn getc_unlocked(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc_unlocked(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar_unlocked(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getw(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putw(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __prefix: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -pub type off_t = __darwin_off_t; -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 snprintf( - __str: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfscanf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - arg1: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vscanf( - __format: *const ::std::os::raw::c_char, - arg1: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf( - __str: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - arg1: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsscanf( - __str: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - arg1: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -pub type ssize_t = __darwin_ssize_t; -extern "C" { - pub fn dprintf( - arg1: ::std::os::raw::c_int, - arg2: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vdprintf( - arg1: ::std::os::raw::c_int, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getdelim( - __linep: *mut *mut ::std::os::raw::c_char, - __linecapp: *mut size_t, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ssize_t; -} -extern "C" { - pub fn getline( - __linep: *mut *mut ::std::os::raw::c_char, - __linecapp: *mut size_t, - __stream: *mut FILE, - ) -> ssize_t; -} -extern "C" { - pub fn fmemopen( - __buf: *mut ::std::os::raw::c_void, - __size: size_t, - __mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn open_memstream( - __bufp: *mut *mut ::std::os::raw::c_char, - __sizep: *mut size_t, - ) -> *mut FILE; -} -extern "C" { - pub static 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 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 ctermid_r(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fgetln(arg1: *mut FILE, arg2: *mut size_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fmtcheck( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn fpurge(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuffer( - arg1: *mut FILE, - arg2: *mut ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn setlinebuf(arg1: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vasprintf( - arg1: *mut *mut ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn zopen( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> *mut FILE; -} -extern "C" { - pub fn funopen( - arg1: *const ::std::os::raw::c_void, - arg2: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - arg3: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - arg4: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: fpos_t, - arg3: ::std::os::raw::c_int, - ) -> fpos_t, - >, - arg5: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, - >, - ) -> *mut FILE; -} -extern "C" { - pub fn __sprintf_chk( - arg1: *mut ::std::os::raw::c_char, - arg2: ::std::os::raw::c_int, - arg3: size_t, - arg4: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __snprintf_chk( - arg1: *mut ::std::os::raw::c_char, - arg2: size_t, - arg3: ::std::os::raw::c_int, - arg4: size_t, - arg5: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __vsprintf_chk( - arg1: *mut ::std::os::raw::c_char, - arg2: ::std::os::raw::c_int, - arg3: size_t, - arg4: *const ::std::os::raw::c_char, - arg5: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __vsnprintf_chk( - arg1: *mut ::std::os::raw::c_char, - arg2: size_t, - arg3: ::std::os::raw::c_int, - arg4: size_t, - arg5: *const ::std::os::raw::c_char, - arg6: *mut __va_list_tag, - ) -> ::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 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 memcpy( - __dst: *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( - __dst: *mut ::std::os::raw::c_void, - __src: *const ::std::os::raw::c_void, - __len: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn memset( - __b: *mut ::std::os::raw::c_void, - __c: ::std::os::raw::c_int, - __len: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn strcat( - __s1: *mut ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - ) -> *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 strcmp( - __s1: *const ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - ) -> ::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 strcpy( - __dst: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strcspn( - __s: *const ::std::os::raw::c_char, - __charset: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strerror(__errnum: ::std::os::raw::c_int) -> *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 strncat( - __s1: *mut ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_char; -} -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 strncpy( - __dst: *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 strpbrk( - __s: *const ::std::os::raw::c_char, - __charset: *const ::std::os::raw::c_char, - ) -> *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 strspn( - __s: *const ::std::os::raw::c_char, - __charset: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strstr( - __big: *const ::std::os::raw::c_char, - __little: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strtok( - __str: *mut ::std::os::raw::c_char, - __sep: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strxfrm( - __s1: *mut ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strtok_r( - __str: *mut ::std::os::raw::c_char, - __sep: *const ::std::os::raw::c_char, - __lasts: *mut *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strerror_r( - __errnum: ::std::os::raw::c_int, - __strerrbuf: *mut ::std::os::raw::c_char, - __buflen: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strdup(__s1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn memccpy( - __dst: *mut ::std::os::raw::c_void, - __src: *const ::std::os::raw::c_void, - __c: ::std::os::raw::c_int, - __n: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn stpcpy( - __dst: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn stpncpy( - __dst: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - __n: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strndup(__s1: *const ::std::os::raw::c_char, __n: size_t) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strnlen(__s1: *const ::std::os::raw::c_char, __n: size_t) -> size_t; -} -extern "C" { - pub fn strsignal(__sig: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn memmem( - __big: *const ::std::os::raw::c_void, - __big_len: size_t, - __little: *const ::std::os::raw::c_void, - __little_len: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn memset_pattern4( - __b: *mut ::std::os::raw::c_void, - __pattern4: *const ::std::os::raw::c_void, - __len: size_t, - ); -} -extern "C" { - pub fn memset_pattern8( - __b: *mut ::std::os::raw::c_void, - __pattern8: *const ::std::os::raw::c_void, - __len: size_t, - ); -} -extern "C" { - pub fn memset_pattern16( - __b: *mut ::std::os::raw::c_void, - __pattern16: *const ::std::os::raw::c_void, - __len: size_t, - ); -} -extern "C" { - pub fn strcasestr( - __big: *const ::std::os::raw::c_char, - __little: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strnstr( - __big: *const ::std::os::raw::c_char, - __little: *const ::std::os::raw::c_char, - __len: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strlcat( - __dst: *mut ::std::os::raw::c_char, - __source: *const ::std::os::raw::c_char, - __size: size_t, - ) -> size_t; -} -extern "C" { - pub fn strlcpy( - __dst: *mut ::std::os::raw::c_char, - __source: *const ::std::os::raw::c_char, - __size: size_t, - ) -> size_t; -} -extern "C" { - pub fn strmode(__mode: ::std::os::raw::c_int, __bp: *mut ::std::os::raw::c_char); -} -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 swab( - arg1: *const ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - arg3: ssize_t, - ); -} -extern "C" { - pub fn timingsafe_bcmp( - __b1: *const ::std::os::raw::c_void, - __b2: *const ::std::os::raw::c_void, - __len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn bcmp( - arg1: *const ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - arg3: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn bcopy( - arg1: *const ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - arg3: size_t, - ); -} -extern "C" { - pub fn bzero(arg1: *mut ::std::os::raw::c_void, arg2: size_t); -} -extern "C" { - pub fn index( - arg1: *const ::std::os::raw::c_char, - arg2: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn rindex( - arg1: *const ::std::os::raw::c_char, - arg2: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ffs(arg1: ::std::os::raw::c_int) -> ::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 strncasecmp( - arg1: *const ::std::os::raw::c_char, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ffsl(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ffsll(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fls(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn flsl(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn flsll(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; -} -pub type float_t = f32; -pub type double_t = f64; -extern "C" { - pub fn __math_errhandling() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __fpclassifyf(arg1: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __fpclassifyd(arg1: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __fpclassifyl(arg1: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosf(arg1: f32) -> f32; -} -extern "C" { - pub fn acos(arg1: f64) -> f64; -} -extern "C" { - pub fn acosl(arg1: u128) -> u128; -} -extern "C" { - pub fn asinf(arg1: f32) -> f32; -} -extern "C" { - pub fn asin(arg1: f64) -> f64; -} -extern "C" { - pub fn asinl(arg1: u128) -> u128; -} -extern "C" { - pub fn atanf(arg1: f32) -> f32; -} -extern "C" { - pub fn atan(arg1: f64) -> f64; -} -extern "C" { - pub fn atanl(arg1: u128) -> u128; -} -extern "C" { - pub fn atan2f(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn atan2(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn atan2l(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn cosf(arg1: f32) -> f32; -} -extern "C" { - pub fn cos(arg1: f64) -> f64; -} -extern "C" { - pub fn cosl(arg1: u128) -> u128; -} -extern "C" { - pub fn sinf(arg1: f32) -> f32; -} -extern "C" { - pub fn sin(arg1: f64) -> f64; -} -extern "C" { - pub fn sinl(arg1: u128) -> u128; -} -extern "C" { - pub fn tanf(arg1: f32) -> f32; -} -extern "C" { - pub fn tan(arg1: f64) -> f64; -} -extern "C" { - pub fn tanl(arg1: u128) -> u128; -} -extern "C" { - pub fn acoshf(arg1: f32) -> f32; -} -extern "C" { - pub fn acosh(arg1: f64) -> f64; -} -extern "C" { - pub fn acoshl(arg1: u128) -> u128; -} -extern "C" { - pub fn asinhf(arg1: f32) -> f32; -} -extern "C" { - pub fn asinh(arg1: f64) -> f64; -} -extern "C" { - pub fn asinhl(arg1: u128) -> u128; -} -extern "C" { - pub fn atanhf(arg1: f32) -> f32; -} -extern "C" { - pub fn atanh(arg1: f64) -> f64; -} -extern "C" { - pub fn atanhl(arg1: u128) -> u128; -} -extern "C" { - pub fn coshf(arg1: f32) -> f32; -} -extern "C" { - pub fn cosh(arg1: f64) -> f64; -} -extern "C" { - pub fn coshl(arg1: u128) -> u128; -} -extern "C" { - pub fn sinhf(arg1: f32) -> f32; -} -extern "C" { - pub fn sinh(arg1: f64) -> f64; -} -extern "C" { - pub fn sinhl(arg1: u128) -> u128; -} -extern "C" { - pub fn tanhf(arg1: f32) -> f32; -} -extern "C" { - pub fn tanh(arg1: f64) -> f64; -} -extern "C" { - pub fn tanhl(arg1: u128) -> u128; -} -extern "C" { - pub fn expf(arg1: f32) -> f32; -} -extern "C" { - pub fn exp(arg1: f64) -> f64; -} -extern "C" { - pub fn expl(arg1: u128) -> u128; -} -extern "C" { - pub fn exp2f(arg1: f32) -> f32; -} -extern "C" { - pub fn exp2(arg1: f64) -> f64; -} -extern "C" { - pub fn exp2l(arg1: u128) -> u128; -} -extern "C" { - pub fn expm1f(arg1: f32) -> f32; -} -extern "C" { - pub fn expm1(arg1: f64) -> f64; -} -extern "C" { - pub fn expm1l(arg1: u128) -> u128; -} -extern "C" { - pub fn logf(arg1: f32) -> f32; -} -extern "C" { - pub fn log(arg1: f64) -> f64; -} -extern "C" { - pub fn logl(arg1: u128) -> u128; -} -extern "C" { - pub fn log10f(arg1: f32) -> f32; -} -extern "C" { - pub fn log10(arg1: f64) -> f64; -} -extern "C" { - pub fn log10l(arg1: u128) -> u128; -} -extern "C" { - pub fn log2f(arg1: f32) -> f32; -} -extern "C" { - pub fn log2(arg1: f64) -> f64; -} -extern "C" { - pub fn log2l(arg1: u128) -> u128; -} -extern "C" { - pub fn log1pf(arg1: f32) -> f32; -} -extern "C" { - pub fn log1p(arg1: f64) -> f64; -} -extern "C" { - pub fn log1pl(arg1: u128) -> u128; -} -extern "C" { - pub fn logbf(arg1: f32) -> f32; -} -extern "C" { - pub fn logb(arg1: f64) -> f64; -} -extern "C" { - pub fn logbl(arg1: u128) -> u128; -} -extern "C" { - pub fn modff(arg1: f32, arg2: *mut f32) -> f32; -} -extern "C" { - pub fn modf(arg1: f64, arg2: *mut f64) -> f64; -} -extern "C" { - pub fn modfl(arg1: u128, arg2: *mut u128) -> u128; -} -extern "C" { - pub fn ldexpf(arg1: f32, arg2: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ldexp(arg1: f64, arg2: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ldexpl(arg1: u128, arg2: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn frexpf(arg1: f32, arg2: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn frexp(arg1: f64, arg2: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn frexpl(arg1: u128, arg2: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn ilogbf(arg1: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ilogb(arg1: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ilogbl(arg1: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalbnf(arg1: f32, arg2: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn scalbn(arg1: f64, arg2: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn scalbnl(arg1: u128, arg2: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn scalblnf(arg1: f32, arg2: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn scalbln(arg1: f64, arg2: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn scalblnl(arg1: u128, arg2: ::std::os::raw::c_long) -> u128; -} -extern "C" { - pub fn fabsf(arg1: f32) -> f32; -} -extern "C" { - pub fn fabs(arg1: f64) -> f64; -} -extern "C" { - pub fn fabsl(arg1: u128) -> u128; -} -extern "C" { - pub fn cbrtf(arg1: f32) -> f32; -} -extern "C" { - pub fn cbrt(arg1: f64) -> f64; -} -extern "C" { - pub fn cbrtl(arg1: u128) -> u128; -} -extern "C" { - pub fn hypotf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn hypot(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn hypotl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn powf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn pow(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn powl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn sqrtf(arg1: f32) -> f32; -} -extern "C" { - pub fn sqrt(arg1: f64) -> f64; -} -extern "C" { - pub fn sqrtl(arg1: u128) -> u128; -} -extern "C" { - pub fn erff(arg1: f32) -> f32; -} -extern "C" { - pub fn erf(arg1: f64) -> f64; -} -extern "C" { - pub fn erfl(arg1: u128) -> u128; -} -extern "C" { - pub fn erfcf(arg1: f32) -> f32; -} -extern "C" { - pub fn erfc(arg1: f64) -> f64; -} -extern "C" { - pub fn erfcl(arg1: u128) -> u128; -} -extern "C" { - pub fn lgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn lgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn lgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn tgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn tgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn tgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn ceilf(arg1: f32) -> f32; -} -extern "C" { - pub fn ceil(arg1: f64) -> f64; -} -extern "C" { - pub fn ceill(arg1: u128) -> u128; -} -extern "C" { - pub fn floorf(arg1: f32) -> f32; -} -extern "C" { - pub fn floor(arg1: f64) -> f64; -} -extern "C" { - pub fn floorl(arg1: u128) -> u128; -} -extern "C" { - pub fn nearbyintf(arg1: f32) -> f32; -} -extern "C" { - pub fn nearbyint(arg1: f64) -> f64; -} -extern "C" { - pub fn nearbyintl(arg1: u128) -> u128; -} -extern "C" { - pub fn rintf(arg1: f32) -> f32; -} -extern "C" { - pub fn rint(arg1: f64) -> f64; -} -extern "C" { - pub fn rintl(arg1: u128) -> u128; -} -extern "C" { - pub fn lrintf(arg1: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lrint(arg1: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lrintl(arg1: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn roundf(arg1: f32) -> f32; -} -extern "C" { - pub fn round(arg1: f64) -> f64; -} -extern "C" { - pub fn roundl(arg1: u128) -> u128; -} -extern "C" { - pub fn lroundf(arg1: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lround(arg1: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lroundl(arg1: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrintf(arg1: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llrint(arg1: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llrintl(arg1: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llroundf(arg1: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llround(arg1: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llroundl(arg1: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn truncf(arg1: f32) -> f32; -} -extern "C" { - pub fn trunc(arg1: f64) -> f64; -} -extern "C" { - pub fn truncl(arg1: u128) -> u128; -} -extern "C" { - pub fn fmodf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn fmod(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn fmodl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn remainderf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn remainder(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn remainderl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn remquof(arg1: f32, arg2: f32, arg3: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn remquo(arg1: f64, arg2: f64, arg3: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn remquol(arg1: u128, arg2: u128, arg3: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn copysignf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn copysign(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn copysignl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn nanf(arg1: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn nan(arg1: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn nanl(arg1: *const ::std::os::raw::c_char) -> u128; -} -extern "C" { - pub fn nextafterf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn nextafter(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn nextafterl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn nexttoward(arg1: f64, arg2: u128) -> f64; -} -extern "C" { - pub fn nexttowardf(arg1: f32, arg2: u128) -> f32; -} -extern "C" { - pub fn nexttowardl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn fdimf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn fdim(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn fdiml(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn fmaxf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn fmax(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn fmaxl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn fminf(arg1: f32, arg2: f32) -> f32; -} -extern "C" { - pub fn fmin(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn fminl(arg1: u128, arg2: u128) -> u128; -} -extern "C" { - pub fn fmaf(arg1: f32, arg2: f32, arg3: f32) -> f32; -} -extern "C" { - pub fn fma(arg1: f64, arg2: f64, arg3: f64) -> f64; -} -extern "C" { - pub fn fmal(arg1: u128, arg2: u128, arg3: u128) -> u128; -} -extern "C" { - pub fn __inff() -> f32; -} -extern "C" { - pub fn __inf() -> f64; -} -extern "C" { - pub fn __infl() -> u128; -} -extern "C" { - pub fn __nan() -> f32; -} -extern "C" { - pub fn __exp10f(arg1: f32) -> f32; -} -extern "C" { - pub fn __exp10(arg1: f64) -> f64; -} -extern "C" { - pub fn __cospif(arg1: f32) -> f32; -} -extern "C" { - pub fn __cospi(arg1: f64) -> f64; -} -extern "C" { - pub fn __sinpif(arg1: f32) -> f32; -} -extern "C" { - pub fn __sinpi(arg1: f64) -> f64; -} -extern "C" { - pub fn __tanpif(arg1: f32) -> f32; -} -extern "C" { - pub fn __tanpi(arg1: f64) -> f64; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __float2 { - pub __sinval: f32, - pub __cosval: f32, -} -#[test] -fn bindgen_test_layout___float2() { - assert_eq!( - ::std::mem::size_of::<__float2>(), - 8usize, - concat!("Size of: ", stringify!(__float2)) - ); - assert_eq!( - ::std::mem::align_of::<__float2>(), - 4usize, - concat!("Alignment of ", stringify!(__float2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__float2>())).__sinval as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__float2), - "::", - stringify!(__sinval) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__float2>())).__cosval as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__float2), - "::", - stringify!(__cosval) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __double2 { - pub __sinval: f64, - pub __cosval: f64, -} -#[test] -fn bindgen_test_layout___double2() { - assert_eq!( - ::std::mem::size_of::<__double2>(), - 16usize, - concat!("Size of: ", stringify!(__double2)) - ); - assert_eq!( - ::std::mem::align_of::<__double2>(), - 8usize, - concat!("Alignment of ", stringify!(__double2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__double2>())).__sinval as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__double2), - "::", - stringify!(__sinval) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__double2>())).__cosval as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__double2), - "::", - stringify!(__cosval) - ) - ); -} -extern "C" { - pub fn __sincosf_stret(arg1: f32) -> __float2; -} -extern "C" { - pub fn __sincos_stret(arg1: f64) -> __double2; -} -extern "C" { - pub fn __sincospif_stret(arg1: f32) -> __float2; -} -extern "C" { - pub fn __sincospi_stret(arg1: f64) -> __double2; -} -extern "C" { - pub fn j0(arg1: f64) -> f64; -} -extern "C" { - pub fn j1(arg1: f64) -> f64; -} -extern "C" { - pub fn jn(arg1: ::std::os::raw::c_int, arg2: f64) -> f64; -} -extern "C" { - pub fn y0(arg1: f64) -> f64; -} -extern "C" { - pub fn y1(arg1: f64) -> f64; -} -extern "C" { - pub fn yn(arg1: ::std::os::raw::c_int, arg2: f64) -> f64; -} -extern "C" { - pub fn scalb(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub static mut signgam: ::std::os::raw::c_int; -} -extern "C" { - pub fn rinttol(arg1: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn roundtol(arg1: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn drem(arg1: f64, arg2: f64) -> f64; -} -extern "C" { - pub fn finite(arg1: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gamma(arg1: f64) -> f64; -} -extern "C" { - pub fn significand(arg1: f64) -> f64; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct exception { - pub type_: ::std::os::raw::c_int, - pub name: *mut ::std::os::raw::c_char, - pub arg1: f64, - pub arg2: f64, - pub retval: f64, -} -#[test] -fn bindgen_test_layout_exception() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(exception)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(exception)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(exception), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(exception), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).arg1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(exception), - "::", - stringify!(arg1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).arg2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(exception), - "::", - stringify!(arg2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).retval as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(exception), - "::", - stringify!(retval) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum GuiPropertyElement { - BORDER = 0, - BASE = 1, - TEXT = 2, - OTHER = 3, -} -extern "C" { - pub static mut guiState: GuiControlState; -} -extern "C" { - pub static mut guiFont: Font; -} -pub const guiLocked: bool = false; -pub const guiAlpha: f32 = 1.0; -extern "C" { - pub static mut guiStyle: [::std::os::raw::c_uint; 384usize]; -} -pub const guiStyleLoaded: bool = false; -extern "C" { - pub static mut guiTooltip: *const ::std::os::raw::c_char; -} -pub const guiTooltipEnabled: bool = true; -extern "C" { - pub fn GuiSliderPro( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - sliderWidth: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn GuiColorPanelEx(bounds: Rectangle, color: Color, hue: f32) -> Color; -} -extern "C" { - pub fn GuiLoadIcons( - fileName: *const ::std::os::raw::c_char, - loadIconsName: bool, - ) -> *mut *mut ::std::os::raw::c_char; -} -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, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/raylib-sys/bindings_web.rs b/raylib-sys/bindings_web.rs deleted file mode 100644 index 4b46d3b9..00000000 --- a/raylib-sys/bindings_web.rs +++ /dev/null @@ -1,15977 +0,0 @@ -/* automatically generated by rust-bindgen 0.55.1 */ - -pub const __GNUC_VA_LIST: u32 = 1; -pub const PI: f64 = 3.141592653589793; -pub const DEG2RAD: f64 = 0.017453292519943295; -pub const RAD2DEG: f64 = 57.29577951308232; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; -pub const _MATH_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: 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 = 31; -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 __LONG_DOUBLE_USES_FLOAT128: u32 = 0; -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_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: 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 __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_LIBM_SIMD_DECL_STUBS_H: u32 = 1; -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 __FP_LOGB0_IS_MIN: u32 = 1; -pub const __FP_LOGBNAN_IS_MIN: u32 = 1; -pub const FP_ILOGB0: i32 = -2147483648; -pub const FP_ILOGBNAN: i32 = -2147483648; -pub const __MATH_DECLARING_DOUBLE: u32 = 1; -pub const __MATH_DECLARING_FLOATN: u32 = 0; -pub const __MATH_DECLARE_LDOUBLE: u32 = 1; -pub const FP_NAN: u32 = 0; -pub const FP_INFINITE: u32 = 1; -pub const FP_ZERO: u32 = 2; -pub const FP_SUBNORMAL: u32 = 3; -pub const FP_NORMAL: u32 = 4; -pub const MATH_ERRNO: u32 = 1; -pub const MATH_ERREXCEPT: u32 = 2; -pub const math_errhandling: u32 = 3; -pub const DEFAULT_BATCH_BUFFER_ELEMENTS: u32 = 8192; -pub const DEFAULT_BATCH_BUFFERS: u32 = 1; -pub const DEFAULT_BATCH_DRAWCALLS: u32 = 256; -pub const MAX_BATCH_ACTIVE_TEXTURES: u32 = 4; -pub const MAX_MATRIX_STACK_SIZE: u32 = 32; -pub const MAX_SHADER_LOCATIONS: u32 = 32; -pub const MAX_MATERIAL_MAPS: u32 = 12; -pub const RL_CULL_DISTANCE_NEAR: f64 = 0.01; -pub const RL_CULL_DISTANCE_FAR: f64 = 1000.0; -pub const RL_TEXTURE_WRAP_S: u32 = 10242; -pub const RL_TEXTURE_WRAP_T: u32 = 10243; -pub const RL_TEXTURE_MAG_FILTER: u32 = 10240; -pub const RL_TEXTURE_MIN_FILTER: u32 = 10241; -pub const RL_TEXTURE_ANISOTROPIC_FILTER: u32 = 12288; -pub const RL_FILTER_NEAREST: u32 = 9728; -pub const RL_FILTER_LINEAR: u32 = 9729; -pub const RL_FILTER_MIP_NEAREST: u32 = 9984; -pub const RL_FILTER_NEAREST_MIP_LINEAR: u32 = 9986; -pub const RL_FILTER_LINEAR_MIP_NEAREST: u32 = 9985; -pub const RL_FILTER_MIP_LINEAR: u32 = 9987; -pub const RL_WRAP_REPEAT: u32 = 10497; -pub const RL_WRAP_CLAMP: u32 = 33071; -pub const RL_WRAP_MIRROR_REPEAT: u32 = 33648; -pub const RL_WRAP_MIRROR_CLAMP: u32 = 34626; -pub const RL_MODELVIEW: u32 = 5888; -pub const RL_PROJECTION: u32 = 5889; -pub const RL_TEXTURE: u32 = 5890; -pub const RL_LINES: u32 = 1; -pub const RL_TRIANGLES: u32 = 4; -pub const RL_QUADS: u32 = 7; -pub const RAYLIB_VERSION: &'static [u8; 4usize] = b"3.0\0"; -pub const SUPPORT_CAMERA_SYSTEM: u32 = 1; -pub const SUPPORT_GESTURES_SYSTEM: u32 = 1; -pub const SUPPORT_MOUSE_GESTURES: u32 = 1; -pub const SUPPORT_SSH_KEYBOARD_RPI: u32 = 1; -pub const SUPPORT_MOUSE_CURSOR_RPI: u32 = 1; -pub const SUPPORT_SCREEN_CAPTURE: u32 = 1; -pub const SUPPORT_COMPRESSION_API: u32 = 1; -pub const SUPPORT_DATA_STORAGE: u32 = 1; -pub const SUPPORT_VR_SIMULATOR: u32 = 1; -pub const SUPPORT_FONT_TEXTURE: u32 = 1; -pub const SUPPORT_QUADS_DRAW_MODE: u32 = 1; -pub const SUPPORT_FILEFORMAT_PNG: u32 = 1; -pub const SUPPORT_FILEFORMAT_BMP: u32 = 1; -pub const SUPPORT_FILEFORMAT_TGA: u32 = 1; -pub const SUPPORT_FILEFORMAT_GIF: u32 = 1; -pub const SUPPORT_FILEFORMAT_DDS: u32 = 1; -pub const SUPPORT_FILEFORMAT_HDR: u32 = 1; -pub const SUPPORT_FILEFORMAT_KTX: u32 = 1; -pub const SUPPORT_FILEFORMAT_ASTC: u32 = 1; -pub const SUPPORT_IMAGE_EXPORT: u32 = 1; -pub const SUPPORT_IMAGE_MANIPULATION: u32 = 1; -pub const SUPPORT_IMAGE_GENERATION: u32 = 1; -pub const SUPPORT_DEFAULT_FONT: u32 = 1; -pub const SUPPORT_FILEFORMAT_FNT: u32 = 1; -pub const SUPPORT_FILEFORMAT_TTF: u32 = 1; -pub const SUPPORT_FILEFORMAT_OBJ: u32 = 1; -pub const SUPPORT_FILEFORMAT_MTL: u32 = 1; -pub const SUPPORT_FILEFORMAT_IQM: u32 = 1; -pub const SUPPORT_FILEFORMAT_GLTF: u32 = 1; -pub const SUPPORT_MESH_GENERATION: u32 = 1; -pub const SUPPORT_FILEFORMAT_WAV: u32 = 1; -pub const SUPPORT_FILEFORMAT_OGG: u32 = 1; -pub const SUPPORT_FILEFORMAT_XM: u32 = 1; -pub const SUPPORT_FILEFORMAT_MOD: u32 = 1; -pub const SUPPORT_FILEFORMAT_MP3: u32 = 1; -pub const SUPPORT_TRACELOG: u32 = 1; -pub const _STDLIB_H: u32 = 1; -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 _STRING_H: u32 = 1; -pub const _INTTYPES_H: u32 = 1; -pub const _STDINT_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 ____gwchar_t_defined: u32 = 1; -pub const __PRI64_PREFIX: &'static [u8; 2usize] = b"l\0"; -pub const __PRIPTR_PREFIX: &'static [u8; 2usize] = b"l\0"; -pub const PRId8: &'static [u8; 2usize] = b"d\0"; -pub const PRId16: &'static [u8; 2usize] = b"d\0"; -pub const PRId32: &'static [u8; 2usize] = b"d\0"; -pub const PRId64: &'static [u8; 3usize] = b"ld\0"; -pub const PRIdLEAST8: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &'static [u8; 3usize] = b"ld\0"; -pub const PRIdFAST8: &'static [u8; 2usize] = b"d\0"; -pub const PRIdFAST16: &'static [u8; 3usize] = b"ld\0"; -pub const PRIdFAST32: &'static [u8; 3usize] = b"ld\0"; -pub const PRIdFAST64: &'static [u8; 3usize] = b"ld\0"; -pub const PRIi8: &'static [u8; 2usize] = b"i\0"; -pub const PRIi16: &'static [u8; 2usize] = b"i\0"; -pub const PRIi32: &'static [u8; 2usize] = b"i\0"; -pub const PRIi64: &'static [u8; 3usize] = b"li\0"; -pub const PRIiLEAST8: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &'static [u8; 3usize] = b"li\0"; -pub const PRIiFAST8: &'static [u8; 2usize] = b"i\0"; -pub const PRIiFAST16: &'static [u8; 3usize] = b"li\0"; -pub const PRIiFAST32: &'static [u8; 3usize] = b"li\0"; -pub const PRIiFAST64: &'static [u8; 3usize] = b"li\0"; -pub const PRIo8: &'static [u8; 2usize] = b"o\0"; -pub const PRIo16: &'static [u8; 2usize] = b"o\0"; -pub const PRIo32: &'static [u8; 2usize] = b"o\0"; -pub const PRIo64: &'static [u8; 3usize] = b"lo\0"; -pub const PRIoLEAST8: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &'static [u8; 3usize] = b"lo\0"; -pub const PRIoFAST8: &'static [u8; 2usize] = b"o\0"; -pub const PRIoFAST16: &'static [u8; 3usize] = b"lo\0"; -pub const PRIoFAST32: &'static [u8; 3usize] = b"lo\0"; -pub const PRIoFAST64: &'static [u8; 3usize] = b"lo\0"; -pub const PRIu8: &'static [u8; 2usize] = b"u\0"; -pub const PRIu16: &'static [u8; 2usize] = b"u\0"; -pub const PRIu32: &'static [u8; 2usize] = b"u\0"; -pub const PRIu64: &'static [u8; 3usize] = b"lu\0"; -pub const PRIuLEAST8: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &'static [u8; 3usize] = b"lu\0"; -pub const PRIuFAST8: &'static [u8; 2usize] = b"u\0"; -pub const PRIuFAST16: &'static [u8; 3usize] = b"lu\0"; -pub const PRIuFAST32: &'static [u8; 3usize] = b"lu\0"; -pub const PRIuFAST64: &'static [u8; 3usize] = b"lu\0"; -pub const PRIx8: &'static [u8; 2usize] = b"x\0"; -pub const PRIx16: &'static [u8; 2usize] = b"x\0"; -pub const PRIx32: &'static [u8; 2usize] = b"x\0"; -pub const PRIx64: &'static [u8; 3usize] = b"lx\0"; -pub const PRIxLEAST8: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &'static [u8; 3usize] = b"lx\0"; -pub const PRIxFAST8: &'static [u8; 2usize] = b"x\0"; -pub const PRIxFAST16: &'static [u8; 3usize] = b"lx\0"; -pub const PRIxFAST32: &'static [u8; 3usize] = b"lx\0"; -pub const PRIxFAST64: &'static [u8; 3usize] = b"lx\0"; -pub const PRIX8: &'static [u8; 2usize] = b"X\0"; -pub const PRIX16: &'static [u8; 2usize] = b"X\0"; -pub const PRIX32: &'static [u8; 2usize] = b"X\0"; -pub const PRIX64: &'static [u8; 3usize] = b"lX\0"; -pub const PRIXLEAST8: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &'static [u8; 3usize] = b"lX\0"; -pub const PRIXFAST8: &'static [u8; 2usize] = b"X\0"; -pub const PRIXFAST16: &'static [u8; 3usize] = b"lX\0"; -pub const PRIXFAST32: &'static [u8; 3usize] = b"lX\0"; -pub const PRIXFAST64: &'static [u8; 3usize] = b"lX\0"; -pub const PRIdMAX: &'static [u8; 3usize] = b"ld\0"; -pub const PRIiMAX: &'static [u8; 3usize] = b"li\0"; -pub const PRIoMAX: &'static [u8; 3usize] = b"lo\0"; -pub const PRIuMAX: &'static [u8; 3usize] = b"lu\0"; -pub const PRIxMAX: &'static [u8; 3usize] = b"lx\0"; -pub const PRIXMAX: &'static [u8; 3usize] = b"lX\0"; -pub const PRIdPTR: &'static [u8; 3usize] = b"ld\0"; -pub const PRIiPTR: &'static [u8; 3usize] = b"li\0"; -pub const PRIoPTR: &'static [u8; 3usize] = b"lo\0"; -pub const PRIuPTR: &'static [u8; 3usize] = b"lu\0"; -pub const PRIxPTR: &'static [u8; 3usize] = b"lx\0"; -pub const PRIXPTR: &'static [u8; 3usize] = b"lX\0"; -pub const SCNd8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNd16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNd32: &'static [u8; 2usize] = b"d\0"; -pub const SCNd64: &'static [u8; 3usize] = b"ld\0"; -pub const SCNdLEAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &'static [u8; 3usize] = b"ld\0"; -pub const SCNdFAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &'static [u8; 3usize] = b"ld\0"; -pub const SCNdFAST32: &'static [u8; 3usize] = b"ld\0"; -pub const SCNdFAST64: &'static [u8; 3usize] = b"ld\0"; -pub const SCNi8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNi16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNi32: &'static [u8; 2usize] = b"i\0"; -pub const SCNi64: &'static [u8; 3usize] = b"li\0"; -pub const SCNiLEAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &'static [u8; 3usize] = b"li\0"; -pub const SCNiFAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &'static [u8; 3usize] = b"li\0"; -pub const SCNiFAST32: &'static [u8; 3usize] = b"li\0"; -pub const SCNiFAST64: &'static [u8; 3usize] = b"li\0"; -pub const SCNu8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNu16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNu32: &'static [u8; 2usize] = b"u\0"; -pub const SCNu64: &'static [u8; 3usize] = b"lu\0"; -pub const SCNuLEAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &'static [u8; 3usize] = b"lu\0"; -pub const SCNuFAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &'static [u8; 3usize] = b"lu\0"; -pub const SCNuFAST32: &'static [u8; 3usize] = b"lu\0"; -pub const SCNuFAST64: &'static [u8; 3usize] = b"lu\0"; -pub const SCNo8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNo16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNo32: &'static [u8; 2usize] = b"o\0"; -pub const SCNo64: &'static [u8; 3usize] = b"lo\0"; -pub const SCNoLEAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &'static [u8; 3usize] = b"lo\0"; -pub const SCNoFAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &'static [u8; 3usize] = b"lo\0"; -pub const SCNoFAST32: &'static [u8; 3usize] = b"lo\0"; -pub const SCNoFAST64: &'static [u8; 3usize] = b"lo\0"; -pub const SCNx8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNx16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNx32: &'static [u8; 2usize] = b"x\0"; -pub const SCNx64: &'static [u8; 3usize] = b"lx\0"; -pub const SCNxLEAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &'static [u8; 3usize] = b"lx\0"; -pub const SCNxFAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &'static [u8; 3usize] = b"lx\0"; -pub const SCNxFAST32: &'static [u8; 3usize] = b"lx\0"; -pub const SCNxFAST64: &'static [u8; 3usize] = b"lx\0"; -pub const SCNdMAX: &'static [u8; 3usize] = b"ld\0"; -pub const SCNiMAX: &'static [u8; 3usize] = b"li\0"; -pub const SCNoMAX: &'static [u8; 3usize] = b"lo\0"; -pub const SCNuMAX: &'static [u8; 3usize] = b"lu\0"; -pub const SCNxMAX: &'static [u8; 3usize] = b"lx\0"; -pub const SCNdPTR: &'static [u8; 3usize] = b"ld\0"; -pub const SCNiPTR: &'static [u8; 3usize] = b"li\0"; -pub const SCNoPTR: &'static [u8; 3usize] = b"lo\0"; -pub const SCNuPTR: &'static [u8; 3usize] = b"lu\0"; -pub const SCNxPTR: &'static [u8; 3usize] = b"lx\0"; -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_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_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_NONE: u32 = 0; -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_FRONT: u32 = 1028; -pub const GL_BACK: u32 = 1029; -pub const GL_LEFT: u32 = 1030; -pub const GL_RIGHT: u32 = 1031; -pub const GL_FRONT_AND_BACK: u32 = 1032; -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_POINT_SIZE: u32 = 2833; -pub const GL_POINT_SIZE_RANGE: u32 = 2834; -pub const GL_POINT_SIZE_GRANULARITY: u32 = 2835; -pub const GL_LINE_SMOOTH: u32 = 2848; -pub const GL_LINE_WIDTH: u32 = 2849; -pub const GL_LINE_WIDTH_RANGE: u32 = 2850; -pub const GL_LINE_WIDTH_GRANULARITY: u32 = 2851; -pub const GL_POLYGON_MODE: u32 = 2880; -pub const GL_POLYGON_SMOOTH: u32 = 2881; -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_DEPTH_RANGE: u32 = 2928; -pub const GL_DEPTH_TEST: u32 = 2929; -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_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_VIEWPORT: u32 = 2978; -pub const GL_DITHER: u32 = 3024; -pub const GL_BLEND_DST: u32 = 3040; -pub const GL_BLEND_SRC: u32 = 3041; -pub const GL_BLEND: u32 = 3042; -pub const GL_LOGIC_OP_MODE: u32 = 3056; -pub const GL_COLOR_LOGIC_OP: u32 = 3058; -pub const GL_DRAW_BUFFER: u32 = 3073; -pub const GL_READ_BUFFER: u32 = 3074; -pub const GL_SCISSOR_BOX: u32 = 3088; -pub const GL_SCISSOR_TEST: u32 = 3089; -pub const GL_COLOR_CLEAR_VALUE: u32 = 3106; -pub const GL_COLOR_WRITEMASK: u32 = 3107; -pub const GL_DOUBLEBUFFER: u32 = 3122; -pub const GL_STEREO: u32 = 3123; -pub const GL_LINE_SMOOTH_HINT: u32 = 3154; -pub const GL_POLYGON_SMOOTH_HINT: u32 = 3155; -pub const GL_UNPACK_SWAP_BYTES: u32 = 3312; -pub const GL_UNPACK_LSB_FIRST: u32 = 3313; -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_UNPACK_ALIGNMENT: u32 = 3317; -pub const GL_PACK_SWAP_BYTES: u32 = 3328; -pub const GL_PACK_LSB_FIRST: u32 = 3329; -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_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_TEXTURE_1D: u32 = 3552; -pub const GL_TEXTURE_2D: u32 = 3553; -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_POLYGON_OFFSET_FACTOR: u32 = 32824; -pub const GL_TEXTURE_BINDING_1D: u32 = 32872; -pub const GL_TEXTURE_BINDING_2D: u32 = 32873; -pub const GL_TEXTURE_WIDTH: u32 = 4096; -pub const GL_TEXTURE_HEIGHT: u32 = 4097; -pub const GL_TEXTURE_INTERNAL_FORMAT: u32 = 4099; -pub const GL_TEXTURE_BORDER_COLOR: u32 = 4100; -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_DONT_CARE: u32 = 4352; -pub const GL_FASTEST: u32 = 4353; -pub const GL_NICEST: u32 = 4354; -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_DOUBLE: u32 = 5130; -pub const GL_CLEAR: u32 = 5376; -pub const GL_AND: u32 = 5377; -pub const GL_AND_REVERSE: u32 = 5378; -pub const GL_COPY: u32 = 5379; -pub const GL_AND_INVERTED: u32 = 5380; -pub const GL_NOOP: u32 = 5381; -pub const GL_XOR: u32 = 5382; -pub const GL_OR: u32 = 5383; -pub const GL_NOR: u32 = 5384; -pub const GL_EQUIV: u32 = 5385; -pub const GL_INVERT: u32 = 5386; -pub const GL_OR_REVERSE: u32 = 5387; -pub const GL_COPY_INVERTED: u32 = 5388; -pub const GL_OR_INVERTED: u32 = 5389; -pub const GL_NAND: u32 = 5390; -pub const GL_SET: u32 = 5391; -pub const GL_TEXTURE: u32 = 5890; -pub const GL_COLOR: u32 = 6144; -pub const GL_DEPTH: u32 = 6145; -pub const GL_STENCIL: u32 = 6146; -pub const GL_STENCIL_INDEX: u32 = 6401; -pub const GL_DEPTH_COMPONENT: u32 = 6402; -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_RGB: u32 = 6407; -pub const GL_RGBA: u32 = 6408; -pub const GL_POINT: u32 = 6912; -pub const GL_LINE: u32 = 6913; -pub const GL_FILL: u32 = 6914; -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_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_PROXY_TEXTURE_1D: u32 = 32867; -pub const GL_PROXY_TEXTURE_2D: u32 = 32868; -pub const GL_REPEAT: u32 = 10497; -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_UNSIGNED_BYTE_3_3_2: u32 = 32818; -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_INT_8_8_8_8: u32 = 32821; -pub const GL_UNSIGNED_INT_10_10_10_2: u32 = 32822; -pub const GL_TEXTURE_BINDING_3D: u32 = 32874; -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_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_REV: u32 = 33637; -pub const GL_UNSIGNED_SHORT_1_5_5_5_REV: u32 = 33638; -pub const GL_UNSIGNED_INT_8_8_8_8_REV: u32 = 33639; -pub const GL_UNSIGNED_INT_2_10_10_10_REV: u32 = 33640; -pub const GL_BGR: u32 = 32992; -pub const GL_BGRA: u32 = 32993; -pub const GL_MAX_ELEMENTS_VERTICES: u32 = 33000; -pub const GL_MAX_ELEMENTS_INDICES: u32 = 33001; -pub const GL_CLAMP_TO_EDGE: u32 = 33071; -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_LINE_WIDTH_RANGE: u32 = 33902; -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_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_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_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_CLAMP_TO_BORDER: u32 = 33069; -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_FUNC_ADD: u32 = 32774; -pub const GL_FUNC_SUBTRACT: u32 = 32778; -pub const GL_FUNC_REVERSE_SUBTRACT: u32 = 32779; -pub const GL_MIN: u32 = 32775; -pub const GL_MAX: u32 = 32776; -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_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_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_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_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_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_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_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_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_1_0: 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_VERSION_1_4: u32 = 1; -pub const GL_VERSION_1_5: u32 = 1; -pub const GL_VERSION_2_0: u32 = 1; -pub const GL_VERSION_2_1: u32 = 1; -pub const GL_VERSION_3_0: u32 = 1; -pub const GL_VERSION_3_1: u32 = 1; -pub const GL_VERSION_3_2: u32 = 1; -pub const GL_VERSION_3_3: 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_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_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_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_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_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_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_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_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_MAX_UNIFORM_LOCATIONS: u32 = 33390; -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_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_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_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_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_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_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_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_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_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_FLOAT_VEC2_ARB: u32 = 35664; -pub const GL_FLOAT_VEC3_ARB: u32 = 35665; -pub const GL_FLOAT_VEC4_ARB: u32 = 35666; -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_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_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_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_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_BLEND_EQUATION_RGB_EXT: u32 = 32777; -pub const GL_BLEND_EQUATION_ALPHA_EXT: u32 = 34877; -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_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_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_SCALED_RESOLVE_FASTEST_EXT: u32 = 37050; -pub const GL_SCALED_RESOLVE_NICEST_EXT: u32 = 37051; -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_FRAMEBUFFER_SRGB_EXT: u32 = 36281; -pub const GL_FRAMEBUFFER_SRGB_CAPABLE_EXT: u32 = 36282; -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_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_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_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_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_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_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_AMD_debug_output: u32 = 1; -pub const GL_AMD_query_buffer_object: u32 = 1; -pub const GL_ARB_ES2_compatibility: u32 = 1; -pub const GL_ARB_ES3_compatibility: u32 = 1; -pub const GL_ARB_buffer_storage: u32 = 1; -pub const GL_ARB_compatibility: u32 = 1; -pub const GL_ARB_compressed_texture_pixel_storage: u32 = 1; -pub const GL_ARB_debug_output: u32 = 1; -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_ARB_draw_buffers: u32 = 1; -pub const GL_ARB_draw_buffers_blend: 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_program: u32 = 1; -pub const GL_ARB_fragment_shader: u32 = 1; -pub const GL_ARB_framebuffer_object: u32 = 1; -pub const GL_ARB_framebuffer_sRGB: u32 = 1; -pub const GL_ARB_multisample: u32 = 1; -pub const GL_ARB_sample_locations: u32 = 1; -pub const GL_ARB_texture_compression: u32 = 1; -pub const GL_ARB_texture_float: u32 = 1; -pub const GL_ARB_texture_multisample: u32 = 1; -pub const GL_ARB_texture_non_power_of_two: u32 = 1; -pub const GL_ARB_texture_rg: u32 = 1; -pub const GL_ARB_texture_swizzle: u32 = 1; -pub const GL_ARB_uniform_buffer_object: u32 = 1; -pub const GL_ARB_vertex_array_object: u32 = 1; -pub const GL_ARB_vertex_attrib_binding: u32 = 1; -pub const GL_ARB_vertex_buffer_object: u32 = 1; -pub const GL_ARB_vertex_program: u32 = 1; -pub const GL_ARB_vertex_shader: u32 = 1; -pub const GL_ATI_element_array: u32 = 1; -pub const GL_ATI_fragment_shader: u32 = 1; -pub const GL_ATI_vertex_array_object: u32 = 1; -pub const GL_EXT_blend_color: u32 = 1; -pub const GL_EXT_blend_equation_separate: u32 = 1; -pub const GL_EXT_blend_func_separate: u32 = 1; -pub const GL_EXT_debug_marker: u32 = 1; -pub const GL_EXT_framebuffer_blit: u32 = 1; -pub const GL_EXT_framebuffer_multisample: u32 = 1; -pub const GL_EXT_framebuffer_multisample_blit_scaled: u32 = 1; -pub const GL_EXT_framebuffer_object: u32 = 1; -pub const GL_EXT_framebuffer_sRGB: u32 = 1; -pub const GL_EXT_index_array_formats: u32 = 1; -pub const GL_EXT_texture: u32 = 1; -pub const GL_EXT_texture_compression_s3tc: u32 = 1; -pub const GL_EXT_texture_sRGB: u32 = 1; -pub const GL_EXT_texture_swizzle: u32 = 1; -pub const GL_EXT_vertex_array: u32 = 1; -pub const GL_EXT_vertex_shader: u32 = 1; -pub const _STDIO_H: 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 _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 FOPEN_MAX: u32 = 16; -pub const _GLAD_IS_SOME_NEW_VERSION: u32 = 1; -pub const GL_ETC1_RGB8_OES: u32 = 36196; -pub const GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: u32 = 35840; -pub const GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: u32 = 35842; -pub const GL_COMPRESSED_RGBA_ASTC_4x4_KHR: u32 = 37808; -pub const GL_COMPRESSED_RGBA_ASTC_8x8_KHR: u32 = 37815; -pub const GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34047; -pub const GL_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34046; -pub const DEFAULT_SHADER_ATTRIB_NAME_POSITION: &'static [u8; 15usize] = b"vertexPosition\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD: &'static [u8; 15usize] = b"vertexTexCoord\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_NORMAL: &'static [u8; 13usize] = b"vertexNormal\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_COLOR: &'static [u8; 12usize] = b"vertexColor\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TANGENT: &'static [u8; 14usize] = b"vertexTangent\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2: &'static [u8; 16usize] = b"vertexTexCoord2\0"; -pub const MAX_MIPMAP_LEVELS: u32 = 5; -pub const RAYGUI_VERSION: &'static [u8; 8usize] = b"2.6-dev\0"; -pub const NUM_CONTROLS: u32 = 16; -pub const NUM_PROPS_DEFAULT: u32 = 16; -pub const NUM_PROPS_EXTENDED: u32 = 8; -pub const TEXTEDIT_CURSOR_BLINK_FRAMES: u32 = 20; -pub const RICON_MAX_ICONS: u32 = 256; -pub const RICON_SIZE: u32 = 16; -pub const RICON_MAX_NAME_LENGTH: u32 = 32; -pub const RICON_DATA_ELEMENTS: u32 = 8; -pub const WINDOW_STATUSBAR_HEIGHT: u32 = 22; -pub const GROUPBOX_LINE_THICK: u32 = 1; -pub const GROUPBOX_TEXT_PADDING: u32 = 10; -pub const LINE_TEXT_PADDING: u32 = 10; -pub const PANEL_BORDER_WIDTH: u32 = 1; -pub const TOGGLEGROUP_MAX_ELEMENTS: u32 = 32; -pub const VALUEBOX_MAX_CHARS: u32 = 32; -pub const COLORBARALPHA_CHECKED_SIZE: u32 = 10; -pub const MESSAGEBOX_BUTTON_HEIGHT: u32 = 24; -pub const MESSAGEBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_BUTTON_HEIGHT: u32 = 24; -pub const TEXTINPUTBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_HEIGHT: u32 = 30; -pub const TEXTINPUTBOX_MAX_TEXT_LENGTH: u32 = 256; -pub const GRID_COLOR_ALPHA: f64 = 0.15; -pub const ICON_TEXT_PADDING: u32 = 4; -pub const TEXTSPLIT_MAX_TEXT_LENGTH: u32 = 1024; -pub const TEXTSPLIT_MAX_TEXT_ELEMENTS: u32 = 128; -pub const MAX_LIGHTS: u32 = 4; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector2 { - pub x: f32, - pub y: f32, -} -#[test] -fn bindgen_test_layout_Vector2() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(Vector2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(y) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector3 { - pub x: f32, - pub y: f32, - pub z: f32, -} -#[test] -fn bindgen_test_layout_Vector3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(Vector3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(z) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector4 { - pub x: f32, - pub y: f32, - pub z: f32, - pub w: f32, -} -#[test] -fn bindgen_test_layout_Vector4() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Vector4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector4)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(z) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(w) - ) - ); -} -pub type Quaternion = Vector4; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Matrix { - pub m0: f32, - pub m4: f32, - pub m8: f32, - pub m12: f32, - pub m1: f32, - pub m5: f32, - pub m9: f32, - pub m13: f32, - pub m2: f32, - pub m6: f32, - pub m10: f32, - pub m14: f32, - pub m3: f32, - pub m7: f32, - pub m11: f32, - pub m15: f32, -} -#[test] -fn bindgen_test_layout_Matrix() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(Matrix)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Matrix)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m4 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m8 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m12 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m12) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m5 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m9 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m13 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m13) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m2 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m6 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m10 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m10) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m14 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m14) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m3 as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m7 as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m7) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m11 as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m11) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m15 as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m15) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Color { - pub r: ::std::os::raw::c_uchar, - pub g: ::std::os::raw::c_uchar, - pub b: ::std::os::raw::c_uchar, - pub a: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_Color() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(Color)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Color)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, - 1usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(g)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 2usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 3usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(a)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rectangle { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, -} -#[test] -fn bindgen_test_layout_Rectangle() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Rectangle)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Rectangle)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(height) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Image { - pub data: *mut ::std::os::raw::c_void, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Image() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Image)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Image)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(format) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Texture { - pub id: ::std::os::raw::c_uint, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Texture() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(Texture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Texture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(format) - ) - ); -} -pub type Texture2D = Texture; -pub type TextureCubemap = Texture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderTexture { - pub id: ::std::os::raw::c_uint, - pub texture: Texture, - pub depth: Texture, -} -#[test] -fn bindgen_test_layout_RenderTexture() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(RenderTexture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RenderTexture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).depth as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(depth) - ) - ); -} -pub type RenderTexture2D = RenderTexture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NPatchInfo { - pub source: Rectangle, - pub left: ::std::os::raw::c_int, - pub top: ::std::os::raw::c_int, - pub right: ::std::os::raw::c_int, - pub bottom: ::std::os::raw::c_int, - pub type_: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NPatchInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(NPatchInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(NPatchInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).left as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).top as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).right as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bottom as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(bottom) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(type_) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CharInfo { - pub value: ::std::os::raw::c_int, - pub offsetX: ::std::os::raw::c_int, - pub offsetY: ::std::os::raw::c_int, - pub advanceX: ::std::os::raw::c_int, - pub image: Image, -} -#[test] -fn bindgen_test_layout_CharInfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CharInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CharInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetX as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetY as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).advanceX as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(advanceX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).image as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(image) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Font { - pub baseSize: ::std::os::raw::c_int, - pub charsCount: ::std::os::raw::c_int, - pub charsPadding: ::std::os::raw::c_int, - pub texture: Texture2D, - pub recs: *mut Rectangle, - pub chars: *mut CharInfo, -} -#[test] -fn bindgen_test_layout_Font() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Font)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Font)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).baseSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(baseSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsPadding as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsPadding) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).recs as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(recs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chars as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(chars) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera3D { - pub position: Vector3, - pub target: Vector3, - pub up: Vector3, - pub fovy: f32, - pub type_: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Camera3D() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(Camera3D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera3D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).up as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(up) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fovy as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(fovy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(type_) - ) - ); -} -pub type Camera = Camera3D; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera2D { - pub offset: Vector2, - pub target: Vector2, - pub rotation: f32, - pub zoom: f32, -} -#[test] -fn bindgen_test_layout_Camera2D() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Camera2D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera2D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).zoom as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(zoom) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Mesh { - pub vertexCount: ::std::os::raw::c_int, - pub triangleCount: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub texcoords2: *mut f32, - pub normals: *mut f32, - pub tangents: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_ushort, - pub animVertices: *mut f32, - pub animNormals: *mut f32, - pub boneIds: *mut ::std::os::raw::c_int, - pub boneWeights: *mut f32, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: *mut ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Mesh() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(Mesh)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Mesh)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).triangleCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(triangleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normals as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(normals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tangents as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(tangents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animVertices as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animVertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animNormals as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animNormals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneIds as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneIds) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneWeights as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneWeights) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Shader { - pub id: ::std::os::raw::c_uint, - pub locs: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Shader() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Shader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Shader)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).locs as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(locs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MaterialMap { - pub texture: Texture2D, - pub color: Color, - pub value: f32, -} -#[test] -fn bindgen_test_layout_MaterialMap() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(MaterialMap)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MaterialMap)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(color) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(value) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Material { - pub shader: Shader, - pub maps: *mut MaterialMap, - pub params: *mut f32, -} -#[test] -fn bindgen_test_layout_Material() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(Material)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Material)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).shader as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(shader) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).maps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(maps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).params as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(params) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Transform { - pub translation: Vector3, - pub rotation: Quaternion, - pub scale: Vector3, -} -#[test] -fn bindgen_test_layout_Transform() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Transform)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Transform)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).translation as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(translation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(scale) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoneInfo { - pub name: [::std::os::raw::c_char; 32usize], - pub parent: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_BoneInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(BoneInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoneInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(parent) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Model { - pub transform: Matrix, - pub meshCount: ::std::os::raw::c_int, - pub materialCount: ::std::os::raw::c_int, - pub meshes: *mut Mesh, - pub materials: *mut Material, - pub meshMaterial: *mut ::std::os::raw::c_int, - pub boneCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub bindPose: *mut Transform, -} -#[test] -fn bindgen_test_layout_Model() { - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Model)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).transform as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshCount as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materialCount as *const _ as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materialCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshes as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshes) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materials as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materials) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshMaterial as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshMaterial) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bindPose as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bindPose) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ModelAnimation { - pub boneCount: ::std::os::raw::c_int, - pub frameCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub framePoses: *mut *mut Transform, -} -#[test] -fn bindgen_test_layout_ModelAnimation() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ModelAnimation)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ModelAnimation)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).frameCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(frameCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).framePoses as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(framePoses) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Ray { - pub position: Vector3, - pub direction: Vector3, -} -#[test] -fn bindgen_test_layout_Ray() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Ray)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Ray)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).direction as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(direction) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RayHitInfo { - pub hit: bool, - pub distance: f32, - pub position: Vector3, - pub normal: Vector3, -} -#[test] -fn bindgen_test_layout_RayHitInfo() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RayHitInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RayHitInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hit as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(hit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(distance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normal as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(normal) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoundingBox { - pub min: Vector3, - pub max: Vector3, -} -#[test] -fn bindgen_test_layout_BoundingBox() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(BoundingBox)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoundingBox)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(min) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(max) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wave { - pub sampleCount: ::std::os::raw::c_uint, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, - pub data: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Wave() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Wave)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Wave)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(channels) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rAudioBuffer { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AudioStream { - pub buffer: *mut rAudioBuffer, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_AudioStream() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(AudioStream)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AudioStream)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(channels) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Sound { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Sound() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(Sound)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Sound)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(sampleCount) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Music { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, - pub looping: bool, - pub ctxType: ::std::os::raw::c_int, - pub ctxData: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Music() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Music)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Music)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).looping as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(looping) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxType as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxType) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxData as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxData) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrDeviceInfo { - pub hResolution: ::std::os::raw::c_int, - pub vResolution: ::std::os::raw::c_int, - pub hScreenSize: f32, - pub vScreenSize: f32, - pub vScreenCenter: f32, - pub eyeToScreenDistance: f32, - pub lensSeparationDistance: f32, - pub interpupillaryDistance: f32, - pub lensDistortionValues: [f32; 4usize], - pub chromaAbCorrection: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_VrDeviceInfo() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hResolution as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vResolution as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hScreenSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenCenter as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eyeToScreenDistance as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(eyeToScreenDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensSeparationDistance as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensSeparationDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).interpupillaryDistance as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(interpupillaryDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensDistortionValues as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensDistortionValues) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chromaAbCorrection as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(chromaAbCorrection) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ConfigFlag { - FLAG_VSYNC_HINT = 64, - FLAG_FULLSCREEN_MODE = 2, - FLAG_WINDOW_RESIZABLE = 4, - FLAG_WINDOW_UNDECORATED = 8, - FLAG_WINDOW_HIDDEN = 128, - FLAG_WINDOW_MINIMIZED = 512, - FLAG_WINDOW_MAXIMIZED = 1024, - FLAG_WINDOW_UNFOCUSED = 2048, - FLAG_WINDOW_TOPMOST = 4096, - FLAG_WINDOW_ALWAYS_RUN = 256, - FLAG_WINDOW_TRANSPARENT = 16, - FLAG_WINDOW_HIGHDPI = 8192, - FLAG_MSAA_4X_HINT = 32, - FLAG_INTERLACED_HINT = 65536, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TraceLogType { - LOG_ALL = 0, - LOG_TRACE = 1, - LOG_DEBUG = 2, - LOG_INFO = 3, - LOG_WARNING = 4, - LOG_ERROR = 5, - LOG_FATAL = 6, - LOG_NONE = 7, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum KeyboardKey { - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum AndroidButton { - KEY_BACK = 4, - KEY_MENU = 82, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MouseButton { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MouseCursor { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, - MOUSE_CURSOR_RESIZE_NS = 6, - MOUSE_CURSOR_RESIZE_NWSE = 7, - MOUSE_CURSOR_RESIZE_NESW = 8, - MOUSE_CURSOR_RESIZE_ALL = 9, - MOUSE_CURSOR_NOT_ALLOWED = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GamepadNumber { - GAMEPAD_PLAYER1 = 0, - GAMEPAD_PLAYER2 = 1, - GAMEPAD_PLAYER3 = 2, - GAMEPAD_PLAYER4 = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GamepadButton { - GAMEPAD_BUTTON_UNKNOWN = 0, - GAMEPAD_BUTTON_LEFT_FACE_UP = 1, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2, - GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3, - GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4, - GAMEPAD_BUTTON_RIGHT_FACE_UP = 5, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8, - GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9, - GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12, - GAMEPAD_BUTTON_MIDDLE_LEFT = 13, - GAMEPAD_BUTTON_MIDDLE = 14, - GAMEPAD_BUTTON_MIDDLE_RIGHT = 15, - GAMEPAD_BUTTON_LEFT_THUMB = 16, - GAMEPAD_BUTTON_RIGHT_THUMB = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GamepadAxis { - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - GAMEPAD_AXIS_LEFT_TRIGGER = 4, - GAMEPAD_AXIS_RIGHT_TRIGGER = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ShaderLocationIndex { - LOC_VERTEX_POSITION = 0, - LOC_VERTEX_TEXCOORD01 = 1, - LOC_VERTEX_TEXCOORD02 = 2, - LOC_VERTEX_NORMAL = 3, - LOC_VERTEX_TANGENT = 4, - LOC_VERTEX_COLOR = 5, - LOC_MATRIX_MVP = 6, - LOC_MATRIX_MODEL = 7, - LOC_MATRIX_VIEW = 8, - LOC_MATRIX_PROJECTION = 9, - LOC_VECTOR_VIEW = 10, - LOC_COLOR_DIFFUSE = 11, - LOC_COLOR_SPECULAR = 12, - LOC_COLOR_AMBIENT = 13, - LOC_MAP_ALBEDO = 14, - LOC_MAP_METALNESS = 15, - LOC_MAP_NORMAL = 16, - LOC_MAP_ROUGHNESS = 17, - LOC_MAP_OCCLUSION = 18, - LOC_MAP_EMISSION = 19, - LOC_MAP_HEIGHT = 20, - LOC_MAP_CUBEMAP = 21, - LOC_MAP_IRRADIANCE = 22, - LOC_MAP_PREFILTER = 23, - LOC_MAP_BRDF = 24, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ShaderUniformDataType { - UNIFORM_FLOAT = 0, - UNIFORM_VEC2 = 1, - UNIFORM_VEC3 = 2, - UNIFORM_VEC4 = 3, - UNIFORM_INT = 4, - UNIFORM_IVEC2 = 5, - UNIFORM_IVEC3 = 6, - UNIFORM_IVEC4 = 7, - UNIFORM_SAMPLER2D = 8, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MaterialMapType { - MAP_ALBEDO = 0, - MAP_METALNESS = 1, - MAP_NORMAL = 2, - MAP_ROUGHNESS = 3, - MAP_OCCLUSION = 4, - MAP_EMISSION = 5, - MAP_HEIGHT = 6, - MAP_CUBEMAP = 7, - MAP_IRRADIANCE = 8, - MAP_PREFILTER = 9, - MAP_BRDF = 10, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum PixelFormat { - UNCOMPRESSED_GRAYSCALE = 1, - UNCOMPRESSED_GRAY_ALPHA = 2, - UNCOMPRESSED_R5G6B5 = 3, - UNCOMPRESSED_R8G8B8 = 4, - UNCOMPRESSED_R5G5B5A1 = 5, - UNCOMPRESSED_R4G4B4A4 = 6, - UNCOMPRESSED_R8G8B8A8 = 7, - UNCOMPRESSED_R32 = 8, - UNCOMPRESSED_R32G32B32 = 9, - UNCOMPRESSED_R32G32B32A32 = 10, - COMPRESSED_DXT1_RGB = 11, - COMPRESSED_DXT1_RGBA = 12, - COMPRESSED_DXT3_RGBA = 13, - COMPRESSED_DXT5_RGBA = 14, - COMPRESSED_ETC1_RGB = 15, - COMPRESSED_ETC2_RGB = 16, - COMPRESSED_ETC2_EAC_RGBA = 17, - COMPRESSED_PVRT_RGB = 18, - COMPRESSED_PVRT_RGBA = 19, - COMPRESSED_ASTC_4x4_RGBA = 20, - COMPRESSED_ASTC_8x8_RGBA = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TextureFilterMode { - FILTER_POINT = 0, - FILTER_BILINEAR = 1, - FILTER_TRILINEAR = 2, - FILTER_ANISOTROPIC_4X = 3, - FILTER_ANISOTROPIC_8X = 4, - FILTER_ANISOTROPIC_16X = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TextureWrapMode { - WRAP_REPEAT = 0, - WRAP_CLAMP = 1, - WRAP_MIRROR_REPEAT = 2, - WRAP_MIRROR_CLAMP = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CubemapLayoutType { - CUBEMAP_AUTO_DETECT = 0, - CUBEMAP_LINE_VERTICAL = 1, - CUBEMAP_LINE_HORIZONTAL = 2, - CUBEMAP_CROSS_THREE_BY_FOUR = 3, - CUBEMAP_CROSS_FOUR_BY_THREE = 4, - CUBEMAP_PANORAMA = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FontType { - FONT_DEFAULT = 0, - FONT_BITMAP = 1, - FONT_SDF = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum BlendMode { - BLEND_ALPHA = 0, - BLEND_ADDITIVE = 1, - BLEND_MULTIPLIED = 2, - BLEND_ADD_COLORS = 3, - BLEND_SUBTRACT_COLORS = 4, - BLEND_CUSTOM = 5, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GestureType { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CameraMode { - CAMERA_CUSTOM = 0, - CAMERA_FREE = 1, - CAMERA_ORBITAL = 2, - CAMERA_FIRST_PERSON = 3, - CAMERA_THIRD_PERSON = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CameraType { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum NPatchType { - NPT_9PATCH = 0, - NPT_3PATCH_VERTICAL = 1, - NPT_3PATCH_HORIZONTAL = 2, -} -pub type TraceLogCallback = ::std::option::Option< - unsafe extern "C" fn( - logType: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - args: *mut __va_list_tag, - ), ->; -extern "C" { - pub fn InitWindow( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn WindowShouldClose() -> bool; -} -extern "C" { - pub fn CloseWindow(); -} -extern "C" { - pub fn IsWindowReady() -> bool; -} -extern "C" { - pub fn IsWindowFullscreen() -> bool; -} -extern "C" { - pub fn IsWindowHidden() -> bool; -} -extern "C" { - pub fn IsWindowMinimized() -> bool; -} -extern "C" { - pub fn IsWindowMaximized() -> bool; -} -extern "C" { - pub fn IsWindowFocused() -> bool; -} -extern "C" { - pub fn IsWindowResized() -> bool; -} -extern "C" { - pub fn IsWindowState(flag: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn SetWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ClearWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ToggleFullscreen(); -} -extern "C" { - pub fn MaximizeWindow(); -} -extern "C" { - pub fn MinimizeWindow(); -} -extern "C" { - pub fn RestoreWindow(); -} -extern "C" { - pub fn SetWindowIcon(image: Image); -} -extern "C" { - pub fn SetWindowTitle(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetWindowPosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMonitor(monitor: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMinSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetWindowHandle() -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn GetScreenWidth() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetScreenHeight() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPosition(monitor: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GetMonitorWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorRefreshRate(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetWindowPosition() -> Vector2; -} -extern "C" { - pub fn GetWindowScaleDPI() -> Vector2; -} -extern "C" { - pub fn GetMonitorName(monitor: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn SetClipboardText(text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GetClipboardText() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ShowCursor(); -} -extern "C" { - pub fn HideCursor(); -} -extern "C" { - pub fn IsCursorHidden() -> bool; -} -extern "C" { - pub fn EnableCursor(); -} -extern "C" { - pub fn DisableCursor(); -} -extern "C" { - pub fn IsCursorOnScreen() -> bool; -} -extern "C" { - pub fn ClearBackground(color: Color); -} -extern "C" { - pub fn BeginDrawing(); -} -extern "C" { - pub fn EndDrawing(); -} -extern "C" { - pub fn BeginMode2D(camera: Camera2D); -} -extern "C" { - pub fn EndMode2D(); -} -extern "C" { - pub fn BeginMode3D(camera: Camera3D); -} -extern "C" { - pub fn EndMode3D(); -} -extern "C" { - pub fn BeginTextureMode(target: RenderTexture2D); -} -extern "C" { - pub fn EndTextureMode(); -} -extern "C" { - pub fn BeginScissorMode( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn EndScissorMode(); -} -extern "C" { - pub fn GetMouseRay(mousePosition: Vector2, camera: Camera) -> Ray; -} -extern "C" { - pub fn GetCameraMatrix(camera: Camera) -> Matrix; -} -extern "C" { - pub fn GetCameraMatrix2D(camera: Camera2D) -> Matrix; -} -extern "C" { - pub fn GetWorldToScreen(position: Vector3, camera: Camera) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreenEx( - position: Vector3, - camera: Camera, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn SetTargetFPS(fps: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetFPS() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFrameTime() -> f32; -} -extern "C" { - pub fn GetTime() -> f64; -} -extern "C" { - pub fn SetConfigFlags(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn SetTraceLogLevel(logType: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTraceLogExit(logType: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTraceLogCallback(callback: TraceLogCallback); -} -extern "C" { - pub fn TraceLog(logType: ::std::os::raw::c_int, text: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn MemAlloc(size: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemFree(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn TakeScreenshot(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GetRandomValue( - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn LoadFileData( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn UnloadFileData(data: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileData( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool; -} -extern "C" { - pub fn LoadFileText(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn UnloadFileText(text: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileText( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn FileExists(fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn DirectoryExists(dirPath: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileExtension( - fileName: *const ::std::os::raw::c_char, - ext: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetFileExtension( - fileName: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileName(filePath: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileNameWithoutExt( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryPath( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetPrevDirectoryPath( - dirPath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetWorkingDirectory() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryFiles( - dirPath: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDirectoryFiles(); -} -extern "C" { - pub fn ChangeDirectory(dir: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileDropped() -> bool; -} -extern "C" { - pub fn GetDroppedFiles(count: *mut ::std::os::raw::c_int) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDroppedFiles(); -} -extern "C" { - pub fn GetFileModTime(fileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn CompressData( - data: *mut ::std::os::raw::c_uchar, - dataLength: ::std::os::raw::c_int, - compDataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn DecompressData( - compData: *mut ::std::os::raw::c_uchar, - compDataLength: ::std::os::raw::c_int, - dataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn SaveStorageValue(position: ::std::os::raw::c_uint, value: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn LoadStorageValue(position: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn OpenURL(url: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn IsKeyPressed(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyDown(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyReleased(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyUp(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn SetExitKey(key: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetKeyPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCharPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsGamepadAvailable(gamepad: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsGamepadName( - gamepad: ::std::os::raw::c_int, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetGamepadName(gamepad: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn IsGamepadButtonPressed( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonDown( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonReleased( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonUp(gamepad: ::std::os::raw::c_int, button: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn GetGamepadButtonPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisCount(gamepad: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisMovement( - gamepad: ::std::os::raw::c_int, - axis: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn IsMouseButtonPressed(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonDown(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonReleased(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonUp(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetMouseX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMouseY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMousePosition() -> Vector2; -} -extern "C" { - pub fn SetMousePosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseOffset(offsetX: ::std::os::raw::c_int, offsetY: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseScale(scaleX: f32, scaleY: f32); -} -extern "C" { - pub fn GetMouseWheelMove() -> f32; -} -extern "C" { - pub fn GetMouseCursor() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn SetMouseCursor(cursor: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetTouchX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPosition(index: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn SetGesturesEnabled(gestureFlags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsGestureDetected(gesture: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetGestureDetected() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPointsCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGestureHoldDuration() -> f32; -} -extern "C" { - pub fn GetGestureDragVector() -> Vector2; -} -extern "C" { - pub fn GetGestureDragAngle() -> f32; -} -extern "C" { - pub fn GetGesturePinchVector() -> Vector2; -} -extern "C" { - pub fn GetGesturePinchAngle() -> f32; -} -extern "C" { - pub fn SetCameraMode(camera: Camera, mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn UpdateCamera(camera: *mut Camera); -} -extern "C" { - pub fn SetCameraPanControl(keyPan: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraAltControl(keyAlt: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraSmoothZoomControl(keySmoothZoom: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraMoveControls( - keyFront: ::std::os::raw::c_int, - keyBack: ::std::os::raw::c_int, - keyRight: ::std::os::raw::c_int, - keyLeft: ::std::os::raw::c_int, - keyUp: ::std::os::raw::c_int, - keyDown: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn DrawPixel(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawPixelV(position: Vector2, color: Color); -} -extern "C" { - pub fn DrawLine( - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawLineV(startPos: Vector2, endPos: Vector2, color: Color); -} -extern "C" { - pub fn DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineStrip(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawCircle( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSector( - center: Vector2, - radius: f32, - startAngle: ::std::os::raw::c_int, - endAngle: ::std::os::raw::c_int, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSectorLines( - center: Vector2, - radius: f32, - startAngle: ::std::os::raw::c_int, - endAngle: ::std::os::raw::c_int, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleGradient( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawCircleV(center: Vector2, radius: f32, color: Color); -} -extern "C" { - pub fn DrawCircleLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipse( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipseLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawRing( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: ::std::os::raw::c_int, - endAngle: ::std::os::raw::c_int, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRingLines( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: ::std::os::raw::c_int, - endAngle: ::std::os::raw::c_int, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangle( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleV(position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRectangleRec(rec: Rectangle, color: Color); -} -extern "C" { - pub fn DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color); -} -extern "C" { - pub fn DrawRectangleGradientV( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientH( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientEx( - rec: Rectangle, - col1: Color, - col2: Color, - col3: Color, - col4: Color, - ); -} -extern "C" { - pub fn DrawRectangleLines( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleLinesEx(rec: Rectangle, lineThick: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawRectangleRounded( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleRoundedLines( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - lineThick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleFan(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip( - points: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPoly( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawPolyLines( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionCircles( - center1: Vector2, - radius1: f32, - center2: Vector2, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointRec(point: Vector2, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionPointTriangle( - point: Vector2, - p1: Vector2, - p2: Vector2, - p3: Vector2, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionLines( - startPos1: Vector2, - endPos1: Vector2, - startPos2: Vector2, - endPos2: Vector2, - collisionPoint: *mut Vector2, - ) -> bool; -} -extern "C" { - pub fn GetCollisionRec(rec1: Rectangle, rec2: Rectangle) -> Rectangle; -} -extern "C" { - pub fn LoadImage(fileName: *const ::std::os::raw::c_char) -> Image; -} -extern "C" { - pub fn LoadImageRaw( - fileName: *const ::std::os::raw::c_char, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - headerSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageAnim( - fileName: *const ::std::os::raw::c_char, - frames: *mut ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadImage(image: Image); -} -extern "C" { - pub fn ExportImage(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportImageAsCode(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GenImageColor( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientV( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - top: Color, - bottom: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientH( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - left: Color, - right: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientRadial( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - density: f32, - inner: Color, - outer: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageChecked( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - checksX: ::std::os::raw::c_int, - checksY: ::std::os::raw::c_int, - col1: Color, - col2: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageWhiteNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - factor: f32, - ) -> Image; -} -extern "C" { - pub fn GenImagePerlinNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - scale: f32, - ) -> Image; -} -extern "C" { - pub fn GenImageCellular( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - tileSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn ImageCopy(image: Image) -> Image; -} -extern "C" { - pub fn ImageFromImage(image: Image, rec: Rectangle) -> Image; -} -extern "C" { - pub fn ImageText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn ImageTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - tint: Color, - ) -> Image; -} -extern "C" { - pub fn ImageFormat(image: *mut Image, newFormat: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageToPOT(image: *mut Image, fill: Color); -} -extern "C" { - pub fn ImageCrop(image: *mut Image, crop: Rectangle); -} -extern "C" { - pub fn ImageAlphaCrop(image: *mut Image, threshold: f32); -} -extern "C" { - pub fn ImageAlphaClear(image: *mut Image, color: Color, threshold: f32); -} -extern "C" { - pub fn ImageAlphaMask(image: *mut Image, alphaMask: Image); -} -extern "C" { - pub fn ImageAlphaPremultiply(image: *mut Image); -} -extern "C" { - pub fn ImageResize( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeNN( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeCanvas( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - fill: Color, - ); -} -extern "C" { - pub fn ImageMipmaps(image: *mut Image); -} -extern "C" { - pub fn ImageDither( - image: *mut Image, - rBpp: ::std::os::raw::c_int, - gBpp: ::std::os::raw::c_int, - bBpp: ::std::os::raw::c_int, - aBpp: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageFlipVertical(image: *mut Image); -} -extern "C" { - pub fn ImageFlipHorizontal(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCW(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCCW(image: *mut Image); -} -extern "C" { - pub fn ImageColorTint(image: *mut Image, color: Color); -} -extern "C" { - pub fn ImageColorInvert(image: *mut Image); -} -extern "C" { - pub fn ImageColorGrayscale(image: *mut Image); -} -extern "C" { - pub fn ImageColorContrast(image: *mut Image, contrast: f32); -} -extern "C" { - pub fn ImageColorBrightness(image: *mut Image, brightness: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageColorReplace(image: *mut Image, color: Color, replace: Color); -} -extern "C" { - pub fn LoadImageColors(image: Image) -> *mut Color; -} -extern "C" { - pub fn LoadImagePalette( - image: Image, - maxPaletteSize: ::std::os::raw::c_int, - colorsCount: *mut ::std::os::raw::c_int, - ) -> *mut Color; -} -extern "C" { - pub fn UnloadImageColors(colors: *mut Color); -} -extern "C" { - pub fn UnloadImagePalette(colors: *mut Color); -} -extern "C" { - pub fn GetImageAlphaBorder(image: Image, threshold: f32) -> Rectangle; -} -extern "C" { - pub fn ImageClearBackground(dst: *mut Image, color: Color); -} -extern "C" { - pub fn ImageDrawPixel( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawPixelV(dst: *mut Image, position: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawLine( - dst: *mut Image, - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawLineV(dst: *mut Image, start: Vector2, end: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawCircle( - dst: *mut Image, - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawCircleV( - dst: *mut Image, - center: Vector2, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangle( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangleV(dst: *mut Image, position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleRec(dst: *mut Image, rec: Rectangle, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleLines( - dst: *mut Image, - rec: Rectangle, - thick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDraw( - dst: *mut Image, - src: Image, - srcRec: Rectangle, - dstRec: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn ImageDrawText( - dst: *mut Image, - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawTextEx( - dst: *mut Image, - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn LoadTexture(fileName: *const ::std::os::raw::c_char) -> Texture2D; -} -extern "C" { - pub fn LoadTextureFromImage(image: Image) -> Texture2D; -} -extern "C" { - pub fn LoadTextureCubemap(image: Image, layoutType: ::std::os::raw::c_int) -> TextureCubemap; -} -extern "C" { - pub fn LoadRenderTexture( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> RenderTexture2D; -} -extern "C" { - pub fn UnloadTexture(texture: Texture2D); -} -extern "C" { - pub fn UnloadRenderTexture(target: RenderTexture2D); -} -extern "C" { - pub fn UpdateTexture(texture: Texture2D, pixels: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn UpdateTextureRec( - texture: Texture2D, - rec: Rectangle, - pixels: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn GetTextureData(texture: Texture2D) -> Image; -} -extern "C" { - pub fn GetScreenData() -> Image; -} -extern "C" { - pub fn GenTextureMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn SetTextureFilter(texture: Texture2D, filterMode: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTextureWrap(texture: Texture2D, wrapMode: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawTexture( - texture: Texture2D, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureV(texture: Texture2D, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureEx( - texture: Texture2D, - position: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureRec(texture: Texture2D, source: Rectangle, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureQuad( - texture: Texture2D, - tiling: Vector2, - offset: Vector2, - quad: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureTiled( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePro( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureNPatch( - texture: Texture2D, - nPatchInfo: NPatchInfo, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn Fade(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorToInt(color: Color) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ColorNormalize(color: Color) -> Vector4; -} -extern "C" { - pub fn ColorFromNormalized(normalized: Vector4) -> Color; -} -extern "C" { - pub fn ColorToHSV(color: Color) -> Vector3; -} -extern "C" { - pub fn ColorFromHSV(hue: f32, saturation: f32, value: f32) -> Color; -} -extern "C" { - pub fn ColorAlpha(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorAlphaBlend(dst: Color, src: Color, tint: Color) -> Color; -} -extern "C" { - pub fn GetColor(hexValue: ::std::os::raw::c_int) -> Color; -} -extern "C" { - pub fn GetPixelColor( - srcPtr: *mut ::std::os::raw::c_void, - format: ::std::os::raw::c_int, - ) -> Color; -} -extern "C" { - pub fn SetPixelColor( - dstPtr: *mut ::std::os::raw::c_void, - color: Color, - format: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GetPixelDataSize( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFontDefault() -> Font; -} -extern "C" { - pub fn LoadFont(fileName: *const ::std::os::raw::c_char) -> Font; -} -extern "C" { - pub fn LoadFontEx( - fileName: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontFromImage(image: Image, key: Color, firstChar: ::std::os::raw::c_int) -> Font; -} -extern "C" { - pub fn LoadFontFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontData( - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - type_: ::std::os::raw::c_int, - ) -> *mut CharInfo; -} -extern "C" { - pub fn GenImageFontAtlas( - chars: *const CharInfo, - recs: *mut *mut Rectangle, - charsCount: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - padding: ::std::os::raw::c_int, - packMethod: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadFontData(chars: *mut CharInfo, charsCount: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadFont(font: Font); -} -extern "C" { - pub fn DrawFPS(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawText( - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRec( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRecEx( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - selectStart: ::std::os::raw::c_int, - selectLength: ::std::os::raw::c_int, - selectTint: Color, - selectBackTint: Color, - ); -} -extern "C" { - pub fn DrawTextCodepoint( - font: Font, - codepoint: ::std::os::raw::c_int, - position: Vector2, - fontSize: f32, - tint: Color, - ); -} -extern "C" { - pub fn MeasureText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn MeasureTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - ) -> Vector2; -} -extern "C" { - pub fn GetGlyphIndex(font: Font, codepoint: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextCopy( - dst: *mut ::std::os::raw::c_char, - src: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextIsEqual( - text1: *const ::std::os::raw::c_char, - text2: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TextLength(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn TextFormat(text: *const ::std::os::raw::c_char, ...) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSubtext( - text: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextReplace( - text: *mut ::std::os::raw::c_char, - replace: *const ::std::os::raw::c_char, - by: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextInsert( - text: *const ::std::os::raw::c_char, - insert: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextJoin( - textList: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - delimiter: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSplit( - text: *const ::std::os::raw::c_char, - delimiter: ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextAppend( - text: *mut ::std::os::raw::c_char, - append: *const ::std::os::raw::c_char, - position: *mut ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TextFindIndex( - text: *const ::std::os::raw::c_char, - find: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUpper(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToLower(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToPascal(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToInteger(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUtf8( - codepoints: *mut ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn GetCodepoints( - text: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCodepointsCount(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetNextCodepoint( - text: *const ::std::os::raw::c_char, - bytesProcessed: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn CodepointToUtf8( - codepoint: ::std::os::raw::c_int, - byteLength: *mut ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color); -} -extern "C" { - pub fn DrawPoint3D(position: Vector3, color: Color); -} -extern "C" { - pub fn DrawCircle3D( - center: Vector3, - radius: f32, - rotationAxis: Vector3, - rotationAngle: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip3D( - points: *mut Vector3, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeWiresV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeTexture( - texture: Texture2D, - position: Vector3, - width: f32, - height: f32, - length: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawSphere(centerPos: Vector3, radius: f32, color: Color); -} -extern "C" { - pub fn DrawSphereEx( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawSphereWires( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinder( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinderWires( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPlane(centerPos: Vector3, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRay(ray: Ray, color: Color); -} -extern "C" { - pub fn DrawGrid(slices: ::std::os::raw::c_int, spacing: f32); -} -extern "C" { - pub fn DrawGizmo(position: Vector3); -} -extern "C" { - pub fn LoadModel(fileName: *const ::std::os::raw::c_char) -> Model; -} -extern "C" { - pub fn LoadModelFromMesh(mesh: Mesh) -> Model; -} -extern "C" { - pub fn UnloadModel(model: Model); -} -extern "C" { - pub fn UnloadModelKeepMeshes(model: Model); -} -extern "C" { - pub fn LoadMeshes( - fileName: *const ::std::os::raw::c_char, - meshCount: *mut ::std::os::raw::c_int, - ) -> *mut Mesh; -} -extern "C" { - pub fn UnloadMesh(mesh: Mesh); -} -extern "C" { - pub fn ExportMesh(mesh: Mesh, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn LoadMaterials( - fileName: *const ::std::os::raw::c_char, - materialCount: *mut ::std::os::raw::c_int, - ) -> *mut Material; -} -extern "C" { - pub fn LoadMaterialDefault() -> Material; -} -extern "C" { - pub fn UnloadMaterial(material: Material); -} -extern "C" { - pub fn SetMaterialTexture( - material: *mut Material, - mapType: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn SetModelMeshMaterial( - model: *mut Model, - meshId: ::std::os::raw::c_int, - materialId: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadModelAnimations( - fileName: *const ::std::os::raw::c_char, - animsCount: *mut ::std::os::raw::c_int, - ) -> *mut ModelAnimation; -} -extern "C" { - pub fn UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadModelAnimation(anim: ModelAnimation); -} -extern "C" { - pub fn IsModelAnimationValid(model: Model, anim: ModelAnimation) -> bool; -} -extern "C" { - pub fn GenMeshPoly(sides: ::std::os::raw::c_int, radius: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshPlane( - width: f32, - length: f32, - resX: ::std::os::raw::c_int, - resZ: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCube(width: f32, height: f32, length: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHemiSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCylinder(radius: f32, height: f32, slices: ::std::os::raw::c_int) -> Mesh; -} -extern "C" { - pub fn GenMeshTorus( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshKnot( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHeightmap(heightmap: Image, size: Vector3) -> Mesh; -} -extern "C" { - pub fn GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3) -> Mesh; -} -extern "C" { - pub fn MeshBoundingBox(mesh: Mesh) -> BoundingBox; -} -extern "C" { - pub fn MeshTangents(mesh: *mut Mesh); -} -extern "C" { - pub fn MeshBinormals(mesh: *mut Mesh); -} -extern "C" { - pub fn MeshNormalsSmooth(mesh: *mut Mesh); -} -extern "C" { - pub fn DrawModel(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelWiresEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawBoundingBox(box_: BoundingBox, color: Color); -} -extern "C" { - pub fn DrawBillboard( - camera: Camera, - texture: Texture2D, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawBillboardRec( - camera: Camera, - texture: Texture2D, - source: Rectangle, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn CheckCollisionSpheres( - center1: Vector3, - radius1: f32, - center2: Vector3, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxSphere(box_: BoundingBox, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphere(ray: Ray, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphereEx( - ray: Ray, - center: Vector3, - radius: f32, - collisionPoint: *mut Vector3, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionRayBox(ray: Ray, box_: BoundingBox) -> bool; -} -extern "C" { - pub fn GetCollisionRayMesh(ray: Ray, mesh: Mesh, transform: Matrix) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayModel(ray: Ray, model: Model) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayGround(ray: Ray, groundHeight: f32) -> RayHitInfo; -} -extern "C" { - pub fn LoadShader( - vsFileName: *const ::std::os::raw::c_char, - fsFileName: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn LoadShaderCode( - vsCode: *const ::std::os::raw::c_char, - fsCode: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn UnloadShader(shader: Shader); -} -extern "C" { - pub fn GetShaderDefault() -> Shader; -} -extern "C" { - pub fn GetTextureDefault() -> Texture2D; -} -extern "C" { - pub fn GetShapesTexture() -> Texture2D; -} -extern "C" { - pub fn GetShapesTextureRec() -> Rectangle; -} -extern "C" { - pub fn SetShapesTexture(texture: Texture2D, source: Rectangle); -} -extern "C" { - pub fn GetShaderLocation( - shader: Shader, - uniformName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetShaderLocationAttrib( - shader: Shader, - attribName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn SetShaderValue( - shader: Shader, - uniformLoc: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueV( - shader: Shader, - uniformLoc: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueMatrix(shader: Shader, uniformLoc: ::std::os::raw::c_int, mat: Matrix); -} -extern "C" { - pub fn SetShaderValueTexture( - shader: Shader, - uniformLoc: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn SetMatrixProjection(proj: Matrix); -} -extern "C" { - pub fn SetMatrixModelview(view: Matrix); -} -extern "C" { - pub fn GetMatrixModelview() -> Matrix; -} -extern "C" { - pub fn GetMatrixProjection() -> Matrix; -} -extern "C" { - pub fn GenTextureCubemap( - shader: Shader, - panorama: Texture2D, - size: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> TextureCubemap; -} -extern "C" { - pub fn GenTextureIrradiance( - shader: Shader, - cubemap: TextureCubemap, - size: ::std::os::raw::c_int, - ) -> TextureCubemap; -} -extern "C" { - pub fn GenTexturePrefilter( - shader: Shader, - cubemap: TextureCubemap, - size: ::std::os::raw::c_int, - ) -> TextureCubemap; -} -extern "C" { - pub fn GenTextureBRDF(shader: Shader, size: ::std::os::raw::c_int) -> Texture2D; -} -extern "C" { - pub fn BeginShaderMode(shader: Shader); -} -extern "C" { - pub fn EndShaderMode(); -} -extern "C" { - pub fn BeginBlendMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn EndBlendMode(); -} -extern "C" { - pub fn InitVrSimulator(); -} -extern "C" { - pub fn CloseVrSimulator(); -} -extern "C" { - pub fn UpdateVrTracking(camera: *mut Camera); -} -extern "C" { - pub fn SetVrConfiguration(info: VrDeviceInfo, distortion: Shader); -} -extern "C" { - pub fn IsVrSimulatorReady() -> bool; -} -extern "C" { - pub fn ToggleVrMode(); -} -extern "C" { - pub fn BeginVrDrawing(); -} -extern "C" { - pub fn EndVrDrawing(); -} -extern "C" { - pub fn InitAudioDevice(); -} -extern "C" { - pub fn CloseAudioDevice(); -} -extern "C" { - pub fn IsAudioDeviceReady() -> bool; -} -extern "C" { - pub fn SetMasterVolume(volume: f32); -} -extern "C" { - pub fn LoadWave(fileName: *const ::std::os::raw::c_char) -> Wave; -} -extern "C" { - pub fn LoadWaveFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Wave; -} -extern "C" { - pub fn LoadSound(fileName: *const ::std::os::raw::c_char) -> Sound; -} -extern "C" { - pub fn LoadSoundFromWave(wave: Wave) -> Sound; -} -extern "C" { - pub fn UpdateSound( - sound: Sound, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadWave(wave: Wave); -} -extern "C" { - pub fn UnloadSound(sound: Sound); -} -extern "C" { - pub fn ExportWave(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportWaveAsCode(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn PlaySound(sound: Sound); -} -extern "C" { - pub fn StopSound(sound: Sound); -} -extern "C" { - pub fn PauseSound(sound: Sound); -} -extern "C" { - pub fn ResumeSound(sound: Sound); -} -extern "C" { - pub fn PlaySoundMulti(sound: Sound); -} -extern "C" { - pub fn StopSoundMulti(); -} -extern "C" { - pub fn GetSoundsPlaying() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsSoundPlaying(sound: Sound) -> bool; -} -extern "C" { - pub fn SetSoundVolume(sound: Sound, volume: f32); -} -extern "C" { - pub fn SetSoundPitch(sound: Sound, pitch: f32); -} -extern "C" { - pub fn WaveFormat( - wave: *mut Wave, - sampleRate: ::std::os::raw::c_int, - sampleSize: ::std::os::raw::c_int, - channels: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn WaveCopy(wave: Wave) -> Wave; -} -extern "C" { - pub fn WaveCrop( - wave: *mut Wave, - initSample: ::std::os::raw::c_int, - finalSample: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadWaveSamples(wave: Wave) -> *mut f32; -} -extern "C" { - pub fn UnloadWaveSamples(samples: *mut f32); -} -extern "C" { - pub fn LoadMusicStream(fileName: *const ::std::os::raw::c_char) -> Music; -} -extern "C" { - pub fn UnloadMusicStream(music: Music); -} -extern "C" { - pub fn PlayMusicStream(music: Music); -} -extern "C" { - pub fn UpdateMusicStream(music: Music); -} -extern "C" { - pub fn StopMusicStream(music: Music); -} -extern "C" { - pub fn PauseMusicStream(music: Music); -} -extern "C" { - pub fn ResumeMusicStream(music: Music); -} -extern "C" { - pub fn IsMusicPlaying(music: Music) -> bool; -} -extern "C" { - pub fn SetMusicVolume(music: Music, volume: f32); -} -extern "C" { - pub fn SetMusicPitch(music: Music, pitch: f32); -} -extern "C" { - pub fn GetMusicTimeLength(music: Music) -> f32; -} -extern "C" { - pub fn GetMusicTimePlayed(music: Music) -> f32; -} -extern "C" { - pub fn InitAudioStream( - sampleRate: ::std::os::raw::c_uint, - sampleSize: ::std::os::raw::c_uint, - channels: ::std::os::raw::c_uint, - ) -> AudioStream; -} -extern "C" { - pub fn UpdateAudioStream( - stream: AudioStream, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn CloseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamProcessed(stream: AudioStream) -> bool; -} -extern "C" { - pub fn PlayAudioStream(stream: AudioStream); -} -extern "C" { - pub fn PauseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn ResumeAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamPlaying(stream: AudioStream) -> bool; -} -extern "C" { - pub fn StopAudioStream(stream: AudioStream); -} -extern "C" { - pub fn SetAudioStreamVolume(stream: AudioStream, volume: f32); -} -extern "C" { - pub fn SetAudioStreamPitch(stream: AudioStream, pitch: f32); -} -extern "C" { - pub fn SetAudioStreamBufferSizeDefault(size: ::std::os::raw::c_int); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct float3 { - pub v: [f32; 3usize], -} -#[test] -fn bindgen_test_layout_float3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(float3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(float3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).v as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(float3), "::", stringify!(v)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct float16 { - pub v: [f32; 16usize], -} -#[test] -fn bindgen_test_layout_float16() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(float16)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(float16)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).v as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(float16), - "::", - stringify!(v) - ) - ); -} -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], -} -#[test] -fn bindgen_test_layout___fsid_t() { - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -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 _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; -pub type float_t = f32; -pub type double_t = f64; -extern "C" { - pub fn __fpclassify(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbit(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinf(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finite(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnan(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsig(__x: f64, __y: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignaling(__value: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acos(__x: f64) -> f64; -} -extern "C" { - pub fn __acos(__x: f64) -> f64; -} -extern "C" { - pub fn asin(__x: f64) -> f64; -} -extern "C" { - pub fn __asin(__x: f64) -> f64; -} -extern "C" { - pub fn atan(__x: f64) -> f64; -} -extern "C" { - pub fn __atan(__x: f64) -> f64; -} -extern "C" { - pub fn atan2(__y: f64, __x: f64) -> f64; -} -extern "C" { - pub fn __atan2(__y: f64, __x: f64) -> f64; -} -extern "C" { - pub fn cos(__x: f64) -> f64; -} -extern "C" { - pub fn __cos(__x: f64) -> f64; -} -extern "C" { - pub fn sin(__x: f64) -> f64; -} -extern "C" { - pub fn __sin(__x: f64) -> f64; -} -extern "C" { - pub fn tan(__x: f64) -> f64; -} -extern "C" { - pub fn __tan(__x: f64) -> f64; -} -extern "C" { - pub fn cosh(__x: f64) -> f64; -} -extern "C" { - pub fn __cosh(__x: f64) -> f64; -} -extern "C" { - pub fn sinh(__x: f64) -> f64; -} -extern "C" { - pub fn __sinh(__x: f64) -> f64; -} -extern "C" { - pub fn tanh(__x: f64) -> f64; -} -extern "C" { - pub fn __tanh(__x: f64) -> f64; -} -extern "C" { - pub fn acosh(__x: f64) -> f64; -} -extern "C" { - pub fn __acosh(__x: f64) -> f64; -} -extern "C" { - pub fn asinh(__x: f64) -> f64; -} -extern "C" { - pub fn __asinh(__x: f64) -> f64; -} -extern "C" { - pub fn atanh(__x: f64) -> f64; -} -extern "C" { - pub fn __atanh(__x: f64) -> f64; -} -extern "C" { - pub fn exp(__x: f64) -> f64; -} -extern "C" { - pub fn __exp(__x: f64) -> f64; -} -extern "C" { - pub fn frexp(__x: f64, __exponent: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __frexp(__x: f64, __exponent: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ldexp(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __ldexp(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn log(__x: f64) -> f64; -} -extern "C" { - pub fn __log(__x: f64) -> f64; -} -extern "C" { - pub fn log10(__x: f64) -> f64; -} -extern "C" { - pub fn __log10(__x: f64) -> f64; -} -extern "C" { - pub fn modf(__x: f64, __iptr: *mut f64) -> f64; -} -extern "C" { - pub fn __modf(__x: f64, __iptr: *mut f64) -> f64; -} -extern "C" { - pub fn expm1(__x: f64) -> f64; -} -extern "C" { - pub fn __expm1(__x: f64) -> f64; -} -extern "C" { - pub fn log1p(__x: f64) -> f64; -} -extern "C" { - pub fn __log1p(__x: f64) -> f64; -} -extern "C" { - pub fn logb(__x: f64) -> f64; -} -extern "C" { - pub fn __logb(__x: f64) -> f64; -} -extern "C" { - pub fn exp2(__x: f64) -> f64; -} -extern "C" { - pub fn __exp2(__x: f64) -> f64; -} -extern "C" { - pub fn log2(__x: f64) -> f64; -} -extern "C" { - pub fn __log2(__x: f64) -> f64; -} -extern "C" { - pub fn pow(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __pow(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn sqrt(__x: f64) -> f64; -} -extern "C" { - pub fn __sqrt(__x: f64) -> f64; -} -extern "C" { - pub fn hypot(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __hypot(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn cbrt(__x: f64) -> f64; -} -extern "C" { - pub fn __cbrt(__x: f64) -> f64; -} -extern "C" { - pub fn ceil(__x: f64) -> f64; -} -extern "C" { - pub fn __ceil(__x: f64) -> f64; -} -extern "C" { - pub fn fabs(__x: f64) -> f64; -} -extern "C" { - pub fn __fabs(__x: f64) -> f64; -} -extern "C" { - pub fn floor(__x: f64) -> f64; -} -extern "C" { - pub fn __floor(__x: f64) -> f64; -} -extern "C" { - pub fn fmod(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmod(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn copysign(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __copysign(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nan(__tagb: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn __nan(__tagb: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn erf(arg1: f64) -> f64; -} -extern "C" { - pub fn __erf(arg1: f64) -> f64; -} -extern "C" { - pub fn erfc(arg1: f64) -> f64; -} -extern "C" { - pub fn __erfc(arg1: f64) -> f64; -} -extern "C" { - pub fn lgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn __lgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn tgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn __tgamma(arg1: f64) -> f64; -} -extern "C" { - pub fn rint(__x: f64) -> f64; -} -extern "C" { - pub fn __rint(__x: f64) -> f64; -} -extern "C" { - pub fn nextafter(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __nextafter(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nexttoward(__x: f64, __y: u128) -> f64; -} -extern "C" { - pub fn __nexttoward(__x: f64, __y: u128) -> f64; -} -extern "C" { - pub fn remainder(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __remainder(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn scalbn(__x: f64, __n: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __scalbn(__x: f64, __n: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ilogb(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogb(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalbln(__x: f64, __n: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn __scalbln(__x: f64, __n: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn nearbyint(__x: f64) -> f64; -} -extern "C" { - pub fn __nearbyint(__x: f64) -> f64; -} -extern "C" { - pub fn round(__x: f64) -> f64; -} -extern "C" { - pub fn __round(__x: f64) -> f64; -} -extern "C" { - pub fn trunc(__x: f64) -> f64; -} -extern "C" { - pub fn __trunc(__x: f64) -> f64; -} -extern "C" { - pub fn remquo(__x: f64, __y: f64, __quo: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn __remquo(__x: f64, __y: f64, __quo: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn lrint(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrint(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrint(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrint(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lround(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lround(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llround(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llround(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdim(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fdim(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmax(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmax(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmin(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn __fmin(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fma(__x: f64, __y: f64, __z: f64) -> f64; -} -extern "C" { - pub fn __fma(__x: f64, __y: f64, __z: f64) -> f64; -} -extern "C" { - pub fn __fpclassifyf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbitf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinff(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finitef(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnanf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsigf(__x: f32, __y: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignalingf(__value: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosf(__x: f32) -> f32; -} -extern "C" { - pub fn __acosf(__x: f32) -> f32; -} -extern "C" { - pub fn asinf(__x: f32) -> f32; -} -extern "C" { - pub fn __asinf(__x: f32) -> f32; -} -extern "C" { - pub fn atanf(__x: f32) -> f32; -} -extern "C" { - pub fn __atanf(__x: f32) -> f32; -} -extern "C" { - pub fn atan2f(__y: f32, __x: f32) -> f32; -} -extern "C" { - pub fn __atan2f(__y: f32, __x: f32) -> f32; -} -extern "C" { - pub fn cosf(__x: f32) -> f32; -} -extern "C" { - pub fn __cosf(__x: f32) -> f32; -} -extern "C" { - pub fn sinf(__x: f32) -> f32; -} -extern "C" { - pub fn __sinf(__x: f32) -> f32; -} -extern "C" { - pub fn tanf(__x: f32) -> f32; -} -extern "C" { - pub fn __tanf(__x: f32) -> f32; -} -extern "C" { - pub fn coshf(__x: f32) -> f32; -} -extern "C" { - pub fn __coshf(__x: f32) -> f32; -} -extern "C" { - pub fn sinhf(__x: f32) -> f32; -} -extern "C" { - pub fn __sinhf(__x: f32) -> f32; -} -extern "C" { - pub fn tanhf(__x: f32) -> f32; -} -extern "C" { - pub fn __tanhf(__x: f32) -> f32; -} -extern "C" { - pub fn acoshf(__x: f32) -> f32; -} -extern "C" { - pub fn __acoshf(__x: f32) -> f32; -} -extern "C" { - pub fn asinhf(__x: f32) -> f32; -} -extern "C" { - pub fn __asinhf(__x: f32) -> f32; -} -extern "C" { - pub fn atanhf(__x: f32) -> f32; -} -extern "C" { - pub fn __atanhf(__x: f32) -> f32; -} -extern "C" { - pub fn expf(__x: f32) -> f32; -} -extern "C" { - pub fn __expf(__x: f32) -> f32; -} -extern "C" { - pub fn frexpf(__x: f32, __exponent: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __frexpf(__x: f32, __exponent: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ldexpf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __ldexpf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn logf(__x: f32) -> f32; -} -extern "C" { - pub fn __logf(__x: f32) -> f32; -} -extern "C" { - pub fn log10f(__x: f32) -> f32; -} -extern "C" { - pub fn __log10f(__x: f32) -> f32; -} -extern "C" { - pub fn modff(__x: f32, __iptr: *mut f32) -> f32; -} -extern "C" { - pub fn __modff(__x: f32, __iptr: *mut f32) -> f32; -} -extern "C" { - pub fn expm1f(__x: f32) -> f32; -} -extern "C" { - pub fn __expm1f(__x: f32) -> f32; -} -extern "C" { - pub fn log1pf(__x: f32) -> f32; -} -extern "C" { - pub fn __log1pf(__x: f32) -> f32; -} -extern "C" { - pub fn logbf(__x: f32) -> f32; -} -extern "C" { - pub fn __logbf(__x: f32) -> f32; -} -extern "C" { - pub fn exp2f(__x: f32) -> f32; -} -extern "C" { - pub fn __exp2f(__x: f32) -> f32; -} -extern "C" { - pub fn log2f(__x: f32) -> f32; -} -extern "C" { - pub fn __log2f(__x: f32) -> f32; -} -extern "C" { - pub fn powf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __powf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn sqrtf(__x: f32) -> f32; -} -extern "C" { - pub fn __sqrtf(__x: f32) -> f32; -} -extern "C" { - pub fn hypotf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __hypotf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn cbrtf(__x: f32) -> f32; -} -extern "C" { - pub fn __cbrtf(__x: f32) -> f32; -} -extern "C" { - pub fn ceilf(__x: f32) -> f32; -} -extern "C" { - pub fn __ceilf(__x: f32) -> f32; -} -extern "C" { - pub fn fabsf(__x: f32) -> f32; -} -extern "C" { - pub fn __fabsf(__x: f32) -> f32; -} -extern "C" { - pub fn floorf(__x: f32) -> f32; -} -extern "C" { - pub fn __floorf(__x: f32) -> f32; -} -extern "C" { - pub fn fmodf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fmodf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn copysignf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __copysignf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn nanf(__tagb: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn __nanf(__tagb: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn erff(arg1: f32) -> f32; -} -extern "C" { - pub fn __erff(arg1: f32) -> f32; -} -extern "C" { - pub fn erfcf(arg1: f32) -> f32; -} -extern "C" { - pub fn __erfcf(arg1: f32) -> f32; -} -extern "C" { - pub fn lgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn __lgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn tgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn __tgammaf(arg1: f32) -> f32; -} -extern "C" { - pub fn rintf(__x: f32) -> f32; -} -extern "C" { - pub fn __rintf(__x: f32) -> f32; -} -extern "C" { - pub fn nextafterf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __nextafterf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn nexttowardf(__x: f32, __y: u128) -> f32; -} -extern "C" { - pub fn __nexttowardf(__x: f32, __y: u128) -> f32; -} -extern "C" { - pub fn remainderf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __remainderf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn scalbnf(__x: f32, __n: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __scalbnf(__x: f32, __n: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ilogbf(__x: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogbf(__x: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalblnf(__x: f32, __n: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn __scalblnf(__x: f32, __n: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn nearbyintf(__x: f32) -> f32; -} -extern "C" { - pub fn __nearbyintf(__x: f32) -> f32; -} -extern "C" { - pub fn roundf(__x: f32) -> f32; -} -extern "C" { - pub fn __roundf(__x: f32) -> f32; -} -extern "C" { - pub fn truncf(__x: f32) -> f32; -} -extern "C" { - pub fn __truncf(__x: f32) -> f32; -} -extern "C" { - pub fn remquof(__x: f32, __y: f32, __quo: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn __remquof(__x: f32, __y: f32, __quo: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn lrintf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrintf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrintf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrintf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lroundf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lroundf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llroundf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llroundf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdimf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fdimf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmaxf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fmaxf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fminf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn __fminf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmaf(__x: f32, __y: f32, __z: f32) -> f32; -} -extern "C" { - pub fn __fmaf(__x: f32, __y: f32, __z: f32) -> f32; -} -extern "C" { - pub fn __fpclassifyl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __signbitl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isinfl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __finitel(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __isnanl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __iseqsigl(__x: u128, __y: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __issignalingl(__value: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosl(__x: u128) -> u128; -} -extern "C" { - pub fn __acosl(__x: u128) -> u128; -} -extern "C" { - pub fn asinl(__x: u128) -> u128; -} -extern "C" { - pub fn __asinl(__x: u128) -> u128; -} -extern "C" { - pub fn atanl(__x: u128) -> u128; -} -extern "C" { - pub fn __atanl(__x: u128) -> u128; -} -extern "C" { - pub fn atan2l(__y: u128, __x: u128) -> u128; -} -extern "C" { - pub fn __atan2l(__y: u128, __x: u128) -> u128; -} -extern "C" { - pub fn cosl(__x: u128) -> u128; -} -extern "C" { - pub fn __cosl(__x: u128) -> u128; -} -extern "C" { - pub fn sinl(__x: u128) -> u128; -} -extern "C" { - pub fn __sinl(__x: u128) -> u128; -} -extern "C" { - pub fn tanl(__x: u128) -> u128; -} -extern "C" { - pub fn __tanl(__x: u128) -> u128; -} -extern "C" { - pub fn coshl(__x: u128) -> u128; -} -extern "C" { - pub fn __coshl(__x: u128) -> u128; -} -extern "C" { - pub fn sinhl(__x: u128) -> u128; -} -extern "C" { - pub fn __sinhl(__x: u128) -> u128; -} -extern "C" { - pub fn tanhl(__x: u128) -> u128; -} -extern "C" { - pub fn __tanhl(__x: u128) -> u128; -} -extern "C" { - pub fn acoshl(__x: u128) -> u128; -} -extern "C" { - pub fn __acoshl(__x: u128) -> u128; -} -extern "C" { - pub fn asinhl(__x: u128) -> u128; -} -extern "C" { - pub fn __asinhl(__x: u128) -> u128; -} -extern "C" { - pub fn atanhl(__x: u128) -> u128; -} -extern "C" { - pub fn __atanhl(__x: u128) -> u128; -} -extern "C" { - pub fn expl(__x: u128) -> u128; -} -extern "C" { - pub fn __expl(__x: u128) -> u128; -} -extern "C" { - pub fn frexpl(__x: u128, __exponent: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __frexpl(__x: u128, __exponent: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn ldexpl(__x: u128, __exponent: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __ldexpl(__x: u128, __exponent: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn logl(__x: u128) -> u128; -} -extern "C" { - pub fn __logl(__x: u128) -> u128; -} -extern "C" { - pub fn log10l(__x: u128) -> u128; -} -extern "C" { - pub fn __log10l(__x: u128) -> u128; -} -extern "C" { - pub fn modfl(__x: u128, __iptr: *mut u128) -> u128; -} -extern "C" { - pub fn __modfl(__x: u128, __iptr: *mut u128) -> u128; -} -extern "C" { - pub fn expm1l(__x: u128) -> u128; -} -extern "C" { - pub fn __expm1l(__x: u128) -> u128; -} -extern "C" { - pub fn log1pl(__x: u128) -> u128; -} -extern "C" { - pub fn __log1pl(__x: u128) -> u128; -} -extern "C" { - pub fn logbl(__x: u128) -> u128; -} -extern "C" { - pub fn __logbl(__x: u128) -> u128; -} -extern "C" { - pub fn exp2l(__x: u128) -> u128; -} -extern "C" { - pub fn __exp2l(__x: u128) -> u128; -} -extern "C" { - pub fn log2l(__x: u128) -> u128; -} -extern "C" { - pub fn __log2l(__x: u128) -> u128; -} -extern "C" { - pub fn powl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __powl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn sqrtl(__x: u128) -> u128; -} -extern "C" { - pub fn __sqrtl(__x: u128) -> u128; -} -extern "C" { - pub fn hypotl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __hypotl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn cbrtl(__x: u128) -> u128; -} -extern "C" { - pub fn __cbrtl(__x: u128) -> u128; -} -extern "C" { - pub fn ceill(__x: u128) -> u128; -} -extern "C" { - pub fn __ceill(__x: u128) -> u128; -} -extern "C" { - pub fn fabsl(__x: u128) -> u128; -} -extern "C" { - pub fn __fabsl(__x: u128) -> u128; -} -extern "C" { - pub fn floorl(__x: u128) -> u128; -} -extern "C" { - pub fn __floorl(__x: u128) -> u128; -} -extern "C" { - pub fn fmodl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fmodl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn copysignl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __copysignl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn nanl(__tagb: *const ::std::os::raw::c_char) -> u128; -} -extern "C" { - pub fn __nanl(__tagb: *const ::std::os::raw::c_char) -> u128; -} -extern "C" { - pub fn erfl(arg1: u128) -> u128; -} -extern "C" { - pub fn __erfl(arg1: u128) -> u128; -} -extern "C" { - pub fn erfcl(arg1: u128) -> u128; -} -extern "C" { - pub fn __erfcl(arg1: u128) -> u128; -} -extern "C" { - pub fn lgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn __lgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn tgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn __tgammal(arg1: u128) -> u128; -} -extern "C" { - pub fn rintl(__x: u128) -> u128; -} -extern "C" { - pub fn __rintl(__x: u128) -> u128; -} -extern "C" { - pub fn nextafterl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __nextafterl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn nexttowardl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __nexttowardl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn remainderl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __remainderl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn scalbnl(__x: u128, __n: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __scalbnl(__x: u128, __n: ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn ilogbl(__x: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __ilogbl(__x: u128) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scalblnl(__x: u128, __n: ::std::os::raw::c_long) -> u128; -} -extern "C" { - pub fn __scalblnl(__x: u128, __n: ::std::os::raw::c_long) -> u128; -} -extern "C" { - pub fn nearbyintl(__x: u128) -> u128; -} -extern "C" { - pub fn __nearbyintl(__x: u128) -> u128; -} -extern "C" { - pub fn roundl(__x: u128) -> u128; -} -extern "C" { - pub fn __roundl(__x: u128) -> u128; -} -extern "C" { - pub fn truncl(__x: u128) -> u128; -} -extern "C" { - pub fn __truncl(__x: u128) -> u128; -} -extern "C" { - pub fn remquol(__x: u128, __y: u128, __quo: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn __remquol(__x: u128, __y: u128, __quo: *mut ::std::os::raw::c_int) -> u128; -} -extern "C" { - pub fn lrintl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lrintl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrintl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llrintl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn lroundl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn __lroundl(__x: u128) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llroundl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn __llroundl(__x: u128) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fdiml(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fdiml(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fmaxl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fmaxl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fminl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn __fminl(__x: u128, __y: u128) -> u128; -} -extern "C" { - pub fn fmal(__x: u128, __y: u128, __z: u128) -> u128; -} -extern "C" { - pub fn __fmal(__x: u128, __y: u128, __z: u128) -> u128; -} - -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _bindgen_ty_1 { - FP_NAN = 0, - FP_INFINITE = 1, - FP_ZERO = 2, - FP_SUBNORMAL = 3, - FP_NORMAL = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GlVersion { - OPENGL_11 = 1, - OPENGL_21 = 2, - OPENGL_33 = 3, - OPENGL_ES_20 = 4, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FramebufferAttachType { - RL_ATTACHMENT_COLOR_CHANNEL0 = 0, - RL_ATTACHMENT_COLOR_CHANNEL1 = 1, - RL_ATTACHMENT_COLOR_CHANNEL2 = 2, - RL_ATTACHMENT_COLOR_CHANNEL3 = 3, - RL_ATTACHMENT_COLOR_CHANNEL4 = 4, - RL_ATTACHMENT_COLOR_CHANNEL5 = 5, - RL_ATTACHMENT_COLOR_CHANNEL6 = 6, - RL_ATTACHMENT_COLOR_CHANNEL7 = 7, - RL_ATTACHMENT_DEPTH = 100, - RL_ATTACHMENT_STENCIL = 200, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FramebufferTexType { - RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5, - RL_ATTACHMENT_TEXTURE2D = 100, - RL_ATTACHMENT_RENDERBUFFER = 200, -} -extern "C" { - pub fn rlMatrixMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlPushMatrix(); -} -extern "C" { - pub fn rlPopMatrix(); -} -extern "C" { - pub fn rlLoadIdentity(); -} -extern "C" { - pub fn rlTranslatef(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlRotatef(angleDeg: f32, x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlScalef(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlMultMatrixf(matf: *mut f32); -} -extern "C" { - pub fn rlFrustum(left: f64, right: f64, bottom: f64, top: f64, znear: f64, zfar: f64); -} -extern "C" { - pub fn rlOrtho(left: f64, right: f64, bottom: f64, top: f64, znear: f64, zfar: f64); -} -extern "C" { - pub fn rlViewport( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlBegin(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlEnd(); -} -extern "C" { - pub fn rlVertex2i(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlVertex2f(x: f32, y: f32); -} -extern "C" { - pub fn rlVertex3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlTexCoord2f(x: f32, y: f32); -} -extern "C" { - pub fn rlNormal3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlColor4ub( - r: ::std::os::raw::c_uchar, - g: ::std::os::raw::c_uchar, - b: ::std::os::raw::c_uchar, - a: ::std::os::raw::c_uchar, - ); -} -extern "C" { - pub fn rlColor3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlColor4f(x: f32, y: f32, z: f32, w: f32); -} -extern "C" { - pub fn rlEnableTexture(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableTexture(); -} -extern "C" { - pub fn rlTextureParameters( - id: ::std::os::raw::c_uint, - param: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlEnableShader(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableShader(); -} -extern "C" { - pub fn rlEnableFramebuffer(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableFramebuffer(); -} -extern "C" { - pub fn rlEnableDepthTest(); -} -extern "C" { - pub fn rlDisableDepthTest(); -} -extern "C" { - pub fn rlEnableDepthMask(); -} -extern "C" { - pub fn rlDisableDepthMask(); -} -extern "C" { - pub fn rlEnableBackfaceCulling(); -} -extern "C" { - pub fn rlDisableBackfaceCulling(); -} -extern "C" { - pub fn rlEnableScissorTest(); -} -extern "C" { - pub fn rlDisableScissorTest(); -} -extern "C" { - pub fn rlScissor( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlEnableWireMode(); -} -extern "C" { - pub fn rlDisableWireMode(); -} -extern "C" { - pub fn rlSetLineWidth(width: f32); -} -extern "C" { - pub fn rlGetLineWidth() -> f32; -} -extern "C" { - pub fn rlEnableSmoothLines(); -} -extern "C" { - pub fn rlDisableSmoothLines(); -} -extern "C" { - pub fn rlClearColor( - r: ::std::os::raw::c_uchar, - g: ::std::os::raw::c_uchar, - b: ::std::os::raw::c_uchar, - a: ::std::os::raw::c_uchar, - ); -} -extern "C" { - pub fn rlClearScreenBuffers(); -} -extern "C" { - pub fn rlUpdateBuffer( - bufferId: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - dataSize: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlLoadAttribBuffer( - vaoId: ::std::os::raw::c_uint, - shaderLoc: ::std::os::raw::c_int, - buffer: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - dynamic: bool, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlglInit(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlglClose(); -} -extern "C" { - pub fn rlglDraw(); -} -extern "C" { - pub fn rlCheckErrors(); -} -extern "C" { - pub fn rlGetVersion() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlCheckBufferLimit(vCount: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn rlSetDebugMarker(text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn rlSetBlendMode( - glSrcFactor: ::std::os::raw::c_int, - glDstFactor: ::std::os::raw::c_int, - glEquation: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlLoadExtensions(loader: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn rlLoadTexture( - data: *mut ::std::os::raw::c_void, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - mipmapCount: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadTextureDepth( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - useRenderBuffer: bool, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadTextureCubemap( - data: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlUpdateTexture( - id: ::std::os::raw::c_uint, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - data: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn rlGetGlTextureFormats( - format: ::std::os::raw::c_int, - glInternalFormat: *mut ::std::os::raw::c_uint, - glFormat: *mut ::std::os::raw::c_uint, - glType: *mut ::std::os::raw::c_uint, - ); -} -extern "C" { - pub fn rlUnloadTexture(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlGenerateMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn rlReadTexturePixels(texture: Texture2D) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn rlReadScreenPixels( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn rlLoadFramebuffer( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlFramebufferAttach( - fboId: ::std::os::raw::c_uint, - texId: ::std::os::raw::c_uint, - attachType: ::std::os::raw::c_int, - texType: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlFramebufferComplete(id: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn rlUnloadFramebuffer(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlLoadMesh(mesh: *mut Mesh, dynamic: bool); -} -extern "C" { - pub fn rlUpdateMesh(mesh: Mesh, buffer: ::std::os::raw::c_int, count: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlUpdateMeshAt( - mesh: Mesh, - buffer: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - index: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlDrawMesh(mesh: Mesh, material: Material, transform: Matrix); -} -extern "C" { - pub fn rlDrawMeshInstanced( - mesh: Mesh, - material: Material, - transforms: *mut Matrix, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlUnloadMesh(mesh: Mesh); -} -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::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, -} -#[test] -fn bindgen_test_layout_div_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn __ctype_get_mb_cur_max() -> size_t; -} -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 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 rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); -} -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 free(__ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn aligned_alloc(__alignment: size_t, __size: size_t) -> *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 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 system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -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: size_t, - __size: size_t, - __compar: __compar_fn_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nmemb: size_t, - __size: size_t, - __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 mblen(__s: *const ::std::os::raw::c_char, __n: size_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbtowc( - __pwc: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: size_t, - ) -> ::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: size_t, - ) -> size_t; -} -extern "C" { - pub fn wcstombs( - __s: *mut ::std::os::raw::c_char, - __pwcs: *const wchar_t, - __n: size_t, - ) -> size_t; -} -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 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; -} -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 strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct gladGLversionStruct { - pub major: ::std::os::raw::c_int, - pub minor: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_gladGLversionStruct() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gladGLversionStruct)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(gladGLversionStruct)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).major as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gladGLversionStruct), - "::", - stringify!(major) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).minor as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(gladGLversionStruct), - "::", - stringify!(minor) - ) - ); -} -pub type GLADloadproc = ::std::option::Option< - unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut GLVersion: gladGLversionStruct; -} -extern "C" { - pub fn gladLoadGLLoader(arg1: GLADloadproc) -> ::std::os::raw::c_int; -} -#[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, -} -#[test] -fn bindgen_test_layout_max_align_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce2) - ) - ); -} -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 type __gwchar_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct imaxdiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_imaxdiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(imaxdiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(imaxdiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn imaxabs(__n: intmax_t) -> intmax_t; -} -extern "C" { - pub fn imaxdiv(__numer: intmax_t, __denom: intmax_t) -> imaxdiv_t; -} -extern "C" { - pub fn strtoimax( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn strtoumax( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> uintmax_t; -} -extern "C" { - pub fn wcstoimax( - __nptr: *const __gwchar_t, - __endptr: *mut *mut __gwchar_t, - __base: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn wcstoumax( - __nptr: *const __gwchar_t, - __endptr: *mut *mut __gwchar_t, - __base: ::std::os::raw::c_int, - ) -> uintmax_t; -} -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 GLclampx = ::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; -pub type GLeglImageOES = *mut ::std::os::raw::c_void; -pub type GLchar = ::std::os::raw::c_char; -pub type GLcharARB = ::std::os::raw::c_char; -pub type GLhandleARB = ::std::os::raw::c_uint; -pub type GLhalfARB = ::std::os::raw::c_ushort; -pub type GLhalf = ::std::os::raw::c_ushort; -pub type GLfixed = GLint; -pub type GLintptr = isize; -pub type GLsizeiptr = isize; -pub type GLint64 = i64; -pub type GLuint64 = u64; -pub type GLintptrARB = isize; -pub type GLsizeiptrARB = isize; -pub type GLint64EXT = i64; -pub type GLuint64EXT = u64; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __GLsync { - _unused: [u8; 0], -} -pub type GLsync = *mut __GLsync; -#[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 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 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 GLDEBUGPROCKHR = ::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 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 GLhalfNV = ::std::os::raw::c_ushort; -pub type GLvdpauSurfaceNV = GLintptr; -extern "C" { - pub static mut GLAD_GL_VERSION_1_0: ::std::os::raw::c_int; -} -pub type PFNGLCULLFACEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glCullFace: PFNGLCULLFACEPROC; -} -pub type PFNGLFRONTFACEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFrontFace: PFNGLFRONTFACEPROC; -} -pub type PFNGLHINTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glHint: PFNGLHINTPROC; -} -pub type PFNGLLINEWIDTHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLineWidth: PFNGLLINEWIDTHPROC; -} -pub type PFNGLPOINTSIZEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glPointSize: PFNGLPOINTSIZEPROC; -} -pub type PFNGLPOLYGONMODEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPolygonMode: PFNGLPOLYGONMODEPROC; -} -pub type PFNGLSCISSORPROC = ::std::option::Option< - unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glScissor: PFNGLSCISSORPROC; -} -pub type PFNGLTEXPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexParameterf: PFNGLTEXPARAMETERFPROC; -} -pub type PFNGLTEXPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glTexParameterfv: PFNGLTEXPARAMETERFVPROC; -} -pub type PFNGLTEXPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexParameteri: PFNGLTEXPARAMETERIPROC; -} -pub type PFNGLTEXPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), ->; -extern "C" { - pub static mut glad_glTexParameteriv: PFNGLTEXPARAMETERIVPROC; -} -pub type PFNGLTEXIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLint, - width: GLsizei, - border: GLint, - format: GLenum, - type_: GLenum, - pixels: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexImage1D: PFNGLTEXIMAGE1DPROC; -} -pub type PFNGLTEXIMAGE2DPROC = ::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 glad_glTexImage2D: PFNGLTEXIMAGE2DPROC; -} -pub type PFNGLDRAWBUFFERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffer: PFNGLDRAWBUFFERPROC; -} -pub type PFNGLCLEARPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClear: PFNGLCLEARPROC; -} -pub type PFNGLCLEARCOLORPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glClearColor: PFNGLCLEARCOLORPROC; -} -pub type PFNGLCLEARSTENCILPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearStencil: PFNGLCLEARSTENCILPROC; -} -pub type PFNGLCLEARDEPTHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearDepth: PFNGLCLEARDEPTHPROC; -} -pub type PFNGLSTENCILMASKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glStencilMask: PFNGLSTENCILMASKPROC; -} -pub type PFNGLCOLORMASKPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean), ->; -extern "C" { - pub static mut glad_glColorMask: PFNGLCOLORMASKPROC; -} -pub type PFNGLDEPTHMASKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthMask: PFNGLDEPTHMASKPROC; -} -pub type PFNGLDISABLEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDisable: PFNGLDISABLEPROC; -} -pub type PFNGLENABLEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEnable: PFNGLENABLEPROC; -} -pub type PFNGLFINISHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFinish: PFNGLFINISHPROC; -} -pub type PFNGLFLUSHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFlush: PFNGLFLUSHPROC; -} -pub type PFNGLBLENDFUNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendFunc: PFNGLBLENDFUNCPROC; -} -pub type PFNGLLOGICOPPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLogicOp: PFNGLLOGICOPPROC; -} -pub type PFNGLSTENCILFUNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilFunc: PFNGLSTENCILFUNCPROC; -} -pub type PFNGLSTENCILOPPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilOp: PFNGLSTENCILOPPROC; -} -pub type PFNGLDEPTHFUNCPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthFunc: PFNGLDEPTHFUNCPROC; -} -pub type PFNGLPIXELSTOREFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPixelStoref: PFNGLPIXELSTOREFPROC; -} -pub type PFNGLPIXELSTOREIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPixelStorei: PFNGLPIXELSTOREIPROC; -} -pub type PFNGLREADBUFFERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glReadBuffer: PFNGLREADBUFFERPROC; -} -pub type PFNGLREADPIXELSPROC = ::std::option::Option< - unsafe extern "C" fn( - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - format: GLenum, - type_: GLenum, - pixels: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glReadPixels: PFNGLREADPIXELSPROC; -} -pub type PFNGLGETBOOLEANVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBooleanv: PFNGLGETBOOLEANVPROC; -} -pub type PFNGLGETDOUBLEVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetDoublev: PFNGLGETDOUBLEVPROC; -} -pub type PFNGLGETERRORPROC = ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glGetError: PFNGLGETERRORPROC; -} -pub type PFNGLGETFLOATVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetFloatv: PFNGLGETFLOATVPROC; -} -pub type PFNGLGETINTEGERVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetIntegerv: PFNGLGETINTEGERVPROC; -} -pub type PFNGLGETSTRINGPROC = - ::std::option::Option *const GLubyte>; -extern "C" { - pub static mut glad_glGetString: PFNGLGETSTRINGPROC; -} -pub type PFNGLGETTEXIMAGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - format: GLenum, - type_: GLenum, - pixels: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetTexImage: PFNGLGETTEXIMAGEPROC; -} -pub type PFNGLGETTEXPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetTexParameterfv: PFNGLGETTEXPARAMETERFVPROC; -} -pub type PFNGLGETTEXPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameteriv: PFNGLGETTEXPARAMETERIVPROC; -} -pub type PFNGLGETTEXLEVELPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetTexLevelParameterfv: PFNGLGETTEXLEVELPARAMETERFVPROC; -} -pub type PFNGLGETTEXLEVELPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetTexLevelParameteriv: PFNGLGETTEXLEVELPARAMETERIVPROC; -} -pub type PFNGLISENABLEDPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsEnabled: PFNGLISENABLEDPROC; -} -pub type PFNGLDEPTHRANGEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDepthRange: PFNGLDEPTHRANGEPROC; -} -pub type PFNGLVIEWPORTPROC = ::std::option::Option< - unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glViewport: PFNGLVIEWPORTPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_1: ::std::os::raw::c_int; -} -pub type PFNGLDRAWARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawArrays: PFNGLDRAWARRAYSPROC; -} -pub type PFNGLDRAWELEMENTSPROC = ::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 glad_glDrawElements: PFNGLDRAWELEMENTSPROC; -} -pub type PFNGLPOLYGONOFFSETPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPolygonOffset: PFNGLPOLYGONOFFSETPROC; -} -pub type PFNGLCOPYTEXIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLenum, - x: GLint, - y: GLint, - width: GLsizei, - border: GLint, - ), ->; -extern "C" { - pub static mut glad_glCopyTexImage1D: PFNGLCOPYTEXIMAGE1DPROC; -} -pub type PFNGLCOPYTEXIMAGE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLenum, - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - border: GLint, - ), ->; -extern "C" { - pub static mut glad_glCopyTexImage2D: PFNGLCOPYTEXIMAGE2DPROC; -} -pub type PFNGLCOPYTEXSUBIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - xoffset: GLint, - x: GLint, - y: GLint, - width: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glCopyTexSubImage1D: PFNGLCOPYTEXSUBIMAGE1DPROC; -} -pub type PFNGLCOPYTEXSUBIMAGE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - xoffset: GLint, - yoffset: GLint, - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glCopyTexSubImage2D: PFNGLCOPYTEXSUBIMAGE2DPROC; -} -pub type PFNGLTEXSUBIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glTexSubImage1D: PFNGLTEXSUBIMAGE1DPROC; -} -pub type PFNGLTEXSUBIMAGE2DPROC = ::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 glad_glTexSubImage2D: PFNGLTEXSUBIMAGE2DPROC; -} -pub type PFNGLBINDTEXTUREPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindTexture: PFNGLBINDTEXTUREPROC; -} -pub type PFNGLDELETETEXTURESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteTextures: PFNGLDELETETEXTURESPROC; -} -pub type PFNGLGENTEXTURESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenTextures: PFNGLGENTEXTURESPROC; -} -pub type PFNGLISTEXTUREPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsTexture: PFNGLISTEXTUREPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_2: ::std::os::raw::c_int; -} -pub type PFNGLDRAWRANGEELEMENTSPROC = ::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 static mut glad_glDrawRangeElements: PFNGLDRAWRANGEELEMENTSPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexImage3D: PFNGLTEXIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexSubImage3D: PFNGLTEXSUBIMAGE3DPROC; -} -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 static mut glad_glCopyTexSubImage3D: PFNGLCOPYTEXSUBIMAGE3DPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_3: ::std::os::raw::c_int; -} -pub type PFNGLACTIVETEXTUREPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glActiveTexture: PFNGLACTIVETEXTUREPROC; -} -pub type PFNGLSAMPLECOVERAGEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleCoverage: PFNGLSAMPLECOVERAGEPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage3D: PFNGLCOMPRESSEDTEXIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage2D: PFNGLCOMPRESSEDTEXIMAGE2DPROC; -} -pub type PFNGLCOMPRESSEDTEXIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage1D: PFNGLCOMPRESSEDTEXIMAGE1DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage3D: PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage2D: PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC; -} -pub type PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage1D: PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC; -} -pub type PFNGLGETCOMPRESSEDTEXIMAGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, img: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetCompressedTexImage: PFNGLGETCOMPRESSEDTEXIMAGEPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_4: ::std::os::raw::c_int; -} -pub type PFNGLBLENDFUNCSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn( - sfactorRGB: GLenum, - dfactorRGB: GLenum, - sfactorAlpha: GLenum, - dfactorAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparate: PFNGLBLENDFUNCSEPARATEPROC; -} -pub type PFNGLMULTIDRAWARRAYSPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - first: *const GLint, - count: *const GLsizei, - drawcount: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawArrays: PFNGLMULTIDRAWARRAYSPROC; -} -pub type PFNGLMULTIDRAWELEMENTSPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - count: *const GLsizei, - type_: GLenum, - indices: *mut *const ::std::os::raw::c_void, - drawcount: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawElements: PFNGLMULTIDRAWELEMENTSPROC; -} -pub type PFNGLPOINTPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameterf: PFNGLPOINTPARAMETERFPROC; -} -pub type PFNGLPOINTPARAMETERFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameterfv: PFNGLPOINTPARAMETERFVPROC; -} -pub type PFNGLPOINTPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameteri: PFNGLPOINTPARAMETERIPROC; -} -pub type PFNGLPOINTPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameteriv: PFNGLPOINTPARAMETERIVPROC; -} -pub type PFNGLBLENDCOLORPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glBlendColor: PFNGLBLENDCOLORPROC; -} -pub type PFNGLBLENDEQUATIONPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquation: PFNGLBLENDEQUATIONPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_5: ::std::os::raw::c_int; -} -pub type PFNGLGENQUERIESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenQueries: PFNGLGENQUERIESPROC; -} -pub type PFNGLDELETEQUERIESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteQueries: PFNGLDELETEQUERIESPROC; -} -pub type PFNGLISQUERYPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsQuery: PFNGLISQUERYPROC; -} -pub type PFNGLBEGINQUERYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginQuery: PFNGLBEGINQUERYPROC; -} -pub type PFNGLENDQUERYPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndQuery: PFNGLENDQUERYPROC; -} -pub type PFNGLGETQUERYIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryiv: PFNGLGETQUERYIVPROC; -} -pub type PFNGLGETQUERYOBJECTIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectiv: PFNGLGETQUERYOBJECTIVPROC; -} -pub type PFNGLGETQUERYOBJECTUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectuiv: PFNGLGETQUERYOBJECTUIVPROC; -} -pub type PFNGLBINDBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBuffer: PFNGLBINDBUFFERPROC; -} -pub type PFNGLDELETEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteBuffers: PFNGLDELETEBUFFERSPROC; -} -pub type PFNGLGENBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenBuffers: PFNGLGENBUFFERSPROC; -} -pub type PFNGLISBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsBuffer: PFNGLISBUFFERPROC; -} -pub type PFNGLBUFFERDATAPROC = ::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 glad_glBufferData: PFNGLBUFFERDATAPROC; -} -pub type PFNGLBUFFERSUBDATAPROC = ::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 glad_glBufferSubData: PFNGLBUFFERSUBDATAPROC; -} -pub type PFNGLGETBUFFERSUBDATAPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptr, - size: GLsizeiptr, - data: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetBufferSubData: PFNGLGETBUFFERSUBDATAPROC; -} -pub type PFNGLMAPBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBuffer: PFNGLMAPBUFFERPROC; -} -pub type PFNGLUNMAPBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glUnmapBuffer: PFNGLUNMAPBUFFERPROC; -} -pub type PFNGLGETBUFFERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBufferParameteriv: PFNGLGETBUFFERPARAMETERIVPROC; -} -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 static mut glad_glGetBufferPointerv: PFNGLGETBUFFERPOINTERVPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_2_0: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONSEPARATEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparate: PFNGLBLENDEQUATIONSEPARATEPROC; -} -pub type PFNGLDRAWBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffers: PFNGLDRAWBUFFERSPROC; -} -pub type PFNGLSTENCILOPSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum), ->; -extern "C" { - pub static mut glad_glStencilOpSeparate: PFNGLSTENCILOPSEPARATEPROC; -} -pub type PFNGLSTENCILFUNCSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint), ->; -extern "C" { - pub static mut glad_glStencilFuncSeparate: PFNGLSTENCILFUNCSEPARATEPROC; -} -pub type PFNGLSTENCILMASKSEPARATEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilMaskSeparate: PFNGLSTENCILMASKSEPARATEPROC; -} -pub type PFNGLATTACHSHADERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glAttachShader: PFNGLATTACHSHADERPROC; -} -pub type PFNGLBINDATTRIBLOCATIONPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, index: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindAttribLocation: PFNGLBINDATTRIBLOCATIONPROC; -} -pub type PFNGLCOMPILESHADERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glCompileShader: PFNGLCOMPILESHADERPROC; -} -pub type PFNGLCREATEPROGRAMPROC = ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glCreateProgram: PFNGLCREATEPROGRAMPROC; -} -pub type PFNGLCREATESHADERPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glCreateShader: PFNGLCREATESHADERPROC; -} -pub type PFNGLDELETEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteProgram: PFNGLDELETEPROGRAMPROC; -} -pub type PFNGLDELETESHADERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteShader: PFNGLDELETESHADERPROC; -} -pub type PFNGLDETACHSHADERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDetachShader: PFNGLDETACHSHADERPROC; -} -pub type PFNGLDISABLEVERTEXATTRIBARRAYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVertexAttribArray: PFNGLDISABLEVERTEXATTRIBARRAYPROC; -} -pub type PFNGLENABLEVERTEXATTRIBARRAYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVertexAttribArray: PFNGLENABLEVERTEXATTRIBARRAYPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveAttrib: PFNGLGETACTIVEATTRIBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniform: PFNGLGETACTIVEUNIFORMPROC; -} -pub type PFNGLGETATTACHEDSHADERSPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - maxCount: GLsizei, - count: *mut GLsizei, - shaders: *mut GLuint, - ), ->; -extern "C" { - pub static mut glad_glGetAttachedShaders: PFNGLGETATTACHEDSHADERSPROC; -} -pub type PFNGLGETATTRIBLOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetAttribLocation: PFNGLGETATTRIBLOCATIONPROC; -} -pub type PFNGLGETPROGRAMIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetProgramiv: PFNGLGETPROGRAMIVPROC; -} -pub type PFNGLGETPROGRAMINFOLOGPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - infoLog: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetProgramInfoLog: PFNGLGETPROGRAMINFOLOGPROC; -} -pub type PFNGLGETSHADERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetShaderiv: PFNGLGETSHADERIVPROC; -} -pub type PFNGLGETSHADERINFOLOGPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - infoLog: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetShaderInfoLog: PFNGLGETSHADERINFOLOGPROC; -} -pub type PFNGLGETSHADERSOURCEPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - source: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetShaderSource: PFNGLGETSHADERSOURCEPROC; -} -pub type PFNGLGETUNIFORMLOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetUniformLocation: PFNGLGETUNIFORMLOCATIONPROC; -} -pub type PFNGLGETUNIFORMFVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetUniformfv: PFNGLGETUNIFORMFVPROC; -} -pub type PFNGLGETUNIFORMIVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetUniformiv: PFNGLGETUNIFORMIVPROC; -} -pub type PFNGLGETVERTEXATTRIBDVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetVertexAttribdv: PFNGLGETVERTEXATTRIBDVPROC; -} -pub type PFNGLGETVERTEXATTRIBFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribfv: PFNGLGETVERTEXATTRIBFVPROC; -} -pub type PFNGLGETVERTEXATTRIBIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribiv: PFNGLGETVERTEXATTRIBIVPROC; -} -pub type PFNGLGETVERTEXATTRIBPOINTERVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, pointer: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetVertexAttribPointerv: PFNGLGETVERTEXATTRIBPOINTERVPROC; -} -pub type PFNGLISPROGRAMPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsProgram: PFNGLISPROGRAMPROC; -} -pub type PFNGLISSHADERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsShader: PFNGLISSHADERPROC; -} -pub type PFNGLLINKPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLinkProgram: PFNGLLINKPROGRAMPROC; -} -pub type PFNGLSHADERSOURCEPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - count: GLsizei, - string: *mut *const GLchar, - length: *const GLint, - ), ->; -extern "C" { - pub static mut glad_glShaderSource: PFNGLSHADERSOURCEPROC; -} -pub type PFNGLUSEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glUseProgram: PFNGLUSEPROGRAMPROC; -} -pub type PFNGLUNIFORM1FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1f: PFNGLUNIFORM1FPROC; -} -pub type PFNGLUNIFORM2FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2f: PFNGLUNIFORM2FPROC; -} -pub type PFNGLUNIFORM3FPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), ->; -extern "C" { - pub static mut glad_glUniform3f: PFNGLUNIFORM3FPROC; -} -pub type PFNGLUNIFORM4FPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat), ->; -extern "C" { - pub static mut glad_glUniform4f: PFNGLUNIFORM4FPROC; -} -pub type PFNGLUNIFORM1IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1i: PFNGLUNIFORM1IPROC; -} -pub type PFNGLUNIFORM2IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2i: PFNGLUNIFORM2IPROC; -} -pub type PFNGLUNIFORM3IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform3i: PFNGLUNIFORM3IPROC; -} -pub type PFNGLUNIFORM4IPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint), ->; -extern "C" { - pub static mut glad_glUniform4i: PFNGLUNIFORM4IPROC; -} -pub type PFNGLUNIFORM1FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform1fv: PFNGLUNIFORM1FVPROC; -} -pub type PFNGLUNIFORM2FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform2fv: PFNGLUNIFORM2FVPROC; -} -pub type PFNGLUNIFORM3FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform3fv: PFNGLUNIFORM3FVPROC; -} -pub type PFNGLUNIFORM4FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform4fv: PFNGLUNIFORM4FVPROC; -} -pub type PFNGLUNIFORM1IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform1iv: PFNGLUNIFORM1IVPROC; -} -pub type PFNGLUNIFORM2IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform2iv: PFNGLUNIFORM2IVPROC; -} -pub type PFNGLUNIFORM3IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform3iv: PFNGLUNIFORM3IVPROC; -} -pub type PFNGLUNIFORM4IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform4iv: PFNGLUNIFORM4IVPROC; -} -pub type PFNGLUNIFORMMATRIX2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2fv: PFNGLUNIFORMMATRIX2FVPROC; -} -pub type PFNGLUNIFORMMATRIX3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3fv: PFNGLUNIFORMMATRIX3FVPROC; -} -pub type PFNGLUNIFORMMATRIX4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4fv: PFNGLUNIFORMMATRIX4FVPROC; -} -pub type PFNGLVALIDATEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glValidateProgram: PFNGLVALIDATEPROGRAMPROC; -} -pub type PFNGLVERTEXATTRIB1DPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1d: PFNGLVERTEXATTRIB1DPROC; -} -pub type PFNGLVERTEXATTRIB1DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dv: PFNGLVERTEXATTRIB1DVPROC; -} -pub type PFNGLVERTEXATTRIB1FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1f: PFNGLVERTEXATTRIB1FPROC; -} -pub type PFNGLVERTEXATTRIB1FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fv: PFNGLVERTEXATTRIB1FVPROC; -} -pub type PFNGLVERTEXATTRIB1SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1s: PFNGLVERTEXATTRIB1SPROC; -} -pub type PFNGLVERTEXATTRIB1SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1sv: PFNGLVERTEXATTRIB1SVPROC; -} -pub type PFNGLVERTEXATTRIB2DPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2d: PFNGLVERTEXATTRIB2DPROC; -} -pub type PFNGLVERTEXATTRIB2DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dv: PFNGLVERTEXATTRIB2DVPROC; -} -pub type PFNGLVERTEXATTRIB2FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2f: PFNGLVERTEXATTRIB2FPROC; -} -pub type PFNGLVERTEXATTRIB2FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fv: PFNGLVERTEXATTRIB2FVPROC; -} -pub type PFNGLVERTEXATTRIB2SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2s: PFNGLVERTEXATTRIB2SPROC; -} -pub type PFNGLVERTEXATTRIB2SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2sv: PFNGLVERTEXATTRIB2SVPROC; -} -pub type PFNGLVERTEXATTRIB3DPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib3d: PFNGLVERTEXATTRIB3DPROC; -} -pub type PFNGLVERTEXATTRIB3DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3dv: PFNGLVERTEXATTRIB3DVPROC; -} -pub type PFNGLVERTEXATTRIB3FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3f: PFNGLVERTEXATTRIB3FPROC; -} -pub type PFNGLVERTEXATTRIB3FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fv: PFNGLVERTEXATTRIB3FVPROC; -} -pub type PFNGLVERTEXATTRIB3SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3s: PFNGLVERTEXATTRIB3SPROC; -} -pub type PFNGLVERTEXATTRIB3SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3sv: PFNGLVERTEXATTRIB3SVPROC; -} -pub type PFNGLVERTEXATTRIB4NBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nbv: PFNGLVERTEXATTRIB4NBVPROC; -} -pub type PFNGLVERTEXATTRIB4NIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Niv: PFNGLVERTEXATTRIB4NIVPROC; -} -pub type PFNGLVERTEXATTRIB4NSVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nsv: PFNGLVERTEXATTRIB4NSVPROC; -} -pub type PFNGLVERTEXATTRIB4NUBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), ->; -extern "C" { - pub static mut glad_glVertexAttrib4Nub: PFNGLVERTEXATTRIB4NUBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nubv: PFNGLVERTEXATTRIB4NUBVPROC; -} -pub type PFNGLVERTEXATTRIB4NUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nuiv: PFNGLVERTEXATTRIB4NUIVPROC; -} -pub type PFNGLVERTEXATTRIB4NUSVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nusv: PFNGLVERTEXATTRIB4NUSVPROC; -} -pub type PFNGLVERTEXATTRIB4BVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4bv: PFNGLVERTEXATTRIB4BVPROC; -} -pub type PFNGLVERTEXATTRIB4DPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib4d: PFNGLVERTEXATTRIB4DPROC; -} -pub type PFNGLVERTEXATTRIB4DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4dv: PFNGLVERTEXATTRIB4DVPROC; -} -pub type PFNGLVERTEXATTRIB4FPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), ->; -extern "C" { - pub static mut glad_glVertexAttrib4f: PFNGLVERTEXATTRIB4FPROC; -} -pub type PFNGLVERTEXATTRIB4FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4fv: PFNGLVERTEXATTRIB4FVPROC; -} -pub type PFNGLVERTEXATTRIB4IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4iv: PFNGLVERTEXATTRIB4IVPROC; -} -pub type PFNGLVERTEXATTRIB4SPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), ->; -extern "C" { - pub static mut glad_glVertexAttrib4s: PFNGLVERTEXATTRIB4SPROC; -} -pub type PFNGLVERTEXATTRIB4SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4sv: PFNGLVERTEXATTRIB4SVPROC; -} -pub type PFNGLVERTEXATTRIB4UBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ubv: PFNGLVERTEXATTRIB4UBVPROC; -} -pub type PFNGLVERTEXATTRIB4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4uiv: PFNGLVERTEXATTRIB4UIVPROC; -} -pub type PFNGLVERTEXATTRIB4USVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4usv: PFNGLVERTEXATTRIB4USVPROC; -} -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 static mut glad_glVertexAttribPointer: PFNGLVERTEXATTRIBPOINTERPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_2_1: ::std::os::raw::c_int; -} -pub type PFNGLUNIFORMMATRIX2X3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2x3fv: PFNGLUNIFORMMATRIX2X3FVPROC; -} -pub type PFNGLUNIFORMMATRIX3X2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3x2fv: PFNGLUNIFORMMATRIX3X2FVPROC; -} -pub type PFNGLUNIFORMMATRIX2X4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2x4fv: PFNGLUNIFORMMATRIX2X4FVPROC; -} -pub type PFNGLUNIFORMMATRIX4X2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4x2fv: PFNGLUNIFORMMATRIX4X2FVPROC; -} -pub type PFNGLUNIFORMMATRIX3X4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3x4fv: PFNGLUNIFORMMATRIX3X4FVPROC; -} -pub type PFNGLUNIFORMMATRIX4X3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4x3fv: PFNGLUNIFORMMATRIX4X3FVPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_0: ::std::os::raw::c_int; -} -pub type PFNGLCOLORMASKIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean), ->; -extern "C" { - pub static mut glad_glColorMaski: PFNGLCOLORMASKIPROC; -} -pub type PFNGLGETBOOLEANI_VPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, data: *mut GLboolean), ->; -extern "C" { - pub static mut glad_glGetBooleani_v: PFNGLGETBOOLEANI_VPROC; -} -pub type PFNGLGETINTEGERI_VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetIntegeri_v: PFNGLGETINTEGERI_VPROC; -} -pub type PFNGLENABLEIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnablei: PFNGLENABLEIPROC; -} -pub type PFNGLDISABLEIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisablei: PFNGLDISABLEIPROC; -} -pub type PFNGLISENABLEDIPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsEnabledi: PFNGLISENABLEDIPROC; -} -pub type PFNGLBEGINTRANSFORMFEEDBACKPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginTransformFeedback: PFNGLBEGINTRANSFORMFEEDBACKPROC; -} -pub type PFNGLENDTRANSFORMFEEDBACKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndTransformFeedback: PFNGLENDTRANSFORMFEEDBACKPROC; -} -pub type PFNGLBINDBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - buffer: GLuint, - offset: GLintptr, - size: GLsizeiptr, - ), ->; -extern "C" { - pub static mut glad_glBindBufferRange: PFNGLBINDBUFFERRANGEPROC; -} -pub type PFNGLBINDBUFFERBASEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBufferBase: PFNGLBINDBUFFERBASEPROC; -} -pub type PFNGLTRANSFORMFEEDBACKVARYINGSPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - count: GLsizei, - varyings: *mut *const GLchar, - bufferMode: GLenum, - ), ->; -extern "C" { - pub static mut glad_glTransformFeedbackVaryings: PFNGLTRANSFORMFEEDBACKVARYINGSPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetTransformFeedbackVarying: PFNGLGETTRANSFORMFEEDBACKVARYINGPROC; -} -pub type PFNGLCLAMPCOLORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glClampColor: PFNGLCLAMPCOLORPROC; -} -pub type PFNGLBEGINCONDITIONALRENDERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginConditionalRender: PFNGLBEGINCONDITIONALRENDERPROC; -} -pub type PFNGLENDCONDITIONALRENDERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndConditionalRender: PFNGLENDCONDITIONALRENDERPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribIPointer: PFNGLVERTEXATTRIBIPOINTERPROC; -} -pub type PFNGLGETVERTEXATTRIBIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribIiv: PFNGLGETVERTEXATTRIBIIVPROC; -} -pub type PFNGLGETVERTEXATTRIBIUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribIuiv: PFNGLGETVERTEXATTRIBIUIVPROC; -} -pub type PFNGLVERTEXATTRIBI1IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1i: PFNGLVERTEXATTRIBI1IPROC; -} -pub type PFNGLVERTEXATTRIBI2IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2i: PFNGLVERTEXATTRIBI2IPROC; -} -pub type PFNGLVERTEXATTRIBI3IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3i: PFNGLVERTEXATTRIBI3IPROC; -} -pub type PFNGLVERTEXATTRIBI4IPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), ->; -extern "C" { - pub static mut glad_glVertexAttribI4i: PFNGLVERTEXATTRIBI4IPROC; -} -pub type PFNGLVERTEXATTRIBI1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1ui: PFNGLVERTEXATTRIBI1UIPROC; -} -pub type PFNGLVERTEXATTRIBI2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2ui: PFNGLVERTEXATTRIBI2UIPROC; -} -pub type PFNGLVERTEXATTRIBI3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3ui: PFNGLVERTEXATTRIBI3UIPROC; -} -pub type PFNGLVERTEXATTRIBI4UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribI4ui: PFNGLVERTEXATTRIBI4UIPROC; -} -pub type PFNGLVERTEXATTRIBI1IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1iv: PFNGLVERTEXATTRIBI1IVPROC; -} -pub type PFNGLVERTEXATTRIBI2IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2iv: PFNGLVERTEXATTRIBI2IVPROC; -} -pub type PFNGLVERTEXATTRIBI3IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3iv: PFNGLVERTEXATTRIBI3IVPROC; -} -pub type PFNGLVERTEXATTRIBI4IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4iv: PFNGLVERTEXATTRIBI4IVPROC; -} -pub type PFNGLVERTEXATTRIBI1UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1uiv: PFNGLVERTEXATTRIBI1UIVPROC; -} -pub type PFNGLVERTEXATTRIBI2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2uiv: PFNGLVERTEXATTRIBI2UIVPROC; -} -pub type PFNGLVERTEXATTRIBI3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3uiv: PFNGLVERTEXATTRIBI3UIVPROC; -} -pub type PFNGLVERTEXATTRIBI4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4uiv: PFNGLVERTEXATTRIBI4UIVPROC; -} -pub type PFNGLVERTEXATTRIBI4BVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4bv: PFNGLVERTEXATTRIBI4BVPROC; -} -pub type PFNGLVERTEXATTRIBI4SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4sv: PFNGLVERTEXATTRIBI4SVPROC; -} -pub type PFNGLVERTEXATTRIBI4UBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4ubv: PFNGLVERTEXATTRIBI4UBVPROC; -} -pub type PFNGLVERTEXATTRIBI4USVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4usv: PFNGLVERTEXATTRIBI4USVPROC; -} -pub type PFNGLGETUNIFORMUIVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint), ->; -extern "C" { - pub static mut glad_glGetUniformuiv: PFNGLGETUNIFORMUIVPROC; -} -pub type PFNGLBINDFRAGDATALOCATIONPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, color: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindFragDataLocation: PFNGLBINDFRAGDATALOCATIONPROC; -} -pub type PFNGLGETFRAGDATALOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetFragDataLocation: PFNGLGETFRAGDATALOCATIONPROC; -} -pub type PFNGLUNIFORM1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1ui: PFNGLUNIFORM1UIPROC; -} -pub type PFNGLUNIFORM2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2ui: PFNGLUNIFORM2UIPROC; -} -pub type PFNGLUNIFORM3UIPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), ->; -extern "C" { - pub static mut glad_glUniform3ui: PFNGLUNIFORM3UIPROC; -} -pub type PFNGLUNIFORM4UIPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint), ->; -extern "C" { - pub static mut glad_glUniform4ui: PFNGLUNIFORM4UIPROC; -} -pub type PFNGLUNIFORM1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform1uiv: PFNGLUNIFORM1UIVPROC; -} -pub type PFNGLUNIFORM2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform2uiv: PFNGLUNIFORM2UIVPROC; -} -pub type PFNGLUNIFORM3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform3uiv: PFNGLUNIFORM3UIVPROC; -} -pub type PFNGLUNIFORM4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform4uiv: PFNGLUNIFORM4UIVPROC; -} -pub type PFNGLTEXPARAMETERIIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), ->; -extern "C" { - pub static mut glad_glTexParameterIiv: PFNGLTEXPARAMETERIIVPROC; -} -pub type PFNGLTEXPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLuint), ->; -extern "C" { - pub static mut glad_glTexParameterIuiv: PFNGLTEXPARAMETERIUIVPROC; -} -pub type PFNGLGETTEXPARAMETERIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameterIiv: PFNGLGETTEXPARAMETERIIVPROC; -} -pub type PFNGLGETTEXPARAMETERIUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameterIuiv: PFNGLGETTEXPARAMETERIUIVPROC; -} -pub type PFNGLCLEARBUFFERIVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLint), ->; -extern "C" { - pub static mut glad_glClearBufferiv: PFNGLCLEARBUFFERIVPROC; -} -pub type PFNGLCLEARBUFFERUIVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glClearBufferuiv: PFNGLCLEARBUFFERUIVPROC; -} -pub type PFNGLCLEARBUFFERFVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glClearBufferfv: PFNGLCLEARBUFFERFVPROC; -} -pub type PFNGLCLEARBUFFERFIPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint), ->; -extern "C" { - pub static mut glad_glClearBufferfi: PFNGLCLEARBUFFERFIPROC; -} -pub type PFNGLGETSTRINGIPROC = - ::std::option::Option *const GLubyte>; -extern "C" { - pub static mut glad_glGetStringi: PFNGLGETSTRINGIPROC; -} -pub type PFNGLISRENDERBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsRenderbuffer: PFNGLISRENDERBUFFERPROC; -} -pub type PFNGLBINDRENDERBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindRenderbuffer: PFNGLBINDRENDERBUFFERPROC; -} -pub type PFNGLDELETERENDERBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteRenderbuffers: PFNGLDELETERENDERBUFFERSPROC; -} -pub type PFNGLGENRENDERBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenRenderbuffers: PFNGLGENRENDERBUFFERSPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glRenderbufferStorage: PFNGLRENDERBUFFERSTORAGEPROC; -} -pub type PFNGLGETRENDERBUFFERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetRenderbufferParameteriv: PFNGLGETRENDERBUFFERPARAMETERIVPROC; -} -pub type PFNGLISFRAMEBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsFramebuffer: PFNGLISFRAMEBUFFERPROC; -} -pub type PFNGLBINDFRAMEBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindFramebuffer: PFNGLBINDFRAMEBUFFERPROC; -} -pub type PFNGLDELETEFRAMEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFramebuffers: PFNGLDELETEFRAMEBUFFERSPROC; -} -pub type PFNGLGENFRAMEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenFramebuffers: PFNGLGENFRAMEBUFFERSPROC; -} -pub type PFNGLCHECKFRAMEBUFFERSTATUSPROC = - ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glCheckFramebufferStatus: PFNGLCHECKFRAMEBUFFERSTATUSPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture1D: PFNGLFRAMEBUFFERTEXTURE1DPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture2D: PFNGLFRAMEBUFFERTEXTURE2DPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE3DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - zoffset: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture3D: PFNGLFRAMEBUFFERTEXTURE3DPROC; -} -pub type PFNGLFRAMEBUFFERRENDERBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferRenderbuffer: PFNGLFRAMEBUFFERRENDERBUFFERPROC; -} -pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetFramebufferAttachmentParameteriv: - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC; -} -pub type PFNGLGENERATEMIPMAPPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glGenerateMipmap: PFNGLGENERATEMIPMAPPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glBlitFramebuffer: PFNGLBLITFRAMEBUFFERPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageMultisample: PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURELAYERPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - texture: GLuint, - level: GLint, - layer: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTextureLayer: PFNGLFRAMEBUFFERTEXTURELAYERPROC; -} -pub type PFNGLMAPBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptr, - length: GLsizeiptr, - access: GLbitfield, - ) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBufferRange: PFNGLMAPBUFFERRANGEPROC; -} -pub type PFNGLFLUSHMAPPEDBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, offset: GLintptr, length: GLsizeiptr), ->; -extern "C" { - pub static mut glad_glFlushMappedBufferRange: PFNGLFLUSHMAPPEDBUFFERRANGEPROC; -} -pub type PFNGLBINDVERTEXARRAYPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindVertexArray: PFNGLBINDVERTEXARRAYPROC; -} -pub type PFNGLDELETEVERTEXARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteVertexArrays: PFNGLDELETEVERTEXARRAYSPROC; -} -pub type PFNGLGENVERTEXARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenVertexArrays: PFNGLGENVERTEXARRAYSPROC; -} -pub type PFNGLISVERTEXARRAYPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsVertexArray: PFNGLISVERTEXARRAYPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_1: ::std::os::raw::c_int; -} -pub type PFNGLDRAWARRAYSINSTANCEDPROC = ::std::option::Option< - unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, instancecount: GLsizei), ->; -extern "C" { - pub static mut glad_glDrawArraysInstanced: PFNGLDRAWARRAYSINSTANCEDPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsInstanced: PFNGLDRAWELEMENTSINSTANCEDPROC; -} -pub type PFNGLTEXBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, buffer: GLuint), ->; -extern "C" { - pub static mut glad_glTexBuffer: PFNGLTEXBUFFERPROC; -} -pub type PFNGLPRIMITIVERESTARTINDEXPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPrimitiveRestartIndex: PFNGLPRIMITIVERESTARTINDEXPROC; -} -pub type PFNGLCOPYBUFFERSUBDATAPROC = ::std::option::Option< - unsafe extern "C" fn( - readTarget: GLenum, - writeTarget: GLenum, - readOffset: GLintptr, - writeOffset: GLintptr, - size: GLsizeiptr, - ), ->; -extern "C" { - pub static mut glad_glCopyBufferSubData: PFNGLCOPYBUFFERSUBDATAPROC; -} -pub type PFNGLGETUNIFORMINDICESPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformCount: GLsizei, - uniformNames: *mut *const GLchar, - uniformIndices: *mut GLuint, - ), ->; -extern "C" { - pub static mut glad_glGetUniformIndices: PFNGLGETUNIFORMINDICESPROC; -} -pub type PFNGLGETACTIVEUNIFORMSIVPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformCount: GLsizei, - uniformIndices: *const GLuint, - pname: GLenum, - params: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformsiv: PFNGLGETACTIVEUNIFORMSIVPROC; -} -pub type PFNGLGETACTIVEUNIFORMNAMEPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformIndex: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - uniformName: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformName: PFNGLGETACTIVEUNIFORMNAMEPROC; -} -pub type PFNGLGETUNIFORMBLOCKINDEXPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, uniformBlockName: *const GLchar) -> GLuint, ->; -extern "C" { - pub static mut glad_glGetUniformBlockIndex: PFNGLGETUNIFORMBLOCKINDEXPROC; -} -pub type PFNGLGETACTIVEUNIFORMBLOCKIVPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformBlockIndex: GLuint, - pname: GLenum, - params: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformBlockiv: PFNGLGETACTIVEUNIFORMBLOCKIVPROC; -} -pub type PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformBlockIndex: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - uniformBlockName: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformBlockName: PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC; -} -pub type PFNGLUNIFORMBLOCKBINDINGPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint), ->; -extern "C" { - pub static mut glad_glUniformBlockBinding: PFNGLUNIFORMBLOCKBINDINGPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_2: ::std::os::raw::c_int; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsBaseVertex: PFNGLDRAWELEMENTSBASEVERTEXPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawRangeElementsBaseVertex: PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsInstancedBaseVertex: PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC; -} -pub type PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - count: *const GLsizei, - type_: GLenum, - indices: *mut *const ::std::os::raw::c_void, - drawcount: GLsizei, - basevertex: *const GLint, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawElementsBaseVertex: PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC; -} -pub type PFNGLPROVOKINGVERTEXPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glProvokingVertex: PFNGLPROVOKINGVERTEXPROC; -} -pub type PFNGLFENCESYNCPROC = - ::std::option::Option GLsync>; -extern "C" { - pub static mut glad_glFenceSync: PFNGLFENCESYNCPROC; -} -pub type PFNGLISSYNCPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsSync: PFNGLISSYNCPROC; -} -pub type PFNGLDELETESYNCPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteSync: PFNGLDELETESYNCPROC; -} -pub type PFNGLCLIENTWAITSYNCPROC = ::std::option::Option< - unsafe extern "C" fn(sync: GLsync, flags: GLbitfield, timeout: GLuint64) -> GLenum, ->; -extern "C" { - pub static mut glad_glClientWaitSync: PFNGLCLIENTWAITSYNCPROC; -} -pub type PFNGLWAITSYNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glWaitSync: PFNGLWAITSYNCPROC; -} -pub type PFNGLGETINTEGER64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInteger64v: PFNGLGETINTEGER64VPROC; -} -pub type PFNGLGETSYNCIVPROC = ::std::option::Option< - unsafe extern "C" fn( - sync: GLsync, - pname: GLenum, - bufSize: GLsizei, - length: *mut GLsizei, - values: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetSynciv: PFNGLGETSYNCIVPROC; -} -pub type PFNGLGETINTEGER64I_VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInteger64i_v: PFNGLGETINTEGER64I_VPROC; -} -pub type PFNGLGETBUFFERPARAMETERI64VPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLint64), ->; -extern "C" { - pub static mut glad_glGetBufferParameteri64v: PFNGLGETBUFFERPARAMETERI64VPROC; -} -pub type PFNGLFRAMEBUFFERTEXTUREPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint), ->; -extern "C" { - pub static mut glad_glFramebufferTexture: PFNGLFRAMEBUFFERTEXTUREPROC; -} -pub type PFNGLTEXIMAGE2DMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - fixedsamplelocations: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glTexImage2DMultisample: PFNGLTEXIMAGE2DMULTISAMPLEPROC; -} -pub type PFNGLTEXIMAGE3DMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - depth: GLsizei, - fixedsamplelocations: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glTexImage3DMultisample: PFNGLTEXIMAGE3DMULTISAMPLEPROC; -} -pub type PFNGLGETMULTISAMPLEFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetMultisamplefv: PFNGLGETMULTISAMPLEFVPROC; -} -pub type PFNGLSAMPLEMASKIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleMaski: PFNGLSAMPLEMASKIPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_3: ::std::os::raw::c_int; -} -pub type PFNGLBINDFRAGDATALOCATIONINDEXEDPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, colorNumber: GLuint, index: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindFragDataLocationIndexed: PFNGLBINDFRAGDATALOCATIONINDEXEDPROC; -} -pub type PFNGLGETFRAGDATAINDEXPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetFragDataIndex: PFNGLGETFRAGDATAINDEXPROC; -} -pub type PFNGLGENSAMPLERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenSamplers: PFNGLGENSAMPLERSPROC; -} -pub type PFNGLDELETESAMPLERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteSamplers: PFNGLDELETESAMPLERSPROC; -} -pub type PFNGLISSAMPLERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsSampler: PFNGLISSAMPLERPROC; -} -pub type PFNGLBINDSAMPLERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindSampler: PFNGLBINDSAMPLERPROC; -} -pub type PFNGLSAMPLERPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSamplerParameteri: PFNGLSAMPLERPARAMETERIPROC; -} -pub type PFNGLSAMPLERPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), ->; -extern "C" { - pub static mut glad_glSamplerParameteriv: PFNGLSAMPLERPARAMETERIVPROC; -} -pub type PFNGLSAMPLERPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSamplerParameterf: PFNGLSAMPLERPARAMETERFPROC; -} -pub type PFNGLSAMPLERPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLfloat), ->; -extern "C" { - pub static mut glad_glSamplerParameterfv: PFNGLSAMPLERPARAMETERFVPROC; -} -pub type PFNGLSAMPLERPARAMETERIIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), ->; -extern "C" { - pub static mut glad_glSamplerParameterIiv: PFNGLSAMPLERPARAMETERIIVPROC; -} -pub type PFNGLSAMPLERPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLuint), ->; -extern "C" { - pub static mut glad_glSamplerParameterIuiv: PFNGLSAMPLERPARAMETERIUIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetSamplerParameteriv: PFNGLGETSAMPLERPARAMETERIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetSamplerParameterIiv: PFNGLGETSAMPLERPARAMETERIIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetSamplerParameterfv: PFNGLGETSAMPLERPARAMETERFVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLuint), ->; -extern "C" { - pub static mut glad_glGetSamplerParameterIuiv: PFNGLGETSAMPLERPARAMETERIUIVPROC; -} -pub type PFNGLQUERYCOUNTERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glQueryCounter: PFNGLQUERYCOUNTERPROC; -} -pub type PFNGLGETQUERYOBJECTI64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjecti64v: PFNGLGETQUERYOBJECTI64VPROC; -} -pub type PFNGLGETQUERYOBJECTUI64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectui64v: PFNGLGETQUERYOBJECTUI64VPROC; -} -pub type PFNGLVERTEXATTRIBDIVISORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribDivisor: PFNGLVERTEXATTRIBDIVISORPROC; -} -pub type PFNGLVERTEXATTRIBP1UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP1ui: PFNGLVERTEXATTRIBP1UIPROC; -} -pub type PFNGLVERTEXATTRIBP1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP1uiv: PFNGLVERTEXATTRIBP1UIVPROC; -} -pub type PFNGLVERTEXATTRIBP2UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP2ui: PFNGLVERTEXATTRIBP2UIPROC; -} -pub type PFNGLVERTEXATTRIBP2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP2uiv: PFNGLVERTEXATTRIBP2UIVPROC; -} -pub type PFNGLVERTEXATTRIBP3UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP3ui: PFNGLVERTEXATTRIBP3UIPROC; -} -pub type PFNGLVERTEXATTRIBP3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP3uiv: PFNGLVERTEXATTRIBP3UIVPROC; -} -pub type PFNGLVERTEXATTRIBP4UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP4ui: PFNGLVERTEXATTRIBP4UIPROC; -} -pub type PFNGLVERTEXATTRIBP4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP4uiv: PFNGLVERTEXATTRIBP4UIVPROC; -} -pub type PFNGLVERTEXP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP2ui: PFNGLVERTEXP2UIPROC; -} -pub type PFNGLVERTEXP2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP2uiv: PFNGLVERTEXP2UIVPROC; -} -pub type PFNGLVERTEXP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP3ui: PFNGLVERTEXP3UIPROC; -} -pub type PFNGLVERTEXP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP3uiv: PFNGLVERTEXP3UIVPROC; -} -pub type PFNGLVERTEXP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP4ui: PFNGLVERTEXP4UIPROC; -} -pub type PFNGLVERTEXP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP4uiv: PFNGLVERTEXP4UIVPROC; -} -pub type PFNGLTEXCOORDP1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP1ui: PFNGLTEXCOORDP1UIPROC; -} -pub type PFNGLTEXCOORDP1UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP1uiv: PFNGLTEXCOORDP1UIVPROC; -} -pub type PFNGLTEXCOORDP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP2ui: PFNGLTEXCOORDP2UIPROC; -} -pub type PFNGLTEXCOORDP2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP2uiv: PFNGLTEXCOORDP2UIVPROC; -} -pub type PFNGLTEXCOORDP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP3ui: PFNGLTEXCOORDP3UIPROC; -} -pub type PFNGLTEXCOORDP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP3uiv: PFNGLTEXCOORDP3UIVPROC; -} -pub type PFNGLTEXCOORDP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP4ui: PFNGLTEXCOORDP4UIPROC; -} -pub type PFNGLTEXCOORDP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP4uiv: PFNGLTEXCOORDP4UIVPROC; -} -pub type PFNGLMULTITEXCOORDP1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP1ui: PFNGLMULTITEXCOORDP1UIPROC; -} -pub type PFNGLMULTITEXCOORDP1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP1uiv: PFNGLMULTITEXCOORDP1UIVPROC; -} -pub type PFNGLMULTITEXCOORDP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP2ui: PFNGLMULTITEXCOORDP2UIPROC; -} -pub type PFNGLMULTITEXCOORDP2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP2uiv: PFNGLMULTITEXCOORDP2UIVPROC; -} -pub type PFNGLMULTITEXCOORDP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP3ui: PFNGLMULTITEXCOORDP3UIPROC; -} -pub type PFNGLMULTITEXCOORDP3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP3uiv: PFNGLMULTITEXCOORDP3UIVPROC; -} -pub type PFNGLMULTITEXCOORDP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP4ui: PFNGLMULTITEXCOORDP4UIPROC; -} -pub type PFNGLMULTITEXCOORDP4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP4uiv: PFNGLMULTITEXCOORDP4UIVPROC; -} -pub type PFNGLNORMALP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glNormalP3ui: PFNGLNORMALP3UIPROC; -} -pub type PFNGLNORMALP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glNormalP3uiv: PFNGLNORMALP3UIVPROC; -} -pub type PFNGLCOLORP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP3ui: PFNGLCOLORP3UIPROC; -} -pub type PFNGLCOLORP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP3uiv: PFNGLCOLORP3UIVPROC; -} -pub type PFNGLCOLORP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP4ui: PFNGLCOLORP4UIPROC; -} -pub type PFNGLCOLORP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP4uiv: PFNGLCOLORP4UIVPROC; -} -pub type PFNGLSECONDARYCOLORP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSecondaryColorP3ui: PFNGLSECONDARYCOLORP3UIPROC; -} -pub type PFNGLSECONDARYCOLORP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSecondaryColorP3uiv: PFNGLSECONDARYCOLORP3UIVPROC; -} -extern "C" { - pub static mut GLAD_GL_AMD_debug_output: ::std::os::raw::c_int; -} -pub type PFNGLDEBUGMESSAGEENABLEAMDPROC = ::std::option::Option< - unsafe extern "C" fn( - category: GLenum, - severity: GLenum, - count: GLsizei, - ids: *const GLuint, - enabled: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageEnableAMD: PFNGLDEBUGMESSAGEENABLEAMDPROC; -} -pub type PFNGLDEBUGMESSAGEINSERTAMDPROC = ::std::option::Option< - unsafe extern "C" fn( - category: GLenum, - severity: GLenum, - id: GLuint, - length: GLsizei, - buf: *const GLchar, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageInsertAMD: PFNGLDEBUGMESSAGEINSERTAMDPROC; -} -pub type PFNGLDEBUGMESSAGECALLBACKAMDPROC = ::std::option::Option< - unsafe extern "C" fn(callback: GLDEBUGPROCAMD, userParam: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glDebugMessageCallbackAMD: PFNGLDEBUGMESSAGECALLBACKAMDPROC; -} -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 static mut glad_glGetDebugMessageLogAMD: PFNGLGETDEBUGMESSAGELOGAMDPROC; -} -extern "C" { - pub static mut GLAD_GL_AMD_query_buffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_ES2_compatibility: ::std::os::raw::c_int; -} -pub type PFNGLRELEASESHADERCOMPILERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glReleaseShaderCompiler: PFNGLRELEASESHADERCOMPILERPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glShaderBinary: PFNGLSHADERBINARYPROC; -} -pub type PFNGLGETSHADERPRECISIONFORMATPROC = ::std::option::Option< - unsafe extern "C" fn( - shadertype: GLenum, - precisiontype: GLenum, - range: *mut GLint, - precision: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetShaderPrecisionFormat: PFNGLGETSHADERPRECISIONFORMATPROC; -} -pub type PFNGLDEPTHRANGEFPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthRangef: PFNGLDEPTHRANGEFPROC; -} -pub type PFNGLCLEARDEPTHFPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearDepthf: PFNGLCLEARDEPTHFPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_ES3_compatibility: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_buffer_storage: ::std::os::raw::c_int; -} -pub type PFNGLBUFFERSTORAGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - size: GLsizeiptr, - data: *const ::std::os::raw::c_void, - flags: GLbitfield, - ), ->; -extern "C" { - pub static mut glad_glBufferStorage: PFNGLBUFFERSTORAGEPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_compatibility: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_compressed_texture_pixel_storage: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_debug_output: ::std::os::raw::c_int; -} -pub type PFNGLDEBUGMESSAGECONTROLARBPROC = ::std::option::Option< - unsafe extern "C" fn( - source: GLenum, - type_: GLenum, - severity: GLenum, - count: GLsizei, - ids: *const GLuint, - enabled: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageControlARB: PFNGLDEBUGMESSAGECONTROLARBPROC; -} -pub type PFNGLDEBUGMESSAGEINSERTARBPROC = ::std::option::Option< - unsafe extern "C" fn( - source: GLenum, - type_: GLenum, - id: GLuint, - severity: GLenum, - length: GLsizei, - buf: *const GLchar, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageInsertARB: PFNGLDEBUGMESSAGEINSERTARBPROC; -} -pub type PFNGLDEBUGMESSAGECALLBACKARBPROC = ::std::option::Option< - unsafe extern "C" fn(callback: GLDEBUGPROCARB, userParam: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glDebugMessageCallbackARB: PFNGLDEBUGMESSAGECALLBACKARBPROC; -} -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 static mut glad_glGetDebugMessageLogARB: PFNGLGETDEBUGMESSAGELOGARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_buffer_float: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_clamp: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_texture: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_draw_buffers: ::std::os::raw::c_int; -} -pub type PFNGLDRAWBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffersARB: PFNGLDRAWBUFFERSARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_draw_buffers_blend: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationiARB: PFNGLBLENDEQUATIONIARBPROC; -} -pub type PFNGLBLENDEQUATIONSEPARATEIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparateiARB: PFNGLBLENDEQUATIONSEPARATEIARBPROC; -} -pub type PFNGLBLENDFUNCIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendFunciARB: PFNGLBLENDFUNCIARBPROC; -} -pub type PFNGLBLENDFUNCSEPARATEIARBPROC = ::std::option::Option< - unsafe extern "C" fn( - buf: GLuint, - srcRGB: GLenum, - dstRGB: GLenum, - srcAlpha: GLenum, - dstAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparateiARB: PFNGLBLENDFUNCSEPARATEIARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_explicit_attrib_location: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_explicit_uniform_location: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_fragment_program: ::std::os::raw::c_int; -} -pub type PFNGLPROGRAMSTRINGARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - format: GLenum, - len: GLsizei, - string: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glProgramStringARB: PFNGLPROGRAMSTRINGARBPROC; -} -pub type PFNGLBINDPROGRAMARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindProgramARB: PFNGLBINDPROGRAMARBPROC; -} -pub type PFNGLDELETEPROGRAMSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteProgramsARB: PFNGLDELETEPROGRAMSARBPROC; -} -pub type PFNGLGENPROGRAMSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenProgramsARB: PFNGLGENPROGRAMSARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4DARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLdouble, - y: GLdouble, - z: GLdouble, - w: GLdouble, - ), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4dARB: PFNGLPROGRAMENVPARAMETER4DARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4DVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4dvARB: PFNGLPROGRAMENVPARAMETER4DVARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4FARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLfloat, - y: GLfloat, - z: GLfloat, - w: GLfloat, - ), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4fARB: PFNGLPROGRAMENVPARAMETER4FARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4FVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4fvARB: PFNGLPROGRAMENVPARAMETER4FVARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4DARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLdouble, - y: GLdouble, - z: GLdouble, - w: GLdouble, - ), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4dARB: PFNGLPROGRAMLOCALPARAMETER4DARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4DVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4dvARB: PFNGLPROGRAMLOCALPARAMETER4DVARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4FARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLfloat, - y: GLfloat, - z: GLfloat, - w: GLfloat, - ), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4fARB: PFNGLPROGRAMLOCALPARAMETER4FARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4FVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4fvARB: PFNGLPROGRAMLOCALPARAMETER4FVARBPROC; -} -pub type PFNGLGETPROGRAMENVPARAMETERDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetProgramEnvParameterdvARB: PFNGLGETPROGRAMENVPARAMETERDVARBPROC; -} -pub type PFNGLGETPROGRAMENVPARAMETERFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetProgramEnvParameterfvARB: PFNGLGETPROGRAMENVPARAMETERFVARBPROC; -} -pub type PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetProgramLocalParameterdvARB: PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC; -} -pub type PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetProgramLocalParameterfvARB: PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC; -} -pub type PFNGLGETPROGRAMIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetProgramivARB: PFNGLGETPROGRAMIVARBPROC; -} -pub type PFNGLGETPROGRAMSTRINGARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, string: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetProgramStringARB: PFNGLGETPROGRAMSTRINGARBPROC; -} -pub type PFNGLISPROGRAMARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsProgramARB: PFNGLISPROGRAMARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_fragment_shader: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_framebuffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_framebuffer_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_multisample: ::std::os::raw::c_int; -} -pub type PFNGLSAMPLECOVERAGEARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleCoverageARB: PFNGLSAMPLECOVERAGEARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_sample_locations: ::std::os::raw::c_int; -} -pub type PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, start: GLuint, count: GLsizei, v: *const GLfloat), ->; -extern "C" { - pub static mut glad_glFramebufferSampleLocationsfvARB: PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC; -} -pub type PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(framebuffer: GLuint, start: GLuint, count: GLsizei, v: *const GLfloat), ->; -extern "C" { - pub static mut glad_glNamedFramebufferSampleLocationsfvARB: - PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC; -} -pub type PFNGLEVALUATEDEPTHVALUESARBPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEvaluateDepthValuesARB: PFNGLEVALUATEDEPTHVALUESARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_compression: ::std::os::raw::c_int; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage3DARB: PFNGLCOMPRESSEDTEXIMAGE3DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage2DARB: PFNGLCOMPRESSEDTEXIMAGE2DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage1DARB: PFNGLCOMPRESSEDTEXIMAGE1DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage3DARB: PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage2DARB: PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage1DARB: PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC; -} -pub type PFNGLGETCOMPRESSEDTEXIMAGEARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, img: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetCompressedTexImageARB: PFNGLGETCOMPRESSEDTEXIMAGEARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_float: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_multisample: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_non_power_of_two: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_rg: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_swizzle: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_uniform_buffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_array_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_attrib_binding: ::std::os::raw::c_int; -} -pub type PFNGLBINDVERTEXBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(bindingindex: GLuint, buffer: GLuint, offset: GLintptr, stride: GLsizei), ->; -extern "C" { - pub static mut glad_glBindVertexBuffer: PFNGLBINDVERTEXBUFFERPROC; -} -pub type PFNGLVERTEXATTRIBFORMATPROC = ::std::option::Option< - unsafe extern "C" fn( - attribindex: GLuint, - size: GLint, - type_: GLenum, - normalized: GLboolean, - relativeoffset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribFormat: PFNGLVERTEXATTRIBFORMATPROC; -} -pub type PFNGLVERTEXATTRIBIFORMATPROC = ::std::option::Option< - unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribIFormat: PFNGLVERTEXATTRIBIFORMATPROC; -} -pub type PFNGLVERTEXATTRIBLFORMATPROC = ::std::option::Option< - unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribLFormat: PFNGLVERTEXATTRIBLFORMATPROC; -} -pub type PFNGLVERTEXATTRIBBINDINGPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribBinding: PFNGLVERTEXATTRIBBINDINGPROC; -} -pub type PFNGLVERTEXBINDINGDIVISORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexBindingDivisor: PFNGLVERTEXBINDINGDIVISORPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_buffer_object: ::std::os::raw::c_int; -} -pub type PFNGLBINDBUFFERARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBufferARB: PFNGLBINDBUFFERARBPROC; -} -pub type PFNGLDELETEBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteBuffersARB: PFNGLDELETEBUFFERSARBPROC; -} -pub type PFNGLGENBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenBuffersARB: PFNGLGENBUFFERSARBPROC; -} -pub type PFNGLISBUFFERARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsBufferARB: PFNGLISBUFFERARBPROC; -} -pub type PFNGLBUFFERDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - size: GLsizeiptrARB, - data: *const ::std::os::raw::c_void, - usage: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBufferDataARB: PFNGLBUFFERDATAARBPROC; -} -pub type PFNGLBUFFERSUBDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptrARB, - size: GLsizeiptrARB, - data: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glBufferSubDataARB: PFNGLBUFFERSUBDATAARBPROC; -} -pub type PFNGLGETBUFFERSUBDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptrARB, - size: GLsizeiptrARB, - data: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetBufferSubDataARB: PFNGLGETBUFFERSUBDATAARBPROC; -} -pub type PFNGLMAPBUFFERARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBufferARB: PFNGLMAPBUFFERARBPROC; -} -pub type PFNGLUNMAPBUFFERARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glUnmapBufferARB: PFNGLUNMAPBUFFERARBPROC; -} -pub type PFNGLGETBUFFERPARAMETERIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBufferParameterivARB: PFNGLGETBUFFERPARAMETERIVARBPROC; -} -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 static mut glad_glGetBufferPointervARB: PFNGLGETBUFFERPOINTERVARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_program: ::std::os::raw::c_int; -} -pub type PFNGLVERTEXATTRIB1DARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dARB: PFNGLVERTEXATTRIB1DARBPROC; -} -pub type PFNGLVERTEXATTRIB1DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dvARB: PFNGLVERTEXATTRIB1DVARBPROC; -} -pub type PFNGLVERTEXATTRIB1FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fARB: PFNGLVERTEXATTRIB1FARBPROC; -} -pub type PFNGLVERTEXATTRIB1FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fvARB: PFNGLVERTEXATTRIB1FVARBPROC; -} -pub type PFNGLVERTEXATTRIB1SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1sARB: PFNGLVERTEXATTRIB1SARBPROC; -} -pub type PFNGLVERTEXATTRIB1SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1svARB: PFNGLVERTEXATTRIB1SVARBPROC; -} -pub type PFNGLVERTEXATTRIB2DARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dARB: PFNGLVERTEXATTRIB2DARBPROC; -} -pub type PFNGLVERTEXATTRIB2DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dvARB: PFNGLVERTEXATTRIB2DVARBPROC; -} -pub type PFNGLVERTEXATTRIB2FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fARB: PFNGLVERTEXATTRIB2FARBPROC; -} -pub type PFNGLVERTEXATTRIB2FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fvARB: PFNGLVERTEXATTRIB2FVARBPROC; -} -pub type PFNGLVERTEXATTRIB2SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2sARB: PFNGLVERTEXATTRIB2SARBPROC; -} -pub type PFNGLVERTEXATTRIB2SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2svARB: PFNGLVERTEXATTRIB2SVARBPROC; -} -pub type PFNGLVERTEXATTRIB3DARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib3dARB: PFNGLVERTEXATTRIB3DARBPROC; -} -pub type PFNGLVERTEXATTRIB3DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3dvARB: PFNGLVERTEXATTRIB3DVARBPROC; -} -pub type PFNGLVERTEXATTRIB3FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fARB: PFNGLVERTEXATTRIB3FARBPROC; -} -pub type PFNGLVERTEXATTRIB3FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fvARB: PFNGLVERTEXATTRIB3FVARBPROC; -} -pub type PFNGLVERTEXATTRIB3SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3sARB: PFNGLVERTEXATTRIB3SARBPROC; -} -pub type PFNGLVERTEXATTRIB3SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3svARB: PFNGLVERTEXATTRIB3SVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NbvARB: PFNGLVERTEXATTRIB4NBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NivARB: PFNGLVERTEXATTRIB4NIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NSVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NsvARB: PFNGLVERTEXATTRIB4NSVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), ->; -extern "C" { - pub static mut glad_glVertexAttrib4NubARB: PFNGLVERTEXATTRIB4NUBARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NubvARB: PFNGLVERTEXATTRIB4NUBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NuivARB: PFNGLVERTEXATTRIB4NUIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUSVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NusvARB: PFNGLVERTEXATTRIB4NUSVARBPROC; -} -pub type PFNGLVERTEXATTRIB4BVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4bvARB: PFNGLVERTEXATTRIB4BVARBPROC; -} -pub type PFNGLVERTEXATTRIB4DARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib4dARB: PFNGLVERTEXATTRIB4DARBPROC; -} -pub type PFNGLVERTEXATTRIB4DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4dvARB: PFNGLVERTEXATTRIB4DVARBPROC; -} -pub type PFNGLVERTEXATTRIB4FARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), ->; -extern "C" { - pub static mut glad_glVertexAttrib4fARB: PFNGLVERTEXATTRIB4FARBPROC; -} -pub type PFNGLVERTEXATTRIB4FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4fvARB: PFNGLVERTEXATTRIB4FVARBPROC; -} -pub type PFNGLVERTEXATTRIB4IVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ivARB: PFNGLVERTEXATTRIB4IVARBPROC; -} -pub type PFNGLVERTEXATTRIB4SARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), ->; -extern "C" { - pub static mut glad_glVertexAttrib4sARB: PFNGLVERTEXATTRIB4SARBPROC; -} -pub type PFNGLVERTEXATTRIB4SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4svARB: PFNGLVERTEXATTRIB4SVARBPROC; -} -pub type PFNGLVERTEXATTRIB4UBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ubvARB: PFNGLVERTEXATTRIB4UBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4UIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4uivARB: PFNGLVERTEXATTRIB4UIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4USVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4usvARB: PFNGLVERTEXATTRIB4USVARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribPointerARB: PFNGLVERTEXATTRIBPOINTERARBPROC; -} -pub type PFNGLENABLEVERTEXATTRIBARRAYARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVertexAttribArrayARB: PFNGLENABLEVERTEXATTRIBARRAYARBPROC; -} -pub type PFNGLDISABLEVERTEXATTRIBARRAYARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVertexAttribArrayARB: PFNGLDISABLEVERTEXATTRIBARRAYARBPROC; -} -pub type PFNGLGETVERTEXATTRIBDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetVertexAttribdvARB: PFNGLGETVERTEXATTRIBDVARBPROC; -} -pub type PFNGLGETVERTEXATTRIBFVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribfvARB: PFNGLGETVERTEXATTRIBFVARBPROC; -} -pub type PFNGLGETVERTEXATTRIBIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribivARB: PFNGLGETVERTEXATTRIBIVARBPROC; -} -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 static mut glad_glGetVertexAttribPointervARB: PFNGLGETVERTEXATTRIBPOINTERVARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_shader: ::std::os::raw::c_int; -} -pub type PFNGLBINDATTRIBLOCATIONARBPROC = ::std::option::Option< - unsafe extern "C" fn(programObj: GLhandleARB, index: GLuint, name: *const GLcharARB), ->; -extern "C" { - pub static mut glad_glBindAttribLocationARB: PFNGLBINDATTRIBLOCATIONARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveAttribARB: PFNGLGETACTIVEATTRIBARBPROC; -} -pub type PFNGLGETATTRIBLOCATIONARBPROC = ::std::option::Option< - unsafe extern "C" fn(programObj: GLhandleARB, name: *const GLcharARB) -> GLint, ->; -extern "C" { - pub static mut glad_glGetAttribLocationARB: PFNGLGETATTRIBLOCATIONARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_element_array: ::std::os::raw::c_int; -} -pub type PFNGLELEMENTPOINTERATIPROC = ::std::option::Option< - unsafe extern "C" fn(type_: GLenum, pointer: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glElementPointerATI: PFNGLELEMENTPOINTERATIPROC; -} -pub type PFNGLDRAWELEMENTARRAYATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawElementArrayATI: PFNGLDRAWELEMENTARRAYATIPROC; -} -pub type PFNGLDRAWRANGEELEMENTARRAYATIPROC = ::std::option::Option< - unsafe extern "C" fn(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei), ->; -extern "C" { - pub static mut glad_glDrawRangeElementArrayATI: PFNGLDRAWRANGEELEMENTARRAYATIPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_fragment_shader: ::std::os::raw::c_int; -} -pub type PFNGLGENFRAGMENTSHADERSATIPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glGenFragmentShadersATI: PFNGLGENFRAGMENTSHADERSATIPROC; -} -pub type PFNGLBINDFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindFragmentShaderATI: PFNGLBINDFRAGMENTSHADERATIPROC; -} -pub type PFNGLDELETEFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFragmentShaderATI: PFNGLDELETEFRAGMENTSHADERATIPROC; -} -pub type PFNGLBEGINFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBeginFragmentShaderATI: PFNGLBEGINFRAGMENTSHADERATIPROC; -} -pub type PFNGLENDFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndFragmentShaderATI: PFNGLENDFRAGMENTSHADERATIPROC; -} -pub type PFNGLPASSTEXCOORDATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPassTexCoordATI: PFNGLPASSTEXCOORDATIPROC; -} -pub type PFNGLSAMPLEMAPATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleMapATI: PFNGLSAMPLEMAPATIPROC; -} -pub type PFNGLCOLORFRAGMENTOP1ATIPROC = ::std::option::Option< - unsafe extern "C" fn( - op: GLenum, - dst: GLuint, - dstMask: GLuint, - dstMod: GLuint, - arg1: GLuint, - arg1Rep: GLuint, - arg1Mod: GLuint, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp1ATI: PFNGLCOLORFRAGMENTOP1ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp2ATI: PFNGLCOLORFRAGMENTOP2ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp3ATI: PFNGLCOLORFRAGMENTOP3ATIPROC; -} -pub type PFNGLALPHAFRAGMENTOP1ATIPROC = ::std::option::Option< - unsafe extern "C" fn( - op: GLenum, - dst: GLuint, - dstMod: GLuint, - arg1: GLuint, - arg1Rep: GLuint, - arg1Mod: GLuint, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp1ATI: PFNGLALPHAFRAGMENTOP1ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp2ATI: PFNGLALPHAFRAGMENTOP2ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp3ATI: PFNGLALPHAFRAGMENTOP3ATIPROC; -} -pub type PFNGLSETFRAGMENTSHADERCONSTANTATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSetFragmentShaderConstantATI: PFNGLSETFRAGMENTSHADERCONSTANTATIPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_vertex_array_object: ::std::os::raw::c_int; -} -pub type PFNGLNEWOBJECTBUFFERATIPROC = ::std::option::Option< - unsafe extern "C" fn( - size: GLsizei, - pointer: *const ::std::os::raw::c_void, - usage: GLenum, - ) -> GLuint, ->; -extern "C" { - pub static mut glad_glNewObjectBufferATI: PFNGLNEWOBJECTBUFFERATIPROC; -} -pub type PFNGLISOBJECTBUFFERATIPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsObjectBufferATI: PFNGLISOBJECTBUFFERATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glUpdateObjectBufferATI: PFNGLUPDATEOBJECTBUFFERATIPROC; -} -pub type PFNGLGETOBJECTBUFFERFVATIPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetObjectBufferfvATI: PFNGLGETOBJECTBUFFERFVATIPROC; -} -pub type PFNGLGETOBJECTBUFFERIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetObjectBufferivATI: PFNGLGETOBJECTBUFFERIVATIPROC; -} -pub type PFNGLFREEOBJECTBUFFERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFreeObjectBufferATI: PFNGLFREEOBJECTBUFFERATIPROC; -} -pub type PFNGLARRAYOBJECTATIPROC = ::std::option::Option< - unsafe extern "C" fn( - array: GLenum, - size: GLint, - type_: GLenum, - stride: GLsizei, - buffer: GLuint, - offset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glArrayObjectATI: PFNGLARRAYOBJECTATIPROC; -} -pub type PFNGLGETARRAYOBJECTFVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetArrayObjectfvATI: PFNGLGETARRAYOBJECTFVATIPROC; -} -pub type PFNGLGETARRAYOBJECTIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetArrayObjectivATI: PFNGLGETARRAYOBJECTIVATIPROC; -} -pub type PFNGLVARIANTARRAYOBJECTATIPROC = ::std::option::Option< - unsafe extern "C" fn( - id: GLuint, - type_: GLenum, - stride: GLsizei, - buffer: GLuint, - offset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glVariantArrayObjectATI: PFNGLVARIANTARRAYOBJECTATIPROC; -} -pub type PFNGLGETVARIANTARRAYOBJECTFVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantArrayObjectfvATI: PFNGLGETVARIANTARRAYOBJECTFVATIPROC; -} -pub type PFNGLGETVARIANTARRAYOBJECTIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantArrayObjectivATI: PFNGLGETVARIANTARRAYOBJECTIVATIPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_color: ::std::os::raw::c_int; -} -pub type PFNGLBLENDCOLOREXTPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glBlendColorEXT: PFNGLBLENDCOLOREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_equation_separate: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONSEPARATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparateEXT: PFNGLBLENDEQUATIONSEPARATEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_func_separate: ::std::os::raw::c_int; -} -pub type PFNGLBLENDFUNCSEPARATEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - sfactorRGB: GLenum, - dfactorRGB: GLenum, - sfactorAlpha: GLenum, - dfactorAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparateEXT: PFNGLBLENDFUNCSEPARATEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_debug_marker: ::std::os::raw::c_int; -} -pub type PFNGLINSERTEVENTMARKEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glInsertEventMarkerEXT: PFNGLINSERTEVENTMARKEREXTPROC; -} -pub type PFNGLPUSHGROUPMARKEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPushGroupMarkerEXT: PFNGLPUSHGROUPMARKEREXTPROC; -} -pub type PFNGLPOPGROUPMARKEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glPopGroupMarkerEXT: PFNGLPOPGROUPMARKEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_blit: ::std::os::raw::c_int; -} -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 static mut glad_glBlitFramebufferEXT: PFNGLBLITFRAMEBUFFEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_multisample: ::std::os::raw::c_int; -} -pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageMultisampleEXT: - PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_multisample_blit_scaled: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_object: ::std::os::raw::c_int; -} -pub type PFNGLISRENDERBUFFEREXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsRenderbufferEXT: PFNGLISRENDERBUFFEREXTPROC; -} -pub type PFNGLBINDRENDERBUFFEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindRenderbufferEXT: PFNGLBINDRENDERBUFFEREXTPROC; -} -pub type PFNGLDELETERENDERBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteRenderbuffersEXT: PFNGLDELETERENDERBUFFERSEXTPROC; -} -pub type PFNGLGENRENDERBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenRenderbuffersEXT: PFNGLGENRENDERBUFFERSEXTPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEEXTPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageEXT: PFNGLRENDERBUFFERSTORAGEEXTPROC; -} -pub type PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetRenderbufferParameterivEXT: PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC; -} -pub type PFNGLISFRAMEBUFFEREXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsFramebufferEXT: PFNGLISFRAMEBUFFEREXTPROC; -} -pub type PFNGLBINDFRAMEBUFFEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindFramebufferEXT: PFNGLBINDFRAMEBUFFEREXTPROC; -} -pub type PFNGLDELETEFRAMEBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFramebuffersEXT: PFNGLDELETEFRAMEBUFFERSEXTPROC; -} -pub type PFNGLGENFRAMEBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenFramebuffersEXT: PFNGLGENFRAMEBUFFERSEXTPROC; -} -pub type PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC = - ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glCheckFramebufferStatusEXT: PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE1DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture1DEXT: PFNGLFRAMEBUFFERTEXTURE1DEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE2DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture2DEXT: PFNGLFRAMEBUFFERTEXTURE2DEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE3DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - zoffset: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture3DEXT: PFNGLFRAMEBUFFERTEXTURE3DEXTPROC; -} -pub type PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferRenderbufferEXT: PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC; -} -pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetFramebufferAttachmentParameterivEXT: - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC; -} -pub type PFNGLGENERATEMIPMAPEXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glGenerateMipmapEXT: PFNGLGENERATEMIPMAPEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_index_array_formats: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_compression_s3tc: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_swizzle: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_vertex_array: ::std::os::raw::c_int; -} -pub type PFNGLARRAYELEMENTEXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glArrayElementEXT: PFNGLARRAYELEMENTEXTPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorPointerEXT: PFNGLCOLORPOINTEREXTPROC; -} -pub type PFNGLDRAWARRAYSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawArraysEXT: PFNGLDRAWARRAYSEXTPROC; -} -pub type PFNGLEDGEFLAGPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn(stride: GLsizei, count: GLsizei, pointer: *const GLboolean), ->; -extern "C" { - pub static mut glad_glEdgeFlagPointerEXT: PFNGLEDGEFLAGPOINTEREXTPROC; -} -pub type PFNGLGETPOINTERVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(pname: GLenum, params: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetPointervEXT: PFNGLGETPOINTERVEXTPROC; -} -pub type PFNGLINDEXPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - type_: GLenum, - stride: GLsizei, - count: GLsizei, - pointer: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glIndexPointerEXT: PFNGLINDEXPOINTEREXTPROC; -} -pub type PFNGLNORMALPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - type_: GLenum, - stride: GLsizei, - count: GLsizei, - pointer: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glNormalPointerEXT: PFNGLNORMALPOINTEREXTPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glTexCoordPointerEXT: PFNGLTEXCOORDPOINTEREXTPROC; -} -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 static mut glad_glVertexPointerEXT: PFNGLVERTEXPOINTEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_vertex_shader: ::std::os::raw::c_int; -} -pub type PFNGLBEGINVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBeginVertexShaderEXT: PFNGLBEGINVERTEXSHADEREXTPROC; -} -pub type PFNGLENDVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndVertexShaderEXT: PFNGLENDVERTEXSHADEREXTPROC; -} -pub type PFNGLBINDVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindVertexShaderEXT: PFNGLBINDVERTEXSHADEREXTPROC; -} -pub type PFNGLGENVERTEXSHADERSEXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glGenVertexShadersEXT: PFNGLGENVERTEXSHADERSEXTPROC; -} -pub type PFNGLDELETEVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteVertexShaderEXT: PFNGLDELETEVERTEXSHADEREXTPROC; -} -pub type PFNGLSHADEROP1EXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glShaderOp1EXT: PFNGLSHADEROP1EXTPROC; -} -pub type PFNGLSHADEROP2EXTPROC = ::std::option::Option< - unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint), ->; -extern "C" { - pub static mut glad_glShaderOp2EXT: PFNGLSHADEROP2EXTPROC; -} -pub type PFNGLSHADEROP3EXTPROC = ::std::option::Option< - unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint, arg3: GLuint), ->; -extern "C" { - pub static mut glad_glShaderOp3EXT: PFNGLSHADEROP3EXTPROC; -} -pub type PFNGLSWIZZLEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - res: GLuint, - in_: GLuint, - outX: GLenum, - outY: GLenum, - outZ: GLenum, - outW: GLenum, - ), ->; -extern "C" { - pub static mut glad_glSwizzleEXT: PFNGLSWIZZLEEXTPROC; -} -pub type PFNGLWRITEMASKEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - res: GLuint, - in_: GLuint, - outX: GLenum, - outY: GLenum, - outZ: GLenum, - outW: GLenum, - ), ->; -extern "C" { - pub static mut glad_glWriteMaskEXT: PFNGLWRITEMASKEXTPROC; -} -pub type PFNGLINSERTCOMPONENTEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glInsertComponentEXT: PFNGLINSERTCOMPONENTEXTPROC; -} -pub type PFNGLEXTRACTCOMPONENTEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glExtractComponentEXT: PFNGLEXTRACTCOMPONENTEXTPROC; -} -pub type PFNGLGENSYMBOLSEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - datatype: GLenum, - storagetype: GLenum, - range: GLenum, - components: GLuint, - ) -> GLuint, ->; -extern "C" { - pub static mut glad_glGenSymbolsEXT: PFNGLGENSYMBOLSEXTPROC; -} -pub type PFNGLSETINVARIANTEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glSetInvariantEXT: PFNGLSETINVARIANTEXTPROC; -} -pub type PFNGLSETLOCALCONSTANTEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glSetLocalConstantEXT: PFNGLSETLOCALCONSTANTEXTPROC; -} -pub type PFNGLVARIANTBVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantbvEXT: PFNGLVARIANTBVEXTPROC; -} -pub type PFNGLVARIANTSVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantsvEXT: PFNGLVARIANTSVEXTPROC; -} -pub type PFNGLVARIANTIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantivEXT: PFNGLVARIANTIVEXTPROC; -} -pub type PFNGLVARIANTFVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantfvEXT: PFNGLVARIANTFVEXTPROC; -} -pub type PFNGLVARIANTDVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantdvEXT: PFNGLVARIANTDVEXTPROC; -} -pub type PFNGLVARIANTUBVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantubvEXT: PFNGLVARIANTUBVEXTPROC; -} -pub type PFNGLVARIANTUSVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantusvEXT: PFNGLVARIANTUSVEXTPROC; -} -pub type PFNGLVARIANTUIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantuivEXT: PFNGLVARIANTUIVEXTPROC; -} -pub type PFNGLVARIANTPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - id: GLuint, - type_: GLenum, - stride: GLuint, - addr: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glVariantPointerEXT: PFNGLVARIANTPOINTEREXTPROC; -} -pub type PFNGLENABLEVARIANTCLIENTSTATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVariantClientStateEXT: PFNGLENABLEVARIANTCLIENTSTATEEXTPROC; -} -pub type PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVariantClientStateEXT: PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC; -} -pub type PFNGLBINDLIGHTPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindLightParameterEXT: PFNGLBINDLIGHTPARAMETEREXTPROC; -} -pub type PFNGLBINDMATERIALPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindMaterialParameterEXT: PFNGLBINDMATERIALPARAMETEREXTPROC; -} -pub type PFNGLBINDTEXGENPARAMETEREXTPROC = ::std::option::Option< - unsafe extern "C" fn(unit: GLenum, coord: GLenum, value: GLenum) -> GLuint, ->; -extern "C" { - pub static mut glad_glBindTexGenParameterEXT: PFNGLBINDTEXGENPARAMETEREXTPROC; -} -pub type PFNGLBINDTEXTUREUNITPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindTextureUnitParameterEXT: PFNGLBINDTEXTUREUNITPARAMETEREXTPROC; -} -pub type PFNGLBINDPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindParameterEXT: PFNGLBINDPARAMETEREXTPROC; -} -pub type PFNGLISVARIANTENABLEDEXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsVariantEnabledEXT: PFNGLISVARIANTENABLEDEXTPROC; -} -pub type PFNGLGETVARIANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantBooleanvEXT: PFNGLGETVARIANTBOOLEANVEXTPROC; -} -pub type PFNGLGETVARIANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantIntegervEXT: PFNGLGETVARIANTINTEGERVEXTPROC; -} -pub type PFNGLGETVARIANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantFloatvEXT: PFNGLGETVARIANTFLOATVEXTPROC; -} -pub type PFNGLGETVARIANTPOINTERVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, value: GLenum, data: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetVariantPointervEXT: PFNGLGETVARIANTPOINTERVEXTPROC; -} -pub type PFNGLGETINVARIANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantBooleanvEXT: PFNGLGETINVARIANTBOOLEANVEXTPROC; -} -pub type PFNGLGETINVARIANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantIntegervEXT: PFNGLGETINVARIANTINTEGERVEXTPROC; -} -pub type PFNGLGETINVARIANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantFloatvEXT: PFNGLGETINVARIANTFLOATVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantBooleanvEXT: PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantIntegervEXT: PFNGLGETLOCALCONSTANTINTEGERVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantFloatvEXT: PFNGLGETLOCALCONSTANTFLOATVEXTPROC; -} -#[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, -} -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wch as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wchb as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__value as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__state as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} -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, -} -#[test] -fn bindgen_test_layout__G_fpos64_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos64_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos64_t>())).__state as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} -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: size_t, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._codecvt as *const _ as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._wide_data as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_list as *const _ as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._freeres_buf as *const _ as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -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 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 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 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 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: size_t, - ) -> ::std::os::raw::c_int; -} -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 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 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 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 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 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 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 perror(__s: *const ::std::os::raw::c_char); -} -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; -} -extern "C" { - pub static mut max_loaded_major: ::std::os::raw::c_int; -} -extern "C" { - pub static mut max_loaded_minor: ::std::os::raw::c_int; -} -extern "C" { - pub static mut exts: *const ::std::os::raw::c_char; -} -pub const num_exts_i: ::std::os::raw::c_int = 0; -extern "C" { - pub static mut exts_i: *mut *const ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VertexBuffer { - pub elementsCount: ::std::os::raw::c_int, - pub vCounter: ::std::os::raw::c_int, - pub tcCounter: ::std::os::raw::c_int, - pub cCounter: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_uint, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: [::std::os::raw::c_uint; 4usize], -} -#[test] -fn bindgen_test_layout_VertexBuffer() { - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(VertexBuffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(VertexBuffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).elementsCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(elementsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vCounter as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tcCounter as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(tcCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cCounter as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(cCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DrawCall { - pub mode: ::std::os::raw::c_int, - pub vertexCount: ::std::os::raw::c_int, - pub vertexAlignment: ::std::os::raw::c_int, - pub textureId: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_DrawCall() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(DrawCall)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(DrawCall)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mode as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(mode) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexAlignment as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(vertexAlignment) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).textureId as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(textureId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderBatch { - pub buffersCount: ::std::os::raw::c_int, - pub currentBuffer: ::std::os::raw::c_int, - pub vertexBuffer: *mut VertexBuffer, - pub draws: *mut DrawCall, - pub drawsCounter: ::std::os::raw::c_int, - pub currentDepth: f32, -} -#[test] -fn bindgen_test_layout_RenderBatch() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RenderBatch)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RenderBatch)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffersCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(buffersCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentBuffer as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(currentBuffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexBuffer as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(vertexBuffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).draws as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(draws) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).drawsCounter as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(drawsCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentDepth as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(currentDepth) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrStereoConfig { - pub distortionShader: Shader, - pub eyesProjection: [Matrix; 2usize], - pub eyesViewOffset: [Matrix; 2usize], - pub eyeViewportRight: [::std::os::raw::c_int; 4usize], - pub eyeViewportLeft: [::std::os::raw::c_int; 4usize], -} -#[test] -fn bindgen_test_layout_VrStereoConfig() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!("Size of: ", stringify!(VrStereoConfig)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(VrStereoConfig)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).distortionShader as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(distortionShader) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eyesProjection as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(eyesProjection) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eyesViewOffset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(eyesViewOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eyeViewportRight as *const _ as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(eyeViewportRight) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).eyeViewportLeft as *const _ as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(eyeViewportLeft) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData { - pub currentBatch: *mut RenderBatch, - pub defaultBatch: RenderBatch, - pub State: rlglData__bindgen_ty_1, - pub ExtSupported: rlglData__bindgen_ty_2, - pub Vr: rlglData__bindgen_ty_3, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData__bindgen_ty_1 { - pub currentMatrixMode: ::std::os::raw::c_int, - pub currentMatrix: *mut Matrix, - pub modelview: Matrix, - pub projection: Matrix, - pub transform: Matrix, - pub transformRequired: bool, - pub stack: [Matrix; 32usize], - pub stackCounter: ::std::os::raw::c_int, - pub shapesTexture: Texture2D, - pub shapesTextureRec: Rectangle, - pub defaultTextureId: ::std::os::raw::c_uint, - pub activeTextureId: [::std::os::raw::c_uint; 4usize], - pub defaultVShaderId: ::std::os::raw::c_uint, - pub defaultFShaderId: ::std::os::raw::c_uint, - pub defaultShader: Shader, - pub currentShader: Shader, - pub currentBlendMode: ::std::os::raw::c_int, - pub glBlendSrcFactor: ::std::os::raw::c_int, - pub glBlendDstFactor: ::std::os::raw::c_int, - pub glad_glBlendEquation: ::std::os::raw::c_int, - pub framebufferWidth: ::std::os::raw::c_int, - pub framebufferHeight: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_rlglData__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 2384usize, - concat!("Size of: ", stringify!(rlglData__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlglData__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentMatrixMode as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentMatrixMode) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentMatrix as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentMatrix) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).modelview as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(modelview) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).projection as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(projection) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).transform as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).transformRequired as *const _ - as usize - }, - 208usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(transformRequired) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, - 212usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(stack) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stackCounter as *const _ as usize - }, - 2260usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(stackCounter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).shapesTexture as *const _ as usize - }, - 2264usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(shapesTexture) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).shapesTextureRec as *const _ as usize - }, - 2284usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(shapesTextureRec) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultTextureId as *const _ as usize - }, - 2300usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultTextureId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).activeTextureId as *const _ as usize - }, - 2304usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(activeTextureId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultVShaderId as *const _ as usize - }, - 2320usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultVShaderId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultFShaderId as *const _ as usize - }, - 2324usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultFShaderId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultShader as *const _ as usize - }, - 2328usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultShader) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentShader as *const _ as usize - }, - 2344usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentShader) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentBlendMode as *const _ as usize - }, - 2360usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentBlendMode) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glBlendSrcFactor as *const _ as usize - }, - 2364usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glBlendSrcFactor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glBlendDstFactor as *const _ as usize - }, - 2368usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glBlendDstFactor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glad_glBlendEquation as *const _ - as usize - }, - 2372usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glad_glBlendEquation) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).framebufferWidth as *const _ as usize - }, - 2376usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(framebufferWidth) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).framebufferHeight as *const _ - as usize - }, - 2380usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(framebufferHeight) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData__bindgen_ty_2 { - pub vao: bool, - pub texNPOT: bool, - pub texDepth: bool, - pub texFloat32: bool, - pub texCompDXT: bool, - pub texCompETC1: bool, - pub texCompETC2: bool, - pub texCompPVRT: bool, - pub texCompASTC: bool, - pub texMirrorClamp: bool, - pub texAnisoFilter: bool, - pub debugMarker: bool, - pub maxAnisotropicLevel: f32, - pub maxDepthBits: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_rlglData__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(rlglData__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(rlglData__bindgen_ty_2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vao as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(vao) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texNPOT as *const _ as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texNPOT) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texDepth as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texDepth) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texFloat32 as *const _ as usize - }, - 3usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texFloat32) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompDXT as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompDXT) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompETC1 as *const _ as usize - }, - 5usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompETC1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompETC2 as *const _ as usize - }, - 6usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompETC2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompPVRT as *const _ as usize - }, - 7usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompPVRT) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompASTC as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompASTC) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texMirrorClamp as *const _ as usize - }, - 9usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texMirrorClamp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texAnisoFilter as *const _ as usize - }, - 10usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texAnisoFilter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).debugMarker as *const _ as usize - }, - 11usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(debugMarker) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).maxAnisotropicLevel as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(maxAnisotropicLevel) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).maxDepthBits as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(maxDepthBits) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData__bindgen_ty_3 { - pub config: VrStereoConfig, - pub stereoFboId: ::std::os::raw::c_uint, - pub stereoTexId: ::std::os::raw::c_uint, - pub simulatorReady: bool, - pub stereoRender: bool, -} -#[test] -fn bindgen_test_layout_rlglData__bindgen_ty_3() { - assert_eq!( - ::std::mem::size_of::(), - 320usize, - concat!("Size of: ", stringify!(rlglData__bindgen_ty_3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlglData__bindgen_ty_3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).config as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_3), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stereoFboId as *const _ as usize - }, - 304usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_3), - "::", - stringify!(stereoFboId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stereoTexId as *const _ as usize - }, - 308usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_3), - "::", - stringify!(stereoTexId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).simulatorReady as *const _ as usize - }, - 312usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_3), - "::", - stringify!(simulatorReady) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stereoRender as *const _ as usize - }, - 313usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_3), - "::", - stringify!(stereoRender) - ) - ); -} -#[test] -fn bindgen_test_layout_rlglData() { - assert_eq!( - ::std::mem::size_of::(), - 2768usize, - concat!("Size of: ", stringify!(rlglData)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlglData)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentBatch as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(currentBatch) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).defaultBatch as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(defaultBatch) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).State as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(State) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ExtSupported as *const _ as usize }, - 2424usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(ExtSupported) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).Vr as *const _ as usize }, - 2448usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(Vr) - ) - ); -} -extern "C" { - pub static mut RLGL: rlglData; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GuiStyleProp { - pub controlId: ::std::os::raw::c_ushort, - pub propertyId: ::std::os::raw::c_ushort, - pub propertyValue: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_GuiStyleProp() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GuiStyleProp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GuiStyleProp)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).controlId as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(controlId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyId as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyValue) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControlState { - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED = 1, - GUI_STATE_PRESSED = 2, - GUI_STATE_DISABLED = 3, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiTextAlignment { - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER = 1, - GUI_TEXT_ALIGN_RIGHT = 2, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControl { - DEFAULT = 0, - LABEL = 1, - BUTTON = 2, - TOGGLE = 3, - SLIDER = 4, - PROGRESSBAR = 5, - CHECKBOX = 6, - COMBOBOX = 7, - DROPDOWNBOX = 8, - TEXTBOX = 9, - VALUEBOX = 10, - SPINNER = 11, - LISTVIEW = 12, - COLORPICKER = 13, - SCROLLBAR = 14, - STATUSBAR = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControlProperty { - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL = 1, - TEXT_COLOR_NORMAL = 2, - BORDER_COLOR_FOCUSED = 3, - BASE_COLOR_FOCUSED = 4, - TEXT_COLOR_FOCUSED = 5, - BORDER_COLOR_PRESSED = 6, - BASE_COLOR_PRESSED = 7, - TEXT_COLOR_PRESSED = 8, - BORDER_COLOR_DISABLED = 9, - BASE_COLOR_DISABLED = 10, - TEXT_COLOR_DISABLED = 11, - BORDER_WIDTH = 12, - TEXT_PADDING = 13, - TEXT_ALIGNMENT = 14, - RESERVED = 15, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiDefaultProperty { - TEXT_SIZE = 16, - TEXT_SPACING = 17, - LINE_COLOR = 18, - BACKGROUND_COLOR = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiToggleProperty { - GROUP_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiSliderProperty { - SLIDER_WIDTH = 16, - SLIDER_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiProgressBarProperty { - PROGRESS_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiCheckBoxProperty { - CHECK_PADDING = 16, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiComboBoxProperty { - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiDropdownBoxProperty { - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiTextBoxProperty { - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING = 17, - COLOR_SELECTED_FG = 18, - COLOR_SELECTED_BG = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiSpinnerProperty { - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING = 17, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiScrollBarProperty { - ARROWS_SIZE = 16, - ARROWS_VISIBLE = 17, - SCROLL_SLIDER_PADDING = 18, - SCROLL_SLIDER_SIZE = 19, - SCROLL_PADDING = 20, - SCROLL_SPEED = 21, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiScrollBarSide { - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE = 1, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiListViewProperty { - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING = 17, - SCROLLBAR_WIDTH = 18, - SCROLLBAR_SIDE = 19, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiColorPickerProperty { - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH = 17, - HUEBAR_PADDING = 18, - HUEBAR_SELECTOR_HEIGHT = 19, - HUEBAR_SELECTOR_OVERFLOW = 20, -} -extern "C" { - pub fn GuiEnable(); -} -extern "C" { - pub fn GuiDisable(); -} -extern "C" { - pub fn GuiLock(); -} -extern "C" { - pub fn GuiUnlock(); -} -extern "C" { - pub fn GuiFade(alpha: f32); -} -extern "C" { - pub fn GuiSetState(state: ::std::os::raw::c_int); -} -extern "C" { - pub fn GuiGetState() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiSetFont(font: Font); -} -extern "C" { - pub fn GuiGetFont() -> Font; -} -extern "C" { - pub fn GuiSetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiGetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiEnableTooltip(); -} -extern "C" { - pub fn GuiDisableTooltip(); -} -extern "C" { - pub fn GuiSetTooltip(tooltip: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiClearTooltip(); -} -extern "C" { - pub fn GuiWindowBox(bounds: Rectangle, title: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiGroupBox(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLine(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiPanel(bounds: Rectangle); -} -extern "C" { - pub fn GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: *mut Vector2) - -> Rectangle; -} -extern "C" { - pub fn GuiLabel(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiLabelButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiImageButton( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - ) -> bool; -} -extern "C" { - pub fn GuiImageButtonEx( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - texSource: Rectangle, - ) -> bool; -} -extern "C" { - pub fn GuiToggle(bounds: Rectangle, text: *const ::std::os::raw::c_char, active: bool) -> bool; -} -extern "C" { - pub fn GuiToggleGroup( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiCheckBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - checked: bool, - ) -> bool; -} -extern "C" { - pub fn GuiComboBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiDropdownBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: *mut ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSpinner( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiValueBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBox( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBoxMulti( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSlider( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiSliderBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiProgressBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiStatusBar(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiDummyRec(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiScrollBar( - bounds: Rectangle, - value: ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiGrid(bounds: Rectangle, spacing: f32, subdivs: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GuiListView( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiListViewEx( - bounds: Rectangle, - text: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - focus: *mut ::std::os::raw::c_int, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiMessageBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiTextInputBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiColorPicker(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorPanel(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorBarAlpha(bounds: Rectangle, alpha: f32) -> f32; -} -extern "C" { - pub fn GuiColorBarHue(bounds: Rectangle, value: f32) -> f32; -} -extern "C" { - pub fn GuiLoadStyle(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLoadStyleDefault(); -} -extern "C" { - pub fn GuiIconText( - iconId: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GuiDrawIcon( - iconId: ::std::os::raw::c_int, - position: Vector2, - pixelSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn GuiGetIcons() -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiGetIconData(iconId: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiSetIconData(iconId: ::std::os::raw::c_int, data: *mut ::std::os::raw::c_uint); -} -extern "C" { - pub fn GuiSetIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiClearIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiCheckIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum guiIconName { - RICON_NONE = 0, - RICON_FOLDER_FILE_OPEN = 1, - RICON_FILE_SAVE_CLASSIC = 2, - RICON_FOLDER_OPEN = 3, - RICON_FOLDER_SAVE = 4, - RICON_FILE_OPEN = 5, - RICON_FILE_SAVE = 6, - RICON_FILE_EXPORT = 7, - RICON_FILE_NEW = 8, - RICON_FILE_DELETE = 9, - RICON_FILETYPE_TEXT = 10, - RICON_FILETYPE_AUDIO = 11, - RICON_FILETYPE_IMAGE = 12, - RICON_FILETYPE_PLAY = 13, - RICON_FILETYPE_VIDEO = 14, - RICON_FILETYPE_INFO = 15, - RICON_FILE_COPY = 16, - RICON_FILE_CUT = 17, - RICON_FILE_PASTE = 18, - RICON_CURSOR_HAND = 19, - RICON_CURSOR_POINTER = 20, - RICON_CURSOR_CLASSIC = 21, - RICON_PENCIL = 22, - RICON_PENCIL_BIG = 23, - RICON_BRUSH_CLASSIC = 24, - RICON_BRUSH_PAINTER = 25, - RICON_WATER_DROP = 26, - RICON_COLOR_PICKER = 27, - RICON_RUBBER = 28, - RICON_COLOR_BUCKET = 29, - RICON_TEXT_T = 30, - RICON_TEXT_A = 31, - RICON_SCALE = 32, - RICON_RESIZE = 33, - RICON_FILTER_POINT = 34, - RICON_FILTER_BILINEAR = 35, - RICON_CROP = 36, - RICON_CROP_ALPHA = 37, - RICON_SQUARE_TOGGLE = 38, - RICON_SYMMETRY = 39, - RICON_SYMMETRY_HORIZONTAL = 40, - RICON_SYMMETRY_VERTICAL = 41, - RICON_LENS = 42, - RICON_LENS_BIG = 43, - RICON_EYE_ON = 44, - RICON_EYE_OFF = 45, - RICON_FILTER_TOP = 46, - RICON_FILTER = 47, - RICON_TARGET_POINT = 48, - RICON_TARGET_SMALL = 49, - RICON_TARGET_BIG = 50, - RICON_TARGET_MOVE = 51, - RICON_CURSOR_MOVE = 52, - RICON_CURSOR_SCALE = 53, - RICON_CURSOR_SCALE_RIGHT = 54, - RICON_CURSOR_SCALE_LEFT = 55, - RICON_UNDO = 56, - RICON_REDO = 57, - RICON_REREDO = 58, - RICON_MUTATE = 59, - RICON_ROTATE = 60, - RICON_REPEAT = 61, - RICON_SHUFFLE = 62, - RICON_EMPTYBOX = 63, - RICON_TARGET = 64, - RICON_TARGET_SMALL_FILL = 65, - RICON_TARGET_BIG_FILL = 66, - RICON_TARGET_MOVE_FILL = 67, - RICON_CURSOR_MOVE_FILL = 68, - RICON_CURSOR_SCALE_FILL = 69, - RICON_CURSOR_SCALE_RIGHT_FILL = 70, - RICON_CURSOR_SCALE_LEFT_FILL = 71, - RICON_UNDO_FILL = 72, - RICON_REDO_FILL = 73, - RICON_REREDO_FILL = 74, - RICON_MUTATE_FILL = 75, - RICON_ROTATE_FILL = 76, - RICON_REPEAT_FILL = 77, - RICON_SHUFFLE_FILL = 78, - RICON_EMPTYBOX_SMALL = 79, - RICON_BOX = 80, - RICON_BOX_TOP = 81, - RICON_BOX_TOP_RIGHT = 82, - RICON_BOX_RIGHT = 83, - RICON_BOX_BOTTOM_RIGHT = 84, - RICON_BOX_BOTTOM = 85, - RICON_BOX_BOTTOM_LEFT = 86, - RICON_BOX_LEFT = 87, - RICON_BOX_TOP_LEFT = 88, - RICON_BOX_CENTER = 89, - RICON_BOX_CIRCLE_MASK = 90, - RICON_POT = 91, - RICON_ALPHA_MULTIPLY = 92, - RICON_ALPHA_CLEAR = 93, - RICON_DITHERING = 94, - RICON_MIPMAPS = 95, - RICON_BOX_GRID = 96, - RICON_GRID = 97, - RICON_BOX_CORNERS_SMALL = 98, - RICON_BOX_CORNERS_BIG = 99, - RICON_FOUR_BOXES = 100, - RICON_GRID_FILL = 101, - RICON_BOX_MULTISIZE = 102, - RICON_ZOOM_SMALL = 103, - RICON_ZOOM_MEDIUM = 104, - RICON_ZOOM_BIG = 105, - RICON_ZOOM_ALL = 106, - RICON_ZOOM_CENTER = 107, - RICON_BOX_DOTS_SMALL = 108, - RICON_BOX_DOTS_BIG = 109, - RICON_BOX_CONCENTRIC = 110, - RICON_BOX_GRID_BIG = 111, - RICON_OK_TICK = 112, - RICON_CROSS = 113, - RICON_ARROW_LEFT = 114, - RICON_ARROW_RIGHT = 115, - RICON_ARROW_BOTTOM = 116, - RICON_ARROW_TOP = 117, - RICON_ARROW_LEFT_FILL = 118, - RICON_ARROW_RIGHT_FILL = 119, - RICON_ARROW_BOTTOM_FILL = 120, - RICON_ARROW_TOP_FILL = 121, - RICON_AUDIO = 122, - RICON_FX = 123, - RICON_WAVE = 124, - RICON_WAVE_SINUS = 125, - RICON_WAVE_SQUARE = 126, - RICON_WAVE_TRIANGULAR = 127, - RICON_CROSS_SMALL = 128, - RICON_PLAYER_PREVIOUS = 129, - RICON_PLAYER_PLAY_BACK = 130, - RICON_PLAYER_PLAY = 131, - RICON_PLAYER_PAUSE = 132, - RICON_PLAYER_STOP = 133, - RICON_PLAYER_NEXT = 134, - RICON_PLAYER_RECORD = 135, - RICON_MAGNET = 136, - RICON_LOCK_CLOSE = 137, - RICON_LOCK_OPEN = 138, - RICON_CLOCK = 139, - RICON_TOOLS = 140, - RICON_GEAR = 141, - RICON_GEAR_BIG = 142, - RICON_BIN = 143, - RICON_HAND_POINTER = 144, - RICON_LASER = 145, - RICON_COIN = 146, - RICON_EXPLOSION = 147, - RICON_1UP = 148, - RICON_PLAYER = 149, - RICON_PLAYER_JUMP = 150, - RICON_KEY = 151, - RICON_DEMON = 152, - RICON_TEXT_POPUP = 153, - RICON_GEAR_EX = 154, - RICON_CRACK = 155, - RICON_CRACK_POINTS = 156, - RICON_STAR = 157, - RICON_DOOR = 158, - RICON_EXIT = 159, - RICON_MODE_2D = 160, - RICON_MODE_3D = 161, - RICON_CUBE = 162, - RICON_CUBE_FACE_TOP = 163, - RICON_CUBE_FACE_LEFT = 164, - RICON_CUBE_FACE_FRONT = 165, - RICON_CUBE_FACE_BOTTOM = 166, - RICON_CUBE_FACE_RIGHT = 167, - RICON_CUBE_FACE_BACK = 168, - RICON_CAMERA = 169, - RICON_SPECIAL = 170, - RICON_LINK_NET = 171, - RICON_LINK_BOXES = 172, - RICON_LINK_MULTI = 173, - RICON_LINK = 174, - RICON_LINK_BROKE = 175, - RICON_TEXT_NOTES = 176, - RICON_NOTEBOOK = 177, - RICON_SUITCASE = 178, - RICON_SUITCASE_ZIP = 179, - RICON_MAILBOX = 180, - RICON_MONITOR = 181, - RICON_PRINTER = 182, - RICON_PHOTO_CAMERA = 183, - RICON_PHOTO_CAMERA_FLASH = 184, - RICON_HOUSE = 185, - RICON_HEART = 186, - RICON_CORNER = 187, - RICON_VERTICAL_BARS = 188, - RICON_VERTICAL_BARS_FILL = 189, - RICON_LIFE_BARS = 190, - RICON_INFO = 191, - RICON_CROSSLINE = 192, - RICON_HELP = 193, - RICON_FILETYPE_ALPHA = 194, - RICON_FILETYPE_HOME = 195, - RICON_LAYERS_VISIBLE = 196, - RICON_LAYERS = 197, - RICON_WINDOW = 198, - RICON_HIDPI = 199, - RICON_200 = 200, - RICON_201 = 201, - RICON_202 = 202, - RICON_203 = 203, - RICON_204 = 204, - RICON_205 = 205, - RICON_206 = 206, - RICON_207 = 207, - RICON_208 = 208, - RICON_209 = 209, - RICON_210 = 210, - RICON_211 = 211, - RICON_212 = 212, - RICON_213 = 213, - RICON_214 = 214, - RICON_215 = 215, - RICON_216 = 216, - RICON_217 = 217, - RICON_218 = 218, - RICON_219 = 219, - RICON_220 = 220, - RICON_221 = 221, - RICON_222 = 222, - RICON_223 = 223, - RICON_224 = 224, - RICON_225 = 225, - RICON_226 = 226, - RICON_227 = 227, - RICON_228 = 228, - RICON_229 = 229, - RICON_230 = 230, - RICON_231 = 231, - RICON_232 = 232, - RICON_233 = 233, - RICON_234 = 234, - RICON_235 = 235, - RICON_236 = 236, - RICON_237 = 237, - RICON_238 = 238, - RICON_239 = 239, - RICON_240 = 240, - RICON_241 = 241, - RICON_242 = 242, - RICON_243 = 243, - RICON_244 = 244, - RICON_245 = 245, - RICON_246 = 246, - RICON_247 = 247, - RICON_248 = 248, - RICON_249 = 249, - RICON_250 = 250, - RICON_251 = 251, - RICON_252 = 252, - RICON_253 = 253, - RICON_254 = 254, - RICON_255 = 255, -} -extern "C" { - pub static mut guiIcons: [::std::os::raw::c_uint; 2048usize]; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiPropertyElement { - BORDER = 0, - BASE = 1, - TEXT = 2, - OTHER = 3, -} -extern "C" { - pub static mut guiState: GuiControlState; -} -extern "C" { - pub static mut guiFont: Font; -} -pub const guiLocked: bool = false; -pub const guiAlpha: f32 = 1.0; -extern "C" { - pub static mut guiStyle: [::std::os::raw::c_uint; 384usize]; -} -pub const guiStyleLoaded: bool = false; -extern "C" { - pub static mut guiTooltip: *const ::std::os::raw::c_char; -} -pub const guiTooltipEnabled: bool = true; -extern "C" { - pub fn GuiSliderPro( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - sliderWidth: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn GuiColorPanelEx(bounds: Rectangle, color: Color, hue: f32) -> Color; -} -extern "C" { - pub fn GuiLoadIcons( - fileName: *const ::std::os::raw::c_char, - loadIconsName: bool, - ) -> *mut *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Light { - pub type_: ::std::os::raw::c_int, - pub position: Vector3, - pub target: Vector3, - pub color: Color, - pub enabled: bool, - pub enabledLoc: ::std::os::raw::c_int, - pub typeLoc: ::std::os::raw::c_int, - pub posLoc: ::std::os::raw::c_int, - pub targetLoc: ::std::os::raw::c_int, - pub colorLoc: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Light() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(Light)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Light)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(color) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).enabled as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(enabled) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).enabledLoc as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(enabledLoc) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).typeLoc as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(typeLoc) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).posLoc as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(posLoc) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).targetLoc as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(targetLoc) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colorLoc as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(Light), - "::", - stringify!(colorLoc) - ) - ); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum LightType { - LIGHT_DIRECTIONAL = 0, - LIGHT_POINT = 1, -} -extern "C" { - pub fn CreateLight( - type_: ::std::os::raw::c_int, - position: Vector3, - target: Vector3, - color: Color, - shader: Shader, - ) -> Light; -} -extern "C" { - pub fn UpdateLightValues(shader: Shader, light: Light); -} -pub const lightsCount: ::std::os::raw::c_int = 0; -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, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/raylib-sys/bindings_windows.rs b/raylib-sys/bindings_windows.rs deleted file mode 100644 index f99f987e..00000000 --- a/raylib-sys/bindings_windows.rs +++ /dev/null @@ -1,17873 +0,0 @@ -/* automatically generated by rust-bindgen 0.54.1 */ - -pub const __GNUC_VA_LIST: u32 = 1; -pub const PI: f64 = 3.141592653589793; -pub const DEG2RAD: f64 = 0.017453292519943295; -pub const RAD2DEG: f64 = 57.29577951308232; -pub const _VCRT_COMPILER_PREPROCESSOR: u32 = 1; -pub const _SAL_VERSION: u32 = 20; -pub const __SAL_H_VERSION: u32 = 180000000; -pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; -pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; -pub const _CRT_PACKING: u32 = 8; -pub const _HAS_EXCEPTIONS: u32 = 1; -pub const _STL_LANG: u32 = 0; -pub const _HAS_CXX17: u32 = 0; -pub const _HAS_CXX20: u32 = 0; -pub const _HAS_NODISCARD: u32 = 0; -pub const _ARGMAX: u32 = 100; -pub const _CRT_INT_MAX: u32 = 2147483647; -pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; -pub const _CRT_HAS_CXX17: u32 = 0; -pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; -pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; -pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; -pub const __STDC_SECURE_LIB__: u32 = 200411; -pub const __GOT_SECURE_LIB__: u32 = 200411; -pub const __STDC_WANT_SECURE_LIB__: u32 = 1; -pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; -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_SECURE_NAMES: u32 = 1; -pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; -pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; -pub const _DOMAIN: u32 = 1; -pub const _SING: u32 = 2; -pub const _OVERFLOW: u32 = 3; -pub const _UNDERFLOW: u32 = 4; -pub const _TLOSS: u32 = 5; -pub const _PLOSS: u32 = 6; -pub const _HUGE_ENUF : f64 = 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 ; -pub const _DENORM: i32 = -2; -pub const _FINITE: i32 = -1; -pub const _INFCODE: u32 = 1; -pub const _NANCODE: u32 = 2; -pub const FP_INFINITE: u32 = 1; -pub const FP_NAN: u32 = 2; -pub const FP_NORMAL: i32 = -1; -pub const FP_SUBNORMAL: i32 = -2; -pub const FP_ZERO: u32 = 0; -pub const _C2: u32 = 1; -pub const FP_ILOGB0: i32 = -2147483648; -pub const FP_ILOGBNAN: u32 = 2147483647; -pub const MATH_ERRNO: u32 = 1; -pub const MATH_ERREXCEPT: u32 = 2; -pub const math_errhandling: u32 = 3; -pub const _FE_DIVBYZERO: u32 = 4; -pub const _FE_INEXACT: u32 = 32; -pub const _FE_INVALID: u32 = 1; -pub const _FE_OVERFLOW: u32 = 8; -pub const _FE_UNDERFLOW: u32 = 16; -pub const _D0_C: u32 = 3; -pub const _D1_C: u32 = 2; -pub const _D2_C: u32 = 1; -pub const _D3_C: u32 = 0; -pub const _DBIAS: u32 = 1022; -pub const _DOFF: u32 = 4; -pub const _F0_C: u32 = 1; -pub const _F1_C: u32 = 0; -pub const _FBIAS: u32 = 126; -pub const _FOFF: u32 = 7; -pub const _FRND: u32 = 1; -pub const _L0_C: u32 = 3; -pub const _L1_C: u32 = 2; -pub const _L2_C: u32 = 1; -pub const _L3_C: u32 = 0; -pub const _LBIAS: u32 = 1022; -pub const _LOFF: u32 = 4; -pub const _FP_LT: u32 = 1; -pub const _FP_EQ: u32 = 2; -pub const _FP_GT: u32 = 4; -pub const DOMAIN: u32 = 1; -pub const SING: u32 = 2; -pub const OVERFLOW: u32 = 3; -pub const UNDERFLOW: u32 = 4; -pub const TLOSS: u32 = 5; -pub const PLOSS: u32 = 6; -pub const DEFAULT_BATCH_BUFFER_ELEMENTS: u32 = 8192; -pub const DEFAULT_BATCH_BUFFERS: u32 = 1; -pub const DEFAULT_BATCH_DRAWCALLS: u32 = 256; -pub const MAX_BATCH_ACTIVE_TEXTURES: u32 = 4; -pub const MAX_MATRIX_STACK_SIZE: u32 = 32; -pub const MAX_MESH_VERTEX_BUFFERS: u32 = 7; -pub const MAX_SHADER_LOCATIONS: u32 = 32; -pub const MAX_MATERIAL_MAPS: u32 = 12; -pub const RL_CULL_DISTANCE_NEAR: f64 = 0.01; -pub const RL_CULL_DISTANCE_FAR: f64 = 1000.0; -pub const RL_TEXTURE_WRAP_S: u32 = 10242; -pub const RL_TEXTURE_WRAP_T: u32 = 10243; -pub const RL_TEXTURE_MAG_FILTER: u32 = 10240; -pub const RL_TEXTURE_MIN_FILTER: u32 = 10241; -pub const RL_TEXTURE_FILTER_NEAREST: u32 = 9728; -pub const RL_TEXTURE_FILTER_LINEAR: u32 = 9729; -pub const RL_TEXTURE_FILTER_MIP_NEAREST: u32 = 9984; -pub const RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR: u32 = 9986; -pub const RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST: u32 = 9985; -pub const RL_TEXTURE_FILTER_MIP_LINEAR: u32 = 9987; -pub const RL_TEXTURE_FILTER_ANISOTROPIC: u32 = 12288; -pub const RL_TEXTURE_WRAP_REPEAT: u32 = 10497; -pub const RL_TEXTURE_WRAP_CLAMP: u32 = 33071; -pub const RL_TEXTURE_WRAP_MIRROR_REPEAT: u32 = 33648; -pub const RL_TEXTURE_WRAP_MIRROR_CLAMP: u32 = 34626; -pub const RL_MODELVIEW: u32 = 5888; -pub const RL_PROJECTION: u32 = 5889; -pub const RL_TEXTURE: u32 = 5890; -pub const RL_LINES: u32 = 1; -pub const RL_TRIANGLES: u32 = 4; -pub const RL_QUADS: u32 = 7; -pub const RL_UNSIGNED_BYTE: u32 = 5121; -pub const RL_FLOAT: u32 = 5126; -pub const RAYLIB_VERSION: &'static [u8; 4usize] = b"3.0\0"; -pub const SUPPORT_CAMERA_SYSTEM: u32 = 1; -pub const SUPPORT_GESTURES_SYSTEM: u32 = 1; -pub const SUPPORT_MOUSE_GESTURES: u32 = 1; -pub const SUPPORT_SSH_KEYBOARD_RPI: u32 = 1; -pub const SUPPORT_MOUSE_CURSOR_RPI: u32 = 1; -pub const SUPPORT_SCREEN_CAPTURE: u32 = 1; -pub const SUPPORT_COMPRESSION_API: u32 = 1; -pub const SUPPORT_DATA_STORAGE: u32 = 1; -pub const SUPPORT_VR_SIMULATOR: u32 = 1; -pub const SUPPORT_FONT_TEXTURE: u32 = 1; -pub const SUPPORT_QUADS_DRAW_MODE: u32 = 1; -pub const SUPPORT_FILEFORMAT_PNG: u32 = 1; -pub const SUPPORT_FILEFORMAT_BMP: u32 = 1; -pub const SUPPORT_FILEFORMAT_TGA: u32 = 1; -pub const SUPPORT_FILEFORMAT_GIF: u32 = 1; -pub const SUPPORT_FILEFORMAT_DDS: u32 = 1; -pub const SUPPORT_FILEFORMAT_HDR: u32 = 1; -pub const SUPPORT_FILEFORMAT_KTX: u32 = 1; -pub const SUPPORT_FILEFORMAT_ASTC: u32 = 1; -pub const SUPPORT_IMAGE_EXPORT: u32 = 1; -pub const SUPPORT_IMAGE_MANIPULATION: u32 = 1; -pub const SUPPORT_IMAGE_GENERATION: u32 = 1; -pub const SUPPORT_DEFAULT_FONT: u32 = 1; -pub const SUPPORT_FILEFORMAT_FNT: u32 = 1; -pub const SUPPORT_FILEFORMAT_TTF: u32 = 1; -pub const SUPPORT_FILEFORMAT_OBJ: u32 = 1; -pub const SUPPORT_FILEFORMAT_MTL: u32 = 1; -pub const SUPPORT_FILEFORMAT_IQM: u32 = 1; -pub const SUPPORT_FILEFORMAT_GLTF: u32 = 1; -pub const SUPPORT_MESH_GENERATION: u32 = 1; -pub const SUPPORT_FILEFORMAT_WAV: u32 = 1; -pub const SUPPORT_FILEFORMAT_OGG: u32 = 1; -pub const SUPPORT_FILEFORMAT_XM: u32 = 1; -pub const SUPPORT_FILEFORMAT_MOD: u32 = 1; -pub const SUPPORT_FILEFORMAT_MP3: u32 = 1; -pub const SUPPORT_TRACELOG: u32 = 1; -pub const _MAX_ITOSTR_BASE16_COUNT: u32 = 9; -pub const _MAX_ITOSTR_BASE10_COUNT: u32 = 12; -pub const _MAX_ITOSTR_BASE8_COUNT: u32 = 12; -pub const _MAX_ITOSTR_BASE2_COUNT: u32 = 33; -pub const _MAX_LTOSTR_BASE16_COUNT: u32 = 9; -pub const _MAX_LTOSTR_BASE10_COUNT: u32 = 12; -pub const _MAX_LTOSTR_BASE8_COUNT: u32 = 12; -pub const _MAX_LTOSTR_BASE2_COUNT: u32 = 33; -pub const _MAX_ULTOSTR_BASE16_COUNT: u32 = 9; -pub const _MAX_ULTOSTR_BASE10_COUNT: u32 = 11; -pub const _MAX_ULTOSTR_BASE8_COUNT: u32 = 12; -pub const _MAX_ULTOSTR_BASE2_COUNT: u32 = 33; -pub const _MAX_I64TOSTR_BASE16_COUNT: u32 = 17; -pub const _MAX_I64TOSTR_BASE10_COUNT: u32 = 21; -pub const _MAX_I64TOSTR_BASE8_COUNT: u32 = 23; -pub const _MAX_I64TOSTR_BASE2_COUNT: u32 = 65; -pub const _MAX_U64TOSTR_BASE16_COUNT: u32 = 17; -pub const _MAX_U64TOSTR_BASE10_COUNT: u32 = 21; -pub const _MAX_U64TOSTR_BASE8_COUNT: u32 = 23; -pub const _MAX_U64TOSTR_BASE2_COUNT: u32 = 65; -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 EXIT_SUCCESS: u32 = 0; -pub const EXIT_FAILURE: u32 = 1; -pub const _WRITE_ABORT_MSG: u32 = 1; -pub const _CALL_REPORTFAULT: u32 = 2; -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 RAND_MAX: u32 = 32767; -pub const _CVTBUFSIZE: u32 = 349; -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 _MAX_ENV: u32 = 32767; -pub const EPERM: u32 = 1; -pub const ENOENT: u32 = 2; -pub const ESRCH: u32 = 3; -pub const EINTR: u32 = 4; -pub const EIO: u32 = 5; -pub const ENXIO: u32 = 6; -pub const E2BIG: u32 = 7; -pub const ENOEXEC: u32 = 8; -pub const EBADF: u32 = 9; -pub const ECHILD: u32 = 10; -pub const EAGAIN: u32 = 11; -pub const ENOMEM: u32 = 12; -pub const EACCES: u32 = 13; -pub const EFAULT: u32 = 14; -pub const EBUSY: u32 = 16; -pub const EEXIST: u32 = 17; -pub const EXDEV: u32 = 18; -pub const ENODEV: u32 = 19; -pub const ENOTDIR: u32 = 20; -pub const EISDIR: u32 = 21; -pub const ENFILE: u32 = 23; -pub const EMFILE: u32 = 24; -pub const ENOTTY: u32 = 25; -pub const EFBIG: u32 = 27; -pub const ENOSPC: u32 = 28; -pub const ESPIPE: u32 = 29; -pub const EROFS: u32 = 30; -pub const EMLINK: u32 = 31; -pub const EPIPE: u32 = 32; -pub const EDOM: u32 = 33; -pub const EDEADLK: u32 = 36; -pub const ENAMETOOLONG: u32 = 38; -pub const ENOLCK: u32 = 39; -pub const ENOSYS: u32 = 40; -pub const ENOTEMPTY: u32 = 41; -pub const EINVAL: u32 = 22; -pub const ERANGE: u32 = 34; -pub const EILSEQ: u32 = 42; -pub const STRUNCATE: u32 = 80; -pub const EDEADLOCK: u32 = 36; -pub const EADDRINUSE: u32 = 100; -pub const EADDRNOTAVAIL: u32 = 101; -pub const EAFNOSUPPORT: u32 = 102; -pub const EALREADY: u32 = 103; -pub const EBADMSG: u32 = 104; -pub const ECANCELED: u32 = 105; -pub const ECONNABORTED: u32 = 106; -pub const ECONNREFUSED: u32 = 107; -pub const ECONNRESET: u32 = 108; -pub const EDESTADDRREQ: u32 = 109; -pub const EHOSTUNREACH: u32 = 110; -pub const EIDRM: u32 = 111; -pub const EINPROGRESS: u32 = 112; -pub const EISCONN: u32 = 113; -pub const ELOOP: u32 = 114; -pub const EMSGSIZE: u32 = 115; -pub const ENETDOWN: u32 = 116; -pub const ENETRESET: u32 = 117; -pub const ENETUNREACH: u32 = 118; -pub const ENOBUFS: u32 = 119; -pub const ENODATA: u32 = 120; -pub const ENOLINK: u32 = 121; -pub const ENOMSG: u32 = 122; -pub const ENOPROTOOPT: u32 = 123; -pub const ENOSR: u32 = 124; -pub const ENOSTR: u32 = 125; -pub const ENOTCONN: u32 = 126; -pub const ENOTRECOVERABLE: u32 = 127; -pub const ENOTSOCK: u32 = 128; -pub const ENOTSUP: u32 = 129; -pub const EOPNOTSUPP: u32 = 130; -pub const EOTHER: u32 = 131; -pub const EOVERFLOW: u32 = 132; -pub const EOWNERDEAD: u32 = 133; -pub const EPROTO: u32 = 134; -pub const EPROTONOSUPPORT: u32 = 135; -pub const EPROTOTYPE: u32 = 136; -pub const ETIME: u32 = 137; -pub const ETIMEDOUT: u32 = 138; -pub const ETXTBSY: u32 = 139; -pub const EWOULDBLOCK: u32 = 140; -pub const _NLSCMPERROR: u32 = 2147483647; -pub const WIN32_LEAN_AND_MEAN: u32 = 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 PRId8: &'static [u8; 4usize] = b"hhd\0"; -pub const PRId16: &'static [u8; 3usize] = b"hd\0"; -pub const PRId32: &'static [u8; 2usize] = b"d\0"; -pub const PRId64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const PRIdLEAST16: &'static [u8; 3usize] = b"hd\0"; -pub const PRIdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const PRIdFAST16: &'static [u8; 2usize] = b"d\0"; -pub const PRIdFAST32: &'static [u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdMAX: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdPTR: &'static [u8; 4usize] = b"lld\0"; -pub const PRIi8: &'static [u8; 4usize] = b"hhi\0"; -pub const PRIi16: &'static [u8; 3usize] = b"hi\0"; -pub const PRIi32: &'static [u8; 2usize] = b"i\0"; -pub const PRIi64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const PRIiLEAST16: &'static [u8; 3usize] = b"hi\0"; -pub const PRIiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const PRIiFAST16: &'static [u8; 2usize] = b"i\0"; -pub const PRIiFAST32: &'static [u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiMAX: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiPTR: &'static [u8; 4usize] = b"lli\0"; -pub const PRIo8: &'static [u8; 4usize] = b"hho\0"; -pub const PRIo16: &'static [u8; 3usize] = b"ho\0"; -pub const PRIo32: &'static [u8; 2usize] = b"o\0"; -pub const PRIo64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &'static [u8; 4usize] = b"hho\0"; -pub const PRIoLEAST16: &'static [u8; 3usize] = b"ho\0"; -pub const PRIoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &'static [u8; 4usize] = b"hho\0"; -pub const PRIoFAST16: &'static [u8; 2usize] = b"o\0"; -pub const PRIoFAST32: &'static [u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoMAX: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoPTR: &'static [u8; 4usize] = b"llo\0"; -pub const PRIu8: &'static [u8; 4usize] = b"hhu\0"; -pub const PRIu16: &'static [u8; 3usize] = b"hu\0"; -pub const PRIu32: &'static [u8; 2usize] = b"u\0"; -pub const PRIu64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const PRIuLEAST16: &'static [u8; 3usize] = b"hu\0"; -pub const PRIuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const PRIuFAST16: &'static [u8; 2usize] = b"u\0"; -pub const PRIuFAST32: &'static [u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuMAX: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuPTR: &'static [u8; 4usize] = b"llu\0"; -pub const PRIx8: &'static [u8; 4usize] = b"hhx\0"; -pub const PRIx16: &'static [u8; 3usize] = b"hx\0"; -pub const PRIx32: &'static [u8; 2usize] = b"x\0"; -pub const PRIx64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const PRIxLEAST16: &'static [u8; 3usize] = b"hx\0"; -pub const PRIxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const PRIxFAST16: &'static [u8; 2usize] = b"x\0"; -pub const PRIxFAST32: &'static [u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxMAX: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxPTR: &'static [u8; 4usize] = b"llx\0"; -pub const PRIX8: &'static [u8; 4usize] = b"hhX\0"; -pub const PRIX16: &'static [u8; 3usize] = b"hX\0"; -pub const PRIX32: &'static [u8; 2usize] = b"X\0"; -pub const PRIX64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &'static [u8; 4usize] = b"hhX\0"; -pub const PRIXLEAST16: &'static [u8; 3usize] = b"hX\0"; -pub const PRIXLEAST32: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &'static [u8; 4usize] = b"hhX\0"; -pub const PRIXFAST16: &'static [u8; 2usize] = b"X\0"; -pub const PRIXFAST32: &'static [u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXMAX: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXPTR: &'static [u8; 4usize] = b"llX\0"; -pub const SCNd8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNd16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNd32: &'static [u8; 2usize] = b"d\0"; -pub const SCNd64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &'static [u8; 2usize] = b"d\0"; -pub const SCNdFAST32: &'static [u8; 2usize] = b"d\0"; -pub const SCNdFAST64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdMAX: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdPTR: &'static [u8; 4usize] = b"lld\0"; -pub const SCNi8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNi16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNi32: &'static [u8; 2usize] = b"i\0"; -pub const SCNi64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &'static [u8; 2usize] = b"i\0"; -pub const SCNiFAST32: &'static [u8; 2usize] = b"i\0"; -pub const SCNiFAST64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiMAX: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiPTR: &'static [u8; 4usize] = b"lli\0"; -pub const SCNo8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNo16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNo32: &'static [u8; 2usize] = b"o\0"; -pub const SCNo64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &'static [u8; 2usize] = b"o\0"; -pub const SCNoFAST32: &'static [u8; 2usize] = b"o\0"; -pub const SCNoFAST64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoMAX: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoPTR: &'static [u8; 4usize] = b"llo\0"; -pub const SCNu8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNu16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNu32: &'static [u8; 2usize] = b"u\0"; -pub const SCNu64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &'static [u8; 2usize] = b"u\0"; -pub const SCNuFAST32: &'static [u8; 2usize] = b"u\0"; -pub const SCNuFAST64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuMAX: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuPTR: &'static [u8; 4usize] = b"llu\0"; -pub const SCNx8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNx16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNx32: &'static [u8; 2usize] = b"x\0"; -pub const SCNx64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxFAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &'static [u8; 2usize] = b"x\0"; -pub const SCNxFAST32: &'static [u8; 2usize] = b"x\0"; -pub const SCNxFAST64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxMAX: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxPTR: &'static [u8; 4usize] = b"llx\0"; -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_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_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_NONE: u32 = 0; -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_FRONT: u32 = 1028; -pub const GL_BACK: u32 = 1029; -pub const GL_LEFT: u32 = 1030; -pub const GL_RIGHT: u32 = 1031; -pub const GL_FRONT_AND_BACK: u32 = 1032; -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_POINT_SIZE: u32 = 2833; -pub const GL_POINT_SIZE_RANGE: u32 = 2834; -pub const GL_POINT_SIZE_GRANULARITY: u32 = 2835; -pub const GL_LINE_SMOOTH: u32 = 2848; -pub const GL_LINE_WIDTH: u32 = 2849; -pub const GL_LINE_WIDTH_RANGE: u32 = 2850; -pub const GL_LINE_WIDTH_GRANULARITY: u32 = 2851; -pub const GL_POLYGON_MODE: u32 = 2880; -pub const GL_POLYGON_SMOOTH: u32 = 2881; -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_DEPTH_RANGE: u32 = 2928; -pub const GL_DEPTH_TEST: u32 = 2929; -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_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_VIEWPORT: u32 = 2978; -pub const GL_DITHER: u32 = 3024; -pub const GL_BLEND_DST: u32 = 3040; -pub const GL_BLEND_SRC: u32 = 3041; -pub const GL_BLEND: u32 = 3042; -pub const GL_LOGIC_OP_MODE: u32 = 3056; -pub const GL_COLOR_LOGIC_OP: u32 = 3058; -pub const GL_DRAW_BUFFER: u32 = 3073; -pub const GL_READ_BUFFER: u32 = 3074; -pub const GL_SCISSOR_BOX: u32 = 3088; -pub const GL_SCISSOR_TEST: u32 = 3089; -pub const GL_COLOR_CLEAR_VALUE: u32 = 3106; -pub const GL_COLOR_WRITEMASK: u32 = 3107; -pub const GL_DOUBLEBUFFER: u32 = 3122; -pub const GL_STEREO: u32 = 3123; -pub const GL_LINE_SMOOTH_HINT: u32 = 3154; -pub const GL_POLYGON_SMOOTH_HINT: u32 = 3155; -pub const GL_UNPACK_SWAP_BYTES: u32 = 3312; -pub const GL_UNPACK_LSB_FIRST: u32 = 3313; -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_UNPACK_ALIGNMENT: u32 = 3317; -pub const GL_PACK_SWAP_BYTES: u32 = 3328; -pub const GL_PACK_LSB_FIRST: u32 = 3329; -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_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_TEXTURE_1D: u32 = 3552; -pub const GL_TEXTURE_2D: u32 = 3553; -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_POLYGON_OFFSET_FACTOR: u32 = 32824; -pub const GL_TEXTURE_BINDING_1D: u32 = 32872; -pub const GL_TEXTURE_BINDING_2D: u32 = 32873; -pub const GL_TEXTURE_WIDTH: u32 = 4096; -pub const GL_TEXTURE_HEIGHT: u32 = 4097; -pub const GL_TEXTURE_INTERNAL_FORMAT: u32 = 4099; -pub const GL_TEXTURE_BORDER_COLOR: u32 = 4100; -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_DONT_CARE: u32 = 4352; -pub const GL_FASTEST: u32 = 4353; -pub const GL_NICEST: u32 = 4354; -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_DOUBLE: u32 = 5130; -pub const GL_CLEAR: u32 = 5376; -pub const GL_AND: u32 = 5377; -pub const GL_AND_REVERSE: u32 = 5378; -pub const GL_COPY: u32 = 5379; -pub const GL_AND_INVERTED: u32 = 5380; -pub const GL_NOOP: u32 = 5381; -pub const GL_XOR: u32 = 5382; -pub const GL_OR: u32 = 5383; -pub const GL_NOR: u32 = 5384; -pub const GL_EQUIV: u32 = 5385; -pub const GL_INVERT: u32 = 5386; -pub const GL_OR_REVERSE: u32 = 5387; -pub const GL_COPY_INVERTED: u32 = 5388; -pub const GL_OR_INVERTED: u32 = 5389; -pub const GL_NAND: u32 = 5390; -pub const GL_SET: u32 = 5391; -pub const GL_TEXTURE: u32 = 5890; -pub const GL_COLOR: u32 = 6144; -pub const GL_DEPTH: u32 = 6145; -pub const GL_STENCIL: u32 = 6146; -pub const GL_STENCIL_INDEX: u32 = 6401; -pub const GL_DEPTH_COMPONENT: u32 = 6402; -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_RGB: u32 = 6407; -pub const GL_RGBA: u32 = 6408; -pub const GL_POINT: u32 = 6912; -pub const GL_LINE: u32 = 6913; -pub const GL_FILL: u32 = 6914; -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_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_PROXY_TEXTURE_1D: u32 = 32867; -pub const GL_PROXY_TEXTURE_2D: u32 = 32868; -pub const GL_REPEAT: u32 = 10497; -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_UNSIGNED_BYTE_3_3_2: u32 = 32818; -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_INT_8_8_8_8: u32 = 32821; -pub const GL_UNSIGNED_INT_10_10_10_2: u32 = 32822; -pub const GL_TEXTURE_BINDING_3D: u32 = 32874; -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_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_REV: u32 = 33637; -pub const GL_UNSIGNED_SHORT_1_5_5_5_REV: u32 = 33638; -pub const GL_UNSIGNED_INT_8_8_8_8_REV: u32 = 33639; -pub const GL_UNSIGNED_INT_2_10_10_10_REV: u32 = 33640; -pub const GL_BGR: u32 = 32992; -pub const GL_BGRA: u32 = 32993; -pub const GL_MAX_ELEMENTS_VERTICES: u32 = 33000; -pub const GL_MAX_ELEMENTS_INDICES: u32 = 33001; -pub const GL_CLAMP_TO_EDGE: u32 = 33071; -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_LINE_WIDTH_RANGE: u32 = 33902; -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_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_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_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_CLAMP_TO_BORDER: u32 = 33069; -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_FUNC_ADD: u32 = 32774; -pub const GL_FUNC_SUBTRACT: u32 = 32778; -pub const GL_FUNC_REVERSE_SUBTRACT: u32 = 32779; -pub const GL_MIN: u32 = 32775; -pub const GL_MAX: u32 = 32776; -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_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_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_boolVEC2: u32 = 35671; -pub const GL_boolVEC3: u32 = 35672; -pub const GL_boolVEC4: 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_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_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_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_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_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_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_1_0: 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_VERSION_1_4: u32 = 1; -pub const GL_VERSION_1_5: u32 = 1; -pub const GL_VERSION_2_0: u32 = 1; -pub const GL_VERSION_2_1: u32 = 1; -pub const GL_VERSION_3_0: u32 = 1; -pub const GL_VERSION_3_1: u32 = 1; -pub const GL_VERSION_3_2: u32 = 1; -pub const GL_VERSION_3_3: 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_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_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_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_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_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_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_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_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_MAX_UNIFORM_LOCATIONS: u32 = 33390; -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_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_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_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_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_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_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_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_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_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_FLOAT_VEC2_ARB: u32 = 35664; -pub const GL_FLOAT_VEC3_ARB: u32 = 35665; -pub const GL_FLOAT_VEC4_ARB: u32 = 35666; -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_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_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_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_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_BLEND_EQUATION_RGB_EXT: u32 = 32777; -pub const GL_BLEND_EQUATION_ALPHA_EXT: u32 = 34877; -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_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_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_SCALED_RESOLVE_FASTEST_EXT: u32 = 37050; -pub const GL_SCALED_RESOLVE_NICEST_EXT: u32 = 37051; -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_FRAMEBUFFER_SRGB_EXT: u32 = 36281; -pub const GL_FRAMEBUFFER_SRGB_CAPABLE_EXT: u32 = 36282; -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_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_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_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_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_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_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_AMD_debug_output: u32 = 1; -pub const GL_AMD_query_buffer_object: u32 = 1; -pub const GL_ARB_ES2_compatibility: u32 = 1; -pub const GL_ARB_ES3_compatibility: u32 = 1; -pub const GL_ARB_buffer_storage: u32 = 1; -pub const GL_ARB_compatibility: u32 = 1; -pub const GL_ARB_compressed_texture_pixel_storage: u32 = 1; -pub const GL_ARB_debug_output: u32 = 1; -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_ARB_draw_buffers: u32 = 1; -pub const GL_ARB_draw_buffers_blend: 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_program: u32 = 1; -pub const GL_ARB_fragment_shader: u32 = 1; -pub const GL_ARB_framebuffer_object: u32 = 1; -pub const GL_ARB_framebuffer_sRGB: u32 = 1; -pub const GL_ARB_multisample: u32 = 1; -pub const GL_ARB_sample_locations: u32 = 1; -pub const GL_ARB_texture_compression: u32 = 1; -pub const GL_ARB_texture_float: u32 = 1; -pub const GL_ARB_texture_multisample: u32 = 1; -pub const GL_ARB_texture_non_power_of_two: u32 = 1; -pub const GL_ARB_texture_rg: u32 = 1; -pub const GL_ARB_texture_swizzle: u32 = 1; -pub const GL_ARB_uniform_buffer_object: u32 = 1; -pub const GL_ARB_vertex_array_object: u32 = 1; -pub const GL_ARB_vertex_attrib_binding: u32 = 1; -pub const GL_ARB_vertex_buffer_object: u32 = 1; -pub const GL_ARB_vertex_program: u32 = 1; -pub const GL_ARB_vertex_shader: u32 = 1; -pub const GL_ATI_element_array: u32 = 1; -pub const GL_ATI_fragment_shader: u32 = 1; -pub const GL_ATI_vertex_array_object: u32 = 1; -pub const GL_EXT_blend_color: u32 = 1; -pub const GL_EXT_blend_equation_separate: u32 = 1; -pub const GL_EXT_blend_func_separate: u32 = 1; -pub const GL_EXT_debug_marker: u32 = 1; -pub const GL_EXT_framebuffer_blit: u32 = 1; -pub const GL_EXT_framebuffer_multisample: u32 = 1; -pub const GL_EXT_framebuffer_multisample_blit_scaled: u32 = 1; -pub const GL_EXT_framebuffer_object: u32 = 1; -pub const GL_EXT_framebuffer_sRGB: u32 = 1; -pub const GL_EXT_index_array_formats: u32 = 1; -pub const GL_EXT_texture: u32 = 1; -pub const GL_EXT_texture_compression_s3tc: u32 = 1; -pub const GL_EXT_texture_sRGB: u32 = 1; -pub const GL_EXT_texture_swizzle: u32 = 1; -pub const GL_EXT_vertex_array: u32 = 1; -pub const GL_EXT_vertex_shader: u32 = 1; -pub const _CRT_INTERNAL_STDIO_SYMBOL_PREFIX: &'static [u8; 1usize] = b"\0"; -pub const _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION: u32 = 1; -pub const _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR: u32 = 2; -pub const _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS: u32 = 4; -pub const _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 8; -pub const _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS: u32 = 16; -pub const _CRT_INTERNAL_SCANF_SECURECRT: u32 = 1; -pub const _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS: u32 = 2; -pub const _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY: u32 = 4; -pub const BUFSIZ: u32 = 512; -pub const _NSTREAM_: u32 = 512; -pub const _IOB_ENTRIES: u32 = 3; -pub const EOF: i32 = -1; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 64; -pub const _IONBF: u32 = 4; -pub const L_tmpnam: u32 = 260; -pub const L_tmpnam_s: u32 = 260; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const SEEK_SET: u32 = 0; -pub const FILENAME_MAX: u32 = 260; -pub const FOPEN_MAX: u32 = 20; -pub const _SYS_OPEN: u32 = 20; -pub const TMP_MAX: u32 = 2147483647; -pub const TMP_MAX_S: u32 = 2147483647; -pub const _TMP_MAX_S: u32 = 2147483647; -pub const SYS_OPEN: u32 = 20; -pub const _GLAD_IS_SOME_NEW_VERSION: u32 = 1; -pub const GL_ETC1_RGB8_OES: u32 = 36196; -pub const GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: u32 = 35840; -pub const GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: u32 = 35842; -pub const GL_COMPRESSED_RGBA_ASTC_4x4_KHR: u32 = 37808; -pub const GL_COMPRESSED_RGBA_ASTC_8x8_KHR: u32 = 37815; -pub const GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34047; -pub const GL_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34046; -pub const DEFAULT_SHADER_ATTRIB_NAME_POSITION: &'static [u8; 15usize] = b"vertexPosition\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD: &'static [u8; 15usize] = b"vertexTexCoord\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_NORMAL: &'static [u8; 13usize] = b"vertexNormal\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_COLOR: &'static [u8; 12usize] = b"vertexColor\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TANGENT: &'static [u8; 14usize] = b"vertexTangent\0"; -pub const DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2: &'static [u8; 16usize] = b"vertexTexCoord2\0"; -pub const RAYGUI_VERSION: &'static [u8; 8usize] = b"2.6-dev\0"; -pub const NUM_CONTROLS: u32 = 16; -pub const NUM_PROPS_DEFAULT: u32 = 16; -pub const NUM_PROPS_EXTENDED: u32 = 8; -pub const TEXTEDIT_CURSOR_BLINK_FRAMES: u32 = 20; -pub const RICON_MAX_ICONS: u32 = 256; -pub const RICON_SIZE: u32 = 16; -pub const RICON_MAX_NAME_LENGTH: u32 = 32; -pub const RICON_DATA_ELEMENTS: u32 = 8; -pub const WINDOW_STATUSBAR_HEIGHT: u32 = 22; -pub const GROUPBOX_LINE_THICK: u32 = 1; -pub const GROUPBOX_TEXT_PADDING: u32 = 10; -pub const LINE_TEXT_PADDING: u32 = 10; -pub const PANEL_BORDER_WIDTH: u32 = 1; -pub const TOGGLEGROUP_MAX_ELEMENTS: u32 = 32; -pub const VALUEBOX_MAX_CHARS: u32 = 32; -pub const COLORBARALPHA_CHECKED_SIZE: u32 = 10; -pub const MESSAGEBOX_BUTTON_HEIGHT: u32 = 24; -pub const MESSAGEBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_BUTTON_HEIGHT: u32 = 24; -pub const TEXTINPUTBOX_BUTTON_PADDING: u32 = 10; -pub const TEXTINPUTBOX_HEIGHT: u32 = 30; -pub const TEXTINPUTBOX_MAX_TEXT_LENGTH: u32 = 256; -pub const GRID_COLOR_ALPHA: f64 = 0.15; -pub const ICON_TEXT_PADDING: u32 = 4; -pub const TEXTSPLIT_MAX_TEXT_LENGTH: u32 = 1024; -pub const TEXTSPLIT_MAX_TEXT_ELEMENTS: u32 = 128; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector2 { - pub x: f32, - pub y: f32, -} -#[test] -fn bindgen_test_layout_Vector2() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(Vector2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector2), - "::", - stringify!(y) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector3 { - pub x: f32, - pub y: f32, - pub z: f32, -} -#[test] -fn bindgen_test_layout_Vector3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(Vector3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector3), - "::", - stringify!(z) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Vector4 { - pub x: f32, - pub y: f32, - pub z: f32, - pub w: f32, -} -#[test] -fn bindgen_test_layout_Vector4() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Vector4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Vector4)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(z) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).w as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Vector4), - "::", - stringify!(w) - ) - ); -} -pub type Quaternion = Vector4; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Matrix { - pub m0: f32, - pub m4: f32, - pub m8: f32, - pub m12: f32, - pub m1: f32, - pub m5: f32, - pub m9: f32, - pub m13: f32, - pub m2: f32, - pub m6: f32, - pub m10: f32, - pub m14: f32, - pub m3: f32, - pub m7: f32, - pub m11: f32, - pub m15: f32, -} -#[test] -fn bindgen_test_layout_Matrix() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(Matrix)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Matrix)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m4 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m8 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m12 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m12) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m5 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m9 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m13 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m13) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m2 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m6 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m10 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m10) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m14 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m14) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m3 as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m7 as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m7) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m11 as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m11) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).m15 as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(Matrix), - "::", - stringify!(m15) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Color { - pub r: ::std::os::raw::c_uchar, - pub g: ::std::os::raw::c_uchar, - pub b: ::std::os::raw::c_uchar, - pub a: ::std::os::raw::c_uchar, -} -#[test] -fn bindgen_test_layout_Color() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(Color)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Color)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).r as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(r)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).g as *const _ as usize }, - 1usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(g)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 2usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).a as *const _ as usize }, - 3usize, - concat!("Offset of field: ", stringify!(Color), "::", stringify!(a)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rectangle { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, -} -#[test] -fn bindgen_test_layout_Rectangle() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Rectangle)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Rectangle)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Rectangle), - "::", - stringify!(height) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Image { - pub data: *mut ::std::os::raw::c_void, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Image() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Image)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Image)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Image), - "::", - stringify!(format) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Texture { - pub id: ::std::os::raw::c_uint, - pub width: ::std::os::raw::c_int, - pub height: ::std::os::raw::c_int, - pub mipmaps: ::std::os::raw::c_int, - pub format: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Texture() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(Texture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Texture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mipmaps as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(mipmaps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Texture), - "::", - stringify!(format) - ) - ); -} -pub type Texture2D = Texture; -pub type TextureCubemap = Texture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderTexture { - pub id: ::std::os::raw::c_uint, - pub texture: Texture, - pub depth: Texture, -} -#[test] -fn bindgen_test_layout_RenderTexture() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(RenderTexture)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RenderTexture)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).depth as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderTexture), - "::", - stringify!(depth) - ) - ); -} -pub type RenderTexture2D = RenderTexture; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NPatchInfo { - pub source: Rectangle, - pub left: ::std::os::raw::c_int, - pub top: ::std::os::raw::c_int, - pub right: ::std::os::raw::c_int, - pub bottom: ::std::os::raw::c_int, - pub layout: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_NPatchInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(NPatchInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(NPatchInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).left as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).top as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).right as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bottom as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(bottom) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).layout as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(NPatchInfo), - "::", - stringify!(layout) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CharInfo { - pub value: ::std::os::raw::c_int, - pub offsetX: ::std::os::raw::c_int, - pub offsetY: ::std::os::raw::c_int, - pub advanceX: ::std::os::raw::c_int, - pub image: Image, -} -#[test] -fn bindgen_test_layout_CharInfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CharInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CharInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetX as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offsetY as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(offsetY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).advanceX as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(advanceX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).image as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CharInfo), - "::", - stringify!(image) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Font { - pub baseSize: ::std::os::raw::c_int, - pub charsCount: ::std::os::raw::c_int, - pub charsPadding: ::std::os::raw::c_int, - pub texture: Texture2D, - pub recs: *mut Rectangle, - pub chars: *mut CharInfo, -} -#[test] -fn bindgen_test_layout_Font() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Font)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Font)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).baseSize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(baseSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).charsPadding as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(charsPadding) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).recs as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(recs) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chars as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Font), - "::", - stringify!(chars) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera3D { - pub position: Vector3, - pub target: Vector3, - pub up: Vector3, - pub fovy: f32, - pub projection: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Camera3D() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(Camera3D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera3D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).up as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(up) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fovy as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(fovy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Camera3D), - "::", - stringify!(projection) - ) - ); -} -pub type Camera = Camera3D; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera2D { - pub offset: Vector2, - pub target: Vector2, - pub rotation: f32, - pub zoom: f32, -} -#[test] -fn bindgen_test_layout_Camera2D() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Camera2D)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Camera2D)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).zoom as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(Camera2D), - "::", - stringify!(zoom) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Mesh { - pub vertexCount: ::std::os::raw::c_int, - pub triangleCount: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub texcoords2: *mut f32, - pub normals: *mut f32, - pub tangents: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_ushort, - pub animVertices: *mut f32, - pub animNormals: *mut f32, - pub boneIds: *mut ::std::os::raw::c_int, - pub boneWeights: *mut f32, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: *mut ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Mesh() { - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(Mesh)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Mesh)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).triangleCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(triangleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(texcoords2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normals as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(normals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tangents as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(tangents) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animVertices as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animVertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).animNormals as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(animNormals) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneIds as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneIds) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneWeights as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(boneWeights) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Mesh), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Shader { - pub id: ::std::os::raw::c_uint, - pub locs: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_Shader() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Shader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Shader)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).locs as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Shader), - "::", - stringify!(locs) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MaterialMap { - pub texture: Texture2D, - pub color: Color, - pub value: f32, -} -#[test] -fn bindgen_test_layout_MaterialMap() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(MaterialMap)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MaterialMap)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texture as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(texture) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(color) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(MaterialMap), - "::", - stringify!(value) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Material { - pub shader: Shader, - pub maps: *mut MaterialMap, - pub params: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_Material() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Material)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Material)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).shader as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(shader) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).maps as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(maps) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).params as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Material), - "::", - stringify!(params) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Transform { - pub translation: Vector3, - pub rotation: Quaternion, - pub scale: Vector3, -} -#[test] -fn bindgen_test_layout_Transform() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Transform)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Transform)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).translation as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(translation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rotation as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(rotation) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Transform), - "::", - stringify!(scale) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoneInfo { - pub name: [::std::os::raw::c_char; 32usize], - pub parent: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_BoneInfo() { - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(BoneInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoneInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).parent as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(BoneInfo), - "::", - stringify!(parent) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Model { - pub transform: Matrix, - pub meshCount: ::std::os::raw::c_int, - pub materialCount: ::std::os::raw::c_int, - pub meshes: *mut Mesh, - pub materials: *mut Material, - pub meshMaterial: *mut ::std::os::raw::c_int, - pub boneCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub bindPose: *mut Transform, -} -#[test] -fn bindgen_test_layout_Model() { - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(Model)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Model)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).transform as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshCount as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materialCount as *const _ as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materialCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshes as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshes) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).materials as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(materials) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).meshMaterial as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(meshMaterial) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bindPose as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(Model), - "::", - stringify!(bindPose) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ModelAnimation { - pub boneCount: ::std::os::raw::c_int, - pub frameCount: ::std::os::raw::c_int, - pub bones: *mut BoneInfo, - pub framePoses: *mut *mut Transform, -} -#[test] -fn bindgen_test_layout_ModelAnimation() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ModelAnimation)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ModelAnimation)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).boneCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(boneCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).frameCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(frameCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bones as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(bones) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).framePoses as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ModelAnimation), - "::", - stringify!(framePoses) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Ray { - pub position: Vector3, - pub direction: Vector3, -} -#[test] -fn bindgen_test_layout_Ray() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Ray)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Ray)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).direction as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Ray), - "::", - stringify!(direction) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RayHitInfo { - pub hit: bool, - pub distance: f32, - pub position: Vector3, - pub normal: Vector3, -} -#[test] -fn bindgen_test_layout_RayHitInfo() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RayHitInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(RayHitInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hit as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(hit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).distance as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(distance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).position as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(position) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).normal as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(RayHitInfo), - "::", - stringify!(normal) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BoundingBox { - pub min: Vector3, - pub max: Vector3, -} -#[test] -fn bindgen_test_layout_BoundingBox() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(BoundingBox)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(BoundingBox)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(min) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(BoundingBox), - "::", - stringify!(max) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Wave { - pub sampleCount: ::std::os::raw::c_uint, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, - pub data: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Wave() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Wave)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Wave)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(channels) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Wave), - "::", - stringify!(data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rAudioBuffer { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AudioStream { - pub buffer: *mut rAudioBuffer, - pub sampleRate: ::std::os::raw::c_uint, - pub sampleSize: ::std::os::raw::c_uint, - pub channels: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_AudioStream() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(AudioStream)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AudioStream)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleRate as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleRate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(sampleSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).channels as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AudioStream), - "::", - stringify!(channels) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Sound { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_Sound() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(Sound)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Sound)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Sound), - "::", - stringify!(sampleCount) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Music { - pub stream: AudioStream, - pub sampleCount: ::std::os::raw::c_uint, - pub looping: bool, - pub ctxType: ::std::os::raw::c_int, - pub ctxData: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_Music() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(Music)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Music)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sampleCount as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(sampleCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).looping as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(looping) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxType as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxType) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctxData as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Music), - "::", - stringify!(ctxData) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrDeviceInfo { - pub hResolution: ::std::os::raw::c_int, - pub vResolution: ::std::os::raw::c_int, - pub hScreenSize: f32, - pub vScreenSize: f32, - pub vScreenCenter: f32, - pub eyeToScreenDistance: f32, - pub lensSeparationDistance: f32, - pub interpupillaryDistance: f32, - pub lensDistortionValues: [f32; 4usize], - pub chromaAbCorrection: [f32; 4usize], -} -#[test] -fn bindgen_test_layout_VrDeviceInfo() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrDeviceInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hResolution as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vResolution as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vResolution) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hScreenSize as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(hScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenSize as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenSize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vScreenCenter as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(vScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).eyeToScreenDistance as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(eyeToScreenDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensSeparationDistance as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensSeparationDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).interpupillaryDistance as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(interpupillaryDistance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lensDistortionValues as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(lensDistortionValues) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).chromaAbCorrection as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VrDeviceInfo), - "::", - stringify!(chromaAbCorrection) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VrStereoConfig { - pub projection: [Matrix; 2usize], - pub viewOffset: [Matrix; 2usize], - pub leftLensCenter: [f32; 2usize], - pub rightLensCenter: [f32; 2usize], - pub leftScreenCenter: [f32; 2usize], - pub rightScreenCenter: [f32; 2usize], - pub scale: [f32; 2usize], - pub scaleIn: [f32; 2usize], -} -#[test] -fn bindgen_test_layout_VrStereoConfig() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!("Size of: ", stringify!(VrStereoConfig)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(VrStereoConfig)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).projection as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(projection) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).viewOffset as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(viewOffset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftLensCenter as *const _ as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rightLensCenter as *const _ as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightLensCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).leftScreenCenter as *const _ as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(leftScreenCenter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rightScreenCenter as *const _ as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(rightScreenCenter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scale) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).scaleIn as *const _ as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(VrStereoConfig), - "::", - stringify!(scaleIn) - ) - ); -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ConfigFlags { - FLAG_VSYNC_HINT = 64, - FLAG_FULLSCREEN_MODE = 2, - FLAG_WINDOW_RESIZABLE = 4, - FLAG_WINDOW_UNDECORATED = 8, - FLAG_WINDOW_HIDDEN = 128, - FLAG_WINDOW_MINIMIZED = 512, - FLAG_WINDOW_MAXIMIZED = 1024, - FLAG_WINDOW_UNFOCUSED = 2048, - FLAG_WINDOW_TOPMOST = 4096, - FLAG_WINDOW_ALWAYS_RUN = 256, - FLAG_WINDOW_TRANSPARENT = 16, - FLAG_WINDOW_HIGHDPI = 8192, - FLAG_MSAA_4X_HINT = 32, - FLAG_INTERLACED_HINT = 65536, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TraceLogLevel { - LOG_ALL = 0, - LOG_TRACE = 1, - LOG_DEBUG = 2, - LOG_INFO = 3, - LOG_WARNING = 4, - LOG_ERROR = 5, - LOG_FATAL = 6, - LOG_NONE = 7, -} -impl KeyboardKey { - pub const KEY_MENU: KeyboardKey = KeyboardKey::KEY_R; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum KeyboardKey { - KEY_NULL = 0, - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, - KEY_BACK = 4, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MouseButton { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MouseCursor { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, - MOUSE_CURSOR_RESIZE_NS = 6, - MOUSE_CURSOR_RESIZE_NWSE = 7, - MOUSE_CURSOR_RESIZE_NESW = 8, - MOUSE_CURSOR_RESIZE_ALL = 9, - MOUSE_CURSOR_NOT_ALLOWED = 10, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GamepadButton { - GAMEPAD_BUTTON_UNKNOWN = 0, - GAMEPAD_BUTTON_LEFT_FACE_UP = 1, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2, - GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3, - GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4, - GAMEPAD_BUTTON_RIGHT_FACE_UP = 5, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8, - GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9, - GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12, - GAMEPAD_BUTTON_MIDDLE_LEFT = 13, - GAMEPAD_BUTTON_MIDDLE = 14, - GAMEPAD_BUTTON_MIDDLE_RIGHT = 15, - GAMEPAD_BUTTON_LEFT_THUMB = 16, - GAMEPAD_BUTTON_RIGHT_THUMB = 17, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GamepadAxis { - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - GAMEPAD_AXIS_LEFT_TRIGGER = 4, - GAMEPAD_AXIS_RIGHT_TRIGGER = 5, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum MaterialMapIndex { - MATERIAL_MAP_ALBEDO = 0, - MATERIAL_MAP_METALNESS = 1, - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION = 4, - MATERIAL_MAP_EMISSION = 5, - MATERIAL_MAP_HEIGHT = 6, - MATERIAL_MAP_BRDG = 7, - MATERIAL_MAP_CUBEMAP = 8, - MATERIAL_MAP_IRRADIANCE = 9, - MATERIAL_MAP_PREFILTER = 10, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ShaderLocationIndex { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01 = 1, - SHADER_LOC_VERTEX_TEXCOORD02 = 2, - SHADER_LOC_VERTEX_NORMAL = 3, - SHADER_LOC_VERTEX_TANGENT = 4, - SHADER_LOC_VERTEX_COLOR = 5, - SHADER_LOC_MATRIX_MVP = 6, - SHADER_LOC_MATRIX_VIEW = 7, - SHADER_LOC_MATRIX_PROJECTION = 8, - SHADER_LOC_MATRIX_MODEL = 9, - SHADER_LOC_MATRIX_NORMAL = 10, - SHADER_LOC_VECTOR_VIEW = 11, - SHADER_LOC_COLOR_DIFFUSE = 12, - SHADER_LOC_COLOR_SPECULAR = 13, - SHADER_LOC_COLOR_AMBIENT = 14, - SHADER_LOC_MAP_ALBEDO = 15, - SHADER_LOC_MAP_METALNESS = 16, - SHADER_LOC_MAP_NORMAL = 17, - SHADER_LOC_MAP_ROUGHNESS = 18, - SHADER_LOC_MAP_OCCLUSION = 19, - SHADER_LOC_MAP_EMISSION = 20, - SHADER_LOC_MAP_HEIGHT = 21, - SHADER_LOC_MAP_CUBEMAP = 22, - SHADER_LOC_MAP_IRRADIANCE = 23, - SHADER_LOC_MAP_PREFILTER = 24, - SHADER_LOC_MAP_BRDF = 25, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ShaderUniformDataType { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2 = 1, - SHADER_UNIFORM_VEC3 = 2, - SHADER_UNIFORM_VEC4 = 3, - SHADER_UNIFORM_INT = 4, - SHADER_UNIFORM_IVEC2 = 5, - SHADER_UNIFORM_IVEC3 = 6, - SHADER_UNIFORM_IVEC4 = 7, - SHADER_UNIFORM_SAMPLER2D = 8, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum PixelFormat { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2, - PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3, - PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4, - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5, - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6, - PIXELFORMAT_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7, - PIXELFORMAT_UNCOMPRESSED_R32 = 8, - PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9, - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10, - PIXELFORMAT_COMPRESSED_DXT1_RGB = 11, - PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12, - PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13, - PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14, - PIXELFORMAT_COMPRESSED_ETC1_RGB = 15, - PIXELFORMAT_COMPRESSED_ETC2_RGB = 16, - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17, - PIXELFORMAT_COMPRESSED_PVRT_RGB = 18, - PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19, - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20, - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TextureFilter { - TEXTURE_FILTER_POINT = 0, - TEXTURE_FILTER_BILINEAR = 1, - TEXTURE_FILTER_TRILINEAR = 2, - TEXTURE_FILTER_ANISOTROPIC_4X = 3, - TEXTURE_FILTER_ANISOTROPIC_8X = 4, - TEXTURE_FILTER_ANISOTROPIC_16X = 5, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum TextureWrap { - TEXTURE_WRAP_REPEAT = 0, - TEXTURE_WRAP_CLAMP = 1, - TEXTURE_WRAP_MIRROR_REPEAT = 2, - TEXTURE_WRAP_MIRROR_CLAMP = 3, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CubemapLayout { - CUBEMAP_LAYOUT_AUTO_DETECT = 0, - CUBEMAP_LAYOUT_LINE_VERTICAL = 1, - CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2, - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3, - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4, - CUBEMAP_LAYOUT_PANORAMA = 5, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FontType { - FONT_DEFAULT = 0, - FONT_BITMAP = 1, - FONT_SDF = 2, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum BlendMode { - BLEND_ALPHA = 0, - BLEND_ADDITIVE = 1, - BLEND_MULTIPLIED = 2, - BLEND_ADD_COLORS = 3, - BLEND_SUBTRACT_COLORS = 4, - BLEND_CUSTOM = 5, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum Gestures { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CameraMode { - CAMERA_CUSTOM = 0, - CAMERA_FREE = 1, - CAMERA_ORBITAL = 2, - CAMERA_FIRST_PERSON = 3, - CAMERA_THIRD_PERSON = 4, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum CameraProjection { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC = 1, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum NPatchLayout { - NPATCH_NINE_PATCH = 0, - NPATCH_THREE_PATCH_VERTICAL = 1, - NPATCH_THREE_PATCH_HORIZONTAL = 2, -} -pub type TraceLogCallback = ::std::option::Option< - unsafe extern "C" fn( - logLevel: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - args: va_list, - ), ->; -pub type LoadFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar, ->; -pub type SaveFileDataCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool, ->; -pub type LoadFileTextCallback = ::std::option::Option< - unsafe extern "C" fn(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char, ->; -pub type SaveFileTextCallback = ::std::option::Option< - unsafe extern "C" fn( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool, ->; -extern "C" { - pub fn InitWindow( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - title: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn WindowShouldClose() -> bool; -} -extern "C" { - pub fn CloseWindow(); -} -extern "C" { - pub fn IsWindowReady() -> bool; -} -extern "C" { - pub fn IsWindowFullscreen() -> bool; -} -extern "C" { - pub fn IsWindowHidden() -> bool; -} -extern "C" { - pub fn IsWindowMinimized() -> bool; -} -extern "C" { - pub fn IsWindowMaximized() -> bool; -} -extern "C" { - pub fn IsWindowFocused() -> bool; -} -extern "C" { - pub fn IsWindowResized() -> bool; -} -extern "C" { - pub fn IsWindowState(flag: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn SetWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ClearWindowState(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn ToggleFullscreen(); -} -extern "C" { - pub fn MaximizeWindow(); -} -extern "C" { - pub fn MinimizeWindow(); -} -extern "C" { - pub fn RestoreWindow(); -} -extern "C" { - pub fn SetWindowIcon(image: Image); -} -extern "C" { - pub fn SetWindowTitle(title: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetWindowPosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMonitor(monitor: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowMinSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetWindowSize(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetWindowHandle() -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn GetScreenWidth() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetScreenHeight() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCurrentMonitor() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPosition(monitor: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GetMonitorWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalWidth(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorPhysicalHeight(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMonitorRefreshRate(monitor: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetWindowPosition() -> Vector2; -} -extern "C" { - pub fn GetWindowScaleDPI() -> Vector2; -} -extern "C" { - pub fn GetMonitorName(monitor: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn SetClipboardText(text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GetClipboardText() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ShowCursor(); -} -extern "C" { - pub fn HideCursor(); -} -extern "C" { - pub fn IsCursorHidden() -> bool; -} -extern "C" { - pub fn EnableCursor(); -} -extern "C" { - pub fn DisableCursor(); -} -extern "C" { - pub fn IsCursorOnScreen() -> bool; -} -extern "C" { - pub fn ClearBackground(color: Color); -} -extern "C" { - pub fn BeginDrawing(); -} -extern "C" { - pub fn EndDrawing(); -} -extern "C" { - pub fn BeginMode2D(camera: Camera2D); -} -extern "C" { - pub fn EndMode2D(); -} -extern "C" { - pub fn BeginMode3D(camera: Camera3D); -} -extern "C" { - pub fn EndMode3D(); -} -extern "C" { - pub fn BeginTextureMode(target: RenderTexture2D); -} -extern "C" { - pub fn EndTextureMode(); -} -extern "C" { - pub fn BeginShaderMode(shader: Shader); -} -extern "C" { - pub fn EndShaderMode(); -} -extern "C" { - pub fn BeginBlendMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn EndBlendMode(); -} -extern "C" { - pub fn BeginScissorMode( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn EndScissorMode(); -} -extern "C" { - pub fn BeginVrStereoMode(config: VrStereoConfig); -} -extern "C" { - pub fn EndVrStereoMode(); -} -extern "C" { - pub fn LoadVrStereoConfig(device: VrDeviceInfo) -> VrStereoConfig; -} -extern "C" { - pub fn UnloadVrStereoConfig(config: VrStereoConfig); -} -extern "C" { - pub fn LoadShader( - vsFileName: *const ::std::os::raw::c_char, - fsFileName: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn LoadShaderFromMemory( - vsCode: *const ::std::os::raw::c_char, - fsCode: *const ::std::os::raw::c_char, - ) -> Shader; -} -extern "C" { - pub fn GetShaderLocation( - shader: Shader, - uniformName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetShaderLocationAttrib( - shader: Shader, - attribName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn SetShaderValue( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueV( - shader: Shader, - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShaderValueMatrix(shader: Shader, locIndex: ::std::os::raw::c_int, mat: Matrix); -} -extern "C" { - pub fn SetShaderValueTexture( - shader: Shader, - locIndex: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn UnloadShader(shader: Shader); -} -extern "C" { - pub fn GetMouseRay(mousePosition: Vector2, camera: Camera) -> Ray; -} -extern "C" { - pub fn GetCameraMatrix(camera: Camera) -> Matrix; -} -extern "C" { - pub fn GetCameraMatrix2D(camera: Camera2D) -> Matrix; -} -extern "C" { - pub fn GetWorldToScreen(position: Vector3, camera: Camera) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreenEx( - position: Vector3, - camera: Camera, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> Vector2; -} -extern "C" { - pub fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) -> Vector2; -} -extern "C" { - pub fn SetTargetFPS(fps: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetFPS() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFrameTime() -> f32; -} -extern "C" { - pub fn GetTime() -> f64; -} -extern "C" { - pub fn GetRandomValue( - min: ::std::os::raw::c_int, - max: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TakeScreenshot(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn SetConfigFlags(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn TraceLog(logLevel: ::std::os::raw::c_int, text: *const ::std::os::raw::c_char, ...); -} -extern "C" { - pub fn SetTraceLogLevel(logLevel: ::std::os::raw::c_int); -} -extern "C" { - pub fn MemAlloc(size: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemRealloc( - ptr: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn MemFree(ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn SetTraceLogCallback(callback: TraceLogCallback); -} -extern "C" { - pub fn SetLoadFileDataCallback(callback: LoadFileDataCallback); -} -extern "C" { - pub fn SetSaveFileDataCallback(callback: SaveFileDataCallback); -} -extern "C" { - pub fn SetLoadFileTextCallback(callback: LoadFileTextCallback); -} -extern "C" { - pub fn SetSaveFileTextCallback(callback: SaveFileTextCallback); -} -extern "C" { - pub fn LoadFileData( - fileName: *const ::std::os::raw::c_char, - bytesRead: *mut ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn UnloadFileData(data: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileData( - fileName: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_void, - bytesToWrite: ::std::os::raw::c_uint, - ) -> bool; -} -extern "C" { - pub fn LoadFileText(fileName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn UnloadFileText(text: *mut ::std::os::raw::c_uchar); -} -extern "C" { - pub fn SaveFileText( - fileName: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn FileExists(fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn DirectoryExists(dirPath: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileExtension( - fileName: *const ::std::os::raw::c_char, - ext: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetFileExtension( - fileName: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileName(filePath: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetFileNameWithoutExt( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryPath( - filePath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetPrevDirectoryPath( - dirPath: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetWorkingDirectory() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GetDirectoryFiles( - dirPath: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDirectoryFiles(); -} -extern "C" { - pub fn ChangeDirectory(dir: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn IsFileDropped() -> bool; -} -extern "C" { - pub fn GetDroppedFiles(count: *mut ::std::os::raw::c_int) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ClearDroppedFiles(); -} -extern "C" { - pub fn GetFileModTime(fileName: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn CompressData( - data: *mut ::std::os::raw::c_uchar, - dataLength: ::std::os::raw::c_int, - compDataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn DecompressData( - compData: *mut ::std::os::raw::c_uchar, - compDataLength: ::std::os::raw::c_int, - dataLength: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn SaveStorageValue(position: ::std::os::raw::c_uint, value: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn LoadStorageValue(position: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn OpenURL(url: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn IsKeyPressed(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyDown(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyReleased(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsKeyUp(key: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn SetExitKey(key: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetKeyPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCharPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsGamepadAvailable(gamepad: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsGamepadName( - gamepad: ::std::os::raw::c_int, - name: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn GetGamepadName(gamepad: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn IsGamepadButtonPressed( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonDown( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonReleased( - gamepad: ::std::os::raw::c_int, - button: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn IsGamepadButtonUp(gamepad: ::std::os::raw::c_int, button: ::std::os::raw::c_int) - -> bool; -} -extern "C" { - pub fn GetGamepadButtonPressed() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisCount(gamepad: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGamepadAxisMovement( - gamepad: ::std::os::raw::c_int, - axis: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn SetGamepadMappings(mappings: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsMouseButtonPressed(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonDown(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonReleased(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn IsMouseButtonUp(button: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetMouseX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMouseY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetMousePosition() -> Vector2; -} -extern "C" { - pub fn SetMousePosition(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseOffset(offsetX: ::std::os::raw::c_int, offsetY: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetMouseScale(scaleX: f32, scaleY: f32); -} -extern "C" { - pub fn GetMouseWheelMove() -> f32; -} -extern "C" { - pub fn SetMouseCursor(cursor: ::std::os::raw::c_int); -} -extern "C" { - pub fn GetTouchX() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchY() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPosition(index: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn SetGesturesEnabled(flags: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsGestureDetected(gesture: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn GetGestureDetected() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetTouchPointsCount() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetGestureHoldDuration() -> f32; -} -extern "C" { - pub fn GetGestureDragVector() -> Vector2; -} -extern "C" { - pub fn GetGestureDragAngle() -> f32; -} -extern "C" { - pub fn GetGesturePinchVector() -> Vector2; -} -extern "C" { - pub fn GetGesturePinchAngle() -> f32; -} -extern "C" { - pub fn SetCameraMode(camera: Camera, mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn UpdateCamera(camera: *mut Camera); -} -extern "C" { - pub fn SetCameraPanControl(keyPan: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraAltControl(keyAlt: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraSmoothZoomControl(keySmoothZoom: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetCameraMoveControls( - keyFront: ::std::os::raw::c_int, - keyBack: ::std::os::raw::c_int, - keyRight: ::std::os::raw::c_int, - keyLeft: ::std::os::raw::c_int, - keyUp: ::std::os::raw::c_int, - keyDown: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn SetShapesTexture(texture: Texture2D, source: Rectangle); -} -extern "C" { - pub fn DrawPixel(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawPixelV(position: Vector2, color: Color); -} -extern "C" { - pub fn DrawLine( - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawLineV(startPos: Vector2, endPos: Vector2, color: Color); -} -extern "C" { - pub fn DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color); -} -extern "C" { - pub fn DrawLineBezierQuad( - startPos: Vector2, - endPos: Vector2, - controlPos: Vector2, - thick: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawLineStrip(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawCircle( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSector( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleSectorLines( - center: Vector2, - radius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCircleGradient( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawCircleV(center: Vector2, radius: f32, color: Color); -} -extern "C" { - pub fn DrawCircleLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipse( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawEllipseLines( - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radiusH: f32, - radiusV: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawRing( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRingLines( - center: Vector2, - innerRadius: f32, - outerRadius: f32, - startAngle: f32, - endAngle: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangle( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleV(position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRectangleRec(rec: Rectangle, color: Color); -} -extern "C" { - pub fn DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color); -} -extern "C" { - pub fn DrawRectangleGradientV( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientH( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color1: Color, - color2: Color, - ); -} -extern "C" { - pub fn DrawRectangleGradientEx( - rec: Rectangle, - col1: Color, - col2: Color, - col3: Color, - col4: Color, - ); -} -extern "C" { - pub fn DrawRectangleLines( - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleLinesEx(rec: Rectangle, lineThick: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawRectangleRounded( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawRectangleRoundedLines( - rec: Rectangle, - roundness: f32, - segments: ::std::os::raw::c_int, - lineThick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color); -} -extern "C" { - pub fn DrawTriangleFan(points: *mut Vector2, pointsCount: ::std::os::raw::c_int, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip( - points: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPoly( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawPolyLines( - center: Vector2, - sides: ::std::os::raw::c_int, - radius: f32, - rotation: f32, - color: Color, - ); -} -extern "C" { - pub fn CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionCircles( - center1: Vector2, - radius1: f32, - center2: Vector2, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointRec(point: Vector2, rec: Rectangle) -> bool; -} -extern "C" { - pub fn CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionPointTriangle( - point: Vector2, - p1: Vector2, - p2: Vector2, - p3: Vector2, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionLines( - startPos1: Vector2, - endPos1: Vector2, - startPos2: Vector2, - endPos2: Vector2, - collisionPoint: *mut Vector2, - ) -> bool; -} -extern "C" { - pub fn GetCollisionRec(rec1: Rectangle, rec2: Rectangle) -> Rectangle; -} -extern "C" { - pub fn LoadImage(fileName: *const ::std::os::raw::c_char) -> Image; -} -extern "C" { - pub fn LoadImageRaw( - fileName: *const ::std::os::raw::c_char, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - headerSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageAnim( - fileName: *const ::std::os::raw::c_char, - frames: *mut ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn LoadImageFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadImage(image: Image); -} -extern "C" { - pub fn ExportImage(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportImageAsCode(image: Image, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GenImageColor( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientV( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - top: Color, - bottom: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientH( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - left: Color, - right: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageGradientRadial( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - density: f32, - inner: Color, - outer: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageChecked( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - checksX: ::std::os::raw::c_int, - checksY: ::std::os::raw::c_int, - col1: Color, - col2: Color, - ) -> Image; -} -extern "C" { - pub fn GenImageWhiteNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - factor: f32, - ) -> Image; -} -extern "C" { - pub fn GenImagePerlinNoise( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - scale: f32, - ) -> Image; -} -extern "C" { - pub fn GenImageCellular( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - tileSize: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn ImageCopy(image: Image) -> Image; -} -extern "C" { - pub fn ImageFromImage(image: Image, rec: Rectangle) -> Image; -} -extern "C" { - pub fn ImageText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - color: Color, - ) -> Image; -} -extern "C" { - pub fn ImageTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - tint: Color, - ) -> Image; -} -extern "C" { - pub fn ImageFormat(image: *mut Image, newFormat: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageToPOT(image: *mut Image, fill: Color); -} -extern "C" { - pub fn ImageCrop(image: *mut Image, crop: Rectangle); -} -extern "C" { - pub fn ImageAlphaCrop(image: *mut Image, threshold: f32); -} -extern "C" { - pub fn ImageAlphaClear(image: *mut Image, color: Color, threshold: f32); -} -extern "C" { - pub fn ImageAlphaMask(image: *mut Image, alphaMask: Image); -} -extern "C" { - pub fn ImageAlphaPremultiply(image: *mut Image); -} -extern "C" { - pub fn ImageResize( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeNN( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageResizeCanvas( - image: *mut Image, - newWidth: ::std::os::raw::c_int, - newHeight: ::std::os::raw::c_int, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - fill: Color, - ); -} -extern "C" { - pub fn ImageMipmaps(image: *mut Image); -} -extern "C" { - pub fn ImageDither( - image: *mut Image, - rBpp: ::std::os::raw::c_int, - gBpp: ::std::os::raw::c_int, - bBpp: ::std::os::raw::c_int, - aBpp: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ImageFlipVertical(image: *mut Image); -} -extern "C" { - pub fn ImageFlipHorizontal(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCW(image: *mut Image); -} -extern "C" { - pub fn ImageRotateCCW(image: *mut Image); -} -extern "C" { - pub fn ImageColorTint(image: *mut Image, color: Color); -} -extern "C" { - pub fn ImageColorInvert(image: *mut Image); -} -extern "C" { - pub fn ImageColorGrayscale(image: *mut Image); -} -extern "C" { - pub fn ImageColorContrast(image: *mut Image, contrast: f32); -} -extern "C" { - pub fn ImageColorBrightness(image: *mut Image, brightness: ::std::os::raw::c_int); -} -extern "C" { - pub fn ImageColorReplace(image: *mut Image, color: Color, replace: Color); -} -extern "C" { - pub fn LoadImageColors(image: Image) -> *mut Color; -} -extern "C" { - pub fn LoadImagePalette( - image: Image, - maxPaletteSize: ::std::os::raw::c_int, - colorsCount: *mut ::std::os::raw::c_int, - ) -> *mut Color; -} -extern "C" { - pub fn UnloadImageColors(colors: *mut Color); -} -extern "C" { - pub fn UnloadImagePalette(colors: *mut Color); -} -extern "C" { - pub fn GetImageAlphaBorder(image: Image, threshold: f32) -> Rectangle; -} -extern "C" { - pub fn ImageClearBackground(dst: *mut Image, color: Color); -} -extern "C" { - pub fn ImageDrawPixel( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawPixelV(dst: *mut Image, position: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawLine( - dst: *mut Image, - startPosX: ::std::os::raw::c_int, - startPosY: ::std::os::raw::c_int, - endPosX: ::std::os::raw::c_int, - endPosY: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawLineV(dst: *mut Image, start: Vector2, end: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawCircle( - dst: *mut Image, - centerX: ::std::os::raw::c_int, - centerY: ::std::os::raw::c_int, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawCircleV( - dst: *mut Image, - center: Vector2, - radius: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangle( - dst: *mut Image, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawRectangleV(dst: *mut Image, position: Vector2, size: Vector2, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleRec(dst: *mut Image, rec: Rectangle, color: Color); -} -extern "C" { - pub fn ImageDrawRectangleLines( - dst: *mut Image, - rec: Rectangle, - thick: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDraw( - dst: *mut Image, - src: Image, - srcRec: Rectangle, - dstRec: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn ImageDrawText( - dst: *mut Image, - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn ImageDrawTextEx( - dst: *mut Image, - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn LoadTexture(fileName: *const ::std::os::raw::c_char) -> Texture2D; -} -extern "C" { - pub fn LoadTextureFromImage(image: Image) -> Texture2D; -} -extern "C" { - pub fn LoadTextureCubemap(image: Image, layout: ::std::os::raw::c_int) -> TextureCubemap; -} -extern "C" { - pub fn LoadRenderTexture( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> RenderTexture2D; -} -extern "C" { - pub fn UnloadTexture(texture: Texture2D); -} -extern "C" { - pub fn UnloadRenderTexture(target: RenderTexture2D); -} -extern "C" { - pub fn UpdateTexture(texture: Texture2D, pixels: *const ::std::os::raw::c_void); -} -extern "C" { - pub fn UpdateTextureRec( - texture: Texture2D, - rec: Rectangle, - pixels: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn GetTextureData(texture: Texture2D) -> Image; -} -extern "C" { - pub fn GetScreenData() -> Image; -} -extern "C" { - pub fn GenTextureMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn SetTextureFilter(texture: Texture2D, filter: ::std::os::raw::c_int); -} -extern "C" { - pub fn SetTextureWrap(texture: Texture2D, wrap: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawTexture( - texture: Texture2D, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureV(texture: Texture2D, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureEx( - texture: Texture2D, - position: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureRec(texture: Texture2D, source: Rectangle, position: Vector2, tint: Color); -} -extern "C" { - pub fn DrawTextureQuad( - texture: Texture2D, - tiling: Vector2, - offset: Vector2, - quad: Rectangle, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureTiled( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - scale: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePro( - texture: Texture2D, - source: Rectangle, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextureNPatch( - texture: Texture2D, - nPatchInfo: NPatchInfo, - dest: Rectangle, - origin: Vector2, - rotation: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTexturePoly( - texture: Texture2D, - center: Vector2, - points: *mut Vector2, - texcoords: *mut Vector2, - pointsCount: ::std::os::raw::c_int, - tint: Color, - ); -} -extern "C" { - pub fn Fade(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorToInt(color: Color) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ColorNormalize(color: Color) -> Vector4; -} -extern "C" { - pub fn ColorFromNormalized(normalized: Vector4) -> Color; -} -extern "C" { - pub fn ColorToHSV(color: Color) -> Vector3; -} -extern "C" { - pub fn ColorFromHSV(hue: f32, saturation: f32, value: f32) -> Color; -} -extern "C" { - pub fn ColorAlpha(color: Color, alpha: f32) -> Color; -} -extern "C" { - pub fn ColorAlphaBlend(dst: Color, src: Color, tint: Color) -> Color; -} -extern "C" { - pub fn GetColor(hexValue: ::std::os::raw::c_int) -> Color; -} -extern "C" { - pub fn GetPixelColor( - srcPtr: *mut ::std::os::raw::c_void, - format: ::std::os::raw::c_int, - ) -> Color; -} -extern "C" { - pub fn SetPixelColor( - dstPtr: *mut ::std::os::raw::c_void, - color: Color, - format: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GetPixelDataSize( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetFontDefault() -> Font; -} -extern "C" { - pub fn LoadFont(fileName: *const ::std::os::raw::c_char) -> Font; -} -extern "C" { - pub fn LoadFontEx( - fileName: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontFromImage(image: Image, key: Color, firstChar: ::std::os::raw::c_int) -> Font; -} -extern "C" { - pub fn LoadFontFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - ) -> Font; -} -extern "C" { - pub fn LoadFontData( - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - fontChars: *mut ::std::os::raw::c_int, - charsCount: ::std::os::raw::c_int, - type_: ::std::os::raw::c_int, - ) -> *mut CharInfo; -} -extern "C" { - pub fn GenImageFontAtlas( - chars: *const CharInfo, - recs: *mut *mut Rectangle, - charsCount: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - padding: ::std::os::raw::c_int, - packMethod: ::std::os::raw::c_int, - ) -> Image; -} -extern "C" { - pub fn UnloadFontData(chars: *mut CharInfo, charsCount: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadFont(font: Font); -} -extern "C" { - pub fn DrawFPS(posX: ::std::os::raw::c_int, posY: ::std::os::raw::c_int); -} -extern "C" { - pub fn DrawText( - text: *const ::std::os::raw::c_char, - posX: ::std::os::raw::c_int, - posY: ::std::os::raw::c_int, - fontSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - position: Vector2, - fontSize: f32, - spacing: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRec( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - ); -} -extern "C" { - pub fn DrawTextRecEx( - font: Font, - text: *const ::std::os::raw::c_char, - rec: Rectangle, - fontSize: f32, - spacing: f32, - wordWrap: bool, - tint: Color, - selectStart: ::std::os::raw::c_int, - selectLength: ::std::os::raw::c_int, - selectTint: Color, - selectBackTint: Color, - ); -} -extern "C" { - pub fn DrawTextCodepoint( - font: Font, - codepoint: ::std::os::raw::c_int, - position: Vector2, - fontSize: f32, - tint: Color, - ); -} -extern "C" { - pub fn MeasureText( - text: *const ::std::os::raw::c_char, - fontSize: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn MeasureTextEx( - font: Font, - text: *const ::std::os::raw::c_char, - fontSize: f32, - spacing: f32, - ) -> Vector2; -} -extern "C" { - pub fn GetGlyphIndex(font: Font, codepoint: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextCopy( - dst: *mut ::std::os::raw::c_char, - src: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextIsEqual( - text1: *const ::std::os::raw::c_char, - text2: *const ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn TextLength(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn TextFormat(text: *const ::std::os::raw::c_char, ...) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSubtext( - text: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextReplace( - text: *mut ::std::os::raw::c_char, - replace: *const ::std::os::raw::c_char, - by: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextInsert( - text: *const ::std::os::raw::c_char, - insert: *const ::std::os::raw::c_char, - position: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn TextJoin( - textList: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - delimiter: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextSplit( - text: *const ::std::os::raw::c_char, - delimiter: ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextAppend( - text: *mut ::std::os::raw::c_char, - append: *const ::std::os::raw::c_char, - position: *mut ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn TextFindIndex( - text: *const ::std::os::raw::c_char, - find: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUpper(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToLower(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToPascal(text: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn TextToInteger(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn TextToUtf8( - codepoints: *mut ::std::os::raw::c_int, - length: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn GetCodepoints( - text: *const ::std::os::raw::c_char, - count: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn GetCodepointsCount(text: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GetNextCodepoint( - text: *const ::std::os::raw::c_char, - bytesProcessed: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn CodepointToUtf8( - codepoint: ::std::os::raw::c_int, - byteLength: *mut ::std::os::raw::c_int, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color); -} -extern "C" { - pub fn DrawPoint3D(position: Vector3, color: Color); -} -extern "C" { - pub fn DrawCircle3D( - center: Vector3, - radius: f32, - rotationAxis: Vector3, - rotationAngle: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color); -} -extern "C" { - pub fn DrawTriangleStrip3D( - points: *mut Vector3, - pointsCount: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color); -} -extern "C" { - pub fn DrawCubeWiresV(position: Vector3, size: Vector3, color: Color); -} -extern "C" { - pub fn DrawCubeTexture( - texture: Texture2D, - position: Vector3, - width: f32, - height: f32, - length: f32, - color: Color, - ); -} -extern "C" { - pub fn DrawSphere(centerPos: Vector3, radius: f32, color: Color); -} -extern "C" { - pub fn DrawSphereEx( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawSphereWires( - centerPos: Vector3, - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinder( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawCylinderWires( - position: Vector3, - radiusTop: f32, - radiusBottom: f32, - height: f32, - slices: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn DrawPlane(centerPos: Vector3, size: Vector2, color: Color); -} -extern "C" { - pub fn DrawRay(ray: Ray, color: Color); -} -extern "C" { - pub fn DrawGrid(slices: ::std::os::raw::c_int, spacing: f32); -} -extern "C" { - pub fn LoadModel(fileName: *const ::std::os::raw::c_char) -> Model; -} -extern "C" { - pub fn LoadModelFromMesh(mesh: Mesh) -> Model; -} -extern "C" { - pub fn UnloadModel(model: Model); -} -extern "C" { - pub fn UnloadModelKeepMeshes(model: Model); -} -extern "C" { - pub fn UploadMesh(mesh: *mut Mesh, dynamic: bool); -} -extern "C" { - pub fn UpdateMeshBuffer( - mesh: Mesh, - index: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - dataSize: ::std::os::raw::c_int, - offset: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn DrawMesh(mesh: Mesh, material: Material, transform: Matrix); -} -extern "C" { - pub fn DrawMeshInstanced( - mesh: Mesh, - material: Material, - transforms: *mut Matrix, - instances: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadMesh(mesh: Mesh); -} -extern "C" { - pub fn ExportMesh(mesh: Mesh, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn LoadMaterials( - fileName: *const ::std::os::raw::c_char, - materialCount: *mut ::std::os::raw::c_int, - ) -> *mut Material; -} -extern "C" { - pub fn LoadMaterialDefault() -> Material; -} -extern "C" { - pub fn UnloadMaterial(material: Material); -} -extern "C" { - pub fn SetMaterialTexture( - material: *mut Material, - mapType: ::std::os::raw::c_int, - texture: Texture2D, - ); -} -extern "C" { - pub fn SetModelMeshMaterial( - model: *mut Model, - meshId: ::std::os::raw::c_int, - materialId: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadModelAnimations( - fileName: *const ::std::os::raw::c_char, - animsCount: *mut ::std::os::raw::c_int, - ) -> *mut ModelAnimation; -} -extern "C" { - pub fn UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: ::std::os::raw::c_int); -} -extern "C" { - pub fn UnloadModelAnimation(anim: ModelAnimation); -} -extern "C" { - pub fn UnloadModelAnimations(animations: *mut ModelAnimation, count: ::std::os::raw::c_uint); -} -extern "C" { - pub fn IsModelAnimationValid(model: Model, anim: ModelAnimation) -> bool; -} -extern "C" { - pub fn GenMeshPoly(sides: ::std::os::raw::c_int, radius: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshPlane( - width: f32, - length: f32, - resX: ::std::os::raw::c_int, - resZ: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCube(width: f32, height: f32, length: f32) -> Mesh; -} -extern "C" { - pub fn GenMeshSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHemiSphere( - radius: f32, - rings: ::std::os::raw::c_int, - slices: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshCylinder(radius: f32, height: f32, slices: ::std::os::raw::c_int) -> Mesh; -} -extern "C" { - pub fn GenMeshTorus( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshKnot( - radius: f32, - size: f32, - radSeg: ::std::os::raw::c_int, - sides: ::std::os::raw::c_int, - ) -> Mesh; -} -extern "C" { - pub fn GenMeshHeightmap(heightmap: Image, size: Vector3) -> Mesh; -} -extern "C" { - pub fn GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3) -> Mesh; -} -extern "C" { - pub fn MeshBoundingBox(mesh: Mesh) -> BoundingBox; -} -extern "C" { - pub fn MeshTangents(mesh: *mut Mesh); -} -extern "C" { - pub fn MeshBinormals(mesh: *mut Mesh); -} -extern "C" { - pub fn DrawModel(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color); -} -extern "C" { - pub fn DrawModelWiresEx( - model: Model, - position: Vector3, - rotationAxis: Vector3, - rotationAngle: f32, - scale: Vector3, - tint: Color, - ); -} -extern "C" { - pub fn DrawBoundingBox(box_: BoundingBox, color: Color); -} -extern "C" { - pub fn DrawBillboard( - camera: Camera, - texture: Texture2D, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn DrawBillboardRec( - camera: Camera, - texture: Texture2D, - source: Rectangle, - center: Vector3, - size: f32, - tint: Color, - ); -} -extern "C" { - pub fn CheckCollisionSpheres( - center1: Vector3, - radius1: f32, - center2: Vector3, - radius2: f32, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox) -> bool; -} -extern "C" { - pub fn CheckCollisionBoxSphere(box_: BoundingBox, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphere(ray: Ray, center: Vector3, radius: f32) -> bool; -} -extern "C" { - pub fn CheckCollisionRaySphereEx( - ray: Ray, - center: Vector3, - radius: f32, - collisionPoint: *mut Vector3, - ) -> bool; -} -extern "C" { - pub fn CheckCollisionRayBox(ray: Ray, box_: BoundingBox) -> bool; -} -extern "C" { - pub fn GetCollisionRayMesh(ray: Ray, mesh: Mesh, transform: Matrix) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayModel(ray: Ray, model: Model) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) -> RayHitInfo; -} -extern "C" { - pub fn GetCollisionRayGround(ray: Ray, groundHeight: f32) -> RayHitInfo; -} -extern "C" { - pub fn InitAudioDevice(); -} -extern "C" { - pub fn CloseAudioDevice(); -} -extern "C" { - pub fn IsAudioDeviceReady() -> bool; -} -extern "C" { - pub fn SetMasterVolume(volume: f32); -} -extern "C" { - pub fn LoadWave(fileName: *const ::std::os::raw::c_char) -> Wave; -} -extern "C" { - pub fn LoadWaveFromMemory( - fileType: *const ::std::os::raw::c_char, - fileData: *const ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Wave; -} -extern "C" { - pub fn LoadSound(fileName: *const ::std::os::raw::c_char) -> Sound; -} -extern "C" { - pub fn LoadSoundFromWave(wave: Wave) -> Sound; -} -extern "C" { - pub fn UpdateSound( - sound: Sound, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn UnloadWave(wave: Wave); -} -extern "C" { - pub fn UnloadSound(sound: Sound); -} -extern "C" { - pub fn ExportWave(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn ExportWaveAsCode(wave: Wave, fileName: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn PlaySound(sound: Sound); -} -extern "C" { - pub fn StopSound(sound: Sound); -} -extern "C" { - pub fn PauseSound(sound: Sound); -} -extern "C" { - pub fn ResumeSound(sound: Sound); -} -extern "C" { - pub fn PlaySoundMulti(sound: Sound); -} -extern "C" { - pub fn StopSoundMulti(); -} -extern "C" { - pub fn GetSoundsPlaying() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn IsSoundPlaying(sound: Sound) -> bool; -} -extern "C" { - pub fn SetSoundVolume(sound: Sound, volume: f32); -} -extern "C" { - pub fn SetSoundPitch(sound: Sound, pitch: f32); -} -extern "C" { - pub fn WaveFormat( - wave: *mut Wave, - sampleRate: ::std::os::raw::c_int, - sampleSize: ::std::os::raw::c_int, - channels: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn WaveCopy(wave: Wave) -> Wave; -} -extern "C" { - pub fn WaveCrop( - wave: *mut Wave, - initSample: ::std::os::raw::c_int, - finalSample: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn LoadWaveSamples(wave: Wave) -> *mut f32; -} -extern "C" { - pub fn UnloadWaveSamples(samples: *mut f32); -} -extern "C" { - pub fn LoadMusicStream(fileName: *const ::std::os::raw::c_char) -> Music; -} -extern "C" { - pub fn LoadMusicStreamFromMemory( - fileType: *const ::std::os::raw::c_char, - data: *mut ::std::os::raw::c_uchar, - dataSize: ::std::os::raw::c_int, - ) -> Music; -} -extern "C" { - pub fn UnloadMusicStream(music: Music); -} -extern "C" { - pub fn PlayMusicStream(music: Music); -} -extern "C" { - pub fn IsMusicPlaying(music: Music) -> bool; -} -extern "C" { - pub fn UpdateMusicStream(music: Music); -} -extern "C" { - pub fn StopMusicStream(music: Music); -} -extern "C" { - pub fn PauseMusicStream(music: Music); -} -extern "C" { - pub fn ResumeMusicStream(music: Music); -} -extern "C" { - pub fn SetMusicVolume(music: Music, volume: f32); -} -extern "C" { - pub fn SetMusicPitch(music: Music, pitch: f32); -} -extern "C" { - pub fn GetMusicTimeLength(music: Music) -> f32; -} -extern "C" { - pub fn GetMusicTimePlayed(music: Music) -> f32; -} -extern "C" { - pub fn InitAudioStream( - sampleRate: ::std::os::raw::c_uint, - sampleSize: ::std::os::raw::c_uint, - channels: ::std::os::raw::c_uint, - ) -> AudioStream; -} -extern "C" { - pub fn UpdateAudioStream( - stream: AudioStream, - data: *const ::std::os::raw::c_void, - samplesCount: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn CloseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamProcessed(stream: AudioStream) -> bool; -} -extern "C" { - pub fn PlayAudioStream(stream: AudioStream); -} -extern "C" { - pub fn PauseAudioStream(stream: AudioStream); -} -extern "C" { - pub fn ResumeAudioStream(stream: AudioStream); -} -extern "C" { - pub fn IsAudioStreamPlaying(stream: AudioStream) -> bool; -} -extern "C" { - pub fn StopAudioStream(stream: AudioStream); -} -extern "C" { - pub fn SetAudioStreamVolume(stream: AudioStream, volume: f32); -} -extern "C" { - pub fn SetAudioStreamPitch(stream: AudioStream, pitch: f32); -} -extern "C" { - pub fn SetAudioStreamBufferSizeDefault(size: ::std::os::raw::c_int); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct float3 { - pub v: [f32; 3usize], -} -#[test] -fn bindgen_test_layout_float3() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(float3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(float3)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).v as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(float3), "::", stringify!(v)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct float16 { - pub v: [f32; 16usize], -} -#[test] -fn bindgen_test_layout_float16() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(float16)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(float16)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).v as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(float16), - "::", - stringify!(v) - ) - ); -} -extern "C" { - pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); -} -pub type size_t = ::std::os::raw::c_ulonglong; -pub type __vcrt_bool = bool; -pub type wchar_t = ::std::os::raw::c_ushort; -extern "C" { - pub fn __security_init_cookie(); -} -extern "C" { - pub fn __security_check_cookie(_StackCookie: usize); -} -extern "C" { - pub fn __report_gsfailure(_StackCookie: usize); -} -extern "C" { - pub static mut __security_cookie: usize; -} -pub type __crt_bool = bool; -extern "C" { - pub fn _invalid_parameter_noinfo(); -} -extern "C" { - pub fn _invalid_parameter_noinfo_noreturn(); -} -extern "C" { - pub fn _invoke_watson( - _Expression: *const wchar_t, - _FunctionName: *const wchar_t, - _FileName: *const wchar_t, - _LineNo: ::std::os::raw::c_uint, - _Reserved: usize, - ); -} -pub type errno_t = ::std::os::raw::c_int; -pub type wint_t = ::std::os::raw::c_ushort; -pub type wctype_t = ::std::os::raw::c_ushort; -pub type __time32_t = ::std::os::raw::c_long; -pub type __time64_t = ::std::os::raw::c_longlong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_data_public { - pub _locale_pctype: *const ::std::os::raw::c_ushort, - pub _locale_mb_cur_max: ::std::os::raw::c_int, - pub _locale_lc_codepage: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___crt_locale_data_public() { - assert_eq!( - ::std::mem::size_of::<__crt_locale_data_public>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_data_public>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_pctype as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_pctype) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_mb_cur_max as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_mb_cur_max) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_lc_codepage as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_lc_codepage) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_pointers { - pub locinfo: *mut __crt_locale_data, - pub mbcinfo: *mut __crt_multibyte_data, -} -#[test] -fn bindgen_test_layout___crt_locale_pointers() { - assert_eq!( - ::std::mem::size_of::<__crt_locale_pointers>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_pointers>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).locinfo as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(locinfo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).mbcinfo as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(mbcinfo) - ) - ); -} -pub type _locale_t = *mut __crt_locale_pointers; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _Mbstatet { - pub _Wchar: ::std::os::raw::c_ulong, - pub _Byte: ::std::os::raw::c_ushort, - pub _State: ::std::os::raw::c_ushort, -} -#[test] -fn bindgen_test_layout__Mbstatet() { - assert_eq!( - ::std::mem::size_of::<_Mbstatet>(), - 8usize, - concat!("Size of: ", stringify!(_Mbstatet)) - ); - assert_eq!( - ::std::mem::align_of::<_Mbstatet>(), - 4usize, - concat!("Alignment of ", stringify!(_Mbstatet)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Wchar as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Wchar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Byte as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Byte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._State as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_State) - ) - ); -} -pub type mbstate_t = _Mbstatet; -pub type time_t = __time64_t; -pub type rsize_t = size_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _exception { - pub type_: ::std::os::raw::c_int, - pub name: *mut ::std::os::raw::c_char, - pub arg1: f64, - pub arg2: f64, - pub retval: f64, -} -#[test] -fn bindgen_test_layout__exception() { - assert_eq!( - ::std::mem::size_of::<_exception>(), - 40usize, - concat!("Size of: ", stringify!(_exception)) - ); - assert_eq!( - ::std::mem::align_of::<_exception>(), - 8usize, - concat!("Alignment of ", stringify!(_exception)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_exception>())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_exception), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_exception>())).name as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_exception), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_exception>())).arg1 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_exception), - "::", - stringify!(arg1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_exception>())).arg2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_exception), - "::", - stringify!(arg2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_exception>())).retval as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_exception), - "::", - stringify!(retval) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _complex { - pub x: f64, - pub y: f64, -} -#[test] -fn bindgen_test_layout__complex() { - assert_eq!( - ::std::mem::size_of::<_complex>(), - 16usize, - concat!("Size of: ", stringify!(_complex)) - ); - assert_eq!( - ::std::mem::align_of::<_complex>(), - 8usize, - concat!("Alignment of ", stringify!(_complex)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_complex>())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_complex), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_complex>())).y as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_complex), - "::", - stringify!(y) - ) - ); -} -pub type float_t = f32; -pub type double_t = f64; -extern "C" { - pub static _HUGE: f64; -} -extern "C" { - pub fn _fperrraise(_Except: ::std::os::raw::c_int); -} -extern "C" { - pub fn _dclass(_X: f64) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ldclass(_X: f64) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdclass(_X: f32) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dsign(_X: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _ldsign(_X: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fdsign(_X: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _dpcomp(_X: f64, _Y: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _ldpcomp(_X: f64, _Y: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fdpcomp(_X: f32, _Y: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _dtest(_Px: *mut f64) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ldtest(_Px: *mut f64) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdtest(_Px: *mut f32) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _d_int(_Px: *mut f64, _Xexp: ::std::os::raw::c_short) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ld_int(_Px: *mut f64, _Xexp: ::std::os::raw::c_short) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fd_int(_Px: *mut f32, _Xexp: ::std::os::raw::c_short) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dscale(_Px: *mut f64, _Lexp: ::std::os::raw::c_long) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ldscale(_Px: *mut f64, _Lexp: ::std::os::raw::c_long) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdscale(_Px: *mut f32, _Lexp: ::std::os::raw::c_long) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dunscale(_Pex: *mut ::std::os::raw::c_short, _Px: *mut f64) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ldunscale(_Pex: *mut ::std::os::raw::c_short, _Px: *mut f64) - -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdunscale(_Pex: *mut ::std::os::raw::c_short, _Px: *mut f32) - -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dexp(_Px: *mut f64, _Y: f64, _Eoff: ::std::os::raw::c_long) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _ldexp(_Px: *mut f64, _Y: f64, _Eoff: ::std::os::raw::c_long) - -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdexp(_Px: *mut f32, _Y: f32, _Eoff: ::std::os::raw::c_long) - -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dnorm(_Ps: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _fdnorm(_Ps: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_short; -} -extern "C" { - pub fn _dpoly(_X: f64, _Tab: *const f64, _N: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn _ldpoly(_X: f64, _Tab: *const f64, _N: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn _fdpoly(_X: f32, _Tab: *const f32, _N: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn _dlog(_X: f64, _Baseflag: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn _ldlog(_X: f64, _Baseflag: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn _fdlog(_X: f32, _Baseflag: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn _dsin(_X: f64, _Qoff: ::std::os::raw::c_uint) -> f64; -} -extern "C" { - pub fn _ldsin(_X: f64, _Qoff: ::std::os::raw::c_uint) -> f64; -} -extern "C" { - pub fn _fdsin(_X: f32, _Qoff: ::std::os::raw::c_uint) -> f32; -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _double_val { - pub _Sh: [::std::os::raw::c_ushort; 4usize], - pub _Val: f64, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout__double_val() { - assert_eq!( - ::std::mem::size_of::<_double_val>(), - 8usize, - concat!("Size of: ", stringify!(_double_val)) - ); - assert_eq!( - ::std::mem::align_of::<_double_val>(), - 8usize, - concat!("Alignment of ", stringify!(_double_val)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_double_val>()))._Sh as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_double_val), - "::", - stringify!(_Sh) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_double_val>()))._Val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_double_val), - "::", - stringify!(_Val) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _float_val { - pub _Sh: [::std::os::raw::c_ushort; 2usize], - pub _Val: f32, - _bindgen_union_align: u32, -} -#[test] -fn bindgen_test_layout__float_val() { - assert_eq!( - ::std::mem::size_of::<_float_val>(), - 4usize, - concat!("Size of: ", stringify!(_float_val)) - ); - assert_eq!( - ::std::mem::align_of::<_float_val>(), - 4usize, - concat!("Alignment of ", stringify!(_float_val)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_val>()))._Sh as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_val), - "::", - stringify!(_Sh) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_val>()))._Val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_val), - "::", - stringify!(_Val) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _ldouble_val { - pub _Sh: [::std::os::raw::c_ushort; 4usize], - pub _Val: f64, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout__ldouble_val() { - assert_eq!( - ::std::mem::size_of::<_ldouble_val>(), - 8usize, - concat!("Size of: ", stringify!(_ldouble_val)) - ); - assert_eq!( - ::std::mem::align_of::<_ldouble_val>(), - 8usize, - concat!("Alignment of ", stringify!(_ldouble_val)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ldouble_val>()))._Sh as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ldouble_val), - "::", - stringify!(_Sh) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ldouble_val>()))._Val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ldouble_val), - "::", - stringify!(_Val) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _float_const { - pub _Word: [::std::os::raw::c_ushort; 4usize], - pub _Float: f32, - pub _Double: f64, - pub _Long_double: f64, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout__float_const() { - assert_eq!( - ::std::mem::size_of::<_float_const>(), - 8usize, - concat!("Size of: ", stringify!(_float_const)) - ); - assert_eq!( - ::std::mem::align_of::<_float_const>(), - 8usize, - concat!("Alignment of ", stringify!(_float_const)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_const>()))._Word as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_const), - "::", - stringify!(_Word) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_const>()))._Float as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_const), - "::", - stringify!(_Float) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_const>()))._Double as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_const), - "::", - stringify!(_Double) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_float_const>()))._Long_double as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_float_const), - "::", - stringify!(_Long_double) - ) - ); -} -extern "C" { - pub static _Denorm_C: _float_const; -} -extern "C" { - pub static _Inf_C: _float_const; -} -extern "C" { - pub static _Nan_C: _float_const; -} -extern "C" { - pub static _Snan_C: _float_const; -} -extern "C" { - pub static _Hugeval_C: _float_const; -} -extern "C" { - pub static _FDenorm_C: _float_const; -} -extern "C" { - pub static _FInf_C: _float_const; -} -extern "C" { - pub static _FNan_C: _float_const; -} -extern "C" { - pub static _FSnan_C: _float_const; -} -extern "C" { - pub static _LDenorm_C: _float_const; -} -extern "C" { - pub static _LInf_C: _float_const; -} -extern "C" { - pub static _LNan_C: _float_const; -} -extern "C" { - pub static _LSnan_C: _float_const; -} -extern "C" { - pub static _Eps_C: _float_const; -} -extern "C" { - pub static _Rteps_C: _float_const; -} -extern "C" { - pub static _FEps_C: _float_const; -} -extern "C" { - pub static _FRteps_C: _float_const; -} -extern "C" { - pub static _LEps_C: _float_const; -} -extern "C" { - pub static _LRteps_C: _float_const; -} -extern "C" { - pub static _Zero_C: f64; -} -extern "C" { - pub static _Xbig_C: f64; -} -extern "C" { - pub static _FZero_C: f32; -} -extern "C" { - pub static _FXbig_C: f32; -} -extern "C" { - pub static _LZero_C: f64; -} -extern "C" { - pub static _LXbig_C: f64; -} -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 acos(_X: f64) -> f64; -} -extern "C" { - pub fn asin(_X: f64) -> f64; -} -extern "C" { - pub fn atan(_X: f64) -> f64; -} -extern "C" { - pub fn atan2(_Y: f64, _X: f64) -> f64; -} -extern "C" { - pub fn cos(_X: f64) -> f64; -} -extern "C" { - pub fn cosh(_X: f64) -> f64; -} -extern "C" { - pub fn exp(_X: f64) -> f64; -} -extern "C" { - pub fn fabs(_X: f64) -> f64; -} -extern "C" { - pub fn fmod(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn log(_X: f64) -> f64; -} -extern "C" { - pub fn log10(_X: f64) -> f64; -} -extern "C" { - pub fn pow(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn sin(_X: f64) -> f64; -} -extern "C" { - pub fn sinh(_X: f64) -> f64; -} -extern "C" { - pub fn sqrt(_X: f64) -> f64; -} -extern "C" { - pub fn tan(_X: f64) -> f64; -} -extern "C" { - pub fn tanh(_X: f64) -> f64; -} -extern "C" { - pub fn acosh(_X: f64) -> f64; -} -extern "C" { - pub fn asinh(_X: f64) -> f64; -} -extern "C" { - pub fn atanh(_X: f64) -> f64; -} -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 _cabs(_Complex_value: _complex) -> f64; -} -extern "C" { - pub fn cbrt(_X: f64) -> f64; -} -extern "C" { - pub fn ceil(_X: f64) -> f64; -} -extern "C" { - pub fn _chgsign(_X: f64) -> f64; -} -extern "C" { - pub fn copysign(_Number: f64, _Sign: f64) -> f64; -} -extern "C" { - pub fn _copysign(_Number: f64, _Sign: f64) -> f64; -} -extern "C" { - pub fn erf(_X: f64) -> f64; -} -extern "C" { - pub fn erfc(_X: f64) -> f64; -} -extern "C" { - pub fn exp2(_X: f64) -> f64; -} -extern "C" { - pub fn expm1(_X: f64) -> f64; -} -extern "C" { - pub fn fdim(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn floor(_X: f64) -> f64; -} -extern "C" { - pub fn fma(_X: f64, _Y: f64, _Z: f64) -> f64; -} -extern "C" { - pub fn fmax(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn fmin(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn frexp(_X: f64, _Y: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn hypot(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn _hypot(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn ilogb(_X: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ldexp(_X: f64, _Y: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn lgamma(_X: f64) -> f64; -} -extern "C" { - pub fn llrint(_X: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llround(_X: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn log1p(_X: f64) -> f64; -} -extern "C" { - pub fn log2(_X: f64) -> f64; -} -extern "C" { - pub fn logb(_X: f64) -> f64; -} -extern "C" { - pub fn lrint(_X: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lround(_X: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _matherr(_Except: *mut _exception) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn modf(_X: f64, _Y: *mut f64) -> f64; -} -extern "C" { - pub fn nan(_X: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn nearbyint(_X: f64) -> f64; -} -extern "C" { - pub fn nextafter(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn nexttoward(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn remainder(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn remquo(_X: f64, _Y: f64, _Z: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn rint(_X: f64) -> f64; -} -extern "C" { - pub fn round(_X: f64) -> f64; -} -extern "C" { - pub fn scalbln(_X: f64, _Y: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn scalbn(_X: f64, _Y: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn tgamma(_X: f64) -> f64; -} -extern "C" { - pub fn trunc(_X: f64) -> f64; -} -extern "C" { - pub fn _j0(_X: f64) -> f64; -} -extern "C" { - pub fn _j1(_X: f64) -> f64; -} -extern "C" { - pub fn _jn(_X: ::std::os::raw::c_int, _Y: f64) -> f64; -} -extern "C" { - pub fn _y0(_X: f64) -> f64; -} -extern "C" { - pub fn _y1(_X: f64) -> f64; -} -extern "C" { - pub fn _yn(_X: ::std::os::raw::c_int, _Y: f64) -> f64; -} -extern "C" { - pub fn acoshf(_X: f32) -> f32; -} -extern "C" { - pub fn asinhf(_X: f32) -> f32; -} -extern "C" { - pub fn atanhf(_X: f32) -> f32; -} -extern "C" { - pub fn cbrtf(_X: f32) -> f32; -} -extern "C" { - pub fn _chgsignf(_X: f32) -> f32; -} -extern "C" { - pub fn copysignf(_Number: f32, _Sign: f32) -> f32; -} -extern "C" { - pub fn _copysignf(_Number: f32, _Sign: f32) -> f32; -} -extern "C" { - pub fn erff(_X: f32) -> f32; -} -extern "C" { - pub fn erfcf(_X: f32) -> f32; -} -extern "C" { - pub fn expm1f(_X: f32) -> f32; -} -extern "C" { - pub fn exp2f(_X: f32) -> f32; -} -extern "C" { - pub fn fdimf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn fmaf(_X: f32, _Y: f32, _Z: f32) -> f32; -} -extern "C" { - pub fn fmaxf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn fminf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn _hypotf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn ilogbf(_X: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lgammaf(_X: f32) -> f32; -} -extern "C" { - pub fn llrintf(_X: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llroundf(_X: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn log1pf(_X: f32) -> f32; -} -extern "C" { - pub fn log2f(_X: f32) -> f32; -} -extern "C" { - pub fn logbf(_X: f32) -> f32; -} -extern "C" { - pub fn lrintf(_X: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lroundf(_X: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nanf(_X: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn nearbyintf(_X: f32) -> f32; -} -extern "C" { - pub fn nextafterf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn nexttowardf(_X: f32, _Y: f64) -> f32; -} -extern "C" { - pub fn remainderf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn remquof(_X: f32, _Y: f32, _Z: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn rintf(_X: f32) -> f32; -} -extern "C" { - pub fn roundf(_X: f32) -> f32; -} -extern "C" { - pub fn scalblnf(_X: f32, _Y: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn scalbnf(_X: f32, _Y: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn tgammaf(_X: f32) -> f32; -} -extern "C" { - pub fn truncf(_X: f32) -> f32; -} -extern "C" { - pub fn _logbf(_X: f32) -> f32; -} -extern "C" { - pub fn _nextafterf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn _finitef(_X: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _isnanf(_X: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fpclassf(_X: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _set_FMA3_enable(_Flag: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _get_FMA3_enable() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acosf(_X: f32) -> f32; -} -extern "C" { - pub fn asinf(_X: f32) -> f32; -} -extern "C" { - pub fn atan2f(_Y: f32, _X: f32) -> f32; -} -extern "C" { - pub fn atanf(_X: f32) -> f32; -} -extern "C" { - pub fn ceilf(_X: f32) -> f32; -} -extern "C" { - pub fn cosf(_X: f32) -> f32; -} -extern "C" { - pub fn coshf(_X: f32) -> f32; -} -extern "C" { - pub fn expf(_X: f32) -> f32; -} -extern "C" { - pub fn floorf(_X: f32) -> f32; -} -extern "C" { - pub fn fmodf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn log10f(_X: f32) -> f32; -} -extern "C" { - pub fn logf(_X: f32) -> f32; -} -extern "C" { - pub fn modff(_X: f32, _Y: *mut f32) -> f32; -} -extern "C" { - pub fn powf(_X: f32, _Y: f32) -> f32; -} -extern "C" { - pub fn sinf(_X: f32) -> f32; -} -extern "C" { - pub fn sinhf(_X: f32) -> f32; -} -extern "C" { - pub fn sqrtf(_X: f32) -> f32; -} -extern "C" { - pub fn tanf(_X: f32) -> f32; -} -extern "C" { - pub fn tanhf(_X: f32) -> f32; -} -extern "C" { - pub fn acoshl(_X: f64) -> f64; -} -extern "C" { - pub fn asinhl(_X: f64) -> f64; -} -extern "C" { - pub fn atanhl(_X: f64) -> f64; -} -extern "C" { - pub fn cbrtl(_X: f64) -> f64; -} -extern "C" { - pub fn copysignl(_Number: f64, _Sign: f64) -> f64; -} -extern "C" { - pub fn erfl(_X: f64) -> f64; -} -extern "C" { - pub fn erfcl(_X: f64) -> f64; -} -extern "C" { - pub fn exp2l(_X: f64) -> f64; -} -extern "C" { - pub fn expm1l(_X: f64) -> f64; -} -extern "C" { - pub fn fdiml(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn fmal(_X: f64, _Y: f64, _Z: f64) -> f64; -} -extern "C" { - pub fn fmaxl(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn fminl(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn ilogbl(_X: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lgammal(_X: f64) -> f64; -} -extern "C" { - pub fn llrintl(_X: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llroundl(_X: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn log1pl(_X: f64) -> f64; -} -extern "C" { - pub fn log2l(_X: f64) -> f64; -} -extern "C" { - pub fn logbl(_X: f64) -> f64; -} -extern "C" { - pub fn lrintl(_X: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lroundl(_X: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nanl(_X: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn nearbyintl(_X: f64) -> f64; -} -extern "C" { - pub fn nextafterl(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn nexttowardl(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn remainderl(_X: f64, _Y: f64) -> f64; -} -extern "C" { - pub fn remquol(_X: f64, _Y: f64, _Z: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn rintl(_X: f64) -> f64; -} -extern "C" { - pub fn roundl(_X: f64) -> f64; -} -extern "C" { - pub fn scalblnl(_X: f64, _Y: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn scalbnl(_X: f64, _Y: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn tgammal(_X: f64) -> f64; -} -extern "C" { - pub fn truncl(_X: f64) -> f64; -} -extern "C" { - pub static mut HUGE: f64; -} -extern "C" { - pub fn j0(_X: f64) -> f64; -} -extern "C" { - pub fn j1(_X: f64) -> f64; -} -extern "C" { - pub fn jn(_X: ::std::os::raw::c_int, _Y: f64) -> f64; -} -extern "C" { - pub fn y0(_X: f64) -> f64; -} -extern "C" { - pub fn y1(_X: f64) -> f64; -} -extern "C" { - pub fn yn(_X: ::std::os::raw::c_int, _Y: f64) -> f64; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GlVersion { - OPENGL_11 = 1, - OPENGL_21 = 2, - OPENGL_33 = 3, - OPENGL_ES_20 = 4, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FramebufferAttachType { - RL_ATTACHMENT_COLOR_CHANNEL0 = 0, - RL_ATTACHMENT_COLOR_CHANNEL1 = 1, - RL_ATTACHMENT_COLOR_CHANNEL2 = 2, - RL_ATTACHMENT_COLOR_CHANNEL3 = 3, - RL_ATTACHMENT_COLOR_CHANNEL4 = 4, - RL_ATTACHMENT_COLOR_CHANNEL5 = 5, - RL_ATTACHMENT_COLOR_CHANNEL6 = 6, - RL_ATTACHMENT_COLOR_CHANNEL7 = 7, - RL_ATTACHMENT_DEPTH = 100, - RL_ATTACHMENT_STENCIL = 200, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum FramebufferAttachTextureType { - RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5, - RL_ATTACHMENT_TEXTURE2D = 100, - RL_ATTACHMENT_RENDERBUFFER = 200, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VertexBuffer { - pub elementsCount: ::std::os::raw::c_int, - pub vCounter: ::std::os::raw::c_int, - pub tcCounter: ::std::os::raw::c_int, - pub cCounter: ::std::os::raw::c_int, - pub vertices: *mut f32, - pub texcoords: *mut f32, - pub colors: *mut ::std::os::raw::c_uchar, - pub indices: *mut ::std::os::raw::c_uint, - pub vaoId: ::std::os::raw::c_uint, - pub vboId: [::std::os::raw::c_uint; 4usize], -} -#[test] -fn bindgen_test_layout_VertexBuffer() { - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(VertexBuffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(VertexBuffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).elementsCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(elementsCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vCounter as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tcCounter as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(tcCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cCounter as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(cCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertices as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vertices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texcoords as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(texcoords) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).colors as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(colors) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).indices as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(indices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vaoId as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vaoId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vboId as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(VertexBuffer), - "::", - stringify!(vboId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DrawCall { - pub mode: ::std::os::raw::c_int, - pub vertexCount: ::std::os::raw::c_int, - pub vertexAlignment: ::std::os::raw::c_int, - pub textureId: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_DrawCall() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(DrawCall)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(DrawCall)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mode as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(mode) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexCount as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(vertexCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexAlignment as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(vertexAlignment) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).textureId as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(DrawCall), - "::", - stringify!(textureId) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RenderBatch { - pub buffersCount: ::std::os::raw::c_int, - pub currentBuffer: ::std::os::raw::c_int, - pub vertexBuffer: *mut VertexBuffer, - pub draws: *mut DrawCall, - pub drawsCounter: ::std::os::raw::c_int, - pub currentDepth: f32, -} -#[test] -fn bindgen_test_layout_RenderBatch() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(RenderBatch)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RenderBatch)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buffersCount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(buffersCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentBuffer as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(currentBuffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vertexBuffer as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(vertexBuffer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).draws as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(draws) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).drawsCounter as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(drawsCounter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentDepth as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(RenderBatch), - "::", - stringify!(currentDepth) - ) - ); -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ShaderAttributeDataType { - SHADER_ATTRIB_FLOAT = 0, - SHADER_ATTRIB_VEC2 = 1, - SHADER_ATTRIB_VEC3 = 2, - SHADER_ATTRIB_VEC4 = 3, -} -extern "C" { - pub fn rlMatrixMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlPushMatrix(); -} -extern "C" { - pub fn rlPopMatrix(); -} -extern "C" { - pub fn rlLoadIdentity(); -} -extern "C" { - pub fn rlTranslatef(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlRotatef(angleDeg: f32, x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlScalef(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlMultMatrixf(matf: *mut f32); -} -extern "C" { - pub fn rlFrustum(left: f64, right: f64, bottom: f64, top: f64, znear: f64, zfar: f64); -} -extern "C" { - pub fn rlOrtho(left: f64, right: f64, bottom: f64, top: f64, znear: f64, zfar: f64); -} -extern "C" { - pub fn rlViewport( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlBegin(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlEnd(); -} -extern "C" { - pub fn rlVertex2i(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlVertex2f(x: f32, y: f32); -} -extern "C" { - pub fn rlVertex3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlTexCoord2f(x: f32, y: f32); -} -extern "C" { - pub fn rlNormal3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlColor4ub( - r: ::std::os::raw::c_uchar, - g: ::std::os::raw::c_uchar, - b: ::std::os::raw::c_uchar, - a: ::std::os::raw::c_uchar, - ); -} -extern "C" { - pub fn rlColor3f(x: f32, y: f32, z: f32); -} -extern "C" { - pub fn rlColor4f(x: f32, y: f32, z: f32, w: f32); -} -extern "C" { - pub fn rlEnableVertexArray(vaoId: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn rlDisableVertexArray(); -} -extern "C" { - pub fn rlEnableVertexBuffer(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableVertexBuffer(); -} -extern "C" { - pub fn rlEnableVertexBufferElement(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableVertexBufferElement(); -} -extern "C" { - pub fn rlEnableVertexAttribute(index: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableVertexAttribute(index: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlActiveTextureSlot(slot: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlEnableTexture(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableTexture(); -} -extern "C" { - pub fn rlEnableTextureCubemap(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableTextureCubemap(); -} -extern "C" { - pub fn rlTextureParameters( - id: ::std::os::raw::c_uint, - param: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlEnableShader(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableShader(); -} -extern "C" { - pub fn rlEnableFramebuffer(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlDisableFramebuffer(); -} -extern "C" { - pub fn rlEnableDepthTest(); -} -extern "C" { - pub fn rlDisableDepthTest(); -} -extern "C" { - pub fn rlEnableDepthMask(); -} -extern "C" { - pub fn rlDisableDepthMask(); -} -extern "C" { - pub fn rlEnableBackfaceCulling(); -} -extern "C" { - pub fn rlDisableBackfaceCulling(); -} -extern "C" { - pub fn rlEnableScissorTest(); -} -extern "C" { - pub fn rlDisableScissorTest(); -} -extern "C" { - pub fn rlScissor( - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlEnableWireMode(); -} -extern "C" { - pub fn rlDisableWireMode(); -} -extern "C" { - pub fn rlSetLineWidth(width: f32); -} -extern "C" { - pub fn rlGetLineWidth() -> f32; -} -extern "C" { - pub fn rlEnableSmoothLines(); -} -extern "C" { - pub fn rlDisableSmoothLines(); -} -extern "C" { - pub fn rlEnableStereoRender(); -} -extern "C" { - pub fn rlDisableStereoRender(); -} -extern "C" { - pub fn rlIsStereoRenderEnabled() -> bool; -} -extern "C" { - pub fn rlClearColor( - r: ::std::os::raw::c_uchar, - g: ::std::os::raw::c_uchar, - b: ::std::os::raw::c_uchar, - a: ::std::os::raw::c_uchar, - ); -} -extern "C" { - pub fn rlClearScreenBuffers(); -} -extern "C" { - pub fn rlCheckErrors(); -} -extern "C" { - pub fn rlSetBlendMode(mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlSetBlendFactors( - glSrcFactor: ::std::os::raw::c_int, - glDstFactor: ::std::os::raw::c_int, - glEquation: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlglInit(width: ::std::os::raw::c_int, height: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlglClose(); -} -extern "C" { - pub fn rlLoadExtensions(loader: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn rlGetVersion() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlGetFramebufferWidth() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlGetFramebufferHeight() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlGetShaderDefault() -> Shader; -} -extern "C" { - pub fn rlGetTextureDefault() -> Texture2D; -} -extern "C" { - pub fn rlLoadRenderBatch( - numBuffers: ::std::os::raw::c_int, - bufferElements: ::std::os::raw::c_int, - ) -> RenderBatch; -} -extern "C" { - pub fn rlUnloadRenderBatch(batch: RenderBatch); -} -extern "C" { - pub fn rlDrawRenderBatch(batch: *mut RenderBatch); -} -extern "C" { - pub fn rlSetRenderBatchActive(batch: *mut RenderBatch); -} -extern "C" { - pub fn rlDrawRenderBatchActive(); -} -extern "C" { - pub fn rlCheckRenderBatchLimit(vCount: ::std::os::raw::c_int) -> bool; -} -extern "C" { - pub fn rlSetTexture(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlLoadVertexArray() -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadVertexBuffer( - buffer: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - dynamic: bool, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadVertexBufferElement( - buffer: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - dynamic: bool, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlUpdateVertexBuffer( - bufferId: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - dataSize: ::std::os::raw::c_int, - offset: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlUnloadVertexArray(vaoId: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlUnloadVertexBuffer(vboId: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlSetVertexAttribute( - index: ::std::os::raw::c_uint, - compSize: ::std::os::raw::c_int, - type_: ::std::os::raw::c_int, - normalized: bool, - stride: ::std::os::raw::c_int, - pointer: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn rlSetVertexAttributeDivisor( - index: ::std::os::raw::c_uint, - divisor: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlSetVertexAttributeDefault( - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - attribType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlDrawVertexArray(offset: ::std::os::raw::c_int, count: ::std::os::raw::c_int); -} -extern "C" { - pub fn rlDrawVertexArrayElements( - offset: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - buffer: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn rlDrawVertexArrayInstanced( - offset: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - instances: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlDrawVertexArrayElementsInstanced( - offset: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - buffer: *mut ::std::os::raw::c_void, - instances: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlLoadTexture( - data: *mut ::std::os::raw::c_void, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - mipmapCount: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadTextureDepth( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - useRenderBuffer: bool, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadTextureCubemap( - data: *mut ::std::os::raw::c_void, - size: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlUpdateTexture( - id: ::std::os::raw::c_uint, - offsetX: ::std::os::raw::c_int, - offsetY: ::std::os::raw::c_int, - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - format: ::std::os::raw::c_int, - data: *const ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn rlGetGlTextureFormats( - format: ::std::os::raw::c_int, - glInternalFormat: *mut ::std::os::raw::c_uint, - glFormat: *mut ::std::os::raw::c_uint, - glType: *mut ::std::os::raw::c_uint, - ); -} -extern "C" { - pub fn rlUnloadTexture(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlGenerateMipmaps(texture: *mut Texture2D); -} -extern "C" { - pub fn rlReadTexturePixels(texture: Texture2D) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn rlReadScreenPixels( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_uchar; -} -extern "C" { - pub fn rlLoadFramebuffer( - width: ::std::os::raw::c_int, - height: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlFramebufferAttach( - fboId: ::std::os::raw::c_uint, - texId: ::std::os::raw::c_uint, - attachType: ::std::os::raw::c_int, - texType: ::std::os::raw::c_int, - mipLevel: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlFramebufferComplete(id: ::std::os::raw::c_uint) -> bool; -} -extern "C" { - pub fn rlUnloadFramebuffer(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlLoadShaderCode( - vsCode: *const ::std::os::raw::c_char, - fsCode: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlCompileShader( - shaderCode: *const ::std::os::raw::c_char, - type_: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlLoadShaderProgram( - vShaderId: ::std::os::raw::c_uint, - fShaderId: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn rlUnloadShaderProgram(id: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlGetLocationUniform( - shaderId: ::std::os::raw::c_uint, - uniformName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlGetLocationAttrib( - shaderId: ::std::os::raw::c_uint, - attribName: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rlSetUniform( - locIndex: ::std::os::raw::c_int, - value: *const ::std::os::raw::c_void, - uniformType: ::std::os::raw::c_int, - count: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn rlSetUniformMatrix(locIndex: ::std::os::raw::c_int, mat: Matrix); -} -extern "C" { - pub fn rlSetUniformSampler(locIndex: ::std::os::raw::c_int, textureId: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rlSetShader(shader: Shader); -} -extern "C" { - pub fn rlGetMatrixModelview() -> Matrix; -} -extern "C" { - pub fn rlGetMatrixProjection() -> Matrix; -} -extern "C" { - pub fn rlGetMatrixTransform() -> Matrix; -} -extern "C" { - pub fn rlGetMatrixProjectionStereo(eye: ::std::os::raw::c_int) -> Matrix; -} -extern "C" { - pub fn rlGetMatrixViewOffsetStereo(eye: ::std::os::raw::c_int) -> Matrix; -} -extern "C" { - pub fn rlSetMatrixProjection(proj: Matrix); -} -extern "C" { - pub fn rlSetMatrixModelview(view: Matrix); -} -extern "C" { - pub fn rlSetMatrixProjectionStereo(right: Matrix, left: Matrix); -} -extern "C" { - pub fn rlSetMatrixViewOffsetStereo(right: Matrix, left: Matrix); -} -extern "C" { - pub fn rlLoadDrawCube(); -} -extern "C" { - pub fn rlLoadDrawQuad(); -} -extern "C" { - pub fn _calloc_base(_Count: size_t, _Size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn calloc( - _Count: ::std::os::raw::c_ulonglong, - _Size: ::std::os::raw::c_ulonglong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _callnewh(_Size: size_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _expand( - _Block: *mut ::std::os::raw::c_void, - _Size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _free_base(_Block: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn free(_Block: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn _malloc_base(_Size: size_t) -> *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 _msize_base(_Block: *mut ::std::os::raw::c_void) -> size_t; -} -extern "C" { - pub fn _msize(_Block: *mut ::std::os::raw::c_void) -> size_t; -} -extern "C" { - pub fn _realloc_base( - _Block: *mut ::std::os::raw::c_void, - _Size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn realloc( - _Block: *mut ::std::os::raw::c_void, - _Size: ::std::os::raw::c_ulonglong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _recalloc_base( - _Block: *mut ::std::os::raw::c_void, - _Count: size_t, - _Size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _recalloc( - _Block: *mut ::std::os::raw::c_void, - _Count: size_t, - _Size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_free(_Block: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn _aligned_malloc(_Size: size_t, _Alignment: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_offset_malloc( - _Size: size_t, - _Alignment: size_t, - _Offset: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_msize( - _Block: *mut ::std::os::raw::c_void, - _Alignment: size_t, - _Offset: size_t, - ) -> size_t; -} -extern "C" { - pub fn _aligned_offset_realloc( - _Block: *mut ::std::os::raw::c_void, - _Size: size_t, - _Alignment: size_t, - _Offset: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_offset_recalloc( - _Block: *mut ::std::os::raw::c_void, - _Count: size_t, - _Size: size_t, - _Alignment: size_t, - _Offset: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_realloc( - _Block: *mut ::std::os::raw::c_void, - _Size: size_t, - _Alignment: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _aligned_recalloc( - _Block: *mut ::std::os::raw::c_void, - _Count: size_t, - _Size: size_t, - _Alignment: size_t, - ) -> *mut ::std::os::raw::c_void; -} -pub type max_align_t = f64; -pub type _CoreCrtSecureSearchSortCompareFunction = ::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, ->; -pub type _CoreCrtNonSecureSearchSortCompareFunction = ::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_s( - _Key: *const ::std::os::raw::c_void, - _Base: *const ::std::os::raw::c_void, - _NumOfElements: rsize_t, - _SizeOfElements: rsize_t, - _CompareFunction: _CoreCrtSecureSearchSortCompareFunction, - _Context: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort_s( - _Base: *mut ::std::os::raw::c_void, - _NumOfElements: rsize_t, - _SizeOfElements: rsize_t, - _CompareFunction: _CoreCrtSecureSearchSortCompareFunction, - _Context: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn bsearch( - _Key: *const ::std::os::raw::c_void, - _Base: *const ::std::os::raw::c_void, - _NumOfElements: size_t, - _SizeOfElements: size_t, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - _Base: *mut ::std::os::raw::c_void, - _NumOfElements: size_t, - _SizeOfElements: size_t, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ); -} -extern "C" { - pub fn _lfind_s( - _Key: *const ::std::os::raw::c_void, - _Base: *const ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: size_t, - _CompareFunction: _CoreCrtSecureSearchSortCompareFunction, - _Context: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _lfind( - _Key: *const ::std::os::raw::c_void, - _Base: *const ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: ::std::os::raw::c_uint, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _lsearch_s( - _Key: *const ::std::os::raw::c_void, - _Base: *mut ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: size_t, - _CompareFunction: _CoreCrtSecureSearchSortCompareFunction, - _Context: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _lsearch( - _Key: *const ::std::os::raw::c_void, - _Base: *mut ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: ::std::os::raw::c_uint, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn lfind( - _Key: *const ::std::os::raw::c_void, - _Base: *const ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: ::std::os::raw::c_uint, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn lsearch( - _Key: *const ::std::os::raw::c_void, - _Base: *mut ::std::os::raw::c_void, - _NumOfElements: *mut ::std::os::raw::c_uint, - _SizeOfElements: ::std::os::raw::c_uint, - _CompareFunction: _CoreCrtNonSecureSearchSortCompareFunction, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn _itow_s( - _Value: ::std::os::raw::c_int, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _itow( - _Value: ::std::os::raw::c_int, - _Buffer: *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _ltow_s( - _Value: ::std::os::raw::c_long, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ltow( - _Value: ::std::os::raw::c_long, - _Buffer: *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _ultow_s( - _Value: ::std::os::raw::c_ulong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ultow( - _Value: ::std::os::raw::c_ulong, - _Buffer: *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> *mut wchar_t; -} -extern "C" { - pub fn wcstod(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; -} -extern "C" { - pub fn _wcstod_l( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Locale: _locale_t, - ) -> f64; -} -extern "C" { - pub fn wcstol( - _String: *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( - _String: *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 wcstoll( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _wcstoll_l( - _String: *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 wcstoul( - _String: *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( - _String: *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 wcstoull( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn _wcstoull_l( - _String: *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 wcstold(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; -} -extern "C" { - pub fn _wcstold_l( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Locale: _locale_t, - ) -> f64; -} -extern "C" { - pub fn wcstof(_String: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f32; -} -extern "C" { - pub fn _wcstof_l( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Locale: _locale_t, - ) -> f32; -} -extern "C" { - pub fn _wtof(_String: *const wchar_t) -> f64; -} -extern "C" { - pub fn _wtof_l(_String: *const wchar_t, _Locale: _locale_t) -> f64; -} -extern "C" { - pub fn _wtoi(_String: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wtoi_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wtol(_String: *const wchar_t) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _wtol_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _wtoll(_String: *const wchar_t) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _wtoll_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _i64tow_s( - _Value: ::std::os::raw::c_longlong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _i64tow( - _Value: ::std::os::raw::c_longlong, - _Buffer: *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _ui64tow_s( - _Value: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ui64tow( - _Value: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _wtoi64(_String: *const wchar_t) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _wtoi64_l(_String: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _wcstoi64( - _String: *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( - _String: *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( - _String: *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( - _String: *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 _wfullpath( - _Buffer: *mut wchar_t, - _Path: *const wchar_t, - _BufferCount: size_t, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _wmakepath_s( - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Drive: *const wchar_t, - _Dir: *const wchar_t, - _Filename: *const wchar_t, - _Ext: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wmakepath( - _Buffer: *mut wchar_t, - _Drive: *const wchar_t, - _Dir: *const wchar_t, - _Filename: *const wchar_t, - _Ext: *const wchar_t, - ); -} -extern "C" { - pub fn _wperror(_ErrorMessage: *const 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 _wsplitpath_s( - _FullPath: *const wchar_t, - _Drive: *mut wchar_t, - _DriveCount: size_t, - _Dir: *mut wchar_t, - _DirCount: size_t, - _Filename: *mut wchar_t, - _FilenameCount: size_t, - _Ext: *mut wchar_t, - _ExtCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn _wdupenv_s( - _Buffer: *mut *mut wchar_t, - _BufferCount: *mut size_t, - _VarName: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wgetenv(_VarName: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wgetenv_s( - _RequiredCount: *mut size_t, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _VarName: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wputenv(_EnvString: *const wchar_t) -> ::std::os::raw::c_int; -} -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, - _VarName: *const wchar_t, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn _wsearchenv( - _Filename: *const wchar_t, - _VarName: *const wchar_t, - _ResultPath: *mut wchar_t, - ); -} -extern "C" { - pub fn _wsystem(_Command: *const wchar_t) -> ::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 exit(_Code: ::std::os::raw::c_int); -} -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 quick_exit(_Code: ::std::os::raw::c_int); -} -extern "C" { - pub fn abort(); -} -extern "C" { - pub fn _set_abort_behavior( - _Flags: ::std::os::raw::c_uint, - _Mask: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_uint; -} -pub type _onexit_t = ::std::option::Option ::std::os::raw::c_int>; -extern "C" { - pub fn atexit(arg1: ::std::option::Option) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _onexit(_Func: _onexit_t) -> _onexit_t; -} -extern "C" { - pub fn at_quick_exit( - arg1: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -pub type _purecall_handler = ::std::option::Option; -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_purecall_handler(_Handler: _purecall_handler) -> _purecall_handler; -} -extern "C" { - pub fn _get_purecall_handler() -> _purecall_handler; -} -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 _set_thread_local_invalid_parameter_handler( - _Handler: _invalid_parameter_handler, - ) -> _invalid_parameter_handler; -} -extern "C" { - pub fn _get_thread_local_invalid_parameter_handler() -> _invalid_parameter_handler; -} -extern "C" { - pub fn _set_error_mode(_Mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -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 fn __sys_errlist() -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __sys_nerr() -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn perror(_ErrMsg: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn __p__pgmptr() -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __p__wpgmptr() -> *mut *mut wchar_t; -} -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; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _div_t { - pub quot: ::std::os::raw::c_int, - pub rem: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout__div_t() { - assert_eq!( - ::std::mem::size_of::<_div_t>(), - 8usize, - concat!("Size of: ", stringify!(_div_t)) - ); - assert_eq!( - ::std::mem::align_of::<_div_t>(), - 4usize, - concat!("Alignment of ", stringify!(_div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_div_t>())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_div_t>())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_div_t), - "::", - stringify!(rem) - ) - ); -} -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, -} -#[test] -fn bindgen_test_layout__ldiv_t() { - assert_eq!( - ::std::mem::size_of::<_ldiv_t>(), - 8usize, - concat!("Size of: ", stringify!(_ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ldiv_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ldiv_t>())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ldiv_t>())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ldiv_t), - "::", - stringify!(rem) - ) - ); -} -pub type ldiv_t = _ldiv_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, -} -#[test] -fn bindgen_test_layout__lldiv_t() { - assert_eq!( - ::std::mem::size_of::<_lldiv_t>(), - 16usize, - concat!("Size of: ", stringify!(_lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::<_lldiv_t>(), - 8usize, - concat!("Alignment of ", stringify!(_lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_lldiv_t>())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_lldiv_t>())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_lldiv_t), - "::", - stringify!(rem) - ) - ); -} -pub type lldiv_t = _lldiv_t; -extern "C" { - pub fn _abs64(_Number: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _byteswap_ushort(_Number: ::std::os::raw::c_ushort) -> ::std::os::raw::c_ushort; -} -extern "C" { - pub fn _byteswap_ulong(_Number: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn _byteswap_uint64(_Number: ::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 ldiv(_Numerator: ::std::os::raw::c_long, _Denominator: ::std::os::raw::c_long) - -> ldiv_t; -} -extern "C" { - pub fn lldiv( - _Numerator: ::std::os::raw::c_longlong, - _Denominator: ::std::os::raw::c_longlong, - ) -> lldiv_t; -} -extern "C" { - pub fn _rotl( - _Value: ::std::os::raw::c_uint, - _Shift: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn _lrotl( - _Value: ::std::os::raw::c_ulong, - _Shift: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn _rotl64( - _Value: ::std::os::raw::c_ulonglong, - _Shift: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn _rotr( - _Value: ::std::os::raw::c_uint, - _Shift: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn _lrotr( - _Value: ::std::os::raw::c_ulong, - _Shift: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; -} -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 srand(_Seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rand() -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _LDOUBLE { - pub ld: [::std::os::raw::c_uchar; 10usize], -} -#[test] -fn bindgen_test_layout__LDOUBLE() { - assert_eq!( - ::std::mem::size_of::<_LDOUBLE>(), - 10usize, - concat!("Size of: ", stringify!(_LDOUBLE)) - ); - assert_eq!( - ::std::mem::align_of::<_LDOUBLE>(), - 1usize, - concat!("Alignment of ", stringify!(_LDOUBLE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_LDOUBLE>())).ld as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_LDOUBLE), - "::", - stringify!(ld) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CRT_DOUBLE { - pub x: f64, -} -#[test] -fn bindgen_test_layout__CRT_DOUBLE() { - assert_eq!( - ::std::mem::size_of::<_CRT_DOUBLE>(), - 8usize, - concat!("Size of: ", stringify!(_CRT_DOUBLE)) - ); - assert_eq!( - ::std::mem::align_of::<_CRT_DOUBLE>(), - 8usize, - concat!("Alignment of ", stringify!(_CRT_DOUBLE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CRT_DOUBLE>())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CRT_DOUBLE), - "::", - stringify!(x) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CRT_FLOAT { - pub f: f32, -} -#[test] -fn bindgen_test_layout__CRT_FLOAT() { - assert_eq!( - ::std::mem::size_of::<_CRT_FLOAT>(), - 4usize, - concat!("Size of: ", stringify!(_CRT_FLOAT)) - ); - assert_eq!( - ::std::mem::align_of::<_CRT_FLOAT>(), - 4usize, - concat!("Alignment of ", stringify!(_CRT_FLOAT)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CRT_FLOAT>())).f as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CRT_FLOAT), - "::", - stringify!(f) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _LONGDOUBLE { - pub x: f64, -} -#[test] -fn bindgen_test_layout__LONGDOUBLE() { - assert_eq!( - ::std::mem::size_of::<_LONGDOUBLE>(), - 8usize, - concat!("Size of: ", stringify!(_LONGDOUBLE)) - ); - assert_eq!( - ::std::mem::align_of::<_LONGDOUBLE>(), - 8usize, - concat!("Alignment of ", stringify!(_LONGDOUBLE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_LONGDOUBLE>())).x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_LONGDOUBLE), - "::", - stringify!(x) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _LDBL12 { - pub ld12: [::std::os::raw::c_uchar; 12usize], -} -#[test] -fn bindgen_test_layout__LDBL12() { - assert_eq!( - ::std::mem::size_of::<_LDBL12>(), - 12usize, - concat!("Size of: ", stringify!(_LDBL12)) - ); - assert_eq!( - ::std::mem::align_of::<_LDBL12>(), - 1usize, - concat!("Alignment of ", stringify!(_LDBL12)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_LDBL12>())).ld12 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_LDBL12), - "::", - stringify!(ld12) - ) - ); -} -extern "C" { - pub fn atoi(_String: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atol(_String: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn atoll(_String: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _atoi64(_String: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _atoi_l( - _String: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atol_l( - _String: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _atoll_l( - _String: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::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 _atoflt( - _Result: *mut _CRT_FLOAT, - _String: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atodbl( - _Result: *mut _CRT_DOUBLE, - _String: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atoldbl( - _Result: *mut _LDOUBLE, - _String: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atoflt_l( - _Result: *mut _CRT_FLOAT, - _String: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atodbl_l( - _Result: *mut _CRT_DOUBLE, - _String: *mut ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _atoldbl_l( - _Result: *mut _LDOUBLE, - _String: *mut ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strtof( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn _strtof_l( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> f32; -} -extern "C" { - pub fn strtod( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - ) -> f64; -} -extern "C" { - pub fn _strtod_l( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> f64; -} -extern "C" { - pub fn strtold( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - ) -> f64; -} -extern "C" { - pub fn _strtold_l( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> f64; -} -extern "C" { - pub fn strtol( - _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_long; -} -extern "C" { - pub fn _strtol_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_long; -} -extern "C" { - pub fn strtoll( - _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 _strtoll_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 strtoul( - _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_ulong; -} -extern "C" { - pub fn _strtoul_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_ulong; -} -extern "C" { - pub fn strtoull( - _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 _strtoull_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 _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 _itoa_s( - _Value: ::std::os::raw::c_int, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _itoa( - _Value: ::std::os::raw::c_int, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _ltoa_s( - _Value: ::std::os::raw::c_long, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ltoa( - _Value: ::std::os::raw::c_long, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _ultoa_s( - _Value: ::std::os::raw::c_ulong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ultoa( - _Value: ::std::os::raw::c_ulong, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _i64toa_s( - _Value: ::std::os::raw::c_longlong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _i64toa( - _Value: ::std::os::raw::c_longlong, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _ui64toa_s( - _Value: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Radix: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _ui64toa( - _Value: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _ecvt_s( - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Value: f64, - _DigitCount: ::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 _ecvt( - _Value: f64, - _DigitCount: ::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_s( - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Value: f64, - _FractionalDigitCount: ::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( - _Value: f64, - _FractionalDigitCount: ::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_s( - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Value: f64, - _DigitCount: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _gcvt( - _Value: f64, - _DigitCount: ::std::os::raw::c_int, - _Buffer: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ___mb_cur_max_func() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ___mb_cur_max_l_func(_Locale: _locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mblen(_Ch: *const ::std::os::raw::c_char, _MaxCount: size_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _mblen_l( - _Ch: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _mbstrlen(_String: *const ::std::os::raw::c_char) -> size_t; -} -extern "C" { - pub fn _mbstrlen_l(_String: *const ::std::os::raw::c_char, _Locale: _locale_t) -> size_t; -} -extern "C" { - pub fn _mbstrnlen(_String: *const ::std::os::raw::c_char, _MaxCount: size_t) -> size_t; -} -extern "C" { - pub fn _mbstrnlen_l( - _String: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> size_t; -} -extern "C" { - pub fn mbtowc( - _DstCh: *mut wchar_t, - _SrcCh: *const ::std::os::raw::c_char, - _SrcSizeInBytes: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _mbtowc_l( - _DstCh: *mut wchar_t, - _SrcCh: *const ::std::os::raw::c_char, - _SrcSizeInBytes: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbstowcs_s( - _PtNumOfCharConverted: *mut size_t, - _DstBuf: *mut wchar_t, - _SizeInWords: size_t, - _SrcBuf: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn mbstowcs( - _Dest: *mut wchar_t, - _Source: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> size_t; -} -extern "C" { - pub fn _mbstowcs_s_l( - _PtNumOfCharConverted: *mut size_t, - _DstBuf: *mut wchar_t, - _SizeInWords: size_t, - _SrcBuf: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> errno_t; -} -extern "C" { - pub fn _mbstowcs_l( - _Dest: *mut wchar_t, - _Source: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> size_t; -} -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 wctomb_s( - _SizeConverted: *mut ::std::os::raw::c_int, - _MbCh: *mut ::std::os::raw::c_char, - _SizeInBytes: rsize_t, - _WCh: wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wctomb_s_l( - _SizeConverted: *mut ::std::os::raw::c_int, - _MbCh: *mut ::std::os::raw::c_char, - _SizeInBytes: size_t, - _WCh: wchar_t, - _Locale: _locale_t, - ) -> errno_t; -} -extern "C" { - pub fn wcstombs_s( - _PtNumOfCharConverted: *mut size_t, - _Dst: *mut ::std::os::raw::c_char, - _DstSizeInBytes: size_t, - _Src: *const wchar_t, - _MaxCountInBytes: size_t, - ) -> errno_t; -} -extern "C" { - pub fn wcstombs( - _Dest: *mut ::std::os::raw::c_char, - _Source: *const wchar_t, - _MaxCount: size_t, - ) -> size_t; -} -extern "C" { - pub fn _wcstombs_s_l( - _PtNumOfCharConverted: *mut size_t, - _Dst: *mut ::std::os::raw::c_char, - _DstSizeInBytes: size_t, - _Src: *const wchar_t, - _MaxCountInBytes: size_t, - _Locale: _locale_t, - ) -> errno_t; -} -extern "C" { - pub fn _wcstombs_l( - _Dest: *mut ::std::os::raw::c_char, - _Source: *const wchar_t, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> size_t; -} -extern "C" { - pub fn _fullpath( - _Buffer: *mut ::std::os::raw::c_char, - _Path: *const ::std::os::raw::c_char, - _BufferCount: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _makepath_s( - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _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 _makepath( - _Buffer: *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 _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 _splitpath_s( - _FullPath: *const ::std::os::raw::c_char, - _Drive: *mut ::std::os::raw::c_char, - _DriveCount: size_t, - _Dir: *mut ::std::os::raw::c_char, - _DirCount: size_t, - _Filename: *mut ::std::os::raw::c_char, - _FilenameCount: size_t, - _Ext: *mut ::std::os::raw::c_char, - _ExtCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn getenv_s( - _RequiredCount: *mut size_t, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: rsize_t, - _VarName: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn __p___argc() -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn __p___argv() -> *mut *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __p___wargv() -> *mut *mut *mut wchar_t; -} -extern "C" { - pub fn __p__environ() -> *mut *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __p__wenviron() -> *mut *mut *mut wchar_t; -} -extern "C" { - pub fn getenv(_VarName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _dupenv_s( - _Buffer: *mut *mut ::std::os::raw::c_char, - _BufferCount: *mut size_t, - _VarName: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn system(_Command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _putenv(_EnvString: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -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, - _VarName: *const ::std::os::raw::c_char, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn _searchenv( - _Filename: *const ::std::os::raw::c_char, - _VarName: *const ::std::os::raw::c_char, - _Buffer: *mut ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn _seterrormode(_Mode: ::std::os::raw::c_int); -} -extern "C" { - pub fn _beep(_Frequency: ::std::os::raw::c_uint, _Duration: ::std::os::raw::c_uint); -} -extern "C" { - pub fn _sleep(_Duration: ::std::os::raw::c_ulong); -} -extern "C" { - pub fn ecvt( - _Value: f64, - _DigitCount: ::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( - _Value: f64, - _FractionalDigitCount: ::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( - _Value: f64, - _DigitCount: ::std::os::raw::c_int, - _DstBuf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn itoa( - _Value: ::std::os::raw::c_int, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ltoa( - _Value: ::std::os::raw::c_long, - _Buffer: *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> *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 ultoa( - _Value: ::std::os::raw::c_ulong, - _Buffer: *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 onexit(_Func: _onexit_t) -> _onexit_t; -} -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 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 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 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 strchr( - _Str: *const ::std::os::raw::c_char, - _Val: ::std::os::raw::c_int, - ) -> *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 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 wcschr( - _Str: *const ::std::os::raw::c_ushort, - _Ch: ::std::os::raw::c_ushort, - ) -> *mut ::std::os::raw::c_ushort; -} -extern "C" { - pub fn wcsrchr(_Str: *const wchar_t, _Ch: wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsstr(_Str: *const wchar_t, _SubStr: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _memicmp( - _Buf1: *const ::std::os::raw::c_void, - _Buf2: *const ::std::os::raw::c_void, - _Size: size_t, - ) -> ::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: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -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: size_t, - ) -> *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: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcscat_s( - _Destination: *mut wchar_t, - _SizeInWords: rsize_t, - _Source: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn wcscpy_s( - _Destination: *mut wchar_t, - _SizeInWords: rsize_t, - _Source: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn wcsncat_s( - _Destination: *mut wchar_t, - _SizeInWords: rsize_t, - _Source: *const wchar_t, - _MaxCount: rsize_t, - ) -> errno_t; -} -extern "C" { - pub fn wcsncpy_s( - _Destination: *mut wchar_t, - _SizeInWords: rsize_t, - _Source: *const wchar_t, - _MaxCount: rsize_t, - ) -> errno_t; -} -extern "C" { - pub fn wcstok_s( - _String: *mut wchar_t, - _Delimiter: *const wchar_t, - _Context: *mut *mut wchar_t, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _wcsdup(_String: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscat(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscmp( - _String1: *const ::std::os::raw::c_ushort, - _String2: *const ::std::os::raw::c_ushort, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcscpy(_Destination: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcscspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; -} -extern "C" { - pub fn wcslen(_String: *const ::std::os::raw::c_ushort) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn wcsnlen(_Source: *const wchar_t, _MaxCount: size_t) -> size_t; -} -extern "C" { - pub fn wcsncat( - _Destination: *mut wchar_t, - _Source: *const wchar_t, - _Count: size_t, - ) -> *mut wchar_t; -} -extern "C" { - pub fn wcsncmp( - _String1: *const ::std::os::raw::c_ushort, - _String2: *const ::std::os::raw::c_ushort, - _MaxCount: ::std::os::raw::c_ulonglong, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsncpy( - _Destination: *mut wchar_t, - _Source: *const wchar_t, - _Count: size_t, - ) -> *mut wchar_t; -} -extern "C" { - pub fn wcspbrk(_String: *const wchar_t, _Control: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsspn(_String: *const wchar_t, _Control: *const wchar_t) -> size_t; -} -extern "C" { - pub fn wcstok( - _String: *mut wchar_t, - _Delimiter: *const wchar_t, - _Context: *mut *mut wchar_t, - ) -> *mut wchar_t; -} -extern "C" { - pub fn _wcserror(_ErrorNumber: ::std::os::raw::c_int) -> *mut wchar_t; -} -extern "C" { - pub fn _wcserror_s( - _Buffer: *mut wchar_t, - _SizeInWords: size_t, - _ErrorNumber: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn __wcserror(_String: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn __wcserror_s( - _Buffer: *mut wchar_t, - _SizeInWords: size_t, - _ErrorMessage: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsicmp_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsnicmp( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsnicmp_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsnset_s( - _Destination: *mut wchar_t, - _SizeInWords: size_t, - _Value: wchar_t, - _MaxCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn _wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcsrev(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcsset_s(_Destination: *mut wchar_t, _SizeInWords: size_t, _Value: wchar_t) -> errno_t; -} -extern "C" { - pub fn _wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcslwr_s(_String: *mut wchar_t, _SizeInWords: size_t) -> errno_t; -} -extern "C" { - pub fn _wcslwr(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcslwr_s_l(_String: *mut wchar_t, _SizeInWords: size_t, _Locale: _locale_t) -> errno_t; -} -extern "C" { - pub fn _wcslwr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcsupr_s(_String: *mut wchar_t, _Size: size_t) -> errno_t; -} -extern "C" { - pub fn _wcsupr(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wcsupr_s_l(_String: *mut wchar_t, _Size: size_t, _Locale: _locale_t) -> errno_t; -} -extern "C" { - pub fn _wcsupr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsxfrm( - _Destination: *mut wchar_t, - _Source: *const wchar_t, - _MaxCount: size_t, - ) -> size_t; -} -extern "C" { - pub fn _wcsxfrm_l( - _Destination: *mut wchar_t, - _Source: *const wchar_t, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> size_t; -} -extern "C" { - pub fn wcscoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcscoll_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsicoll_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsncoll( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsncoll_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsnicoll( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _wcsnicoll_l( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsdup(_String: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsicmp(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsnicmp( - _String1: *const wchar_t, - _String2: *const wchar_t, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcsnset(_String: *mut wchar_t, _Value: wchar_t, _MaxCount: size_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsrev(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsset(_String: *mut wchar_t, _Value: wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcslwr(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsupr(_String: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn wcsicoll(_String1: *const wchar_t, _String2: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strcpy_s( - _Destination: *mut ::std::os::raw::c_char, - _SizeInBytes: rsize_t, - _Source: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn strcat_s( - _Destination: *mut ::std::os::raw::c_char, - _SizeInBytes: rsize_t, - _Source: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn strerror_s( - _Buffer: *mut ::std::os::raw::c_char, - _SizeInBytes: size_t, - _ErrorNumber: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn strncat_s( - _Destination: *mut ::std::os::raw::c_char, - _SizeInBytes: rsize_t, - _Source: *const ::std::os::raw::c_char, - _MaxCount: rsize_t, - ) -> errno_t; -} -extern "C" { - pub fn strncpy_s( - _Destination: *mut ::std::os::raw::c_char, - _SizeInBytes: rsize_t, - _Source: *const ::std::os::raw::c_char, - _MaxCount: rsize_t, - ) -> errno_t; -} -extern "C" { - pub fn strtok_s( - _String: *mut ::std::os::raw::c_char, - _Delimiter: *const ::std::os::raw::c_char, - _Context: *mut *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -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: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn strcat( - _Destination: *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 _strcmpi( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strcoll( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strcoll_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strcpy( - _Destination: *mut ::std::os::raw::c_char, - _Source: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -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 _strdup(_Source: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strerror(_ErrorMessage: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strerror_s( - _Buffer: *mut ::std::os::raw::c_char, - _SizeInBytes: size_t, - _ErrorMessage: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn strerror(_ErrorMessage: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _stricmp( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _stricoll( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _stricoll_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _stricmp_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _Locale: _locale_t, - ) -> ::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 _strlwr_s(_String: *mut ::std::os::raw::c_char, _Size: size_t) -> errno_t; -} -extern "C" { - pub fn _strlwr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strlwr_s_l( - _String: *mut ::std::os::raw::c_char, - _Size: size_t, - _Locale: _locale_t, - ) -> errno_t; -} -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( - _Destination: *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( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strnicmp_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strnicoll( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strnicoll_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strncoll( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _strncoll_l( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __strncnt(_String: *const ::std::os::raw::c_char, _Count: size_t) -> size_t; -} -extern "C" { - pub fn strncpy( - _Destination: *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 strnlen(_String: *const ::std::os::raw::c_char, _MaxCount: size_t) -> size_t; -} -extern "C" { - pub fn _strnset_s( - _String: *mut ::std::os::raw::c_char, - _SizeInBytes: size_t, - _Value: ::std::os::raw::c_int, - _MaxCount: size_t, - ) -> errno_t; -} -extern "C" { - pub fn _strnset( - _Destination: *mut ::std::os::raw::c_char, - _Value: ::std::os::raw::c_int, - _Count: size_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 _strrev(_Str: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strset_s( - _Destination: *mut ::std::os::raw::c_char, - _DestinationSize: size_t, - _Value: ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn _strset( - _Destination: *mut ::std::os::raw::c_char, - _Value: ::std::os::raw::c_int, - ) -> *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 strtok( - _String: *mut ::std::os::raw::c_char, - _Delimiter: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strupr_s(_String: *mut ::std::os::raw::c_char, _Size: size_t) -> errno_t; -} -extern "C" { - pub fn _strupr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _strupr_s_l( - _String: *mut ::std::os::raw::c_char, - _Size: size_t, - _Locale: _locale_t, - ) -> errno_t; -} -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( - _Destination: *mut ::std::os::raw::c_char, - _Source: *const ::std::os::raw::c_char, - _MaxCount: ::std::os::raw::c_ulonglong, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn _strxfrm_l( - _Destination: *mut ::std::os::raw::c_char, - _Source: *const ::std::os::raw::c_char, - _MaxCount: size_t, - _Locale: _locale_t, - ) -> size_t; -} -extern "C" { - pub fn strdup(_String: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strcmpi( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn stricmp( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strlwr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strnicmp( - _String1: *const ::std::os::raw::c_char, - _String2: *const ::std::os::raw::c_char, - _MaxCount: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strnset( - _String: *mut ::std::os::raw::c_char, - _Value: ::std::os::raw::c_int, - _MaxCount: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strrev(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strset( - _String: *mut ::std::os::raw::c_char, - _Value: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strupr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct gladGLversionStruct { - pub major: ::std::os::raw::c_int, - pub minor: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_gladGLversionStruct() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gladGLversionStruct)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(gladGLversionStruct)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).major as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gladGLversionStruct), - "::", - stringify!(major) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).minor as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(gladGLversionStruct), - "::", - stringify!(minor) - ) - ); -} -pub type GLADloadproc = ::std::option::Option< - unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut GLVersion: gladGLversionStruct; -} -extern "C" { - pub fn gladLoadGLLoader(arg1: GLADloadproc) -> ::std::os::raw::c_int; -} -pub type int_least8_t = ::std::os::raw::c_schar; -pub type int_least16_t = ::std::os::raw::c_short; -pub type int_least32_t = ::std::os::raw::c_int; -pub type int_least64_t = ::std::os::raw::c_longlong; -pub type uint_least8_t = ::std::os::raw::c_uchar; -pub type uint_least16_t = ::std::os::raw::c_ushort; -pub type uint_least32_t = ::std::os::raw::c_uint; -pub type uint_least64_t = ::std::os::raw::c_ulonglong; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_int; -pub type int_fast32_t = ::std::os::raw::c_int; -pub type int_fast64_t = ::std::os::raw::c_longlong; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_uint; -pub type uint_fast32_t = ::std::os::raw::c_uint; -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; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _Lldiv_t { - pub quot: intmax_t, - pub rem: intmax_t, -} -#[test] -fn bindgen_test_layout__Lldiv_t() { - assert_eq!( - ::std::mem::size_of::<_Lldiv_t>(), - 16usize, - concat!("Size of: ", stringify!(_Lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::<_Lldiv_t>(), - 8usize, - concat!("Alignment of ", stringify!(_Lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Lldiv_t>())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Lldiv_t>())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Lldiv_t), - "::", - stringify!(rem) - ) - ); -} -pub type imaxdiv_t = _Lldiv_t; -extern "C" { - pub fn imaxabs(_Number: intmax_t) -> intmax_t; -} -extern "C" { - pub fn imaxdiv(_Numerator: intmax_t, _Denominator: intmax_t) -> imaxdiv_t; -} -extern "C" { - pub fn strtoimax( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn _strtoimax_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, - ) -> intmax_t; -} -extern "C" { - pub fn strtoumax( - _String: *const ::std::os::raw::c_char, - _EndPtr: *mut *mut ::std::os::raw::c_char, - _Radix: ::std::os::raw::c_int, - ) -> uintmax_t; -} -extern "C" { - pub fn _strtoumax_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, - ) -> uintmax_t; -} -extern "C" { - pub fn wcstoimax( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn _wcstoimax_l( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - _Locale: _locale_t, - ) -> intmax_t; -} -extern "C" { - pub fn wcstoumax( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - ) -> uintmax_t; -} -extern "C" { - pub fn _wcstoumax_l( - _String: *const wchar_t, - _EndPtr: *mut *mut wchar_t, - _Radix: ::std::os::raw::c_int, - _Locale: _locale_t, - ) -> uintmax_t; -} -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 GLclampx = ::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; -pub type GLeglImageOES = *mut ::std::os::raw::c_void; -pub type GLchar = ::std::os::raw::c_char; -pub type GLcharARB = ::std::os::raw::c_char; -pub type GLhandleARB = ::std::os::raw::c_uint; -pub type GLhalfARB = ::std::os::raw::c_ushort; -pub type GLhalf = ::std::os::raw::c_ushort; -pub type GLfixed = GLint; -pub type GLintptr = isize; -pub type GLsizeiptr = isize; -pub type GLint64 = i64; -pub type GLuint64 = u64; -pub type GLintptrARB = isize; -pub type GLsizeiptrARB = isize; -pub type GLint64EXT = i64; -pub type GLuint64EXT = u64; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __GLsync { - _unused: [u8; 0], -} -pub type GLsync = *mut __GLsync; -#[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 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 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 GLDEBUGPROCKHR = ::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 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 GLhalfNV = ::std::os::raw::c_ushort; -pub type GLvdpauSurfaceNV = GLintptr; -extern "C" { - pub static mut GLAD_GL_VERSION_1_0: ::std::os::raw::c_int; -} -pub type PFNGLCULLFACEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glCullFace: PFNGLCULLFACEPROC; -} -pub type PFNGLFRONTFACEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFrontFace: PFNGLFRONTFACEPROC; -} -pub type PFNGLHINTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glHint: PFNGLHINTPROC; -} -pub type PFNGLLINEWIDTHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLineWidth: PFNGLLINEWIDTHPROC; -} -pub type PFNGLPOINTSIZEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glPointSize: PFNGLPOINTSIZEPROC; -} -pub type PFNGLPOLYGONMODEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPolygonMode: PFNGLPOLYGONMODEPROC; -} -pub type PFNGLSCISSORPROC = ::std::option::Option< - unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glScissor: PFNGLSCISSORPROC; -} -pub type PFNGLTEXPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexParameterf: PFNGLTEXPARAMETERFPROC; -} -pub type PFNGLTEXPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glTexParameterfv: PFNGLTEXPARAMETERFVPROC; -} -pub type PFNGLTEXPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexParameteri: PFNGLTEXPARAMETERIPROC; -} -pub type PFNGLTEXPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), ->; -extern "C" { - pub static mut glad_glTexParameteriv: PFNGLTEXPARAMETERIVPROC; -} -pub type PFNGLTEXIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLint, - width: GLsizei, - border: GLint, - format: GLenum, - type_: GLenum, - pixels: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexImage1D: PFNGLTEXIMAGE1DPROC; -} -pub type PFNGLTEXIMAGE2DPROC = ::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 glad_glTexImage2D: PFNGLTEXIMAGE2DPROC; -} -pub type PFNGLDRAWBUFFERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffer: PFNGLDRAWBUFFERPROC; -} -pub type PFNGLCLEARPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClear: PFNGLCLEARPROC; -} -pub type PFNGLCLEARCOLORPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glClearColor: PFNGLCLEARCOLORPROC; -} -pub type PFNGLCLEARSTENCILPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearStencil: PFNGLCLEARSTENCILPROC; -} -pub type PFNGLCLEARDEPTHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearDepth: PFNGLCLEARDEPTHPROC; -} -pub type PFNGLSTENCILMASKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glStencilMask: PFNGLSTENCILMASKPROC; -} -pub type PFNGLCOLORMASKPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean), ->; -extern "C" { - pub static mut glad_glColorMask: PFNGLCOLORMASKPROC; -} -pub type PFNGLDEPTHMASKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthMask: PFNGLDEPTHMASKPROC; -} -pub type PFNGLDISABLEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDisable: PFNGLDISABLEPROC; -} -pub type PFNGLENABLEPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEnable: PFNGLENABLEPROC; -} -pub type PFNGLFINISHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFinish: PFNGLFINISHPROC; -} -pub type PFNGLFLUSHPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFlush: PFNGLFLUSHPROC; -} -pub type PFNGLBLENDFUNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendFunc: PFNGLBLENDFUNCPROC; -} -pub type PFNGLLOGICOPPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLogicOp: PFNGLLOGICOPPROC; -} -pub type PFNGLSTENCILFUNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilFunc: PFNGLSTENCILFUNCPROC; -} -pub type PFNGLSTENCILOPPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilOp: PFNGLSTENCILOPPROC; -} -pub type PFNGLDEPTHFUNCPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthFunc: PFNGLDEPTHFUNCPROC; -} -pub type PFNGLPIXELSTOREFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPixelStoref: PFNGLPIXELSTOREFPROC; -} -pub type PFNGLPIXELSTOREIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPixelStorei: PFNGLPIXELSTOREIPROC; -} -pub type PFNGLREADBUFFERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glReadBuffer: PFNGLREADBUFFERPROC; -} -pub type PFNGLREADPIXELSPROC = ::std::option::Option< - unsafe extern "C" fn( - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - format: GLenum, - type_: GLenum, - pixels: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glReadPixels: PFNGLREADPIXELSPROC; -} -pub type PFNGLGETBOOLEANVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBooleanv: PFNGLGETBOOLEANVPROC; -} -pub type PFNGLGETDOUBLEVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetDoublev: PFNGLGETDOUBLEVPROC; -} -pub type PFNGLGETERRORPROC = ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glGetError: PFNGLGETERRORPROC; -} -pub type PFNGLGETFLOATVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetFloatv: PFNGLGETFLOATVPROC; -} -pub type PFNGLGETINTEGERVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetIntegerv: PFNGLGETINTEGERVPROC; -} -pub type PFNGLGETSTRINGPROC = - ::std::option::Option *const GLubyte>; -extern "C" { - pub static mut glad_glGetString: PFNGLGETSTRINGPROC; -} -pub type PFNGLGETTEXIMAGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - format: GLenum, - type_: GLenum, - pixels: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetTexImage: PFNGLGETTEXIMAGEPROC; -} -pub type PFNGLGETTEXPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetTexParameterfv: PFNGLGETTEXPARAMETERFVPROC; -} -pub type PFNGLGETTEXPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameteriv: PFNGLGETTEXPARAMETERIVPROC; -} -pub type PFNGLGETTEXLEVELPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetTexLevelParameterfv: PFNGLGETTEXLEVELPARAMETERFVPROC; -} -pub type PFNGLGETTEXLEVELPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetTexLevelParameteriv: PFNGLGETTEXLEVELPARAMETERIVPROC; -} -pub type PFNGLISENABLEDPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsEnabled: PFNGLISENABLEDPROC; -} -pub type PFNGLDEPTHRANGEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDepthRange: PFNGLDEPTHRANGEPROC; -} -pub type PFNGLVIEWPORTPROC = ::std::option::Option< - unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glViewport: PFNGLVIEWPORTPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_1: ::std::os::raw::c_int; -} -pub type PFNGLDRAWARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawArrays: PFNGLDRAWARRAYSPROC; -} -pub type PFNGLDRAWELEMENTSPROC = ::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 glad_glDrawElements: PFNGLDRAWELEMENTSPROC; -} -pub type PFNGLPOLYGONOFFSETPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPolygonOffset: PFNGLPOLYGONOFFSETPROC; -} -pub type PFNGLCOPYTEXIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLenum, - x: GLint, - y: GLint, - width: GLsizei, - border: GLint, - ), ->; -extern "C" { - pub static mut glad_glCopyTexImage1D: PFNGLCOPYTEXIMAGE1DPROC; -} -pub type PFNGLCOPYTEXIMAGE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - internalformat: GLenum, - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - border: GLint, - ), ->; -extern "C" { - pub static mut glad_glCopyTexImage2D: PFNGLCOPYTEXIMAGE2DPROC; -} -pub type PFNGLCOPYTEXSUBIMAGE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - xoffset: GLint, - x: GLint, - y: GLint, - width: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glCopyTexSubImage1D: PFNGLCOPYTEXSUBIMAGE1DPROC; -} -pub type PFNGLCOPYTEXSUBIMAGE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - level: GLint, - xoffset: GLint, - yoffset: GLint, - x: GLint, - y: GLint, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glCopyTexSubImage2D: PFNGLCOPYTEXSUBIMAGE2DPROC; -} -pub type PFNGLTEXSUBIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glTexSubImage1D: PFNGLTEXSUBIMAGE1DPROC; -} -pub type PFNGLTEXSUBIMAGE2DPROC = ::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 glad_glTexSubImage2D: PFNGLTEXSUBIMAGE2DPROC; -} -pub type PFNGLBINDTEXTUREPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindTexture: PFNGLBINDTEXTUREPROC; -} -pub type PFNGLDELETETEXTURESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteTextures: PFNGLDELETETEXTURESPROC; -} -pub type PFNGLGENTEXTURESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenTextures: PFNGLGENTEXTURESPROC; -} -pub type PFNGLISTEXTUREPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsTexture: PFNGLISTEXTUREPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_2: ::std::os::raw::c_int; -} -pub type PFNGLDRAWRANGEELEMENTSPROC = ::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 static mut glad_glDrawRangeElements: PFNGLDRAWRANGEELEMENTSPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexImage3D: PFNGLTEXIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glTexSubImage3D: PFNGLTEXSUBIMAGE3DPROC; -} -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 static mut glad_glCopyTexSubImage3D: PFNGLCOPYTEXSUBIMAGE3DPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_3: ::std::os::raw::c_int; -} -pub type PFNGLACTIVETEXTUREPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glActiveTexture: PFNGLACTIVETEXTUREPROC; -} -pub type PFNGLSAMPLECOVERAGEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleCoverage: PFNGLSAMPLECOVERAGEPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage3D: PFNGLCOMPRESSEDTEXIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage2D: PFNGLCOMPRESSEDTEXIMAGE2DPROC; -} -pub type PFNGLCOMPRESSEDTEXIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage1D: PFNGLCOMPRESSEDTEXIMAGE1DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage3D: PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC; -} -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 ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage2D: PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC; -} -pub type PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC = ::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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage1D: PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC; -} -pub type PFNGLGETCOMPRESSEDTEXIMAGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, img: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetCompressedTexImage: PFNGLGETCOMPRESSEDTEXIMAGEPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_4: ::std::os::raw::c_int; -} -pub type PFNGLBLENDFUNCSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn( - sfactorRGB: GLenum, - dfactorRGB: GLenum, - sfactorAlpha: GLenum, - dfactorAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparate: PFNGLBLENDFUNCSEPARATEPROC; -} -pub type PFNGLMULTIDRAWARRAYSPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - first: *const GLint, - count: *const GLsizei, - drawcount: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawArrays: PFNGLMULTIDRAWARRAYSPROC; -} -pub type PFNGLMULTIDRAWELEMENTSPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - count: *const GLsizei, - type_: GLenum, - indices: *mut *const ::std::os::raw::c_void, - drawcount: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawElements: PFNGLMULTIDRAWELEMENTSPROC; -} -pub type PFNGLPOINTPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameterf: PFNGLPOINTPARAMETERFPROC; -} -pub type PFNGLPOINTPARAMETERFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameterfv: PFNGLPOINTPARAMETERFVPROC; -} -pub type PFNGLPOINTPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameteri: PFNGLPOINTPARAMETERIPROC; -} -pub type PFNGLPOINTPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPointParameteriv: PFNGLPOINTPARAMETERIVPROC; -} -pub type PFNGLBLENDCOLORPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glBlendColor: PFNGLBLENDCOLORPROC; -} -pub type PFNGLBLENDEQUATIONPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquation: PFNGLBLENDEQUATIONPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_1_5: ::std::os::raw::c_int; -} -pub type PFNGLGENQUERIESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenQueries: PFNGLGENQUERIESPROC; -} -pub type PFNGLDELETEQUERIESPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteQueries: PFNGLDELETEQUERIESPROC; -} -pub type PFNGLISQUERYPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsQuery: PFNGLISQUERYPROC; -} -pub type PFNGLBEGINQUERYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginQuery: PFNGLBEGINQUERYPROC; -} -pub type PFNGLENDQUERYPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndQuery: PFNGLENDQUERYPROC; -} -pub type PFNGLGETQUERYIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryiv: PFNGLGETQUERYIVPROC; -} -pub type PFNGLGETQUERYOBJECTIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectiv: PFNGLGETQUERYOBJECTIVPROC; -} -pub type PFNGLGETQUERYOBJECTUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectuiv: PFNGLGETQUERYOBJECTUIVPROC; -} -pub type PFNGLBINDBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBuffer: PFNGLBINDBUFFERPROC; -} -pub type PFNGLDELETEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteBuffers: PFNGLDELETEBUFFERSPROC; -} -pub type PFNGLGENBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenBuffers: PFNGLGENBUFFERSPROC; -} -pub type PFNGLISBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsBuffer: PFNGLISBUFFERPROC; -} -pub type PFNGLBUFFERDATAPROC = ::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 glad_glBufferData: PFNGLBUFFERDATAPROC; -} -pub type PFNGLBUFFERSUBDATAPROC = ::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 glad_glBufferSubData: PFNGLBUFFERSUBDATAPROC; -} -pub type PFNGLGETBUFFERSUBDATAPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptr, - size: GLsizeiptr, - data: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetBufferSubData: PFNGLGETBUFFERSUBDATAPROC; -} -pub type PFNGLMAPBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBuffer: PFNGLMAPBUFFERPROC; -} -pub type PFNGLUNMAPBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glUnmapBuffer: PFNGLUNMAPBUFFERPROC; -} -pub type PFNGLGETBUFFERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBufferParameteriv: PFNGLGETBUFFERPARAMETERIVPROC; -} -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 static mut glad_glGetBufferPointerv: PFNGLGETBUFFERPOINTERVPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_2_0: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONSEPARATEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparate: PFNGLBLENDEQUATIONSEPARATEPROC; -} -pub type PFNGLDRAWBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffers: PFNGLDRAWBUFFERSPROC; -} -pub type PFNGLSTENCILOPSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum), ->; -extern "C" { - pub static mut glad_glStencilOpSeparate: PFNGLSTENCILOPSEPARATEPROC; -} -pub type PFNGLSTENCILFUNCSEPARATEPROC = ::std::option::Option< - unsafe extern "C" fn(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint), ->; -extern "C" { - pub static mut glad_glStencilFuncSeparate: PFNGLSTENCILFUNCSEPARATEPROC; -} -pub type PFNGLSTENCILMASKSEPARATEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glStencilMaskSeparate: PFNGLSTENCILMASKSEPARATEPROC; -} -pub type PFNGLATTACHSHADERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glAttachShader: PFNGLATTACHSHADERPROC; -} -pub type PFNGLBINDATTRIBLOCATIONPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, index: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindAttribLocation: PFNGLBINDATTRIBLOCATIONPROC; -} -pub type PFNGLCOMPILESHADERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glCompileShader: PFNGLCOMPILESHADERPROC; -} -pub type PFNGLCREATEPROGRAMPROC = ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glCreateProgram: PFNGLCREATEPROGRAMPROC; -} -pub type PFNGLCREATESHADERPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glCreateShader: PFNGLCREATESHADERPROC; -} -pub type PFNGLDELETEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteProgram: PFNGLDELETEPROGRAMPROC; -} -pub type PFNGLDELETESHADERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteShader: PFNGLDELETESHADERPROC; -} -pub type PFNGLDETACHSHADERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDetachShader: PFNGLDETACHSHADERPROC; -} -pub type PFNGLDISABLEVERTEXATTRIBARRAYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVertexAttribArray: PFNGLDISABLEVERTEXATTRIBARRAYPROC; -} -pub type PFNGLENABLEVERTEXATTRIBARRAYPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVertexAttribArray: PFNGLENABLEVERTEXATTRIBARRAYPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveAttrib: PFNGLGETACTIVEATTRIBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniform: PFNGLGETACTIVEUNIFORMPROC; -} -pub type PFNGLGETATTACHEDSHADERSPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - maxCount: GLsizei, - count: *mut GLsizei, - shaders: *mut GLuint, - ), ->; -extern "C" { - pub static mut glad_glGetAttachedShaders: PFNGLGETATTACHEDSHADERSPROC; -} -pub type PFNGLGETATTRIBLOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetAttribLocation: PFNGLGETATTRIBLOCATIONPROC; -} -pub type PFNGLGETPROGRAMIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetProgramiv: PFNGLGETPROGRAMIVPROC; -} -pub type PFNGLGETPROGRAMINFOLOGPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - infoLog: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetProgramInfoLog: PFNGLGETPROGRAMINFOLOGPROC; -} -pub type PFNGLGETSHADERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetShaderiv: PFNGLGETSHADERIVPROC; -} -pub type PFNGLGETSHADERINFOLOGPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - infoLog: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetShaderInfoLog: PFNGLGETSHADERINFOLOGPROC; -} -pub type PFNGLGETSHADERSOURCEPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - source: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetShaderSource: PFNGLGETSHADERSOURCEPROC; -} -pub type PFNGLGETUNIFORMLOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetUniformLocation: PFNGLGETUNIFORMLOCATIONPROC; -} -pub type PFNGLGETUNIFORMFVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetUniformfv: PFNGLGETUNIFORMFVPROC; -} -pub type PFNGLGETUNIFORMIVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetUniformiv: PFNGLGETUNIFORMIVPROC; -} -pub type PFNGLGETVERTEXATTRIBDVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetVertexAttribdv: PFNGLGETVERTEXATTRIBDVPROC; -} -pub type PFNGLGETVERTEXATTRIBFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribfv: PFNGLGETVERTEXATTRIBFVPROC; -} -pub type PFNGLGETVERTEXATTRIBIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribiv: PFNGLGETVERTEXATTRIBIVPROC; -} -pub type PFNGLGETVERTEXATTRIBPOINTERVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, pointer: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetVertexAttribPointerv: PFNGLGETVERTEXATTRIBPOINTERVPROC; -} -pub type PFNGLISPROGRAMPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsProgram: PFNGLISPROGRAMPROC; -} -pub type PFNGLISSHADERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsShader: PFNGLISSHADERPROC; -} -pub type PFNGLLINKPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glLinkProgram: PFNGLLINKPROGRAMPROC; -} -pub type PFNGLSHADERSOURCEPROC = ::std::option::Option< - unsafe extern "C" fn( - shader: GLuint, - count: GLsizei, - string: *mut *const GLchar, - length: *const GLint, - ), ->; -extern "C" { - pub static mut glad_glShaderSource: PFNGLSHADERSOURCEPROC; -} -pub type PFNGLUSEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glUseProgram: PFNGLUSEPROGRAMPROC; -} -pub type PFNGLUNIFORM1FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1f: PFNGLUNIFORM1FPROC; -} -pub type PFNGLUNIFORM2FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2f: PFNGLUNIFORM2FPROC; -} -pub type PFNGLUNIFORM3FPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), ->; -extern "C" { - pub static mut glad_glUniform3f: PFNGLUNIFORM3FPROC; -} -pub type PFNGLUNIFORM4FPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat), ->; -extern "C" { - pub static mut glad_glUniform4f: PFNGLUNIFORM4FPROC; -} -pub type PFNGLUNIFORM1IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1i: PFNGLUNIFORM1IPROC; -} -pub type PFNGLUNIFORM2IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2i: PFNGLUNIFORM2IPROC; -} -pub type PFNGLUNIFORM3IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform3i: PFNGLUNIFORM3IPROC; -} -pub type PFNGLUNIFORM4IPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint), ->; -extern "C" { - pub static mut glad_glUniform4i: PFNGLUNIFORM4IPROC; -} -pub type PFNGLUNIFORM1FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform1fv: PFNGLUNIFORM1FVPROC; -} -pub type PFNGLUNIFORM2FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform2fv: PFNGLUNIFORM2FVPROC; -} -pub type PFNGLUNIFORM3FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform3fv: PFNGLUNIFORM3FVPROC; -} -pub type PFNGLUNIFORM4FVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glUniform4fv: PFNGLUNIFORM4FVPROC; -} -pub type PFNGLUNIFORM1IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform1iv: PFNGLUNIFORM1IVPROC; -} -pub type PFNGLUNIFORM2IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform2iv: PFNGLUNIFORM2IVPROC; -} -pub type PFNGLUNIFORM3IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform3iv: PFNGLUNIFORM3IVPROC; -} -pub type PFNGLUNIFORM4IVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), ->; -extern "C" { - pub static mut glad_glUniform4iv: PFNGLUNIFORM4IVPROC; -} -pub type PFNGLUNIFORMMATRIX2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2fv: PFNGLUNIFORMMATRIX2FVPROC; -} -pub type PFNGLUNIFORMMATRIX3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3fv: PFNGLUNIFORMMATRIX3FVPROC; -} -pub type PFNGLUNIFORMMATRIX4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4fv: PFNGLUNIFORMMATRIX4FVPROC; -} -pub type PFNGLVALIDATEPROGRAMPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glValidateProgram: PFNGLVALIDATEPROGRAMPROC; -} -pub type PFNGLVERTEXATTRIB1DPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1d: PFNGLVERTEXATTRIB1DPROC; -} -pub type PFNGLVERTEXATTRIB1DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dv: PFNGLVERTEXATTRIB1DVPROC; -} -pub type PFNGLVERTEXATTRIB1FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1f: PFNGLVERTEXATTRIB1FPROC; -} -pub type PFNGLVERTEXATTRIB1FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fv: PFNGLVERTEXATTRIB1FVPROC; -} -pub type PFNGLVERTEXATTRIB1SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1s: PFNGLVERTEXATTRIB1SPROC; -} -pub type PFNGLVERTEXATTRIB1SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1sv: PFNGLVERTEXATTRIB1SVPROC; -} -pub type PFNGLVERTEXATTRIB2DPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2d: PFNGLVERTEXATTRIB2DPROC; -} -pub type PFNGLVERTEXATTRIB2DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dv: PFNGLVERTEXATTRIB2DVPROC; -} -pub type PFNGLVERTEXATTRIB2FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2f: PFNGLVERTEXATTRIB2FPROC; -} -pub type PFNGLVERTEXATTRIB2FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fv: PFNGLVERTEXATTRIB2FVPROC; -} -pub type PFNGLVERTEXATTRIB2SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2s: PFNGLVERTEXATTRIB2SPROC; -} -pub type PFNGLVERTEXATTRIB2SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2sv: PFNGLVERTEXATTRIB2SVPROC; -} -pub type PFNGLVERTEXATTRIB3DPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib3d: PFNGLVERTEXATTRIB3DPROC; -} -pub type PFNGLVERTEXATTRIB3DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3dv: PFNGLVERTEXATTRIB3DVPROC; -} -pub type PFNGLVERTEXATTRIB3FPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3f: PFNGLVERTEXATTRIB3FPROC; -} -pub type PFNGLVERTEXATTRIB3FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fv: PFNGLVERTEXATTRIB3FVPROC; -} -pub type PFNGLVERTEXATTRIB3SPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3s: PFNGLVERTEXATTRIB3SPROC; -} -pub type PFNGLVERTEXATTRIB3SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3sv: PFNGLVERTEXATTRIB3SVPROC; -} -pub type PFNGLVERTEXATTRIB4NBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nbv: PFNGLVERTEXATTRIB4NBVPROC; -} -pub type PFNGLVERTEXATTRIB4NIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Niv: PFNGLVERTEXATTRIB4NIVPROC; -} -pub type PFNGLVERTEXATTRIB4NSVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nsv: PFNGLVERTEXATTRIB4NSVPROC; -} -pub type PFNGLVERTEXATTRIB4NUBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), ->; -extern "C" { - pub static mut glad_glVertexAttrib4Nub: PFNGLVERTEXATTRIB4NUBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nubv: PFNGLVERTEXATTRIB4NUBVPROC; -} -pub type PFNGLVERTEXATTRIB4NUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nuiv: PFNGLVERTEXATTRIB4NUIVPROC; -} -pub type PFNGLVERTEXATTRIB4NUSVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4Nusv: PFNGLVERTEXATTRIB4NUSVPROC; -} -pub type PFNGLVERTEXATTRIB4BVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4bv: PFNGLVERTEXATTRIB4BVPROC; -} -pub type PFNGLVERTEXATTRIB4DPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib4d: PFNGLVERTEXATTRIB4DPROC; -} -pub type PFNGLVERTEXATTRIB4DVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4dv: PFNGLVERTEXATTRIB4DVPROC; -} -pub type PFNGLVERTEXATTRIB4FPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), ->; -extern "C" { - pub static mut glad_glVertexAttrib4f: PFNGLVERTEXATTRIB4FPROC; -} -pub type PFNGLVERTEXATTRIB4FVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4fv: PFNGLVERTEXATTRIB4FVPROC; -} -pub type PFNGLVERTEXATTRIB4IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4iv: PFNGLVERTEXATTRIB4IVPROC; -} -pub type PFNGLVERTEXATTRIB4SPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), ->; -extern "C" { - pub static mut glad_glVertexAttrib4s: PFNGLVERTEXATTRIB4SPROC; -} -pub type PFNGLVERTEXATTRIB4SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4sv: PFNGLVERTEXATTRIB4SVPROC; -} -pub type PFNGLVERTEXATTRIB4UBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ubv: PFNGLVERTEXATTRIB4UBVPROC; -} -pub type PFNGLVERTEXATTRIB4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4uiv: PFNGLVERTEXATTRIB4UIVPROC; -} -pub type PFNGLVERTEXATTRIB4USVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4usv: PFNGLVERTEXATTRIB4USVPROC; -} -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 static mut glad_glVertexAttribPointer: PFNGLVERTEXATTRIBPOINTERPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_2_1: ::std::os::raw::c_int; -} -pub type PFNGLUNIFORMMATRIX2X3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2x3fv: PFNGLUNIFORMMATRIX2X3FVPROC; -} -pub type PFNGLUNIFORMMATRIX3X2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3x2fv: PFNGLUNIFORMMATRIX3X2FVPROC; -} -pub type PFNGLUNIFORMMATRIX2X4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix2x4fv: PFNGLUNIFORMMATRIX2X4FVPROC; -} -pub type PFNGLUNIFORMMATRIX4X2FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4x2fv: PFNGLUNIFORMMATRIX4X2FVPROC; -} -pub type PFNGLUNIFORMMATRIX3X4FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix3x4fv: PFNGLUNIFORMMATRIX3X4FVPROC; -} -pub type PFNGLUNIFORMMATRIX4X3FVPROC = ::std::option::Option< - unsafe extern "C" fn( - location: GLint, - count: GLsizei, - transpose: GLboolean, - value: *const GLfloat, - ), ->; -extern "C" { - pub static mut glad_glUniformMatrix4x3fv: PFNGLUNIFORMMATRIX4X3FVPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_0: ::std::os::raw::c_int; -} -pub type PFNGLCOLORMASKIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean), ->; -extern "C" { - pub static mut glad_glColorMaski: PFNGLCOLORMASKIPROC; -} -pub type PFNGLGETBOOLEANI_VPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, data: *mut GLboolean), ->; -extern "C" { - pub static mut glad_glGetBooleani_v: PFNGLGETBOOLEANI_VPROC; -} -pub type PFNGLGETINTEGERI_VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetIntegeri_v: PFNGLGETINTEGERI_VPROC; -} -pub type PFNGLENABLEIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnablei: PFNGLENABLEIPROC; -} -pub type PFNGLDISABLEIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisablei: PFNGLDISABLEIPROC; -} -pub type PFNGLISENABLEDIPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsEnabledi: PFNGLISENABLEDIPROC; -} -pub type PFNGLBEGINTRANSFORMFEEDBACKPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginTransformFeedback: PFNGLBEGINTRANSFORMFEEDBACKPROC; -} -pub type PFNGLENDTRANSFORMFEEDBACKPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndTransformFeedback: PFNGLENDTRANSFORMFEEDBACKPROC; -} -pub type PFNGLBINDBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - buffer: GLuint, - offset: GLintptr, - size: GLsizeiptr, - ), ->; -extern "C" { - pub static mut glad_glBindBufferRange: PFNGLBINDBUFFERRANGEPROC; -} -pub type PFNGLBINDBUFFERBASEPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBufferBase: PFNGLBINDBUFFERBASEPROC; -} -pub type PFNGLTRANSFORMFEEDBACKVARYINGSPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - count: GLsizei, - varyings: *mut *const GLchar, - bufferMode: GLenum, - ), ->; -extern "C" { - pub static mut glad_glTransformFeedbackVaryings: PFNGLTRANSFORMFEEDBACKVARYINGSPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetTransformFeedbackVarying: PFNGLGETTRANSFORMFEEDBACKVARYINGPROC; -} -pub type PFNGLCLAMPCOLORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glClampColor: PFNGLCLAMPCOLORPROC; -} -pub type PFNGLBEGINCONDITIONALRENDERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBeginConditionalRender: PFNGLBEGINCONDITIONALRENDERPROC; -} -pub type PFNGLENDCONDITIONALRENDERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndConditionalRender: PFNGLENDCONDITIONALRENDERPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribIPointer: PFNGLVERTEXATTRIBIPOINTERPROC; -} -pub type PFNGLGETVERTEXATTRIBIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribIiv: PFNGLGETVERTEXATTRIBIIVPROC; -} -pub type PFNGLGETVERTEXATTRIBIUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribIuiv: PFNGLGETVERTEXATTRIBIUIVPROC; -} -pub type PFNGLVERTEXATTRIBI1IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1i: PFNGLVERTEXATTRIBI1IPROC; -} -pub type PFNGLVERTEXATTRIBI2IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2i: PFNGLVERTEXATTRIBI2IPROC; -} -pub type PFNGLVERTEXATTRIBI3IPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3i: PFNGLVERTEXATTRIBI3IPROC; -} -pub type PFNGLVERTEXATTRIBI4IPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), ->; -extern "C" { - pub static mut glad_glVertexAttribI4i: PFNGLVERTEXATTRIBI4IPROC; -} -pub type PFNGLVERTEXATTRIBI1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1ui: PFNGLVERTEXATTRIBI1UIPROC; -} -pub type PFNGLVERTEXATTRIBI2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2ui: PFNGLVERTEXATTRIBI2UIPROC; -} -pub type PFNGLVERTEXATTRIBI3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3ui: PFNGLVERTEXATTRIBI3UIPROC; -} -pub type PFNGLVERTEXATTRIBI4UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribI4ui: PFNGLVERTEXATTRIBI4UIPROC; -} -pub type PFNGLVERTEXATTRIBI1IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1iv: PFNGLVERTEXATTRIBI1IVPROC; -} -pub type PFNGLVERTEXATTRIBI2IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2iv: PFNGLVERTEXATTRIBI2IVPROC; -} -pub type PFNGLVERTEXATTRIBI3IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3iv: PFNGLVERTEXATTRIBI3IVPROC; -} -pub type PFNGLVERTEXATTRIBI4IVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4iv: PFNGLVERTEXATTRIBI4IVPROC; -} -pub type PFNGLVERTEXATTRIBI1UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI1uiv: PFNGLVERTEXATTRIBI1UIVPROC; -} -pub type PFNGLVERTEXATTRIBI2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI2uiv: PFNGLVERTEXATTRIBI2UIVPROC; -} -pub type PFNGLVERTEXATTRIBI3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI3uiv: PFNGLVERTEXATTRIBI3UIVPROC; -} -pub type PFNGLVERTEXATTRIBI4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4uiv: PFNGLVERTEXATTRIBI4UIVPROC; -} -pub type PFNGLVERTEXATTRIBI4BVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4bv: PFNGLVERTEXATTRIBI4BVPROC; -} -pub type PFNGLVERTEXATTRIBI4SVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4sv: PFNGLVERTEXATTRIBI4SVPROC; -} -pub type PFNGLVERTEXATTRIBI4UBVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4ubv: PFNGLVERTEXATTRIBI4UBVPROC; -} -pub type PFNGLVERTEXATTRIBI4USVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribI4usv: PFNGLVERTEXATTRIBI4USVPROC; -} -pub type PFNGLGETUNIFORMUIVPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint), ->; -extern "C" { - pub static mut glad_glGetUniformuiv: PFNGLGETUNIFORMUIVPROC; -} -pub type PFNGLBINDFRAGDATALOCATIONPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, color: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindFragDataLocation: PFNGLBINDFRAGDATALOCATIONPROC; -} -pub type PFNGLGETFRAGDATALOCATIONPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetFragDataLocation: PFNGLGETFRAGDATALOCATIONPROC; -} -pub type PFNGLUNIFORM1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform1ui: PFNGLUNIFORM1UIPROC; -} -pub type PFNGLUNIFORM2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glUniform2ui: PFNGLUNIFORM2UIPROC; -} -pub type PFNGLUNIFORM3UIPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), ->; -extern "C" { - pub static mut glad_glUniform3ui: PFNGLUNIFORM3UIPROC; -} -pub type PFNGLUNIFORM4UIPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint), ->; -extern "C" { - pub static mut glad_glUniform4ui: PFNGLUNIFORM4UIPROC; -} -pub type PFNGLUNIFORM1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform1uiv: PFNGLUNIFORM1UIVPROC; -} -pub type PFNGLUNIFORM2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform2uiv: PFNGLUNIFORM2UIVPROC; -} -pub type PFNGLUNIFORM3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform3uiv: PFNGLUNIFORM3UIVPROC; -} -pub type PFNGLUNIFORM4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glUniform4uiv: PFNGLUNIFORM4UIVPROC; -} -pub type PFNGLTEXPARAMETERIIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), ->; -extern "C" { - pub static mut glad_glTexParameterIiv: PFNGLTEXPARAMETERIIVPROC; -} -pub type PFNGLTEXPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLuint), ->; -extern "C" { - pub static mut glad_glTexParameterIuiv: PFNGLTEXPARAMETERIUIVPROC; -} -pub type PFNGLGETTEXPARAMETERIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameterIiv: PFNGLGETTEXPARAMETERIIVPROC; -} -pub type PFNGLGETTEXPARAMETERIUIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetTexParameterIuiv: PFNGLGETTEXPARAMETERIUIVPROC; -} -pub type PFNGLCLEARBUFFERIVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLint), ->; -extern "C" { - pub static mut glad_glClearBufferiv: PFNGLCLEARBUFFERIVPROC; -} -pub type PFNGLCLEARBUFFERUIVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glClearBufferuiv: PFNGLCLEARBUFFERUIVPROC; -} -pub type PFNGLCLEARBUFFERFVPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat), ->; -extern "C" { - pub static mut glad_glClearBufferfv: PFNGLCLEARBUFFERFVPROC; -} -pub type PFNGLCLEARBUFFERFIPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint), ->; -extern "C" { - pub static mut glad_glClearBufferfi: PFNGLCLEARBUFFERFIPROC; -} -pub type PFNGLGETSTRINGIPROC = - ::std::option::Option *const GLubyte>; -extern "C" { - pub static mut glad_glGetStringi: PFNGLGETSTRINGIPROC; -} -pub type PFNGLISRENDERBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsRenderbuffer: PFNGLISRENDERBUFFERPROC; -} -pub type PFNGLBINDRENDERBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindRenderbuffer: PFNGLBINDRENDERBUFFERPROC; -} -pub type PFNGLDELETERENDERBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteRenderbuffers: PFNGLDELETERENDERBUFFERSPROC; -} -pub type PFNGLGENRENDERBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenRenderbuffers: PFNGLGENRENDERBUFFERSPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glRenderbufferStorage: PFNGLRENDERBUFFERSTORAGEPROC; -} -pub type PFNGLGETRENDERBUFFERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetRenderbufferParameteriv: PFNGLGETRENDERBUFFERPARAMETERIVPROC; -} -pub type PFNGLISFRAMEBUFFERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsFramebuffer: PFNGLISFRAMEBUFFERPROC; -} -pub type PFNGLBINDFRAMEBUFFERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindFramebuffer: PFNGLBINDFRAMEBUFFERPROC; -} -pub type PFNGLDELETEFRAMEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFramebuffers: PFNGLDELETEFRAMEBUFFERSPROC; -} -pub type PFNGLGENFRAMEBUFFERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenFramebuffers: PFNGLGENFRAMEBUFFERSPROC; -} -pub type PFNGLCHECKFRAMEBUFFERSTATUSPROC = - ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glCheckFramebufferStatus: PFNGLCHECKFRAMEBUFFERSTATUSPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE1DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture1D: PFNGLFRAMEBUFFERTEXTURE1DPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE2DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture2D: PFNGLFRAMEBUFFERTEXTURE2DPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE3DPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - zoffset: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture3D: PFNGLFRAMEBUFFERTEXTURE3DPROC; -} -pub type PFNGLFRAMEBUFFERRENDERBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferRenderbuffer: PFNGLFRAMEBUFFERRENDERBUFFERPROC; -} -pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetFramebufferAttachmentParameteriv: - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC; -} -pub type PFNGLGENERATEMIPMAPPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glGenerateMipmap: PFNGLGENERATEMIPMAPPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glBlitFramebuffer: PFNGLBLITFRAMEBUFFERPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageMultisample: PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURELAYERPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - texture: GLuint, - level: GLint, - layer: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTextureLayer: PFNGLFRAMEBUFFERTEXTURELAYERPROC; -} -pub type PFNGLMAPBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptr, - length: GLsizeiptr, - access: GLbitfield, - ) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBufferRange: PFNGLMAPBUFFERRANGEPROC; -} -pub type PFNGLFLUSHMAPPEDBUFFERRANGEPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, offset: GLintptr, length: GLsizeiptr), ->; -extern "C" { - pub static mut glad_glFlushMappedBufferRange: PFNGLFLUSHMAPPEDBUFFERRANGEPROC; -} -pub type PFNGLBINDVERTEXARRAYPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindVertexArray: PFNGLBINDVERTEXARRAYPROC; -} -pub type PFNGLDELETEVERTEXARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteVertexArrays: PFNGLDELETEVERTEXARRAYSPROC; -} -pub type PFNGLGENVERTEXARRAYSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenVertexArrays: PFNGLGENVERTEXARRAYSPROC; -} -pub type PFNGLISVERTEXARRAYPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsVertexArray: PFNGLISVERTEXARRAYPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_1: ::std::os::raw::c_int; -} -pub type PFNGLDRAWARRAYSINSTANCEDPROC = ::std::option::Option< - unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, instancecount: GLsizei), ->; -extern "C" { - pub static mut glad_glDrawArraysInstanced: PFNGLDRAWARRAYSINSTANCEDPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsInstanced: PFNGLDRAWELEMENTSINSTANCEDPROC; -} -pub type PFNGLTEXBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, buffer: GLuint), ->; -extern "C" { - pub static mut glad_glTexBuffer: PFNGLTEXBUFFERPROC; -} -pub type PFNGLPRIMITIVERESTARTINDEXPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPrimitiveRestartIndex: PFNGLPRIMITIVERESTARTINDEXPROC; -} -pub type PFNGLCOPYBUFFERSUBDATAPROC = ::std::option::Option< - unsafe extern "C" fn( - readTarget: GLenum, - writeTarget: GLenum, - readOffset: GLintptr, - writeOffset: GLintptr, - size: GLsizeiptr, - ), ->; -extern "C" { - pub static mut glad_glCopyBufferSubData: PFNGLCOPYBUFFERSUBDATAPROC; -} -pub type PFNGLGETUNIFORMINDICESPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformCount: GLsizei, - uniformNames: *mut *const GLchar, - uniformIndices: *mut GLuint, - ), ->; -extern "C" { - pub static mut glad_glGetUniformIndices: PFNGLGETUNIFORMINDICESPROC; -} -pub type PFNGLGETACTIVEUNIFORMSIVPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformCount: GLsizei, - uniformIndices: *const GLuint, - pname: GLenum, - params: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformsiv: PFNGLGETACTIVEUNIFORMSIVPROC; -} -pub type PFNGLGETACTIVEUNIFORMNAMEPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformIndex: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - uniformName: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformName: PFNGLGETACTIVEUNIFORMNAMEPROC; -} -pub type PFNGLGETUNIFORMBLOCKINDEXPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, uniformBlockName: *const GLchar) -> GLuint, ->; -extern "C" { - pub static mut glad_glGetUniformBlockIndex: PFNGLGETUNIFORMBLOCKINDEXPROC; -} -pub type PFNGLGETACTIVEUNIFORMBLOCKIVPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformBlockIndex: GLuint, - pname: GLenum, - params: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformBlockiv: PFNGLGETACTIVEUNIFORMBLOCKIVPROC; -} -pub type PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC = ::std::option::Option< - unsafe extern "C" fn( - program: GLuint, - uniformBlockIndex: GLuint, - bufSize: GLsizei, - length: *mut GLsizei, - uniformBlockName: *mut GLchar, - ), ->; -extern "C" { - pub static mut glad_glGetActiveUniformBlockName: PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC; -} -pub type PFNGLUNIFORMBLOCKBINDINGPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint), ->; -extern "C" { - pub static mut glad_glUniformBlockBinding: PFNGLUNIFORMBLOCKBINDINGPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_2: ::std::os::raw::c_int; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsBaseVertex: PFNGLDRAWELEMENTSBASEVERTEXPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawRangeElementsBaseVertex: PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glDrawElementsInstancedBaseVertex: PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC; -} -pub type PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC = ::std::option::Option< - unsafe extern "C" fn( - mode: GLenum, - count: *const GLsizei, - type_: GLenum, - indices: *mut *const ::std::os::raw::c_void, - drawcount: GLsizei, - basevertex: *const GLint, - ), ->; -extern "C" { - pub static mut glad_glMultiDrawElementsBaseVertex: PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC; -} -pub type PFNGLPROVOKINGVERTEXPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glProvokingVertex: PFNGLPROVOKINGVERTEXPROC; -} -pub type PFNGLFENCESYNCPROC = - ::std::option::Option GLsync>; -extern "C" { - pub static mut glad_glFenceSync: PFNGLFENCESYNCPROC; -} -pub type PFNGLISSYNCPROC = ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsSync: PFNGLISSYNCPROC; -} -pub type PFNGLDELETESYNCPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteSync: PFNGLDELETESYNCPROC; -} -pub type PFNGLCLIENTWAITSYNCPROC = ::std::option::Option< - unsafe extern "C" fn(sync: GLsync, flags: GLbitfield, timeout: GLuint64) -> GLenum, ->; -extern "C" { - pub static mut glad_glClientWaitSync: PFNGLCLIENTWAITSYNCPROC; -} -pub type PFNGLWAITSYNCPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glWaitSync: PFNGLWAITSYNCPROC; -} -pub type PFNGLGETINTEGER64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInteger64v: PFNGLGETINTEGER64VPROC; -} -pub type PFNGLGETSYNCIVPROC = ::std::option::Option< - unsafe extern "C" fn( - sync: GLsync, - pname: GLenum, - bufSize: GLsizei, - length: *mut GLsizei, - values: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetSynciv: PFNGLGETSYNCIVPROC; -} -pub type PFNGLGETINTEGER64I_VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInteger64i_v: PFNGLGETINTEGER64I_VPROC; -} -pub type PFNGLGETBUFFERPARAMETERI64VPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLint64), ->; -extern "C" { - pub static mut glad_glGetBufferParameteri64v: PFNGLGETBUFFERPARAMETERI64VPROC; -} -pub type PFNGLFRAMEBUFFERTEXTUREPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint), ->; -extern "C" { - pub static mut glad_glFramebufferTexture: PFNGLFRAMEBUFFERTEXTUREPROC; -} -pub type PFNGLTEXIMAGE2DMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - fixedsamplelocations: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glTexImage2DMultisample: PFNGLTEXIMAGE2DMULTISAMPLEPROC; -} -pub type PFNGLTEXIMAGE3DMULTISAMPLEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - depth: GLsizei, - fixedsamplelocations: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glTexImage3DMultisample: PFNGLTEXIMAGE3DMULTISAMPLEPROC; -} -pub type PFNGLGETMULTISAMPLEFVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetMultisamplefv: PFNGLGETMULTISAMPLEFVPROC; -} -pub type PFNGLSAMPLEMASKIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleMaski: PFNGLSAMPLEMASKIPROC; -} -extern "C" { - pub static mut GLAD_GL_VERSION_3_3: ::std::os::raw::c_int; -} -pub type PFNGLBINDFRAGDATALOCATIONINDEXEDPROC = ::std::option::Option< - unsafe extern "C" fn(program: GLuint, colorNumber: GLuint, index: GLuint, name: *const GLchar), ->; -extern "C" { - pub static mut glad_glBindFragDataLocationIndexed: PFNGLBINDFRAGDATALOCATIONINDEXEDPROC; -} -pub type PFNGLGETFRAGDATAINDEXPROC = - ::std::option::Option GLint>; -extern "C" { - pub static mut glad_glGetFragDataIndex: PFNGLGETFRAGDATAINDEXPROC; -} -pub type PFNGLGENSAMPLERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenSamplers: PFNGLGENSAMPLERSPROC; -} -pub type PFNGLDELETESAMPLERSPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteSamplers: PFNGLDELETESAMPLERSPROC; -} -pub type PFNGLISSAMPLERPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsSampler: PFNGLISSAMPLERPROC; -} -pub type PFNGLBINDSAMPLERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindSampler: PFNGLBINDSAMPLERPROC; -} -pub type PFNGLSAMPLERPARAMETERIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSamplerParameteri: PFNGLSAMPLERPARAMETERIPROC; -} -pub type PFNGLSAMPLERPARAMETERIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), ->; -extern "C" { - pub static mut glad_glSamplerParameteriv: PFNGLSAMPLERPARAMETERIVPROC; -} -pub type PFNGLSAMPLERPARAMETERFPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSamplerParameterf: PFNGLSAMPLERPARAMETERFPROC; -} -pub type PFNGLSAMPLERPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLfloat), ->; -extern "C" { - pub static mut glad_glSamplerParameterfv: PFNGLSAMPLERPARAMETERFVPROC; -} -pub type PFNGLSAMPLERPARAMETERIIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), ->; -extern "C" { - pub static mut glad_glSamplerParameterIiv: PFNGLSAMPLERPARAMETERIIVPROC; -} -pub type PFNGLSAMPLERPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLuint), ->; -extern "C" { - pub static mut glad_glSamplerParameterIuiv: PFNGLSAMPLERPARAMETERIUIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetSamplerParameteriv: PFNGLGETSAMPLERPARAMETERIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetSamplerParameterIiv: PFNGLGETSAMPLERPARAMETERIIVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERFVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetSamplerParameterfv: PFNGLGETSAMPLERPARAMETERFVPROC; -} -pub type PFNGLGETSAMPLERPARAMETERIUIVPROC = ::std::option::Option< - unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLuint), ->; -extern "C" { - pub static mut glad_glGetSamplerParameterIuiv: PFNGLGETSAMPLERPARAMETERIUIVPROC; -} -pub type PFNGLQUERYCOUNTERPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glQueryCounter: PFNGLQUERYCOUNTERPROC; -} -pub type PFNGLGETQUERYOBJECTI64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjecti64v: PFNGLGETQUERYOBJECTI64VPROC; -} -pub type PFNGLGETQUERYOBJECTUI64VPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetQueryObjectui64v: PFNGLGETQUERYOBJECTUI64VPROC; -} -pub type PFNGLVERTEXATTRIBDIVISORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribDivisor: PFNGLVERTEXATTRIBDIVISORPROC; -} -pub type PFNGLVERTEXATTRIBP1UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP1ui: PFNGLVERTEXATTRIBP1UIPROC; -} -pub type PFNGLVERTEXATTRIBP1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP1uiv: PFNGLVERTEXATTRIBP1UIVPROC; -} -pub type PFNGLVERTEXATTRIBP2UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP2ui: PFNGLVERTEXATTRIBP2UIPROC; -} -pub type PFNGLVERTEXATTRIBP2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP2uiv: PFNGLVERTEXATTRIBP2UIVPROC; -} -pub type PFNGLVERTEXATTRIBP3UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP3ui: PFNGLVERTEXATTRIBP3UIPROC; -} -pub type PFNGLVERTEXATTRIBP3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP3uiv: PFNGLVERTEXATTRIBP3UIVPROC; -} -pub type PFNGLVERTEXATTRIBP4UIPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP4ui: PFNGLVERTEXATTRIBP4UIPROC; -} -pub type PFNGLVERTEXATTRIBP4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribP4uiv: PFNGLVERTEXATTRIBP4UIVPROC; -} -pub type PFNGLVERTEXP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP2ui: PFNGLVERTEXP2UIPROC; -} -pub type PFNGLVERTEXP2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP2uiv: PFNGLVERTEXP2UIVPROC; -} -pub type PFNGLVERTEXP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP3ui: PFNGLVERTEXP3UIPROC; -} -pub type PFNGLVERTEXP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP3uiv: PFNGLVERTEXP3UIVPROC; -} -pub type PFNGLVERTEXP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP4ui: PFNGLVERTEXP4UIPROC; -} -pub type PFNGLVERTEXP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexP4uiv: PFNGLVERTEXP4UIVPROC; -} -pub type PFNGLTEXCOORDP1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP1ui: PFNGLTEXCOORDP1UIPROC; -} -pub type PFNGLTEXCOORDP1UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP1uiv: PFNGLTEXCOORDP1UIVPROC; -} -pub type PFNGLTEXCOORDP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP2ui: PFNGLTEXCOORDP2UIPROC; -} -pub type PFNGLTEXCOORDP2UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP2uiv: PFNGLTEXCOORDP2UIVPROC; -} -pub type PFNGLTEXCOORDP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP3ui: PFNGLTEXCOORDP3UIPROC; -} -pub type PFNGLTEXCOORDP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP3uiv: PFNGLTEXCOORDP3UIVPROC; -} -pub type PFNGLTEXCOORDP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP4ui: PFNGLTEXCOORDP4UIPROC; -} -pub type PFNGLTEXCOORDP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glTexCoordP4uiv: PFNGLTEXCOORDP4UIVPROC; -} -pub type PFNGLMULTITEXCOORDP1UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP1ui: PFNGLMULTITEXCOORDP1UIPROC; -} -pub type PFNGLMULTITEXCOORDP1UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP1uiv: PFNGLMULTITEXCOORDP1UIVPROC; -} -pub type PFNGLMULTITEXCOORDP2UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP2ui: PFNGLMULTITEXCOORDP2UIPROC; -} -pub type PFNGLMULTITEXCOORDP2UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP2uiv: PFNGLMULTITEXCOORDP2UIVPROC; -} -pub type PFNGLMULTITEXCOORDP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP3ui: PFNGLMULTITEXCOORDP3UIPROC; -} -pub type PFNGLMULTITEXCOORDP3UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP3uiv: PFNGLMULTITEXCOORDP3UIVPROC; -} -pub type PFNGLMULTITEXCOORDP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glMultiTexCoordP4ui: PFNGLMULTITEXCOORDP4UIPROC; -} -pub type PFNGLMULTITEXCOORDP4UIVPROC = ::std::option::Option< - unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), ->; -extern "C" { - pub static mut glad_glMultiTexCoordP4uiv: PFNGLMULTITEXCOORDP4UIVPROC; -} -pub type PFNGLNORMALP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glNormalP3ui: PFNGLNORMALP3UIPROC; -} -pub type PFNGLNORMALP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glNormalP3uiv: PFNGLNORMALP3UIVPROC; -} -pub type PFNGLCOLORP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP3ui: PFNGLCOLORP3UIPROC; -} -pub type PFNGLCOLORP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP3uiv: PFNGLCOLORP3UIVPROC; -} -pub type PFNGLCOLORP4UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP4ui: PFNGLCOLORP4UIPROC; -} -pub type PFNGLCOLORP4UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glColorP4uiv: PFNGLCOLORP4UIVPROC; -} -pub type PFNGLSECONDARYCOLORP3UIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSecondaryColorP3ui: PFNGLSECONDARYCOLORP3UIPROC; -} -pub type PFNGLSECONDARYCOLORP3UIVPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSecondaryColorP3uiv: PFNGLSECONDARYCOLORP3UIVPROC; -} -extern "C" { - pub static mut GLAD_GL_AMD_debug_output: ::std::os::raw::c_int; -} -pub type PFNGLDEBUGMESSAGEENABLEAMDPROC = ::std::option::Option< - unsafe extern "C" fn( - category: GLenum, - severity: GLenum, - count: GLsizei, - ids: *const GLuint, - enabled: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageEnableAMD: PFNGLDEBUGMESSAGEENABLEAMDPROC; -} -pub type PFNGLDEBUGMESSAGEINSERTAMDPROC = ::std::option::Option< - unsafe extern "C" fn( - category: GLenum, - severity: GLenum, - id: GLuint, - length: GLsizei, - buf: *const GLchar, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageInsertAMD: PFNGLDEBUGMESSAGEINSERTAMDPROC; -} -pub type PFNGLDEBUGMESSAGECALLBACKAMDPROC = ::std::option::Option< - unsafe extern "C" fn(callback: GLDEBUGPROCAMD, userParam: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glDebugMessageCallbackAMD: PFNGLDEBUGMESSAGECALLBACKAMDPROC; -} -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 static mut glad_glGetDebugMessageLogAMD: PFNGLGETDEBUGMESSAGELOGAMDPROC; -} -extern "C" { - pub static mut GLAD_GL_AMD_query_buffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_ES2_compatibility: ::std::os::raw::c_int; -} -pub type PFNGLRELEASESHADERCOMPILERPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glReleaseShaderCompiler: PFNGLRELEASESHADERCOMPILERPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glShaderBinary: PFNGLSHADERBINARYPROC; -} -pub type PFNGLGETSHADERPRECISIONFORMATPROC = ::std::option::Option< - unsafe extern "C" fn( - shadertype: GLenum, - precisiontype: GLenum, - range: *mut GLint, - precision: *mut GLint, - ), ->; -extern "C" { - pub static mut glad_glGetShaderPrecisionFormat: PFNGLGETSHADERPRECISIONFORMATPROC; -} -pub type PFNGLDEPTHRANGEFPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDepthRangef: PFNGLDEPTHRANGEFPROC; -} -pub type PFNGLCLEARDEPTHFPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glClearDepthf: PFNGLCLEARDEPTHFPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_ES3_compatibility: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_buffer_storage: ::std::os::raw::c_int; -} -pub type PFNGLBUFFERSTORAGEPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - size: GLsizeiptr, - data: *const ::std::os::raw::c_void, - flags: GLbitfield, - ), ->; -extern "C" { - pub static mut glad_glBufferStorage: PFNGLBUFFERSTORAGEPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_compatibility: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_compressed_texture_pixel_storage: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_debug_output: ::std::os::raw::c_int; -} -pub type PFNGLDEBUGMESSAGECONTROLARBPROC = ::std::option::Option< - unsafe extern "C" fn( - source: GLenum, - type_: GLenum, - severity: GLenum, - count: GLsizei, - ids: *const GLuint, - enabled: GLboolean, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageControlARB: PFNGLDEBUGMESSAGECONTROLARBPROC; -} -pub type PFNGLDEBUGMESSAGEINSERTARBPROC = ::std::option::Option< - unsafe extern "C" fn( - source: GLenum, - type_: GLenum, - id: GLuint, - severity: GLenum, - length: GLsizei, - buf: *const GLchar, - ), ->; -extern "C" { - pub static mut glad_glDebugMessageInsertARB: PFNGLDEBUGMESSAGEINSERTARBPROC; -} -pub type PFNGLDEBUGMESSAGECALLBACKARBPROC = ::std::option::Option< - unsafe extern "C" fn(callback: GLDEBUGPROCARB, userParam: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glDebugMessageCallbackARB: PFNGLDEBUGMESSAGECALLBACKARBPROC; -} -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 static mut glad_glGetDebugMessageLogARB: PFNGLGETDEBUGMESSAGELOGARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_buffer_float: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_clamp: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_depth_texture: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_draw_buffers: ::std::os::raw::c_int; -} -pub type PFNGLDRAWBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawBuffersARB: PFNGLDRAWBUFFERSARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_draw_buffers_blend: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationiARB: PFNGLBLENDEQUATIONIARBPROC; -} -pub type PFNGLBLENDEQUATIONSEPARATEIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparateiARB: PFNGLBLENDEQUATIONSEPARATEIARBPROC; -} -pub type PFNGLBLENDFUNCIARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendFunciARB: PFNGLBLENDFUNCIARBPROC; -} -pub type PFNGLBLENDFUNCSEPARATEIARBPROC = ::std::option::Option< - unsafe extern "C" fn( - buf: GLuint, - srcRGB: GLenum, - dstRGB: GLenum, - srcAlpha: GLenum, - dstAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparateiARB: PFNGLBLENDFUNCSEPARATEIARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_explicit_attrib_location: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_explicit_uniform_location: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_fragment_program: ::std::os::raw::c_int; -} -pub type PFNGLPROGRAMSTRINGARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - format: GLenum, - len: GLsizei, - string: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glProgramStringARB: PFNGLPROGRAMSTRINGARBPROC; -} -pub type PFNGLBINDPROGRAMARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindProgramARB: PFNGLBINDPROGRAMARBPROC; -} -pub type PFNGLDELETEPROGRAMSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteProgramsARB: PFNGLDELETEPROGRAMSARBPROC; -} -pub type PFNGLGENPROGRAMSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenProgramsARB: PFNGLGENPROGRAMSARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4DARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLdouble, - y: GLdouble, - z: GLdouble, - w: GLdouble, - ), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4dARB: PFNGLPROGRAMENVPARAMETER4DARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4DVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4dvARB: PFNGLPROGRAMENVPARAMETER4DVARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4FARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLfloat, - y: GLfloat, - z: GLfloat, - w: GLfloat, - ), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4fARB: PFNGLPROGRAMENVPARAMETER4FARBPROC; -} -pub type PFNGLPROGRAMENVPARAMETER4FVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glProgramEnvParameter4fvARB: PFNGLPROGRAMENVPARAMETER4FVARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4DARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLdouble, - y: GLdouble, - z: GLdouble, - w: GLdouble, - ), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4dARB: PFNGLPROGRAMLOCALPARAMETER4DARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4DVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4dvARB: PFNGLPROGRAMLOCALPARAMETER4DVARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4FARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - index: GLuint, - x: GLfloat, - y: GLfloat, - z: GLfloat, - w: GLfloat, - ), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4fARB: PFNGLPROGRAMLOCALPARAMETER4FARBPROC; -} -pub type PFNGLPROGRAMLOCALPARAMETER4FVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), ->; -extern "C" { - pub static mut glad_glProgramLocalParameter4fvARB: PFNGLPROGRAMLOCALPARAMETER4FVARBPROC; -} -pub type PFNGLGETPROGRAMENVPARAMETERDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetProgramEnvParameterdvARB: PFNGLGETPROGRAMENVPARAMETERDVARBPROC; -} -pub type PFNGLGETPROGRAMENVPARAMETERFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetProgramEnvParameterfvARB: PFNGLGETPROGRAMENVPARAMETERFVARBPROC; -} -pub type PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetProgramLocalParameterdvARB: PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC; -} -pub type PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetProgramLocalParameterfvARB: PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC; -} -pub type PFNGLGETPROGRAMIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetProgramivARB: PFNGLGETPROGRAMIVARBPROC; -} -pub type PFNGLGETPROGRAMSTRINGARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, pname: GLenum, string: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetProgramStringARB: PFNGLGETPROGRAMSTRINGARBPROC; -} -pub type PFNGLISPROGRAMARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsProgramARB: PFNGLISPROGRAMARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_fragment_shader: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_framebuffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_framebuffer_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_multisample: ::std::os::raw::c_int; -} -pub type PFNGLSAMPLECOVERAGEARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleCoverageARB: PFNGLSAMPLECOVERAGEARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_sample_locations: ::std::os::raw::c_int; -} -pub type PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, start: GLuint, count: GLsizei, v: *const GLfloat), ->; -extern "C" { - pub static mut glad_glFramebufferSampleLocationsfvARB: PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC; -} -pub type PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< - unsafe extern "C" fn(framebuffer: GLuint, start: GLuint, count: GLsizei, v: *const GLfloat), ->; -extern "C" { - pub static mut glad_glNamedFramebufferSampleLocationsfvARB: - PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC; -} -pub type PFNGLEVALUATEDEPTHVALUESARBPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEvaluateDepthValuesARB: PFNGLEVALUATEDEPTHVALUESARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_compression: ::std::os::raw::c_int; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage3DARB: PFNGLCOMPRESSEDTEXIMAGE3DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage2DARB: PFNGLCOMPRESSEDTEXIMAGE2DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexImage1DARB: PFNGLCOMPRESSEDTEXIMAGE1DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage3DARB: PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage2DARB: PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glCompressedTexSubImage1DARB: PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC; -} -pub type PFNGLGETCOMPRESSEDTEXIMAGEARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, level: GLint, img: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetCompressedTexImageARB: PFNGLGETCOMPRESSEDTEXIMAGEARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_float: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_multisample: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_non_power_of_two: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_rg: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_texture_swizzle: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_uniform_buffer_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_array_object: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_attrib_binding: ::std::os::raw::c_int; -} -pub type PFNGLBINDVERTEXBUFFERPROC = ::std::option::Option< - unsafe extern "C" fn(bindingindex: GLuint, buffer: GLuint, offset: GLintptr, stride: GLsizei), ->; -extern "C" { - pub static mut glad_glBindVertexBuffer: PFNGLBINDVERTEXBUFFERPROC; -} -pub type PFNGLVERTEXATTRIBFORMATPROC = ::std::option::Option< - unsafe extern "C" fn( - attribindex: GLuint, - size: GLint, - type_: GLenum, - normalized: GLboolean, - relativeoffset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribFormat: PFNGLVERTEXATTRIBFORMATPROC; -} -pub type PFNGLVERTEXATTRIBIFORMATPROC = ::std::option::Option< - unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribIFormat: PFNGLVERTEXATTRIBIFORMATPROC; -} -pub type PFNGLVERTEXATTRIBLFORMATPROC = ::std::option::Option< - unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), ->; -extern "C" { - pub static mut glad_glVertexAttribLFormat: PFNGLVERTEXATTRIBLFORMATPROC; -} -pub type PFNGLVERTEXATTRIBBINDINGPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttribBinding: PFNGLVERTEXATTRIBBINDINGPROC; -} -pub type PFNGLVERTEXBINDINGDIVISORPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexBindingDivisor: PFNGLVERTEXBINDINGDIVISORPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_buffer_object: ::std::os::raw::c_int; -} -pub type PFNGLBINDBUFFERARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindBufferARB: PFNGLBINDBUFFERARBPROC; -} -pub type PFNGLDELETEBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteBuffersARB: PFNGLDELETEBUFFERSARBPROC; -} -pub type PFNGLGENBUFFERSARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenBuffersARB: PFNGLGENBUFFERSARBPROC; -} -pub type PFNGLISBUFFERARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsBufferARB: PFNGLISBUFFERARBPROC; -} -pub type PFNGLBUFFERDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - size: GLsizeiptrARB, - data: *const ::std::os::raw::c_void, - usage: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBufferDataARB: PFNGLBUFFERDATAARBPROC; -} -pub type PFNGLBUFFERSUBDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptrARB, - size: GLsizeiptrARB, - data: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glBufferSubDataARB: PFNGLBUFFERSUBDATAARBPROC; -} -pub type PFNGLGETBUFFERSUBDATAARBPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - offset: GLintptrARB, - size: GLsizeiptrARB, - data: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glGetBufferSubDataARB: PFNGLGETBUFFERSUBDATAARBPROC; -} -pub type PFNGLMAPBUFFERARBPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, ->; -extern "C" { - pub static mut glad_glMapBufferARB: PFNGLMAPBUFFERARBPROC; -} -pub type PFNGLUNMAPBUFFERARBPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glUnmapBufferARB: PFNGLUNMAPBUFFERARBPROC; -} -pub type PFNGLGETBUFFERPARAMETERIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetBufferParameterivARB: PFNGLGETBUFFERPARAMETERIVARBPROC; -} -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 static mut glad_glGetBufferPointervARB: PFNGLGETBUFFERPOINTERVARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_program: ::std::os::raw::c_int; -} -pub type PFNGLVERTEXATTRIB1DARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dARB: PFNGLVERTEXATTRIB1DARBPROC; -} -pub type PFNGLVERTEXATTRIB1DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1dvARB: PFNGLVERTEXATTRIB1DVARBPROC; -} -pub type PFNGLVERTEXATTRIB1FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fARB: PFNGLVERTEXATTRIB1FARBPROC; -} -pub type PFNGLVERTEXATTRIB1FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1fvARB: PFNGLVERTEXATTRIB1FVARBPROC; -} -pub type PFNGLVERTEXATTRIB1SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1sARB: PFNGLVERTEXATTRIB1SARBPROC; -} -pub type PFNGLVERTEXATTRIB1SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib1svARB: PFNGLVERTEXATTRIB1SVARBPROC; -} -pub type PFNGLVERTEXATTRIB2DARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dARB: PFNGLVERTEXATTRIB2DARBPROC; -} -pub type PFNGLVERTEXATTRIB2DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2dvARB: PFNGLVERTEXATTRIB2DVARBPROC; -} -pub type PFNGLVERTEXATTRIB2FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fARB: PFNGLVERTEXATTRIB2FARBPROC; -} -pub type PFNGLVERTEXATTRIB2FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2fvARB: PFNGLVERTEXATTRIB2FVARBPROC; -} -pub type PFNGLVERTEXATTRIB2SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2sARB: PFNGLVERTEXATTRIB2SARBPROC; -} -pub type PFNGLVERTEXATTRIB2SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib2svARB: PFNGLVERTEXATTRIB2SVARBPROC; -} -pub type PFNGLVERTEXATTRIB3DARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib3dARB: PFNGLVERTEXATTRIB3DARBPROC; -} -pub type PFNGLVERTEXATTRIB3DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3dvARB: PFNGLVERTEXATTRIB3DVARBPROC; -} -pub type PFNGLVERTEXATTRIB3FARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fARB: PFNGLVERTEXATTRIB3FARBPROC; -} -pub type PFNGLVERTEXATTRIB3FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3fvARB: PFNGLVERTEXATTRIB3FVARBPROC; -} -pub type PFNGLVERTEXATTRIB3SARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3sARB: PFNGLVERTEXATTRIB3SARBPROC; -} -pub type PFNGLVERTEXATTRIB3SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib3svARB: PFNGLVERTEXATTRIB3SVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NbvARB: PFNGLVERTEXATTRIB4NBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NivARB: PFNGLVERTEXATTRIB4NIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NSVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NsvARB: PFNGLVERTEXATTRIB4NSVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), ->; -extern "C" { - pub static mut glad_glVertexAttrib4NubARB: PFNGLVERTEXATTRIB4NUBARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NubvARB: PFNGLVERTEXATTRIB4NUBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NuivARB: PFNGLVERTEXATTRIB4NUIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4NUSVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4NusvARB: PFNGLVERTEXATTRIB4NUSVARBPROC; -} -pub type PFNGLVERTEXATTRIB4BVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4bvARB: PFNGLVERTEXATTRIB4BVARBPROC; -} -pub type PFNGLVERTEXATTRIB4DARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), ->; -extern "C" { - pub static mut glad_glVertexAttrib4dARB: PFNGLVERTEXATTRIB4DARBPROC; -} -pub type PFNGLVERTEXATTRIB4DVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4dvARB: PFNGLVERTEXATTRIB4DVARBPROC; -} -pub type PFNGLVERTEXATTRIB4FARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), ->; -extern "C" { - pub static mut glad_glVertexAttrib4fARB: PFNGLVERTEXATTRIB4FARBPROC; -} -pub type PFNGLVERTEXATTRIB4FVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4fvARB: PFNGLVERTEXATTRIB4FVARBPROC; -} -pub type PFNGLVERTEXATTRIB4IVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ivARB: PFNGLVERTEXATTRIB4IVARBPROC; -} -pub type PFNGLVERTEXATTRIB4SARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), ->; -extern "C" { - pub static mut glad_glVertexAttrib4sARB: PFNGLVERTEXATTRIB4SARBPROC; -} -pub type PFNGLVERTEXATTRIB4SVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4svARB: PFNGLVERTEXATTRIB4SVARBPROC; -} -pub type PFNGLVERTEXATTRIB4UBVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4ubvARB: PFNGLVERTEXATTRIB4UBVARBPROC; -} -pub type PFNGLVERTEXATTRIB4UIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4uivARB: PFNGLVERTEXATTRIB4UIVARBPROC; -} -pub type PFNGLVERTEXATTRIB4USVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVertexAttrib4usvARB: PFNGLVERTEXATTRIB4USVARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glVertexAttribPointerARB: PFNGLVERTEXATTRIBPOINTERARBPROC; -} -pub type PFNGLENABLEVERTEXATTRIBARRAYARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVertexAttribArrayARB: PFNGLENABLEVERTEXATTRIBARRAYARBPROC; -} -pub type PFNGLDISABLEVERTEXATTRIBARRAYARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVertexAttribArrayARB: PFNGLDISABLEVERTEXATTRIBARRAYARBPROC; -} -pub type PFNGLGETVERTEXATTRIBDVARBPROC = ::std::option::Option< - unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), ->; -extern "C" { - pub static mut glad_glGetVertexAttribdvARB: PFNGLGETVERTEXATTRIBDVARBPROC; -} -pub type PFNGLGETVERTEXATTRIBFVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribfvARB: PFNGLGETVERTEXATTRIBFVARBPROC; -} -pub type PFNGLGETVERTEXATTRIBIVARBPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVertexAttribivARB: PFNGLGETVERTEXATTRIBIVARBPROC; -} -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 static mut glad_glGetVertexAttribPointervARB: PFNGLGETVERTEXATTRIBPOINTERVARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ARB_vertex_shader: ::std::os::raw::c_int; -} -pub type PFNGLBINDATTRIBLOCATIONARBPROC = ::std::option::Option< - unsafe extern "C" fn(programObj: GLhandleARB, index: GLuint, name: *const GLcharARB), ->; -extern "C" { - pub static mut glad_glBindAttribLocationARB: PFNGLBINDATTRIBLOCATIONARBPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glGetActiveAttribARB: PFNGLGETACTIVEATTRIBARBPROC; -} -pub type PFNGLGETATTRIBLOCATIONARBPROC = ::std::option::Option< - unsafe extern "C" fn(programObj: GLhandleARB, name: *const GLcharARB) -> GLint, ->; -extern "C" { - pub static mut glad_glGetAttribLocationARB: PFNGLGETATTRIBLOCATIONARBPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_element_array: ::std::os::raw::c_int; -} -pub type PFNGLELEMENTPOINTERATIPROC = ::std::option::Option< - unsafe extern "C" fn(type_: GLenum, pointer: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glElementPointerATI: PFNGLELEMENTPOINTERATIPROC; -} -pub type PFNGLDRAWELEMENTARRAYATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawElementArrayATI: PFNGLDRAWELEMENTARRAYATIPROC; -} -pub type PFNGLDRAWRANGEELEMENTARRAYATIPROC = ::std::option::Option< - unsafe extern "C" fn(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei), ->; -extern "C" { - pub static mut glad_glDrawRangeElementArrayATI: PFNGLDRAWRANGEELEMENTARRAYATIPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_fragment_shader: ::std::os::raw::c_int; -} -pub type PFNGLGENFRAGMENTSHADERSATIPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glGenFragmentShadersATI: PFNGLGENFRAGMENTSHADERSATIPROC; -} -pub type PFNGLBINDFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindFragmentShaderATI: PFNGLBINDFRAGMENTSHADERATIPROC; -} -pub type PFNGLDELETEFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFragmentShaderATI: PFNGLDELETEFRAGMENTSHADERATIPROC; -} -pub type PFNGLBEGINFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBeginFragmentShaderATI: PFNGLBEGINFRAGMENTSHADERATIPROC; -} -pub type PFNGLENDFRAGMENTSHADERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndFragmentShaderATI: PFNGLENDFRAGMENTSHADERATIPROC; -} -pub type PFNGLPASSTEXCOORDATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPassTexCoordATI: PFNGLPASSTEXCOORDATIPROC; -} -pub type PFNGLSAMPLEMAPATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSampleMapATI: PFNGLSAMPLEMAPATIPROC; -} -pub type PFNGLCOLORFRAGMENTOP1ATIPROC = ::std::option::Option< - unsafe extern "C" fn( - op: GLenum, - dst: GLuint, - dstMask: GLuint, - dstMod: GLuint, - arg1: GLuint, - arg1Rep: GLuint, - arg1Mod: GLuint, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp1ATI: PFNGLCOLORFRAGMENTOP1ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp2ATI: PFNGLCOLORFRAGMENTOP2ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorFragmentOp3ATI: PFNGLCOLORFRAGMENTOP3ATIPROC; -} -pub type PFNGLALPHAFRAGMENTOP1ATIPROC = ::std::option::Option< - unsafe extern "C" fn( - op: GLenum, - dst: GLuint, - dstMod: GLuint, - arg1: GLuint, - arg1Rep: GLuint, - arg1Mod: GLuint, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp1ATI: PFNGLALPHAFRAGMENTOP1ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp2ATI: PFNGLALPHAFRAGMENTOP2ATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glAlphaFragmentOp3ATI: PFNGLALPHAFRAGMENTOP3ATIPROC; -} -pub type PFNGLSETFRAGMENTSHADERCONSTANTATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glSetFragmentShaderConstantATI: PFNGLSETFRAGMENTSHADERCONSTANTATIPROC; -} -extern "C" { - pub static mut GLAD_GL_ATI_vertex_array_object: ::std::os::raw::c_int; -} -pub type PFNGLNEWOBJECTBUFFERATIPROC = ::std::option::Option< - unsafe extern "C" fn( - size: GLsizei, - pointer: *const ::std::os::raw::c_void, - usage: GLenum, - ) -> GLuint, ->; -extern "C" { - pub static mut glad_glNewObjectBufferATI: PFNGLNEWOBJECTBUFFERATIPROC; -} -pub type PFNGLISOBJECTBUFFERATIPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsObjectBufferATI: PFNGLISOBJECTBUFFERATIPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glUpdateObjectBufferATI: PFNGLUPDATEOBJECTBUFFERATIPROC; -} -pub type PFNGLGETOBJECTBUFFERFVATIPROC = ::std::option::Option< - unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut GLfloat), ->; -extern "C" { - pub static mut glad_glGetObjectBufferfvATI: PFNGLGETOBJECTBUFFERFVATIPROC; -} -pub type PFNGLGETOBJECTBUFFERIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetObjectBufferivATI: PFNGLGETOBJECTBUFFERIVATIPROC; -} -pub type PFNGLFREEOBJECTBUFFERATIPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glFreeObjectBufferATI: PFNGLFREEOBJECTBUFFERATIPROC; -} -pub type PFNGLARRAYOBJECTATIPROC = ::std::option::Option< - unsafe extern "C" fn( - array: GLenum, - size: GLint, - type_: GLenum, - stride: GLsizei, - buffer: GLuint, - offset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glArrayObjectATI: PFNGLARRAYOBJECTATIPROC; -} -pub type PFNGLGETARRAYOBJECTFVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetArrayObjectfvATI: PFNGLGETARRAYOBJECTFVATIPROC; -} -pub type PFNGLGETARRAYOBJECTIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetArrayObjectivATI: PFNGLGETARRAYOBJECTIVATIPROC; -} -pub type PFNGLVARIANTARRAYOBJECTATIPROC = ::std::option::Option< - unsafe extern "C" fn( - id: GLuint, - type_: GLenum, - stride: GLsizei, - buffer: GLuint, - offset: GLuint, - ), ->; -extern "C" { - pub static mut glad_glVariantArrayObjectATI: PFNGLVARIANTARRAYOBJECTATIPROC; -} -pub type PFNGLGETVARIANTARRAYOBJECTFVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantArrayObjectfvATI: PFNGLGETVARIANTARRAYOBJECTFVATIPROC; -} -pub type PFNGLGETVARIANTARRAYOBJECTIVATIPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantArrayObjectivATI: PFNGLGETVARIANTARRAYOBJECTIVATIPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_color: ::std::os::raw::c_int; -} -pub type PFNGLBLENDCOLOREXTPROC = ::std::option::Option< - unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), ->; -extern "C" { - pub static mut glad_glBlendColorEXT: PFNGLBLENDCOLOREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_equation_separate: ::std::os::raw::c_int; -} -pub type PFNGLBLENDEQUATIONSEPARATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBlendEquationSeparateEXT: PFNGLBLENDEQUATIONSEPARATEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_blend_func_separate: ::std::os::raw::c_int; -} -pub type PFNGLBLENDFUNCSEPARATEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - sfactorRGB: GLenum, - dfactorRGB: GLenum, - sfactorAlpha: GLenum, - dfactorAlpha: GLenum, - ), ->; -extern "C" { - pub static mut glad_glBlendFuncSeparateEXT: PFNGLBLENDFUNCSEPARATEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_debug_marker: ::std::os::raw::c_int; -} -pub type PFNGLINSERTEVENTMARKEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glInsertEventMarkerEXT: PFNGLINSERTEVENTMARKEREXTPROC; -} -pub type PFNGLPUSHGROUPMARKEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glPushGroupMarkerEXT: PFNGLPUSHGROUPMARKEREXTPROC; -} -pub type PFNGLPOPGROUPMARKEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glPopGroupMarkerEXT: PFNGLPOPGROUPMARKEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_blit: ::std::os::raw::c_int; -} -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 static mut glad_glBlitFramebufferEXT: PFNGLBLITFRAMEBUFFEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_multisample: ::std::os::raw::c_int; -} -pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - samples: GLsizei, - internalformat: GLenum, - width: GLsizei, - height: GLsizei, - ), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageMultisampleEXT: - PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_multisample_blit_scaled: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_object: ::std::os::raw::c_int; -} -pub type PFNGLISRENDERBUFFEREXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsRenderbufferEXT: PFNGLISRENDERBUFFEREXTPROC; -} -pub type PFNGLBINDRENDERBUFFEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindRenderbufferEXT: PFNGLBINDRENDERBUFFEREXTPROC; -} -pub type PFNGLDELETERENDERBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteRenderbuffersEXT: PFNGLDELETERENDERBUFFERSEXTPROC; -} -pub type PFNGLGENRENDERBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenRenderbuffersEXT: PFNGLGENRENDERBUFFERSEXTPROC; -} -pub type PFNGLRENDERBUFFERSTORAGEEXTPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), ->; -extern "C" { - pub static mut glad_glRenderbufferStorageEXT: PFNGLRENDERBUFFERSTORAGEEXTPROC; -} -pub type PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetRenderbufferParameterivEXT: PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC; -} -pub type PFNGLISFRAMEBUFFEREXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsFramebufferEXT: PFNGLISFRAMEBUFFEREXTPROC; -} -pub type PFNGLBINDFRAMEBUFFEREXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glBindFramebufferEXT: PFNGLBINDFRAMEBUFFEREXTPROC; -} -pub type PFNGLDELETEFRAMEBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteFramebuffersEXT: PFNGLDELETEFRAMEBUFFERSEXTPROC; -} -pub type PFNGLGENFRAMEBUFFERSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGenFramebuffersEXT: PFNGLGENFRAMEBUFFERSEXTPROC; -} -pub type PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC = - ::std::option::Option GLenum>; -extern "C" { - pub static mut glad_glCheckFramebufferStatusEXT: PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE1DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture1DEXT: PFNGLFRAMEBUFFERTEXTURE1DEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE2DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture2DEXT: PFNGLFRAMEBUFFERTEXTURE2DEXTPROC; -} -pub type PFNGLFRAMEBUFFERTEXTURE3DEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - textarget: GLenum, - texture: GLuint, - level: GLint, - zoffset: GLint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferTexture3DEXT: PFNGLFRAMEBUFFERTEXTURE3DEXTPROC; -} -pub type PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - target: GLenum, - attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint, - ), ->; -extern "C" { - pub static mut glad_glFramebufferRenderbufferEXT: PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC; -} -pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), ->; -extern "C" { - pub static mut glad_glGetFramebufferAttachmentParameterivEXT: - PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC; -} -pub type PFNGLGENERATEMIPMAPEXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glGenerateMipmapEXT: PFNGLGENERATEMIPMAPEXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_framebuffer_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_index_array_formats: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_compression_s3tc: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_sRGB: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_texture_swizzle: ::std::os::raw::c_int; -} -extern "C" { - pub static mut GLAD_GL_EXT_vertex_array: ::std::os::raw::c_int; -} -pub type PFNGLARRAYELEMENTEXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glArrayElementEXT: PFNGLARRAYELEMENTEXTPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glColorPointerEXT: PFNGLCOLORPOINTEREXTPROC; -} -pub type PFNGLDRAWARRAYSEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDrawArraysEXT: PFNGLDRAWARRAYSEXTPROC; -} -pub type PFNGLEDGEFLAGPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn(stride: GLsizei, count: GLsizei, pointer: *const GLboolean), ->; -extern "C" { - pub static mut glad_glEdgeFlagPointerEXT: PFNGLEDGEFLAGPOINTEREXTPROC; -} -pub type PFNGLGETPOINTERVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(pname: GLenum, params: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetPointervEXT: PFNGLGETPOINTERVEXTPROC; -} -pub type PFNGLINDEXPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - type_: GLenum, - stride: GLsizei, - count: GLsizei, - pointer: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glIndexPointerEXT: PFNGLINDEXPOINTEREXTPROC; -} -pub type PFNGLNORMALPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - type_: GLenum, - stride: GLsizei, - count: GLsizei, - pointer: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glNormalPointerEXT: PFNGLNORMALPOINTEREXTPROC; -} -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, - ), ->; -extern "C" { - pub static mut glad_glTexCoordPointerEXT: PFNGLTEXCOORDPOINTEREXTPROC; -} -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 static mut glad_glVertexPointerEXT: PFNGLVERTEXPOINTEREXTPROC; -} -extern "C" { - pub static mut GLAD_GL_EXT_vertex_shader: ::std::os::raw::c_int; -} -pub type PFNGLBEGINVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBeginVertexShaderEXT: PFNGLBEGINVERTEXSHADEREXTPROC; -} -pub type PFNGLENDVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glEndVertexShaderEXT: PFNGLENDVERTEXSHADEREXTPROC; -} -pub type PFNGLBINDVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glBindVertexShaderEXT: PFNGLBINDVERTEXSHADEREXTPROC; -} -pub type PFNGLGENVERTEXSHADERSEXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glGenVertexShadersEXT: PFNGLGENVERTEXSHADERSEXTPROC; -} -pub type PFNGLDELETEVERTEXSHADEREXTPROC = ::std::option::Option; -extern "C" { - pub static mut glad_glDeleteVertexShaderEXT: PFNGLDELETEVERTEXSHADEREXTPROC; -} -pub type PFNGLSHADEROP1EXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glShaderOp1EXT: PFNGLSHADEROP1EXTPROC; -} -pub type PFNGLSHADEROP2EXTPROC = ::std::option::Option< - unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint), ->; -extern "C" { - pub static mut glad_glShaderOp2EXT: PFNGLSHADEROP2EXTPROC; -} -pub type PFNGLSHADEROP3EXTPROC = ::std::option::Option< - unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint, arg3: GLuint), ->; -extern "C" { - pub static mut glad_glShaderOp3EXT: PFNGLSHADEROP3EXTPROC; -} -pub type PFNGLSWIZZLEEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - res: GLuint, - in_: GLuint, - outX: GLenum, - outY: GLenum, - outZ: GLenum, - outW: GLenum, - ), ->; -extern "C" { - pub static mut glad_glSwizzleEXT: PFNGLSWIZZLEEXTPROC; -} -pub type PFNGLWRITEMASKEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - res: GLuint, - in_: GLuint, - outX: GLenum, - outY: GLenum, - outZ: GLenum, - outW: GLenum, - ), ->; -extern "C" { - pub static mut glad_glWriteMaskEXT: PFNGLWRITEMASKEXTPROC; -} -pub type PFNGLINSERTCOMPONENTEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glInsertComponentEXT: PFNGLINSERTCOMPONENTEXTPROC; -} -pub type PFNGLEXTRACTCOMPONENTEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glExtractComponentEXT: PFNGLEXTRACTCOMPONENTEXTPROC; -} -pub type PFNGLGENSYMBOLSEXTPROC = ::std::option::Option< - unsafe extern "C" fn( - datatype: GLenum, - storagetype: GLenum, - range: GLenum, - components: GLuint, - ) -> GLuint, ->; -extern "C" { - pub static mut glad_glGenSymbolsEXT: PFNGLGENSYMBOLSEXTPROC; -} -pub type PFNGLSETINVARIANTEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glSetInvariantEXT: PFNGLSETINVARIANTEXTPROC; -} -pub type PFNGLSETLOCALCONSTANTEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glSetLocalConstantEXT: PFNGLSETLOCALCONSTANTEXTPROC; -} -pub type PFNGLVARIANTBVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantbvEXT: PFNGLVARIANTBVEXTPROC; -} -pub type PFNGLVARIANTSVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantsvEXT: PFNGLVARIANTSVEXTPROC; -} -pub type PFNGLVARIANTIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantivEXT: PFNGLVARIANTIVEXTPROC; -} -pub type PFNGLVARIANTFVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantfvEXT: PFNGLVARIANTFVEXTPROC; -} -pub type PFNGLVARIANTDVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantdvEXT: PFNGLVARIANTDVEXTPROC; -} -pub type PFNGLVARIANTUBVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantubvEXT: PFNGLVARIANTUBVEXTPROC; -} -pub type PFNGLVARIANTUSVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantusvEXT: PFNGLVARIANTUSVEXTPROC; -} -pub type PFNGLVARIANTUIVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glVariantuivEXT: PFNGLVARIANTUIVEXTPROC; -} -pub type PFNGLVARIANTPOINTEREXTPROC = ::std::option::Option< - unsafe extern "C" fn( - id: GLuint, - type_: GLenum, - stride: GLuint, - addr: *const ::std::os::raw::c_void, - ), ->; -extern "C" { - pub static mut glad_glVariantPointerEXT: PFNGLVARIANTPOINTEREXTPROC; -} -pub type PFNGLENABLEVARIANTCLIENTSTATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glEnableVariantClientStateEXT: PFNGLENABLEVARIANTCLIENTSTATEEXTPROC; -} -pub type PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glDisableVariantClientStateEXT: PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC; -} -pub type PFNGLBINDLIGHTPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindLightParameterEXT: PFNGLBINDLIGHTPARAMETEREXTPROC; -} -pub type PFNGLBINDMATERIALPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindMaterialParameterEXT: PFNGLBINDMATERIALPARAMETEREXTPROC; -} -pub type PFNGLBINDTEXGENPARAMETEREXTPROC = ::std::option::Option< - unsafe extern "C" fn(unit: GLenum, coord: GLenum, value: GLenum) -> GLuint, ->; -extern "C" { - pub static mut glad_glBindTexGenParameterEXT: PFNGLBINDTEXGENPARAMETEREXTPROC; -} -pub type PFNGLBINDTEXTUREUNITPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindTextureUnitParameterEXT: PFNGLBINDTEXTUREUNITPARAMETEREXTPROC; -} -pub type PFNGLBINDPARAMETEREXTPROC = - ::std::option::Option GLuint>; -extern "C" { - pub static mut glad_glBindParameterEXT: PFNGLBINDPARAMETEREXTPROC; -} -pub type PFNGLISVARIANTENABLEDEXTPROC = - ::std::option::Option GLboolean>; -extern "C" { - pub static mut glad_glIsVariantEnabledEXT: PFNGLISVARIANTENABLEDEXTPROC; -} -pub type PFNGLGETVARIANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantBooleanvEXT: PFNGLGETVARIANTBOOLEANVEXTPROC; -} -pub type PFNGLGETVARIANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantIntegervEXT: PFNGLGETVARIANTINTEGERVEXTPROC; -} -pub type PFNGLGETVARIANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetVariantFloatvEXT: PFNGLGETVARIANTFLOATVEXTPROC; -} -pub type PFNGLGETVARIANTPOINTERVEXTPROC = ::std::option::Option< - unsafe extern "C" fn(id: GLuint, value: GLenum, data: *mut *mut ::std::os::raw::c_void), ->; -extern "C" { - pub static mut glad_glGetVariantPointervEXT: PFNGLGETVARIANTPOINTERVEXTPROC; -} -pub type PFNGLGETINVARIANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantBooleanvEXT: PFNGLGETINVARIANTBOOLEANVEXTPROC; -} -pub type PFNGLGETINVARIANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantIntegervEXT: PFNGLGETINVARIANTINTEGERVEXTPROC; -} -pub type PFNGLGETINVARIANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetInvariantFloatvEXT: PFNGLGETINVARIANTFLOATVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantBooleanvEXT: PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTINTEGERVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantIntegervEXT: PFNGLGETLOCALCONSTANTINTEGERVEXTPROC; -} -pub type PFNGLGETLOCALCONSTANTFLOATVEXTPROC = - ::std::option::Option; -extern "C" { - pub static mut glad_glGetLocalConstantFloatvEXT: PFNGLGETLOCALCONSTANTFLOATVEXTPROC; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _iobuf { - pub _Placeholder: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__iobuf() { - assert_eq!( - ::std::mem::size_of::<_iobuf>(), - 8usize, - concat!("Size of: ", stringify!(_iobuf)) - ); - assert_eq!( - ::std::mem::align_of::<_iobuf>(), - 8usize, - concat!("Alignment of ", stringify!(_iobuf)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_iobuf>()))._Placeholder as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_iobuf), - "::", - stringify!(_Placeholder) - ) - ); -} -pub type FILE = _iobuf; -extern "C" { - pub fn __acrt_iob_func(_Ix: ::std::os::raw::c_uint) -> *mut FILE; -} -extern "C" { - pub fn fgetwc(_Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _fgetwchar() -> wint_t; -} -extern "C" { - pub fn fputwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _fputwchar(_Character: wchar_t) -> wint_t; -} -extern "C" { - pub fn getwc(_Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn getwchar() -> wint_t; -} -extern "C" { - pub fn fgetws( - _Buffer: *mut wchar_t, - _BufferCount: ::std::os::raw::c_int, - _Stream: *mut FILE, - ) -> *mut wchar_t; -} -extern "C" { - pub fn fputws(_Buffer: *const wchar_t, _Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _getws_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> *mut wchar_t; -} -extern "C" { - pub fn putwc(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn putwchar(_Character: wchar_t) -> wint_t; -} -extern "C" { - pub fn _putws(_Buffer: *const wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetwc(_Character: wint_t, _Stream: *mut FILE) -> wint_t; -} -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 _wfopen_s( - _Stream: *mut *mut FILE, - _FileName: *const wchar_t, - _Mode: *const wchar_t, - ) -> errno_t; -} -extern "C" { - pub fn _wfreopen( - _FileName: *const wchar_t, - _Mode: *const wchar_t, - _OldStream: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn _wfreopen_s( - _Stream: *mut *mut FILE, - _FileName: *const wchar_t, - _Mode: *const wchar_t, - _OldStream: *mut FILE, - ) -> errno_t; -} -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 _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 _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _wtmpnam_s(_Buffer: *mut wchar_t, _BufferCount: size_t) -> errno_t; -} -extern "C" { - pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; -} -extern "C" { - pub fn _fgetwc_nolock(_Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _fputwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _getwc_nolock(_Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _putwc_nolock(_Character: wchar_t, _Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn _ungetwc_nolock(_Character: wint_t, _Stream: *mut FILE) -> wint_t; -} -extern "C" { - pub fn __stdio_common_vfwprintf( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfwprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfwprintf_p( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfwscanf( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vswprintf( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vswprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsnwprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _MaxCount: size_t, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vswprintf_p( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut wchar_t, - _BufferCount: size_t, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vswscanf( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *const wchar_t, - _BufferCount: size_t, - _Format: *const wchar_t, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -pub type fpos_t = ::std::os::raw::c_longlong; -extern "C" { - pub fn _get_stream_buffer_pointers( - _Stream: *mut FILE, - _Base: *mut *mut *mut ::std::os::raw::c_char, - _Pointer: *mut *mut *mut ::std::os::raw::c_char, - _Count: *mut *mut ::std::os::raw::c_int, - ) -> errno_t; -} -extern "C" { - pub fn clearerr_s(_Stream: *mut FILE) -> errno_t; -} -extern "C" { - pub fn fopen_s( - _Stream: *mut *mut FILE, - _FileName: *const ::std::os::raw::c_char, - _Mode: *const ::std::os::raw::c_char, - ) -> errno_t; -} -extern "C" { - pub fn fread_s( - _Buffer: *mut ::std::os::raw::c_void, - _BufferSize: size_t, - _ElementSize: size_t, - _ElementCount: size_t, - _Stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn freopen_s( - _Stream: *mut *mut FILE, - _FileName: *const ::std::os::raw::c_char, - _Mode: *const ::std::os::raw::c_char, - _OldStream: *mut FILE, - ) -> errno_t; -} -extern "C" { - pub fn gets_s( - _Buffer: *mut ::std::os::raw::c_char, - _Size: rsize_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tmpfile_s(_Stream: *mut *mut FILE) -> errno_t; -} -extern "C" { - pub fn tmpnam_s(_Buffer: *mut ::std::os::raw::c_char, _Size: rsize_t) -> errno_t; -} -extern "C" { - pub fn clearerr(_Stream: *mut FILE); -} -extern "C" { - pub fn fclose(_Stream: *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(_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 fflush(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fgetchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetpos(_Stream: *mut FILE, _Position: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - _Buffer: *mut ::std::os::raw::c_char, - _MaxCount: ::std::os::raw::c_int, - _Stream: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn _fileno(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -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 fputc(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fputchar(_Character: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputs( - _Buffer: *const ::std::os::raw::c_char, - _Stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - _Buffer: *mut ::std::os::raw::c_void, - _ElementSize: ::std::os::raw::c_ulonglong, - _ElementCount: ::std::os::raw::c_ulonglong, - _Stream: *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, - _Stream: *mut FILE, - ) -> *mut FILE; -} -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 fsetpos(_Stream: *mut FILE, _Position: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseek( - _Stream: *mut FILE, - _Offset: ::std::os::raw::c_long, - _Origin: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fseeki64( - _Stream: *mut FILE, - _Offset: ::std::os::raw::c_longlong, - _Origin: ::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 _ftelli64(_Stream: *mut FILE) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn fwrite( - _Buffer: *const ::std::os::raw::c_void, - _ElementSize: ::std::os::raw::c_ulonglong, - _ElementCount: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - ) -> ::std::os::raw::c_ulonglong; -} -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 _getmaxstdio() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _getw(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _pclose(_Stream: *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(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(_Character: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(_Buffer: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _putw(_Word: ::std::os::raw::c_int, _Stream: *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(_Stream: *mut FILE); -} -extern "C" { - pub fn _rmtmp() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuf(_Stream: *mut FILE, _Buffer: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn _setmaxstdio(_Maximum: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setvbuf( - _Stream: *mut FILE, - _Buffer: *mut ::std::os::raw::c_char, - _Mode: ::std::os::raw::c_int, - _Size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _tempnam( - _DirectoryName: *const ::std::os::raw::c_char, - _FilePrefix: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -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(_Character: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _lock_file(_Stream: *mut FILE); -} -extern "C" { - pub fn _unlock_file(_Stream: *mut FILE); -} -extern "C" { - pub fn _fclose_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fflush_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fgetc_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fputc_nolock( - _Character: ::std::os::raw::c_int, - _Stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fread_nolock( - _Buffer: *mut ::std::os::raw::c_void, - _ElementSize: size_t, - _ElementCount: size_t, - _Stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn _fread_nolock_s( - _Buffer: *mut ::std::os::raw::c_void, - _BufferSize: size_t, - _ElementSize: size_t, - _ElementCount: size_t, - _Stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn _fseek_nolock( - _Stream: *mut FILE, - _Offset: ::std::os::raw::c_long, - _Origin: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _fseeki64_nolock( - _Stream: *mut FILE, - _Offset: ::std::os::raw::c_longlong, - _Origin: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _ftell_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn _ftelli64_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn _fwrite_nolock( - _Buffer: *const ::std::os::raw::c_void, - _ElementSize: size_t, - _ElementCount: size_t, - _Stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn _getc_nolock(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _putc_nolock( - _Character: ::std::os::raw::c_int, - _Stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _ungetc_nolock( - _Character: ::std::os::raw::c_int, - _Stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __p__commode() -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfprintf( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vfprintf_p( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _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 __stdio_common_vfscanf( - _Options: ::std::os::raw::c_ulonglong, - _Stream: *mut FILE, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _Arglist: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsprintf( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsnprintf_s( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _MaxCount: size_t, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsprintf_p( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *mut ::std::os::raw::c_char, - _BufferCount: size_t, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __stdio_common_vsscanf( - _Options: ::std::os::raw::c_ulonglong, - _Buffer: *const ::std::os::raw::c_char, - _BufferCount: size_t, - _Format: *const ::std::os::raw::c_char, - _Locale: _locale_t, - _ArgList: va_list, - ) -> ::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(_Stream: *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(_Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putw(_Ch: ::std::os::raw::c_int, _Stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rmtmp() -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut max_loaded_major: ::std::os::raw::c_int; -} -extern "C" { - pub static mut max_loaded_minor: ::std::os::raw::c_int; -} -extern "C" { - pub static mut exts: *const ::std::os::raw::c_char; -} -pub const num_exts_i: ::std::os::raw::c_int = 0; -extern "C" { - pub static mut exts_i: *mut *const ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData { - pub currentBatch: *mut RenderBatch, - pub defaultBatch: RenderBatch, - pub State: rlglData__bindgen_ty_1, - pub ExtSupported: rlglData__bindgen_ty_2, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData__bindgen_ty_1 { - pub currentMatrixMode: ::std::os::raw::c_int, - pub currentMatrix: *mut Matrix, - pub modelview: Matrix, - pub projection: Matrix, - pub transform: Matrix, - pub transformRequired: bool, - pub stack: [Matrix; 32usize], - pub stackCounter: ::std::os::raw::c_int, - pub defaultTextureId: ::std::os::raw::c_uint, - pub activeTextureId: [::std::os::raw::c_uint; 4usize], - pub defaultVShaderId: ::std::os::raw::c_uint, - pub defaultFShaderId: ::std::os::raw::c_uint, - pub defaultShader: Shader, - pub currentShader: Shader, - pub stereoRender: bool, - pub projectionStereo: [Matrix; 2usize], - pub viewOffsetStereo: [Matrix; 2usize], - pub currentBlendMode: ::std::os::raw::c_int, - pub glBlendSrcFactor: ::std::os::raw::c_int, - pub glBlendDstFactor: ::std::os::raw::c_int, - pub glad_glBlendEquation: ::std::os::raw::c_int, - pub framebufferWidth: ::std::os::raw::c_int, - pub framebufferHeight: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_rlglData__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 2616usize, - concat!("Size of: ", stringify!(rlglData__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlglData__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentMatrixMode as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentMatrixMode) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentMatrix as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentMatrix) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).modelview as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(modelview) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).projection as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(projection) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).transform as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(transform) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).transformRequired as *const _ - as usize - }, - 208usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(transformRequired) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack as *const _ as usize }, - 212usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(stack) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stackCounter as *const _ as usize - }, - 2260usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(stackCounter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultTextureId as *const _ as usize - }, - 2264usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultTextureId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).activeTextureId as *const _ as usize - }, - 2268usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(activeTextureId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultVShaderId as *const _ as usize - }, - 2284usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultVShaderId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultFShaderId as *const _ as usize - }, - 2288usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultFShaderId) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).defaultShader as *const _ as usize - }, - 2296usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(defaultShader) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentShader as *const _ as usize - }, - 2312usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentShader) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).stereoRender as *const _ as usize - }, - 2328usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(stereoRender) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).projectionStereo as *const _ as usize - }, - 2332usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(projectionStereo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).viewOffsetStereo as *const _ as usize - }, - 2460usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(viewOffsetStereo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).currentBlendMode as *const _ as usize - }, - 2588usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(currentBlendMode) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glBlendSrcFactor as *const _ as usize - }, - 2592usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glBlendSrcFactor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glBlendDstFactor as *const _ as usize - }, - 2596usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glBlendDstFactor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glad_glBlendEquation as *const _ - as usize - }, - 2600usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(glad_glBlendEquation) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).framebufferWidth as *const _ as usize - }, - 2604usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(framebufferWidth) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).framebufferHeight as *const _ - as usize - }, - 2608usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_1), - "::", - stringify!(framebufferHeight) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rlglData__bindgen_ty_2 { - pub vao: bool, - pub instancing: bool, - pub texNPOT: bool, - pub texDepth: bool, - pub texFloat32: bool, - pub texCompDXT: bool, - pub texCompETC1: bool, - pub texCompETC2: bool, - pub texCompPVRT: bool, - pub texCompASTC: bool, - pub texMirrorClamp: bool, - pub texAnisoFilter: bool, - pub maxAnisotropyLevel: f32, - pub maxDepthBits: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_rlglData__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(rlglData__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(rlglData__bindgen_ty_2)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vao as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(vao) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).instancing as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(instancing) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texNPOT as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texNPOT) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).texDepth as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texDepth) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texFloat32 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texFloat32) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompDXT as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompDXT) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompETC1 as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompETC1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompETC2 as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompETC2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompPVRT as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompPVRT) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texCompASTC as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texCompASTC) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texMirrorClamp as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texMirrorClamp) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).texAnisoFilter as *const _ as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(texAnisoFilter) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).maxAnisotropyLevel as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(maxAnisotropyLevel) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).maxDepthBits as *const _ as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(rlglData__bindgen_ty_2), - "::", - stringify!(maxDepthBits) - ) - ); -} -#[test] -fn bindgen_test_layout_rlglData() { - assert_eq!( - ::std::mem::size_of::(), - 2712usize, - concat!("Size of: ", stringify!(rlglData)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rlglData)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).currentBatch as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(currentBatch) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).defaultBatch as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(defaultBatch) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).State as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(State) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ExtSupported as *const _ as usize }, - 2656usize, - concat!( - "Offset of field: ", - stringify!(rlglData), - "::", - stringify!(ExtSupported) - ) - ); -} -extern "C" { - pub static mut RLGL: rlglData; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GuiStyleProp { - pub controlId: ::std::os::raw::c_ushort, - pub propertyId: ::std::os::raw::c_ushort, - pub propertyValue: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_GuiStyleProp() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(GuiStyleProp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(GuiStyleProp)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).controlId as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(controlId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyId as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyId) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).propertyValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(GuiStyleProp), - "::", - stringify!(propertyValue) - ) - ); -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControlState { - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED = 1, - GUI_STATE_PRESSED = 2, - GUI_STATE_DISABLED = 3, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiTextAlignment { - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER = 1, - GUI_TEXT_ALIGN_RIGHT = 2, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControl { - DEFAULT = 0, - LABEL = 1, - BUTTON = 2, - TOGGLE = 3, - SLIDER = 4, - PROGRESSBAR = 5, - CHECKBOX = 6, - COMBOBOX = 7, - DROPDOWNBOX = 8, - TEXTBOX = 9, - VALUEBOX = 10, - SPINNER = 11, - LISTVIEW = 12, - COLORPICKER = 13, - SCROLLBAR = 14, - STATUSBAR = 15, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiControlProperty { - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL = 1, - TEXT_COLOR_NORMAL = 2, - BORDER_COLOR_FOCUSED = 3, - BASE_COLOR_FOCUSED = 4, - TEXT_COLOR_FOCUSED = 5, - BORDER_COLOR_PRESSED = 6, - BASE_COLOR_PRESSED = 7, - TEXT_COLOR_PRESSED = 8, - BORDER_COLOR_DISABLED = 9, - BASE_COLOR_DISABLED = 10, - TEXT_COLOR_DISABLED = 11, - BORDER_WIDTH = 12, - TEXT_PADDING = 13, - TEXT_ALIGNMENT = 14, - RESERVED = 15, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiDefaultProperty { - TEXT_SIZE = 16, - TEXT_SPACING = 17, - LINE_COLOR = 18, - BACKGROUND_COLOR = 19, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiToggleProperty { - GROUP_PADDING = 16, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiSliderProperty { - SLIDER_WIDTH = 16, - SLIDER_PADDING = 17, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiProgressBarProperty { - PROGRESS_PADDING = 16, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiCheckBoxProperty { - CHECK_PADDING = 16, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiComboBoxProperty { - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING = 17, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiDropdownBoxProperty { - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING = 17, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiTextBoxProperty { - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING = 17, - COLOR_SELECTED_FG = 18, - COLOR_SELECTED_BG = 19, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiSpinnerProperty { - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING = 17, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiScrollBarProperty { - ARROWS_SIZE = 16, - ARROWS_VISIBLE = 17, - SCROLL_SLIDER_PADDING = 18, - SCROLL_SLIDER_SIZE = 19, - SCROLL_PADDING = 20, - SCROLL_SPEED = 21, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiScrollBarSide { - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE = 1, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiListViewProperty { - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING = 17, - SCROLLBAR_WIDTH = 18, - SCROLLBAR_SIDE = 19, -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiColorPickerProperty { - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH = 17, - HUEBAR_PADDING = 18, - HUEBAR_SELECTOR_HEIGHT = 19, - HUEBAR_SELECTOR_OVERFLOW = 20, -} -extern "C" { - pub fn GuiEnable(); -} -extern "C" { - pub fn GuiDisable(); -} -extern "C" { - pub fn GuiLock(); -} -extern "C" { - pub fn GuiUnlock(); -} -extern "C" { - pub fn GuiFade(alpha: f32); -} -extern "C" { - pub fn GuiSetState(state: ::std::os::raw::c_int); -} -extern "C" { - pub fn GuiGetState() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiSetFont(font: Font); -} -extern "C" { - pub fn GuiGetFont() -> Font; -} -extern "C" { - pub fn GuiSetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - value: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiGetStyle( - control: ::std::os::raw::c_int, - property: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiEnableTooltip(); -} -extern "C" { - pub fn GuiDisableTooltip(); -} -extern "C" { - pub fn GuiSetTooltip(tooltip: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiClearTooltip(); -} -extern "C" { - pub fn GuiWindowBox(bounds: Rectangle, title: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiGroupBox(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLine(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiPanel(bounds: Rectangle); -} -extern "C" { - pub fn GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: *mut Vector2) - -> Rectangle; -} -extern "C" { - pub fn GuiLabel(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiLabelButton(bounds: Rectangle, text: *const ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn GuiImageButton( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - ) -> bool; -} -extern "C" { - pub fn GuiImageButtonEx( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - texture: Texture2D, - texSource: Rectangle, - ) -> bool; -} -extern "C" { - pub fn GuiToggle(bounds: Rectangle, text: *const ::std::os::raw::c_char, active: bool) -> bool; -} -extern "C" { - pub fn GuiToggleGroup( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiCheckBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - checked: bool, - ) -> bool; -} -extern "C" { - pub fn GuiComboBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiDropdownBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - active: *mut ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSpinner( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiValueBox( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - value: *mut ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBox( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiTextBoxMulti( - bounds: Rectangle, - text: *mut ::std::os::raw::c_char, - textSize: ::std::os::raw::c_int, - editMode: bool, - ) -> bool; -} -extern "C" { - pub fn GuiSlider( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiSliderBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiProgressBar( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - ) -> f32; -} -extern "C" { - pub fn GuiStatusBar(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiDummyRec(bounds: Rectangle, text: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiScrollBar( - bounds: Rectangle, - value: ::std::os::raw::c_int, - minValue: ::std::os::raw::c_int, - maxValue: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiGrid(bounds: Rectangle, spacing: f32, subdivs: ::std::os::raw::c_int) -> Vector2; -} -extern "C" { - pub fn GuiListView( - bounds: Rectangle, - text: *const ::std::os::raw::c_char, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiListViewEx( - bounds: Rectangle, - text: *mut *const ::std::os::raw::c_char, - count: ::std::os::raw::c_int, - focus: *mut ::std::os::raw::c_int, - scrollIndex: *mut ::std::os::raw::c_int, - active: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiMessageBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiTextInputBox( - bounds: Rectangle, - title: *const ::std::os::raw::c_char, - message: *const ::std::os::raw::c_char, - buttons: *const ::std::os::raw::c_char, - text: *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn GuiColorPicker(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorPanel(bounds: Rectangle, color: Color) -> Color; -} -extern "C" { - pub fn GuiColorBarAlpha(bounds: Rectangle, alpha: f32) -> f32; -} -extern "C" { - pub fn GuiColorBarHue(bounds: Rectangle, value: f32) -> f32; -} -extern "C" { - pub fn GuiLoadStyle(fileName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn GuiLoadStyleDefault(); -} -extern "C" { - pub fn GuiIconText( - iconId: ::std::os::raw::c_int, - text: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn GuiDrawIcon( - iconId: ::std::os::raw::c_int, - position: Vector2, - pixelSize: ::std::os::raw::c_int, - color: Color, - ); -} -extern "C" { - pub fn GuiGetIcons() -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiGetIconData(iconId: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_uint; -} -extern "C" { - pub fn GuiSetIconData(iconId: ::std::os::raw::c_int, data: *mut ::std::os::raw::c_uint); -} -extern "C" { - pub fn GuiSetIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiClearIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn GuiCheckIconPixel( - iconId: ::std::os::raw::c_int, - x: ::std::os::raw::c_int, - y: ::std::os::raw::c_int, - ) -> bool; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum guiIconName { - RICON_NONE = 0, - RICON_FOLDER_FILE_OPEN = 1, - RICON_FILE_SAVE_CLASSIC = 2, - RICON_FOLDER_OPEN = 3, - RICON_FOLDER_SAVE = 4, - RICON_FILE_OPEN = 5, - RICON_FILE_SAVE = 6, - RICON_FILE_EXPORT = 7, - RICON_FILE_NEW = 8, - RICON_FILE_DELETE = 9, - RICON_FILETYPE_TEXT = 10, - RICON_FILETYPE_AUDIO = 11, - RICON_FILETYPE_IMAGE = 12, - RICON_FILETYPE_PLAY = 13, - RICON_FILETYPE_VIDEO = 14, - RICON_FILETYPE_INFO = 15, - RICON_FILE_COPY = 16, - RICON_FILE_CUT = 17, - RICON_FILE_PASTE = 18, - RICON_CURSOR_HAND = 19, - RICON_CURSOR_POINTER = 20, - RICON_CURSOR_CLASSIC = 21, - RICON_PENCIL = 22, - RICON_PENCIL_BIG = 23, - RICON_BRUSH_CLASSIC = 24, - RICON_BRUSH_PAINTER = 25, - RICON_WATER_DROP = 26, - RICON_COLOR_PICKER = 27, - RICON_RUBBER = 28, - RICON_COLOR_BUCKET = 29, - RICON_TEXT_T = 30, - RICON_TEXT_A = 31, - RICON_SCALE = 32, - RICON_RESIZE = 33, - RICON_FILTER_POINT = 34, - RICON_FILTER_BILINEAR = 35, - RICON_CROP = 36, - RICON_CROP_ALPHA = 37, - RICON_SQUARE_TOGGLE = 38, - RICON_SYMMETRY = 39, - RICON_SYMMETRY_HORIZONTAL = 40, - RICON_SYMMETRY_VERTICAL = 41, - RICON_LENS = 42, - RICON_LENS_BIG = 43, - RICON_EYE_ON = 44, - RICON_EYE_OFF = 45, - RICON_FILTER_TOP = 46, - RICON_FILTER = 47, - RICON_TARGET_POINT = 48, - RICON_TARGET_SMALL = 49, - RICON_TARGET_BIG = 50, - RICON_TARGET_MOVE = 51, - RICON_CURSOR_MOVE = 52, - RICON_CURSOR_SCALE = 53, - RICON_CURSOR_SCALE_RIGHT = 54, - RICON_CURSOR_SCALE_LEFT = 55, - RICON_UNDO = 56, - RICON_REDO = 57, - RICON_REREDO = 58, - RICON_MUTATE = 59, - RICON_ROTATE = 60, - RICON_REPEAT = 61, - RICON_SHUFFLE = 62, - RICON_EMPTYBOX = 63, - RICON_TARGET = 64, - RICON_TARGET_SMALL_FILL = 65, - RICON_TARGET_BIG_FILL = 66, - RICON_TARGET_MOVE_FILL = 67, - RICON_CURSOR_MOVE_FILL = 68, - RICON_CURSOR_SCALE_FILL = 69, - RICON_CURSOR_SCALE_RIGHT_FILL = 70, - RICON_CURSOR_SCALE_LEFT_FILL = 71, - RICON_UNDO_FILL = 72, - RICON_REDO_FILL = 73, - RICON_REREDO_FILL = 74, - RICON_MUTATE_FILL = 75, - RICON_ROTATE_FILL = 76, - RICON_REPEAT_FILL = 77, - RICON_SHUFFLE_FILL = 78, - RICON_EMPTYBOX_SMALL = 79, - RICON_BOX = 80, - RICON_BOX_TOP = 81, - RICON_BOX_TOP_RIGHT = 82, - RICON_BOX_RIGHT = 83, - RICON_BOX_BOTTOM_RIGHT = 84, - RICON_BOX_BOTTOM = 85, - RICON_BOX_BOTTOM_LEFT = 86, - RICON_BOX_LEFT = 87, - RICON_BOX_TOP_LEFT = 88, - RICON_BOX_CENTER = 89, - RICON_BOX_CIRCLE_MASK = 90, - RICON_POT = 91, - RICON_ALPHA_MULTIPLY = 92, - RICON_ALPHA_CLEAR = 93, - RICON_DITHERING = 94, - RICON_MIPMAPS = 95, - RICON_BOX_GRID = 96, - RICON_GRID = 97, - RICON_BOX_CORNERS_SMALL = 98, - RICON_BOX_CORNERS_BIG = 99, - RICON_FOUR_BOXES = 100, - RICON_GRID_FILL = 101, - RICON_BOX_MULTISIZE = 102, - RICON_ZOOM_SMALL = 103, - RICON_ZOOM_MEDIUM = 104, - RICON_ZOOM_BIG = 105, - RICON_ZOOM_ALL = 106, - RICON_ZOOM_CENTER = 107, - RICON_BOX_DOTS_SMALL = 108, - RICON_BOX_DOTS_BIG = 109, - RICON_BOX_CONCENTRIC = 110, - RICON_BOX_GRID_BIG = 111, - RICON_OK_TICK = 112, - RICON_CROSS = 113, - RICON_ARROW_LEFT = 114, - RICON_ARROW_RIGHT = 115, - RICON_ARROW_BOTTOM = 116, - RICON_ARROW_TOP = 117, - RICON_ARROW_LEFT_FILL = 118, - RICON_ARROW_RIGHT_FILL = 119, - RICON_ARROW_BOTTOM_FILL = 120, - RICON_ARROW_TOP_FILL = 121, - RICON_AUDIO = 122, - RICON_FX = 123, - RICON_WAVE = 124, - RICON_WAVE_SINUS = 125, - RICON_WAVE_SQUARE = 126, - RICON_WAVE_TRIANGULAR = 127, - RICON_CROSS_SMALL = 128, - RICON_PLAYER_PREVIOUS = 129, - RICON_PLAYER_PLAY_BACK = 130, - RICON_PLAYER_PLAY = 131, - RICON_PLAYER_PAUSE = 132, - RICON_PLAYER_STOP = 133, - RICON_PLAYER_NEXT = 134, - RICON_PLAYER_RECORD = 135, - RICON_MAGNET = 136, - RICON_LOCK_CLOSE = 137, - RICON_LOCK_OPEN = 138, - RICON_CLOCK = 139, - RICON_TOOLS = 140, - RICON_GEAR = 141, - RICON_GEAR_BIG = 142, - RICON_BIN = 143, - RICON_HAND_POINTER = 144, - RICON_LASER = 145, - RICON_COIN = 146, - RICON_EXPLOSION = 147, - RICON_1UP = 148, - RICON_PLAYER = 149, - RICON_PLAYER_JUMP = 150, - RICON_KEY = 151, - RICON_DEMON = 152, - RICON_TEXT_POPUP = 153, - RICON_GEAR_EX = 154, - RICON_CRACK = 155, - RICON_CRACK_POINTS = 156, - RICON_STAR = 157, - RICON_DOOR = 158, - RICON_EXIT = 159, - RICON_MODE_2D = 160, - RICON_MODE_3D = 161, - RICON_CUBE = 162, - RICON_CUBE_FACE_TOP = 163, - RICON_CUBE_FACE_LEFT = 164, - RICON_CUBE_FACE_FRONT = 165, - RICON_CUBE_FACE_BOTTOM = 166, - RICON_CUBE_FACE_RIGHT = 167, - RICON_CUBE_FACE_BACK = 168, - RICON_CAMERA = 169, - RICON_SPECIAL = 170, - RICON_LINK_NET = 171, - RICON_LINK_BOXES = 172, - RICON_LINK_MULTI = 173, - RICON_LINK = 174, - RICON_LINK_BROKE = 175, - RICON_TEXT_NOTES = 176, - RICON_NOTEBOOK = 177, - RICON_SUITCASE = 178, - RICON_SUITCASE_ZIP = 179, - RICON_MAILBOX = 180, - RICON_MONITOR = 181, - RICON_PRINTER = 182, - RICON_PHOTO_CAMERA = 183, - RICON_PHOTO_CAMERA_FLASH = 184, - RICON_HOUSE = 185, - RICON_HEART = 186, - RICON_CORNER = 187, - RICON_VERTICAL_BARS = 188, - RICON_VERTICAL_BARS_FILL = 189, - RICON_LIFE_BARS = 190, - RICON_INFO = 191, - RICON_CROSSLINE = 192, - RICON_HELP = 193, - RICON_FILETYPE_ALPHA = 194, - RICON_FILETYPE_HOME = 195, - RICON_LAYERS_VISIBLE = 196, - RICON_LAYERS = 197, - RICON_WINDOW = 198, - RICON_HIDPI = 199, - RICON_200 = 200, - RICON_201 = 201, - RICON_202 = 202, - RICON_203 = 203, - RICON_204 = 204, - RICON_205 = 205, - RICON_206 = 206, - RICON_207 = 207, - RICON_208 = 208, - RICON_209 = 209, - RICON_210 = 210, - RICON_211 = 211, - RICON_212 = 212, - RICON_213 = 213, - RICON_214 = 214, - RICON_215 = 215, - RICON_216 = 216, - RICON_217 = 217, - RICON_218 = 218, - RICON_219 = 219, - RICON_220 = 220, - RICON_221 = 221, - RICON_222 = 222, - RICON_223 = 223, - RICON_224 = 224, - RICON_225 = 225, - RICON_226 = 226, - RICON_227 = 227, - RICON_228 = 228, - RICON_229 = 229, - RICON_230 = 230, - RICON_231 = 231, - RICON_232 = 232, - RICON_233 = 233, - RICON_234 = 234, - RICON_235 = 235, - RICON_236 = 236, - RICON_237 = 237, - RICON_238 = 238, - RICON_239 = 239, - RICON_240 = 240, - RICON_241 = 241, - RICON_242 = 242, - RICON_243 = 243, - RICON_244 = 244, - RICON_245 = 245, - RICON_246 = 246, - RICON_247 = 247, - RICON_248 = 248, - RICON_249 = 249, - RICON_250 = 250, - RICON_251 = 251, - RICON_252 = 252, - RICON_253 = 253, - RICON_254 = 254, - RICON_255 = 255, -} -extern "C" { - pub static mut guiIcons: [::std::os::raw::c_uint; 2048usize]; -} -#[repr(i32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum GuiPropertyElement { - BORDER = 0, - BASE = 1, - TEXT = 2, - OTHER = 3, -} -extern "C" { - pub static mut guiState: GuiControlState; -} -extern "C" { - pub static mut guiFont: Font; -} -extern "C" { - pub static mut guiLocked: bool; -} -pub const guiAlpha: f32 = 1.0; -extern "C" { - pub static mut guiStyle: [::std::os::raw::c_uint; 384usize]; -} -extern "C" { - pub static mut guiStyleLoaded: bool; -} -extern "C" { - pub static mut guiTooltip: *const ::std::os::raw::c_char; -} -extern "C" { - pub static mut guiTooltipEnabled: bool; -} -extern "C" { - pub fn GuiSliderPro( - bounds: Rectangle, - textLeft: *const ::std::os::raw::c_char, - textRight: *const ::std::os::raw::c_char, - value: f32, - minValue: f32, - maxValue: f32, - sliderWidth: ::std::os::raw::c_int, - ) -> f32; -} -extern "C" { - pub fn GuiColorPanelEx(bounds: Rectangle, color: Color, hue: f32) -> Color; -} -extern "C" { - pub fn GuiLoadIcons( - fileName: *const ::std::os::raw::c_char, - loadIconsName: bool, - ) -> *mut *mut ::std::os::raw::c_char; -} -pub type __builtin_va_list = *mut ::std::os::raw::c_char; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_data { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_multibyte_data { - pub _address: u8, -} diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index 9a7d590d..3ad37764 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -15,6 +15,8 @@ Permission is granted to anyone to use this software for any purpose, including */ #![allow(dead_code)] +extern crate bindgen; + use std::path::{Path, PathBuf}; use std::{env, fs}; @@ -57,6 +59,7 @@ fn build_with_cmake(src_path: &str) { } builder + .generator("Ninja") .define("BUILD_EXAMPLES", "OFF") .define("CMAKE_BUILD_TYPE", "Release") // turn off until this is fixed @@ -93,8 +96,10 @@ fn build_with_cmake(src_path: &str) { } } // on web copy libraylib.bc to libraylib.a if platform == Platform::Web { - std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a")) - .expect("failed to create wasm library"); + if !Path::new(&dst_lib.join("libraylib.a")).exists() { + std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a")) + .expect("failed to create wasm library"); + } } // println!("cmake build {}", c.display()); println!("cargo:rustc-link-search=native={}", dst_lib.display()); @@ -102,38 +107,39 @@ fn build_with_cmake(src_path: &str) { fn gen_bindings() { let target = env::var("TARGET").expect("Cargo build scripts always have TARGET"); - let out_dir = - PathBuf::from(env::var("OUT_DIR").expect("Cargo build scripts always have an OUT_DIR")); + let (platform, os) = platform_from_target(&target); - let (platform, platform_os) = platform_from_target(&target); + let plat = match platform { + Platform::Desktop => "-DPLATFORM_DESKTOP", + Platform::RPI => "-DPLATFORM_RPI", + Platform::Web => "-DPLATFORM_WEB" + }; - // Generate bindings - match (platform, platform_os) { - (_, PlatformOS::Windows) => { - fs::write( - out_dir.join("bindings.rs"), - include_str!("bindings_windows.rs"), - ) - .expect("failed to write bindings"); - } - (_, PlatformOS::Linux) => { - fs::write( - out_dir.join("bindings.rs"), - include_str!("bindings_linux.rs"), - ) - .expect("failed to write bindings"); - } - (_, PlatformOS::OSX) => { - fs::write(out_dir.join("bindings.rs"), include_str!("bindings_osx.rs")) - .expect("failed to write bindings"); - } - (Platform::Web, _) => { - fs::write(out_dir.join("bindings.rs"), include_str!("bindings_web.rs")) - .expect("failed to write bindings"); - } - // for other platforms use bindgen and hope it works - _ => panic!("raylib-rs not supported on your platform"), + let mut builder = bindgen::Builder::default() + .header("binding/binding.h") + .rustified_enum(".+") + .clang_arg("-std=c99") + .clang_arg(plat) + .parse_callbacks(Box::new(bindgen::CargoCallbacks)); + + if platform == Platform::Desktop && os == PlatformOS::Windows { + // odd workaround for booleans being broken + builder = builder.clang_arg("-D__STDC__"); + } + + if platform == Platform::Web { + builder = builder + .clang_arg("-fvisibility=default") + .clang_arg("--target=wasm32-emscripten"); } + + // Build + let bindings = builder.generate().expect("Unable to generate bindings"); + + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); + bindings + .write_to_file(out_path.join("bindings.rs")) + .expect("Couldn't write bindings!"); } fn gen_rgui() { @@ -141,7 +147,7 @@ fn gen_rgui() { #[cfg(target_os = "windows")] { cc::Build::new() - .file("rgui_wrapper.cpp") + .file("binding/rgui_wrapper.cpp") .include(".") .warnings(false) // .flag("-std=c99") @@ -151,7 +157,7 @@ fn gen_rgui() { #[cfg(not(target_os = "windows"))] { cc::Build::new() - .file("rgui_wrapper.c") + .file("binding/rgui_wrapper.c") .include(".") .warnings(false) // .flag("-std=c99") diff --git a/raylib-sys/external/glad.h b/raylib-sys/external/glad.h deleted file mode 100644 index c92e1845..00000000 --- a/raylib-sys/external/glad.h +++ /dev/null @@ -1,5474 +0,0 @@ -/* - - OpenGL loader generated by glad 0.1.10a0 on Fri Jun 10 12:54:12 2016. - - Language/Generator: C/C++ - Specification: gl - APIs: gl=3.3 - Profile: core - Extensions: - GL_AMD_debug_output, GL_AMD_query_buffer_object, GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_buffer_storage, GL_ARB_compatibility, GL_ARB_compressed_texture_pixel_storage, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_multisample, GL_ARB_sample_locations, GL_ARB_texture_compression, GL_ARB_texture_float, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_rg, GL_ARB_texture_swizzle, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_element_array, GL_ATI_fragment_shader, GL_ATI_vertex_array_object, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_index_array_formats, GL_EXT_texture, GL_EXT_texture_compression_s3tc, GL_EXT_texture_sRGB, GL_EXT_texture_swizzle, GL_EXT_vertex_array, GL_EXT_vertex_shader - Loader: No - - Commandline: - --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_AMD_debug_output,GL_AMD_query_buffer_object,GL_ARB_ES2_compatibility,GL_ARB_ES3_compatibility,GL_ARB_buffer_storage,GL_ARB_compatibility,GL_ARB_compressed_texture_pixel_storage,GL_ARB_debug_output,GL_ARB_depth_buffer_float,GL_ARB_depth_clamp,GL_ARB_depth_texture,GL_ARB_draw_buffers,GL_ARB_draw_buffers_blend,GL_ARB_explicit_attrib_location,GL_ARB_explicit_uniform_location,GL_ARB_fragment_program,GL_ARB_fragment_shader,GL_ARB_framebuffer_object,GL_ARB_framebuffer_sRGB,GL_ARB_multisample,GL_ARB_sample_locations,GL_ARB_texture_compression,GL_ARB_texture_float,GL_ARB_texture_multisample,GL_ARB_texture_non_power_of_two,GL_ARB_texture_rg,GL_ARB_texture_swizzle,GL_ARB_uniform_buffer_object,GL_ARB_vertex_array_object,GL_ARB_vertex_attrib_binding,GL_ARB_vertex_buffer_object,GL_ARB_vertex_program,GL_ARB_vertex_shader,GL_ATI_element_array,GL_ATI_fragment_shader,GL_ATI_vertex_array_object,GL_EXT_blend_color,GL_EXT_blend_equation_separate,GL_EXT_blend_func_separate,GL_EXT_framebuffer_blit,GL_EXT_framebuffer_multisample,GL_EXT_framebuffer_multisample_blit_scaled,GL_EXT_framebuffer_object,GL_EXT_framebuffer_sRGB,GL_EXT_index_array_formats,GL_EXT_texture,GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB,GL_EXT_texture_swizzle,GL_EXT_vertex_array,GL_EXT_vertex_shader" - Online: - http://glad.dav1d.de/#profile=core&language=c&specification=gl&api=gl%3D3.3&extensions=GL_AMD_debug_output&extensions=GL_AMD_query_buffer_object&extensions=GL_ARB_ES2_compatibility&extensions=GL_ARB_ES3_compatibility&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_compatibility&extensions=GL_ARB_compressed_texture_pixel_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_depth_buffer_float&extensions=GL_ARB_depth_clamp&extensions=GL_ARB_depth_texture&extensions=GL_ARB_draw_buffers&extensions=GL_ARB_draw_buffers_blend&extensions=GL_ARB_explicit_attrib_location&extensions=GL_ARB_explicit_uniform_location&extensions=GL_ARB_fragment_program&extensions=GL_ARB_fragment_shader&extensions=GL_ARB_framebuffer_object&extensions=GL_ARB_framebuffer_sRGB&extensions=GL_ARB_multisample&extensions=GL_ARB_sample_locations&extensions=GL_ARB_texture_compression&extensions=GL_ARB_texture_float&extensions=GL_ARB_texture_multisample&extensions=GL_ARB_texture_non_power_of_two&extensions=GL_ARB_texture_rg&extensions=GL_ARB_texture_swizzle&extensions=GL_ARB_uniform_buffer_object&extensions=GL_ARB_vertex_array_object&extensions=GL_ARB_vertex_attrib_binding&extensions=GL_ARB_vertex_buffer_object&extensions=GL_ARB_vertex_program&extensions=GL_ARB_vertex_shader&extensions=GL_ATI_element_array&extensions=GL_ATI_fragment_shader&extensions=GL_ATI_vertex_array_object&extensions=GL_EXT_blend_color&extensions=GL_EXT_blend_equation_separate&extensions=GL_EXT_blend_func_separate&extensions=GL_EXT_framebuffer_blit&extensions=GL_EXT_framebuffer_multisample&extensions=GL_EXT_framebuffer_multisample_blit_scaled&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_framebuffer_sRGB&extensions=GL_EXT_index_array_formats&extensions=GL_EXT_texture&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB&extensions=GL_EXT_texture_swizzle&extensions=GL_EXT_vertex_array&extensions=GL_EXT_vertex_shader -*/ - - -#ifndef __glad_h_ -#define __glad_h_ - -#ifdef __gl_h_ -#error OpenGL header already included, remove this include, glad already provides it -#endif -#define __gl_h_ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -//#include -#define APIENTRY __stdcall // RAY: Added -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -// RAY: Added -#ifndef GLAD_REALLOC - #define GLAD_REALLOC(n,sz) realloc(n,sz) -#endif -#ifndef GLAD_FREE - #define GLAD_FREE(p) free(p) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -struct gladGLversionStruct { - int major; - int minor; -}; - -typedef void* (* GLADloadproc)(const char *name); - -#ifndef GLAPI -# if defined(GLAD_GLAPI_EXPORT) -# if defined(WIN32) || defined(__CYGWIN__) -# if defined(GLAD_GLAPI_EXPORT_BUILD) -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllexport)) extern -# else -# define GLAPI __declspec(dllexport) extern -# endif -# else -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllimport)) extern -# else -# define GLAPI __declspec(dllimport) extern -# endif -# endif -# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) -# define GLAPI __attribute__ ((visibility ("default"))) extern -# else -# define GLAPI extern -# endif -# else -# define GLAPI extern -# endif -#endif - -GLAPI struct gladGLversionStruct GLVersion; -GLAPI int gladLoadGLLoader(GLADloadproc); - -#include -//#include // RAY: Not required -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLclampx; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef int GLsizei; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void *GLeglImageOES; -typedef char GLchar; -typedef char GLcharARB; -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef unsigned short GLhalfARB; -typedef unsigned short GLhalf; -typedef GLint GLfixed; -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -typedef int64_t GLint64; -typedef uint64_t GLuint64; -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -typedef struct __GLsync *GLsync; -struct _cl_context; -struct _cl_event; -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -typedef unsigned short GLhalfNV; -typedef GLintptr GLvdpauSurfaceNV; -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_FALSE 0 -#define GL_TRUE 1 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_NONE 0 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_VIEWPORT 0x0BA2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_DOUBLE 0x140A -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_REPEAT 0x2901 -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#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_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_COLOR_ATTACHMENT16 0x8CF0 -#define GL_COLOR_ATTACHMENT17 0x8CF1 -#define GL_COLOR_ATTACHMENT18 0x8CF2 -#define GL_COLOR_ATTACHMENT19 0x8CF3 -#define GL_COLOR_ATTACHMENT20 0x8CF4 -#define GL_COLOR_ATTACHMENT21 0x8CF5 -#define GL_COLOR_ATTACHMENT22 0x8CF6 -#define GL_COLOR_ATTACHMENT23 0x8CF7 -#define GL_COLOR_ATTACHMENT24 0x8CF8 -#define GL_COLOR_ATTACHMENT25 0x8CF9 -#define GL_COLOR_ATTACHMENT26 0x8CFA -#define GL_COLOR_ATTACHMENT27 0x8CFB -#define GL_COLOR_ATTACHMENT28 0x8CFC -#define GL_COLOR_ATTACHMENT29 0x8CFD -#define GL_COLOR_ATTACHMENT30 0x8CFE -#define GL_COLOR_ATTACHMENT31 0x8CFF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#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_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#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_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFF -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_RGB10_A2UI 0x906F -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 -#define GL_INT_2_10_10_10_REV 0x8D9F -#ifndef GL_VERSION_1_0 -#define GL_VERSION_1_0 1 -GLAPI int GLAD_GL_VERSION_1_0; -typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); -GLAPI PFNGLCULLFACEPROC glad_glCullFace; -#define glCullFace glad_glCullFace -typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); -GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; -#define glFrontFace glad_glFrontFace -typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); -GLAPI PFNGLHINTPROC glad_glHint; -#define glHint glad_glHint -typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); -GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; -#define glLineWidth glad_glLineWidth -typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); -GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; -#define glPointSize glad_glPointSize -typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); -GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; -#define glPolygonMode glad_glPolygonMode -typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLSCISSORPROC glad_glScissor; -#define glScissor glad_glScissor -typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -#define glTexParameterf glad_glTexParameterf -typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -#define glTexParameterfv glad_glTexParameterfv -typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -#define glTexParameteri glad_glTexParameteri -typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -#define glTexParameteriv glad_glTexParameteriv -typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -#define glTexImage1D glad_glTexImage1D -typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -#define glTexImage2D glad_glTexImage2D -typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); -GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -#define glDrawBuffer glad_glDrawBuffer -typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); -GLAPI PFNGLCLEARPROC glad_glClear; -#define glClear glad_glClear -typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; -#define glClearColor glad_glClearColor -typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); -GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; -#define glClearStencil glad_glClearStencil -typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); -GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; -#define glClearDepth glad_glClearDepth -typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); -GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; -#define glStencilMask glad_glStencilMask -typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI PFNGLCOLORMASKPROC glad_glColorMask; -#define glColorMask glad_glColorMask -typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); -GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; -#define glDepthMask glad_glDepthMask -typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); -GLAPI PFNGLDISABLEPROC glad_glDisable; -#define glDisable glad_glDisable -typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); -GLAPI PFNGLENABLEPROC glad_glEnable; -#define glEnable glad_glEnable -typedef void (APIENTRYP PFNGLFINISHPROC)(); -GLAPI PFNGLFINISHPROC glad_glFinish; -#define glFinish glad_glFinish -typedef void (APIENTRYP PFNGLFLUSHPROC)(); -GLAPI PFNGLFLUSHPROC glad_glFlush; -#define glFlush glad_glFlush -typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); -GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; -#define glBlendFunc glad_glBlendFunc -typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); -GLAPI PFNGLLOGICOPPROC glad_glLogicOp; -#define glLogicOp glad_glLogicOp -typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; -#define glStencilFunc glad_glStencilFunc -typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); -GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; -#define glStencilOp glad_glStencilOp -typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); -GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; -#define glDepthFunc glad_glDepthFunc -typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; -#define glPixelStoref glad_glPixelStoref -typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; -#define glPixelStorei glad_glPixelStorei -typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); -GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; -#define glReadBuffer glad_glReadBuffer -typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; -#define glReadPixels glad_glReadPixels -typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean* data); -GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -#define glGetBooleanv glad_glGetBooleanv -typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble* data); -GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; -#define glGetDoublev glad_glGetDoublev -typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); -GLAPI PFNGLGETERRORPROC glad_glGetError; -#define glGetError glad_glGetError -typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat* data); -GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; -#define glGetFloatv glad_glGetFloatv -typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint* data); -GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; -#define glGetIntegerv glad_glGetIntegerv -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); -GLAPI PFNGLGETSTRINGPROC glad_glGetString; -#define glGetString glad_glGetString -typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -#define glGetTexImage glad_glGetTexImage -typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -#define glGetTexParameterfv glad_glGetTexParameterfv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -#define glGetTexParameteriv glad_glGetTexParameteriv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv -typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); -GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; -#define glIsEnabled glad_glIsEnabled -typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far); -GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; -#define glDepthRange glad_glDepthRange -typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLVIEWPORTPROC glad_glViewport; -#define glViewport glad_glViewport -#endif -#ifndef GL_VERSION_1_1 -#define GL_VERSION_1_1 1 -GLAPI int GLAD_GL_VERSION_1_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; -#define glDrawArrays glad_glDrawArrays -typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; -#define glDrawElements glad_glDrawElements -typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); -GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -#define glPolygonOffset glad_glPolygonOffset -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -#define glCopyTexImage1D glad_glCopyTexImage1D -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -#define glCopyTexImage2D glad_glCopyTexImage2D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -#define glCopyTexSubImage1D glad_glCopyTexSubImage1D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -#define glCopyTexSubImage2D glad_glCopyTexSubImage2D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -#define glTexSubImage1D glad_glTexSubImage1D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -#define glTexSubImage2D glad_glTexSubImage2D -typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); -GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; -#define glBindTexture glad_glBindTexture -typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint* textures); -GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -#define glDeleteTextures glad_glDeleteTextures -typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint* textures); -GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; -#define glGenTextures glad_glGenTextures -typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); -GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; -#define glIsTexture glad_glIsTexture -#endif -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -GLAPI int GLAD_GL_VERSION_1_2; -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -#define glDrawRangeElements glad_glDrawRangeElements -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -#define glTexImage3D glad_glTexImage3D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -#define glTexSubImage3D glad_glTexSubImage3D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -#define glCopyTexSubImage3D glad_glCopyTexSubImage3D -#endif -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -GLAPI int GLAD_GL_VERSION_1_3; -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); -GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -#define glActiveTexture glad_glActiveTexture -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -#define glSampleCoverage glad_glSampleCoverage -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -#define glCompressedTexImage3D glad_glCompressedTexImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -#define glCompressedTexImage2D glad_glCompressedTexImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -#define glCompressedTexImage1D glad_glCompressedTexImage1D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -#define glGetCompressedTexImage glad_glGetCompressedTexImage -#endif -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -GLAPI int GLAD_GL_VERSION_1_4; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -#define glBlendFuncSeparate glad_glBlendFuncSeparate -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei drawcount); -GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -#define glMultiDrawArrays glad_glMultiDrawArrays -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount); -GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -#define glMultiDrawElements glad_glMultiDrawElements -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -#define glPointParameterf glad_glPointParameterf -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -#define glPointParameterfv glad_glPointParameterfv -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -#define glPointParameteri glad_glPointParameteri -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -#define glPointParameteriv glad_glPointParameteriv -typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; -#define glBlendColor glad_glBlendColor -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); -GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -#define glBlendEquation glad_glBlendEquation -#endif -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -GLAPI int GLAD_GL_VERSION_1_5; -typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; -#define glGenQueries glad_glGenQueries -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -#define glDeleteQueries glad_glDeleteQueries -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); -GLAPI PFNGLISQUERYPROC glad_glIsQuery; -#define glIsQuery glad_glIsQuery -typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); -GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; -#define glBeginQuery glad_glBeginQuery -typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); -GLAPI PFNGLENDQUERYPROC glad_glEndQuery; -#define glEndQuery glad_glEndQuery -typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; -#define glGetQueryiv glad_glGetQueryiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -#define glGetQueryObjectiv glad_glGetQueryObjectiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -#define glGetQueryObjectuiv glad_glGetQueryObjectuiv -typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); -GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; -#define glBindBuffer glad_glBindBuffer -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint* buffers); -GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -#define glDeleteBuffers glad_glDeleteBuffers -typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; -#define glGenBuffers glad_glGenBuffers -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); -GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; -#define glIsBuffer glad_glIsBuffer -typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; -#define glBufferData glad_glBufferData -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -#define glBufferSubData glad_glBufferSubData -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -#define glGetBufferSubData glad_glGetBufferSubData -typedef void* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; -#define glMapBuffer glad_glMapBuffer -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); -GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -#define glUnmapBuffer glad_glUnmapBuffer -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -#define glGetBufferParameteriv glad_glGetBufferParameteriv -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -#define glGetBufferPointerv glad_glGetBufferPointerv -#endif -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -GLAPI int GLAD_GL_VERSION_2_0; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -#define glBlendEquationSeparate glad_glBlendEquationSeparate -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -#define glDrawBuffers glad_glDrawBuffers -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -#define glStencilOpSeparate glad_glStencilOpSeparate -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -#define glStencilFuncSeparate glad_glStencilFuncSeparate -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); -GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -#define glStencilMaskSeparate glad_glStencilMaskSeparate -typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); -GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; -#define glAttachShader glad_glAttachShader -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar* name); -GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -#define glBindAttribLocation glad_glBindAttribLocation -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); -GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; -#define glCompileShader glad_glCompileShader -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); -GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -#define glCreateProgram glad_glCreateProgram -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); -GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; -#define glCreateShader glad_glCreateShader -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); -GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -#define glDeleteProgram glad_glDeleteProgram -typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); -GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; -#define glDeleteShader glad_glDeleteShader -typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); -GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; -#define glDetachShader glad_glDetachShader -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -#define glDisableVertexAttribArray glad_glDisableVertexAttribArray -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -#define glEnableVertexAttribArray glad_glEnableVertexAttribArray -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -#define glGetActiveAttrib glad_glGetActiveAttrib -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -#define glGetActiveUniform glad_glGetActiveUniform -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); -GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -#define glGetAttachedShaders glad_glGetAttachedShaders -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -#define glGetAttribLocation glad_glGetAttribLocation -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -#define glGetProgramiv glad_glGetProgramiv -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -#define glGetProgramInfoLog glad_glGetProgramInfoLog -typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint* params); -GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; -#define glGetShaderiv glad_glGetShaderiv -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -#define glGetShaderInfoLog glad_glGetShaderInfoLog -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* source); -GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -#define glGetShaderSource glad_glGetShaderSource -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -#define glGetUniformLocation glad_glGetUniformLocation -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat* params); -GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -#define glGetUniformfv glad_glGetUniformfv -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint* params); -GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -#define glGetUniformiv glad_glGetUniformiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -#define glGetVertexAttribdv glad_glGetVertexAttribdv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -#define glGetVertexAttribfv glad_glGetVertexAttribfv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -#define glGetVertexAttribiv glad_glGetVertexAttribiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); -GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; -#define glIsProgram glad_glIsProgram -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); -GLAPI PFNGLISSHADERPROC glad_glIsShader; -#define glIsShader glad_glIsShader -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); -GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; -#define glLinkProgram glad_glLinkProgram -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length); -GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; -#define glShaderSource glad_glShaderSource -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); -GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; -#define glUseProgram glad_glUseProgram -typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); -GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; -#define glUniform1f glad_glUniform1f -typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; -#define glUniform2f glad_glUniform2f -typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; -#define glUniform3f glad_glUniform3f -typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; -#define glUniform4f glad_glUniform4f -typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); -GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; -#define glUniform1i glad_glUniform1i -typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); -GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; -#define glUniform2i glad_glUniform2i -typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; -#define glUniform3i glad_glUniform3i -typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; -#define glUniform4i glad_glUniform4i -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; -#define glUniform1fv glad_glUniform1fv -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; -#define glUniform2fv glad_glUniform2fv -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; -#define glUniform3fv glad_glUniform3fv -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; -#define glUniform4fv glad_glUniform4fv -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; -#define glUniform1iv glad_glUniform1iv -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; -#define glUniform2iv glad_glUniform2iv -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; -#define glUniform3iv glad_glUniform3iv -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; -#define glUniform4iv glad_glUniform4iv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -#define glUniformMatrix2fv glad_glUniformMatrix2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -#define glUniformMatrix3fv glad_glUniformMatrix3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -#define glUniformMatrix4fv glad_glUniformMatrix4fv -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); -GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -#define glValidateProgram glad_glValidateProgram -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -#define glVertexAttrib1d glad_glVertexAttrib1d -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -#define glVertexAttrib1dv glad_glVertexAttrib1dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -#define glVertexAttrib1f glad_glVertexAttrib1f -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -#define glVertexAttrib1fv glad_glVertexAttrib1fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -#define glVertexAttrib1s glad_glVertexAttrib1s -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -#define glVertexAttrib1sv glad_glVertexAttrib1sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -#define glVertexAttrib2d glad_glVertexAttrib2d -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -#define glVertexAttrib2dv glad_glVertexAttrib2dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -#define glVertexAttrib2f glad_glVertexAttrib2f -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -#define glVertexAttrib2fv glad_glVertexAttrib2fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -#define glVertexAttrib2s glad_glVertexAttrib2s -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -#define glVertexAttrib2sv glad_glVertexAttrib2sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -#define glVertexAttrib3d glad_glVertexAttrib3d -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -#define glVertexAttrib3dv glad_glVertexAttrib3dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -#define glVertexAttrib3f glad_glVertexAttrib3f -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -#define glVertexAttrib3fv glad_glVertexAttrib3fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -#define glVertexAttrib3s glad_glVertexAttrib3s -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -#define glVertexAttrib3sv glad_glVertexAttrib3sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -#define glVertexAttrib4Niv glad_glVertexAttrib4Niv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -#define glVertexAttrib4Nub glad_glVertexAttrib4Nub -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -#define glVertexAttrib4bv glad_glVertexAttrib4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -#define glVertexAttrib4d glad_glVertexAttrib4d -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -#define glVertexAttrib4dv glad_glVertexAttrib4dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -#define glVertexAttrib4f glad_glVertexAttrib4f -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -#define glVertexAttrib4fv glad_glVertexAttrib4fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -#define glVertexAttrib4iv glad_glVertexAttrib4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -#define glVertexAttrib4s glad_glVertexAttrib4s -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -#define glVertexAttrib4sv glad_glVertexAttrib4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -#define glVertexAttrib4ubv glad_glVertexAttrib4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -#define glVertexAttrib4uiv glad_glVertexAttrib4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -#define glVertexAttrib4usv glad_glVertexAttrib4usv -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -#define glVertexAttribPointer glad_glVertexAttribPointer -#endif -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -GLAPI int GLAD_GL_VERSION_2_1; -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv -#endif -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -GLAPI int GLAD_GL_VERSION_3_0; -typedef void (APIENTRYP PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI PFNGLCOLORMASKIPROC glad_glColorMaski; -#define glColorMaski glad_glColorMaski -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean* data); -GLAPI PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -#define glGetBooleani_v glad_glGetBooleani_v -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint* data); -GLAPI PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -#define glGetIntegeri_v glad_glGetIntegeri_v -typedef void (APIENTRYP PFNGLENABLEIPROC)(GLenum target, GLuint index); -GLAPI PFNGLENABLEIPROC glad_glEnablei; -#define glEnablei glad_glEnablei -typedef void (APIENTRYP PFNGLDISABLEIPROC)(GLenum target, GLuint index); -GLAPI PFNGLDISABLEIPROC glad_glDisablei; -#define glDisablei glad_glDisablei -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC)(GLenum target, GLuint index); -GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; -#define glIsEnabledi glad_glIsEnabledi -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -#define glBeginTransformFeedback glad_glBeginTransformFeedback -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -#define glEndTransformFeedback glad_glEndTransformFeedback -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -#define glBindBufferRange glad_glBindBufferRange -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -#define glBindBufferBase glad_glBindBufferBase -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp); -GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; -#define glClampColor glad_glClampColor -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); -GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -#define glBeginConditionalRender glad_glBeginConditionalRender -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -#define glEndConditionalRender glad_glEndConditionalRender -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -#define glVertexAttribIPointer glad_glVertexAttribIPointer -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -#define glGetVertexAttribIiv glad_glGetVertexAttribIiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint* params); -GLAPI PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x); -GLAPI PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -#define glVertexAttribI1i glad_glVertexAttribI1i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y); -GLAPI PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -#define glVertexAttribI2i glad_glVertexAttribI2i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -#define glVertexAttribI3i glad_glVertexAttribI3i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -#define glVertexAttribI4i glad_glVertexAttribI4i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x); -GLAPI PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -#define glVertexAttribI1ui glad_glVertexAttribI1ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y); -GLAPI PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -#define glVertexAttribI2ui glad_glVertexAttribI2ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -#define glVertexAttribI3ui glad_glVertexAttribI3ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -#define glVertexAttribI4ui glad_glVertexAttribI4ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -#define glVertexAttribI1iv glad_glVertexAttribI1iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -#define glVertexAttribI2iv glad_glVertexAttribI2iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -#define glVertexAttribI3iv glad_glVertexAttribI3iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -#define glVertexAttribI4iv glad_glVertexAttribI4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -#define glVertexAttribI1uiv glad_glVertexAttribI1uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -#define glVertexAttribI2uiv glad_glVertexAttribI2uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -#define glVertexAttribI3uiv glad_glVertexAttribI3uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -#define glVertexAttribI4uiv glad_glVertexAttribI4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -#define glVertexAttribI4bv glad_glVertexAttribI4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -#define glVertexAttribI4sv glad_glVertexAttribI4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -#define glVertexAttribI4ubv glad_glVertexAttribI4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -#define glVertexAttribI4usv glad_glVertexAttribI4usv -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -#define glGetUniformuiv glad_glGetUniformuiv -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -#define glBindFragDataLocation glad_glBindFragDataLocation -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -#define glGetFragDataLocation glad_glGetFragDataLocation -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0); -GLAPI PFNGLUNIFORM1UIPROC glad_glUniform1ui; -#define glUniform1ui glad_glUniform1ui -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLUNIFORM2UIPROC glad_glUniform2ui; -#define glUniform2ui glad_glUniform2ui -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLUNIFORM3UIPROC glad_glUniform3ui; -#define glUniform3ui glad_glUniform3ui -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLUNIFORM4UIPROC glad_glUniform4ui; -#define glUniform4ui glad_glUniform4ui -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -#define glUniform1uiv glad_glUniform1uiv -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -#define glUniform2uiv glad_glUniform2uiv -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -#define glUniform3uiv glad_glUniform3uiv -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -#define glUniform4uiv glad_glUniform4uiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -#define glTexParameterIiv glad_glTexParameterIiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -#define glTexParameterIuiv glad_glTexParameterIuiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -#define glGetTexParameterIiv glad_glGetTexParameterIiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -#define glGetTexParameterIuiv glad_glGetTexParameterIuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint* value); -GLAPI PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -#define glClearBufferiv glad_glClearBufferiv -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint* value); -GLAPI PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -#define glClearBufferuiv glad_glClearBufferuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat* value); -GLAPI PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -#define glClearBufferfv glad_glClearBufferfv -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -#define glClearBufferfi glad_glClearBufferfi -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum name, GLuint index); -GLAPI PFNGLGETSTRINGIPROC glad_glGetStringi; -#define glGetStringi glad_glGetStringi -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); -GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -#define glIsRenderbuffer glad_glIsRenderbuffer -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -#define glBindRenderbuffer glad_glBindRenderbuffer -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint* renderbuffers); -GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -#define glDeleteRenderbuffers glad_glDeleteRenderbuffers -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -#define glGenRenderbuffers glad_glGenRenderbuffers -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -#define glRenderbufferStorage glad_glRenderbufferStorage -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); -GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -#define glIsFramebuffer glad_glIsFramebuffer -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); -GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -#define glBindFramebuffer glad_glBindFramebuffer -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint* framebuffers); -GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -#define glDeleteFramebuffers glad_glDeleteFramebuffers -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -#define glGenFramebuffers glad_glGenFramebuffers -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -#define glCheckFramebufferStatus glad_glCheckFramebufferStatus -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -#define glFramebufferTexture1D glad_glFramebufferTexture1D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -#define glFramebufferTexture2D glad_glFramebufferTexture2D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -#define glFramebufferTexture3D glad_glFramebufferTexture3D -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum target); -GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -#define glGenerateMipmap glad_glGenerateMipmap -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -#define glBlitFramebuffer glad_glBlitFramebuffer -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -#define glFramebufferTextureLayer glad_glFramebufferTextureLayer -typedef void* (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -#define glMapBufferRange glad_glMapBufferRange -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -#define glFlushMappedBufferRange glad_glFlushMappedBufferRange -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC)(GLuint array); -GLAPI PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -#define glBindVertexArray glad_glBindVertexArray -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint* arrays); -GLAPI PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -#define glDeleteVertexArrays glad_glDeleteVertexArrays -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -#define glGenVertexArrays glad_glGenVertexArrays -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint array); -GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -#define glIsVertexArray glad_glIsVertexArray -#endif -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -GLAPI int GLAD_GL_VERSION_3_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -#define glDrawArraysInstanced glad_glDrawArraysInstanced -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -#define glDrawElementsInstanced glad_glDrawElementsInstanced -typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer; -#define glTexBuffer glad_glTexBuffer -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index); -GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -#define glCopyBufferSubData glad_glCopyBufferSubData -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); -GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -#define glGetUniformIndices glad_glGetUniformIndices -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -#define glGetActiveUniformsiv glad_glGetActiveUniformsiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); -GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -#define glGetActiveUniformName glad_glGetActiveUniformName -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar* uniformBlockName); -GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -#define glGetUniformBlockIndex glad_glGetUniformBlockIndex -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -#define glUniformBlockBinding glad_glUniformBlockBinding -#endif -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -GLAPI int GLAD_GL_VERSION_3_2; -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLint basevertex); -GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices, GLint basevertex); -GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount, const GLint* basevertex); -GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum mode); -GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -#define glProvokingVertex glad_glProvokingVertex -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags); -GLAPI PFNGLFENCESYNCPROC glad_glFenceSync; -#define glFenceSync glad_glFenceSync -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync); -GLAPI PFNGLISSYNCPROC glad_glIsSync; -#define glIsSync glad_glIsSync -typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync); -GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync; -#define glDeleteSync glad_glDeleteSync -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -#define glClientWaitSync glad_glClientWaitSync -typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; -#define glWaitSync glad_glWaitSync -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64* data); -GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -#define glGetInteger64v glad_glGetInteger64v -typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); -GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; -#define glGetSynciv glad_glGetSynciv -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64* data); -GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -#define glGetInteger64i_v glad_glGetInteger64i_v -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64* params); -GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -#define glGetBufferParameteri64v glad_glGetBufferParameteri64v -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -#define glFramebufferTexture glad_glFramebufferTexture -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -#define glTexImage2DMultisample glad_glTexImage2DMultisample -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -#define glTexImage3DMultisample glad_glTexImage3DMultisample -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat* val); -GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -#define glGetMultisamplefv glad_glGetMultisamplefv -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask); -GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -#define glSampleMaski glad_glSampleMaski -#endif -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -GLAPI int GLAD_GL_VERSION_3_3; -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -#define glGetFragDataIndex glad_glGetFragDataIndex -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint* samplers); -GLAPI PFNGLGENSAMPLERSPROC glad_glGenSamplers; -#define glGenSamplers glad_glGenSamplers -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint* samplers); -GLAPI PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -#define glDeleteSamplers glad_glDeleteSamplers -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC)(GLuint sampler); -GLAPI PFNGLISSAMPLERPROC glad_glIsSampler; -#define glIsSampler glad_glIsSampler -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler); -GLAPI PFNGLBINDSAMPLERPROC glad_glBindSampler; -#define glBindSampler glad_glBindSampler -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param); -GLAPI PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -#define glSamplerParameteri glad_glSamplerParameteri -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint* param); -GLAPI PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -#define glSamplerParameteriv glad_glSamplerParameteriv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param); -GLAPI PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -#define glSamplerParameterf glad_glSamplerParameterf -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat* param); -GLAPI PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -#define glSamplerParameterfv glad_glSamplerParameterfv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint* param); -GLAPI PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -#define glSamplerParameterIiv glad_glSamplerParameterIiv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint* param); -GLAPI PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -#define glSamplerParameterIuiv glad_glSamplerParameterIuiv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -#define glGetSamplerParameteriv glad_glGetSamplerParameteriv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat* params); -GLAPI PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -#define glGetSamplerParameterfv glad_glGetSamplerParameterfv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target); -GLAPI PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -#define glQueryCounter glad_glQueryCounter -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64* params); -GLAPI PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -#define glGetQueryObjecti64v glad_glGetQueryObjecti64v -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64* params); -GLAPI PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -#define glGetQueryObjectui64v glad_glGetQueryObjectui64v -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -#define glVertexAttribDivisor glad_glVertexAttribDivisor -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -#define glVertexAttribP1ui glad_glVertexAttribP1ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -#define glVertexAttribP1uiv glad_glVertexAttribP1uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -#define glVertexAttribP2ui glad_glVertexAttribP2ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -#define glVertexAttribP2uiv glad_glVertexAttribP2uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -#define glVertexAttribP3ui glad_glVertexAttribP3ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -#define glVertexAttribP3uiv glad_glVertexAttribP3uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -#define glVertexAttribP4ui glad_glVertexAttribP4ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -#define glVertexAttribP4uiv glad_glVertexAttribP4uiv -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -#define glVertexP2ui glad_glVertexP2ui -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -#define glVertexP2uiv glad_glVertexP2uiv -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -#define glVertexP3ui glad_glVertexP3ui -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -#define glVertexP3uiv glad_glVertexP3uiv -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -#define glVertexP4ui glad_glVertexP4ui -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -#define glVertexP4uiv glad_glVertexP4uiv -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -#define glTexCoordP1ui glad_glTexCoordP1ui -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -#define glTexCoordP1uiv glad_glTexCoordP1uiv -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -#define glTexCoordP2ui glad_glTexCoordP2ui -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -#define glTexCoordP2uiv glad_glTexCoordP2uiv -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -#define glTexCoordP3ui glad_glTexCoordP3ui -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -#define glTexCoordP3uiv glad_glTexCoordP3uiv -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -#define glTexCoordP4ui glad_glTexCoordP4ui -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -#define glTexCoordP4uiv glad_glTexCoordP4uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv -typedef void (APIENTRYP PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLNORMALP3UIPROC glad_glNormalP3ui; -#define glNormalP3ui glad_glNormalP3ui -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -#define glNormalP3uiv glad_glNormalP3uiv -typedef void (APIENTRYP PFNGLCOLORP3UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLCOLORP3UIPROC glad_glColorP3ui; -#define glColorP3ui glad_glColorP3ui -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -#define glColorP3uiv glad_glColorP3uiv -typedef void (APIENTRYP PFNGLCOLORP4UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLCOLORP4UIPROC glad_glColorP4ui; -#define glColorP4ui glad_glColorP4ui -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -#define glColorP4uiv glad_glColorP4uiv -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -#define glSecondaryColorP3ui glad_glSecondaryColorP3ui -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv -#endif -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_MAP_PERSISTENT_BIT 0x0040 -#define GL_MAP_COHERENT_BIT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 -#define GL_SAMPLE_LOCATION_ARB 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -GLAPI int GLAD_GL_AMD_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC)(GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -#define glDebugMessageEnableAMD glad_glDebugMessageEnableAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC)(GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -#define glDebugMessageInsertAMD glad_glDebugMessageInsertAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC)(GLDEBUGPROCAMD callback, void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -#define glDebugMessageCallbackAMD glad_glDebugMessageCallbackAMD -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC)(GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); -GLAPI PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -#define glGetDebugMessageLogAMD glad_glGetDebugMessageLogAMD -#endif -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -GLAPI int GLAD_GL_AMD_query_buffer_object; -#endif -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -GLAPI int GLAD_GL_ARB_ES2_compatibility; -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(); -GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -#define glReleaseShaderCompiler glad_glReleaseShaderCompiler -typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); -GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; -#define glShaderBinary glad_glShaderBinary -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); -GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -#define glDepthRangef glad_glDepthRangef -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); -GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -#define glClearDepthf glad_glClearDepthf -#endif -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_compatibility; -#endif -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -GLAPI int GLAD_GL_ARB_buffer_storage; -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -#define glBufferStorage glad_glBufferStorage -#endif -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -GLAPI int GLAD_GL_ARB_compatibility; -#endif -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -GLAPI int GLAD_GL_ARB_compressed_texture_pixel_storage; -#endif -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -GLAPI int GLAD_GL_ARB_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -#define glDebugMessageControlARB glad_glDebugMessageControlARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -#define glDebugMessageInsertARB glad_glDebugMessageInsertARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB -#endif -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -GLAPI int GLAD_GL_ARB_depth_buffer_float; -#endif -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -GLAPI int GLAD_GL_ARB_depth_clamp; -#endif -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -GLAPI int GLAD_GL_ARB_depth_texture; -#endif -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -GLAPI int GLAD_GL_ARB_draw_buffers; -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -#define glDrawBuffersARB glad_glDrawBuffersARB -#endif -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -GLAPI int GLAD_GL_ARB_draw_buffers_blend; -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC)(GLuint buf, GLenum mode); -GLAPI PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -#define glBlendEquationiARB glad_glBlendEquationiARB -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -#define glBlendEquationSeparateiARB glad_glBlendEquationSeparateiARB -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC)(GLuint buf, GLenum src, GLenum dst); -GLAPI PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -#define glBlendFunciARB glad_glBlendFunciARB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -#define glBlendFuncSeparateiARB glad_glBlendFuncSeparateiARB -#endif -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -GLAPI int GLAD_GL_ARB_explicit_attrib_location; -#endif -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -GLAPI int GLAD_GL_ARB_explicit_uniform_location; -#endif -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -GLAPI int GLAD_GL_ARB_fragment_program; -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); -GLAPI PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -#define glProgramStringARB glad_glProgramStringARB -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); -GLAPI PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -#define glBindProgramARB glad_glBindProgramARB -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -#define glDeleteProgramsARB glad_glDeleteProgramsARB -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); -GLAPI PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -#define glGenProgramsARB glad_glGenProgramsARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -#define glProgramEnvParameter4dARB glad_glProgramEnvParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -#define glProgramEnvParameter4dvARB glad_glProgramEnvParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -#define glProgramEnvParameter4fARB glad_glProgramEnvParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -#define glProgramEnvParameter4fvARB glad_glProgramEnvParameter4fvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -#define glProgramLocalParameter4dARB glad_glProgramLocalParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -#define glProgramLocalParameter4dvARB glad_glProgramLocalParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -#define glProgramLocalParameter4fARB glad_glProgramLocalParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -#define glProgramLocalParameter4fvARB glad_glProgramLocalParameter4fvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -#define glGetProgramEnvParameterdvARB glad_glGetProgramEnvParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -#define glGetProgramEnvParameterfvARB glad_glGetProgramEnvParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -#define glGetProgramLocalParameterdvARB glad_glGetProgramLocalParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -#define glGetProgramLocalParameterfvARB glad_glGetProgramLocalParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -#define glGetProgramivARB glad_glGetProgramivARB -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); -GLAPI PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -#define glGetProgramStringARB glad_glGetProgramStringARB -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC)(GLuint program); -GLAPI PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -#define glIsProgramARB glad_glIsProgramARB -#endif -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -GLAPI int GLAD_GL_ARB_fragment_shader; -#endif -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -GLAPI int GLAD_GL_ARB_framebuffer_object; -#endif -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -GLAPI int GLAD_GL_ARB_framebuffer_sRGB; -#endif -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -GLAPI int GLAD_GL_ARB_multisample; -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -#define glSampleCoverageARB glad_glSampleCoverageARB -#endif -#ifndef GL_ARB_sample_locations -#define GL_ARB_sample_locations 1 -GLAPI int GLAD_GL_ARB_sample_locations; -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -#define glFramebufferSampleLocationsfvARB glad_glFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -#define glNamedFramebufferSampleLocationsfvARB glad_glNamedFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC)(); -GLAPI PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -#define glEvaluateDepthValuesARB glad_glEvaluateDepthValuesARB -#endif -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -GLAPI int GLAD_GL_ARB_texture_compression; -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -#define glCompressedTexImage3DARB glad_glCompressedTexImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -#define glCompressedTexImage2DARB glad_glCompressedTexImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -#define glCompressedTexImage1DARB glad_glCompressedTexImage1DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -#define glCompressedTexSubImage3DARB glad_glCompressedTexSubImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -#define glCompressedTexSubImage2DARB glad_glCompressedTexSubImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -#define glCompressedTexSubImage1DARB glad_glCompressedTexSubImage1DARB -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -#define glGetCompressedTexImageARB glad_glGetCompressedTexImageARB -#endif -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -GLAPI int GLAD_GL_ARB_texture_float; -#endif -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -GLAPI int GLAD_GL_ARB_texture_multisample; -#endif -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -GLAPI int GLAD_GL_ARB_texture_non_power_of_two; -#endif -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -GLAPI int GLAD_GL_ARB_texture_rg; -#endif -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -GLAPI int GLAD_GL_ARB_texture_swizzle; -#endif -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -GLAPI int GLAD_GL_ARB_uniform_buffer_object; -#endif -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -GLAPI int GLAD_GL_ARB_vertex_array_object; -#endif -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -GLAPI int GLAD_GL_ARB_vertex_attrib_binding; -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -#define glBindVertexBuffer glad_glBindVertexBuffer -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -#define glVertexAttribFormat glad_glVertexAttribFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -#define glVertexAttribIFormat glad_glVertexAttribIFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -#define glVertexAttribLFormat glad_glVertexAttribLFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC)(GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -#define glVertexAttribBinding glad_glVertexAttribBinding -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC)(GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -#define glVertexBindingDivisor glad_glVertexBindingDivisor -#endif -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -GLAPI int GLAD_GL_ARB_vertex_buffer_object; -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); -GLAPI PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -#define glBindBufferARB glad_glBindBufferARB -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); -GLAPI PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -#define glDeleteBuffersARB glad_glDeleteBuffersARB -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -#define glGenBuffersARB glad_glGenBuffersARB -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC)(GLuint buffer); -GLAPI PFNGLISBUFFERARBPROC glad_glIsBufferARB; -#define glIsBufferARB glad_glIsBufferARB -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const void* data, GLenum usage); -GLAPI PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -#define glBufferDataARB glad_glBufferDataARB -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void* data); -GLAPI PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -#define glBufferSubDataARB glad_glBufferSubDataARB -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void* data); -GLAPI PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -#define glGetBufferSubDataARB glad_glGetBufferSubDataARB -typedef void* (APIENTRYP PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -#define glMapBufferARB glad_glMapBufferARB -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC)(GLenum target); -GLAPI PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -#define glUnmapBufferARB glad_glUnmapBufferARB -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -#define glGetBufferParameterivARB glad_glGetBufferParameterivARB -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -#define glGetBufferPointervARB glad_glGetBufferPointervARB -#endif -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -GLAPI int GLAD_GL_ARB_vertex_program; -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -#define glVertexAttrib1dARB glad_glVertexAttrib1dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -#define glVertexAttrib1dvARB glad_glVertexAttrib1dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -#define glVertexAttrib1fARB glad_glVertexAttrib1fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -#define glVertexAttrib1fvARB glad_glVertexAttrib1fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -#define glVertexAttrib1sARB glad_glVertexAttrib1sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -#define glVertexAttrib1svARB glad_glVertexAttrib1svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -#define glVertexAttrib2dARB glad_glVertexAttrib2dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -#define glVertexAttrib2dvARB glad_glVertexAttrib2dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -#define glVertexAttrib2fARB glad_glVertexAttrib2fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -#define glVertexAttrib2fvARB glad_glVertexAttrib2fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -#define glVertexAttrib2sARB glad_glVertexAttrib2sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -#define glVertexAttrib2svARB glad_glVertexAttrib2svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -#define glVertexAttrib3dARB glad_glVertexAttrib3dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -#define glVertexAttrib3dvARB glad_glVertexAttrib3dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -#define glVertexAttrib3fARB glad_glVertexAttrib3fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -#define glVertexAttrib3fvARB glad_glVertexAttrib3fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -#define glVertexAttrib3sARB glad_glVertexAttrib3sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -#define glVertexAttrib3svARB glad_glVertexAttrib3svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -#define glVertexAttrib4NbvARB glad_glVertexAttrib4NbvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -#define glVertexAttrib4NivARB glad_glVertexAttrib4NivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -#define glVertexAttrib4NsvARB glad_glVertexAttrib4NsvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -#define glVertexAttrib4NubARB glad_glVertexAttrib4NubARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -#define glVertexAttrib4NubvARB glad_glVertexAttrib4NubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -#define glVertexAttrib4NuivARB glad_glVertexAttrib4NuivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -#define glVertexAttrib4NusvARB glad_glVertexAttrib4NusvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -#define glVertexAttrib4bvARB glad_glVertexAttrib4bvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -#define glVertexAttrib4dARB glad_glVertexAttrib4dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -#define glVertexAttrib4dvARB glad_glVertexAttrib4dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -#define glVertexAttrib4fARB glad_glVertexAttrib4fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -#define glVertexAttrib4fvARB glad_glVertexAttrib4fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -#define glVertexAttrib4ivARB glad_glVertexAttrib4ivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -#define glVertexAttrib4sARB glad_glVertexAttrib4sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -#define glVertexAttrib4svARB glad_glVertexAttrib4svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -#define glVertexAttrib4ubvARB glad_glVertexAttrib4ubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -#define glVertexAttrib4uivARB glad_glVertexAttrib4uivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -#define glVertexAttrib4usvARB glad_glVertexAttrib4usvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -#define glVertexAttribPointerARB glad_glVertexAttribPointerARB -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -#define glEnableVertexAttribArrayARB glad_glEnableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -#define glDisableVertexAttribArrayARB glad_glDisableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -#define glGetVertexAttribdvARB glad_glGetVertexAttribdvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -#define glGetVertexAttribfvARB glad_glGetVertexAttribfvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -#define glGetVertexAttribivARB glad_glGetVertexAttribivARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -#define glGetVertexAttribPointervARB glad_glGetVertexAttribPointervARB -#endif -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -GLAPI int GLAD_GL_ARB_vertex_shader; -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC)(GLhandleARB programObj, GLuint index, const GLcharARB* name); -GLAPI PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -#define glBindAttribLocationARB glad_glBindAttribLocationARB -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); -GLAPI PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -#define glGetActiveAttribARB glad_glGetActiveAttribARB -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); -GLAPI PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -#define glGetAttribLocationARB glad_glGetAttribLocationARB -#endif -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -GLAPI int GLAD_GL_ATI_element_array; -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC)(GLenum type, const void* pointer); -GLAPI PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -#define glElementPointerATI glad_glElementPointerATI -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC)(GLenum mode, GLsizei count); -GLAPI PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -#define glDrawElementArrayATI glad_glDrawElementArrayATI -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count); -GLAPI PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -#define glDrawRangeElementArrayATI glad_glDrawRangeElementArrayATI -#endif -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -GLAPI int GLAD_GL_ATI_fragment_shader; -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); -GLAPI PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -#define glGenFragmentShadersATI glad_glGenFragmentShadersATI -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -#define glBindFragmentShaderATI glad_glBindFragmentShaderATI -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -#define glDeleteFragmentShaderATI glad_glDeleteFragmentShaderATI -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -#define glBeginFragmentShaderATI glad_glBeginFragmentShaderATI -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -#define glEndFragmentShaderATI glad_glEndFragmentShaderATI -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); -GLAPI PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -#define glPassTexCoordATI glad_glPassTexCoordATI -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); -GLAPI PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -#define glSampleMapATI glad_glSampleMapATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -#define glColorFragmentOp1ATI glad_glColorFragmentOp1ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -#define glColorFragmentOp2ATI glad_glColorFragmentOp2ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -#define glColorFragmentOp3ATI glad_glColorFragmentOp3ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -#define glAlphaFragmentOp1ATI glad_glAlphaFragmentOp1ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -#define glAlphaFragmentOp2ATI glad_glAlphaFragmentOp2ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -#define glAlphaFragmentOp3ATI glad_glAlphaFragmentOp3ATI -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat* value); -GLAPI PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -#define glSetFragmentShaderConstantATI glad_glSetFragmentShaderConstantATI -#endif -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -GLAPI int GLAD_GL_ATI_vertex_array_object; -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC)(GLsizei size, const void* pointer, GLenum usage); -GLAPI PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -#define glNewObjectBufferATI glad_glNewObjectBufferATI -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -#define glIsObjectBufferATI glad_glIsObjectBufferATI -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC)(GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); -GLAPI PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -#define glUpdateObjectBufferATI glad_glUpdateObjectBufferATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC)(GLuint buffer, GLenum pname, GLfloat* params); -GLAPI PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -#define glGetObjectBufferfvATI glad_glGetObjectBufferfvATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -#define glGetObjectBufferivATI glad_glGetObjectBufferivATI -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -#define glFreeObjectBufferATI glad_glFreeObjectBufferATI -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC)(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -#define glArrayObjectATI glad_glArrayObjectATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC)(GLenum array, GLenum pname, GLfloat* params); -GLAPI PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -#define glGetArrayObjectfvATI glad_glGetArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC)(GLenum array, GLenum pname, GLint* params); -GLAPI PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -#define glGetArrayObjectivATI glad_glGetArrayObjectivATI -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC)(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -#define glVariantArrayObjectATI glad_glVariantArrayObjectATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC)(GLuint id, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -#define glGetVariantArrayObjectfvATI glad_glGetVariantArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -#define glGetVariantArrayObjectivATI glad_glGetVariantArrayObjectivATI -#endif -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -GLAPI int GLAD_GL_EXT_blend_color; -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -#define glBlendColorEXT glad_glBlendColorEXT -#endif -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -GLAPI int GLAD_GL_EXT_blend_equation_separate; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC)(GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -#define glBlendEquationSeparateEXT glad_glBlendEquationSeparateEXT -#endif -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -GLAPI int GLAD_GL_EXT_blend_func_separate; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -#define glBlendFuncSeparateEXT glad_glBlendFuncSeparateEXT -#endif -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -GLAPI int GLAD_GL_EXT_debug_marker; -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC)(GLsizei length, const GLchar *marker); -GLAPI PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -#define glInsertEventMarkerEXT glad_glInsertEventMarkerEXT -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC)(GLsizei length, const GLchar *marker); -GLAPI PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -#define glPushGroupMarkerEXT glad_glPushGroupMarkerEXT -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC)(void); -GLAPI PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -#define glPopGroupMarkerEXT glad_glPopGroupMarkerEXT -#endif -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -GLAPI int GLAD_GL_EXT_framebuffer_blit; -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -#define glBlitFramebufferEXT glad_glBlitFramebufferEXT -#endif -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample; -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT -#endif -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -#endif -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -GLAPI int GLAD_GL_EXT_framebuffer_object; -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); -GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -#define glIsRenderbufferEXT glad_glIsRenderbufferEXT -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -#define glBindRenderbufferEXT glad_glBindRenderbufferEXT -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint* renderbuffers); -GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); -GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -#define glIsFramebufferEXT glad_glIsFramebufferEXT -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); -GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -#define glBindFramebufferEXT glad_glBindFramebufferEXT -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint* framebuffers); -GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -#define glGenFramebuffersEXT glad_glGenFramebuffersEXT -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); -GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -#define glGenerateMipmapEXT glad_glGenerateMipmapEXT -#endif -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -GLAPI int GLAD_GL_EXT_framebuffer_sRGB; -#endif -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -GLAPI int GLAD_GL_EXT_index_array_formats; -#endif -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -GLAPI int GLAD_GL_EXT_texture; -#endif -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -GLAPI int GLAD_GL_EXT_texture_compression_s3tc; -#endif -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -GLAPI int GLAD_GL_EXT_texture_sRGB; -#endif -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -GLAPI int GLAD_GL_EXT_texture_swizzle; -#endif -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -GLAPI int GLAD_GL_EXT_vertex_array; -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC)(GLint i); -GLAPI PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -#define glArrayElementEXT glad_glArrayElementEXT -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -#define glColorPointerEXT glad_glColorPointerEXT -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -#define glDrawArraysEXT glad_glDrawArraysEXT -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); -GLAPI PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -#define glEdgeFlagPointerEXT glad_glEdgeFlagPointerEXT -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -#define glGetPointervEXT glad_glGetPointervEXT -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -#define glIndexPointerEXT glad_glIndexPointerEXT -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -#define glNormalPointerEXT glad_glNormalPointerEXT -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -#define glTexCoordPointerEXT glad_glTexCoordPointerEXT -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -#define glVertexPointerEXT glad_glVertexPointerEXT -#endif -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -GLAPI int GLAD_GL_EXT_vertex_shader; -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC)(); -GLAPI PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -#define glBeginVertexShaderEXT glad_glBeginVertexShaderEXT -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC)(); -GLAPI PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -#define glEndVertexShaderEXT glad_glEndVertexShaderEXT -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -#define glBindVertexShaderEXT glad_glBindVertexShaderEXT -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC)(GLuint range); -GLAPI PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -#define glGenVertexShadersEXT glad_glGenVertexShadersEXT -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -#define glDeleteVertexShaderEXT glad_glDeleteVertexShaderEXT -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC)(GLenum op, GLuint res, GLuint arg1); -GLAPI PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -#define glShaderOp1EXT glad_glShaderOp1EXT -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -#define glShaderOp2EXT glad_glShaderOp2EXT -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -#define glShaderOp3EXT glad_glShaderOp3EXT -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -#define glSwizzleEXT glad_glSwizzleEXT -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -#define glWriteMaskEXT glad_glWriteMaskEXT -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -#define glInsertComponentEXT glad_glInsertComponentEXT -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -#define glExtractComponentEXT glad_glExtractComponentEXT -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC)(GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -#define glGenSymbolsEXT glad_glGenSymbolsEXT -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -#define glSetInvariantEXT glad_glSetInvariantEXT -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -#define glSetLocalConstantEXT glad_glSetLocalConstantEXT -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC)(GLuint id, const GLbyte* addr); -GLAPI PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -#define glVariantbvEXT glad_glVariantbvEXT -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC)(GLuint id, const GLshort* addr); -GLAPI PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -#define glVariantsvEXT glad_glVariantsvEXT -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC)(GLuint id, const GLint* addr); -GLAPI PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -#define glVariantivEXT glad_glVariantivEXT -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC)(GLuint id, const GLfloat* addr); -GLAPI PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -#define glVariantfvEXT glad_glVariantfvEXT -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC)(GLuint id, const GLdouble* addr); -GLAPI PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -#define glVariantdvEXT glad_glVariantdvEXT -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC)(GLuint id, const GLubyte* addr); -GLAPI PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -#define glVariantubvEXT glad_glVariantubvEXT -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC)(GLuint id, const GLushort* addr); -GLAPI PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -#define glVariantusvEXT glad_glVariantusvEXT -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC)(GLuint id, const GLuint* addr); -GLAPI PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -#define glVariantuivEXT glad_glVariantuivEXT -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC)(GLuint id, GLenum type, GLuint stride, const void* addr); -GLAPI PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -#define glVariantPointerEXT glad_glVariantPointerEXT -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -#define glEnableVariantClientStateEXT glad_glEnableVariantClientStateEXT -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -#define glDisableVariantClientStateEXT glad_glDisableVariantClientStateEXT -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC)(GLenum light, GLenum value); -GLAPI PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -#define glBindLightParameterEXT glad_glBindLightParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC)(GLenum face, GLenum value); -GLAPI PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -#define glBindMaterialParameterEXT glad_glBindMaterialParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC)(GLenum unit, GLenum coord, GLenum value); -GLAPI PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -#define glBindTexGenParameterEXT glad_glBindTexGenParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)(GLenum unit, GLenum value); -GLAPI PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -#define glBindTextureUnitParameterEXT glad_glBindTextureUnitParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC)(GLenum value); -GLAPI PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -#define glBindParameterEXT glad_glBindParameterEXT -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC)(GLuint id, GLenum cap); -GLAPI PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -#define glIsVariantEnabledEXT glad_glIsVariantEnabledEXT -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -#define glGetVariantBooleanvEXT glad_glGetVariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -#define glGetVariantIntegervEXT glad_glGetVariantIntegervEXT -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -#define glGetVariantFloatvEXT glad_glGetVariantFloatvEXT -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC)(GLuint id, GLenum value, void** data); -GLAPI PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -#define glGetVariantPointervEXT glad_glGetVariantPointervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -#define glGetInvariantBooleanvEXT glad_glGetInvariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -#define glGetInvariantIntegervEXT glad_glGetInvariantIntegervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -#define glGetInvariantFloatvEXT glad_glGetInvariantFloatvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -#define glGetLocalConstantBooleanvEXT glad_glGetLocalConstantBooleanvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -#define glGetLocalConstantIntegervEXT glad_glGetLocalConstantIntegervEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -#define glGetLocalConstantFloatvEXT glad_glGetLocalConstantFloatvEXT -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// IMPLEMENTATION SECTION -// - -#ifdef GLAD_IMPLEMENTATION - -#include -#include -#include - -struct gladGLversionStruct GLVersion; - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define _GLAD_IS_SOME_NEW_VERSION 1 -#endif - -static int max_loaded_major; -static int max_loaded_minor; - -static const char *exts = NULL; -static int num_exts_i = 0; -static const char **exts_i = NULL; - -static int get_exts(void) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - exts = (const char *)glGetString(GL_EXTENSIONS); -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - num_exts_i = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); - if (num_exts_i > 0) { - exts_i = (const char **)GLAD_REALLOC((void *)exts_i, num_exts_i * sizeof *exts_i); - } - - if (exts_i == NULL) { - return 0; - } - - for(index = 0; index < num_exts_i; index++) { - exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); - } - } -#endif - return 1; -} - -static void free_exts(void) { - if (exts_i != NULL) { - GLAD_FREE((char **)exts_i); - exts_i = NULL; - } -} - -static int has_ext(const char *ext) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - - if(strcmp(e, ext) == 0) { - return 1; - } - } - } -#endif - - return 0; -} -int GLAD_GL_VERSION_1_0; -int GLAD_GL_VERSION_1_1; -int GLAD_GL_VERSION_1_2; -int GLAD_GL_VERSION_1_3; -int GLAD_GL_VERSION_1_4; -int GLAD_GL_VERSION_1_5; -int GLAD_GL_VERSION_2_0; -int GLAD_GL_VERSION_2_1; -int GLAD_GL_VERSION_3_0; -int GLAD_GL_VERSION_3_1; -int GLAD_GL_VERSION_3_2; -int GLAD_GL_VERSION_3_3; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -PFNGLBINDSAMPLERPROC glad_glBindSampler; -PFNGLLINEWIDTHPROC glad_glLineWidth; -PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -PFNGLCOMPILESHADERPROC glad_glCompileShader; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -PFNGLENABLEIPROC glad_glEnablei; -PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -PFNGLCREATESHADERPROC glad_glCreateShader; -PFNGLISBUFFERPROC glad_glIsBuffer; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -PFNGLHINTPROC glad_glHint; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -PFNGLPOINTSIZEPROC glad_glPointSize; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -PFNGLWAITSYNCPROC glad_glWaitSync; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -PFNGLUNIFORM3IPROC glad_glUniform3i; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -PFNGLUNIFORM3FPROC glad_glUniform3f; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -PFNGLCOLORMASKIPROC glad_glColorMaski; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -PFNGLDRAWARRAYSPROC glad_glDrawArrays; -PFNGLUNIFORM1UIPROC glad_glUniform1ui; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -PFNGLCLEARPROC glad_glClear; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -PFNGLISENABLEDPROC glad_glIsEnabled; -PFNGLSTENCILOPPROC glad_glStencilOp; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -PFNGLGETQUERYIVPROC glad_glGetQueryiv; -PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -PFNGLISSHADERPROC glad_glIsShader; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -PFNGLENABLEPROC glad_glEnable; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -PFNGLFLUSHPROC glad_glFlush; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -PFNGLFENCESYNCPROC glad_glFenceSync; -PFNGLCOLORP3UIPROC glad_glColorP3ui; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -PFNGLGENSAMPLERSPROC glad_glGenSamplers; -PFNGLCLAMPCOLORPROC glad_glClampColor; -PFNGLUNIFORM4IVPROC glad_glUniform4iv; -PFNGLCLEARSTENCILPROC glad_glClearStencil; -PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -PFNGLGENTEXTURESPROC glad_glGenTextures; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -PFNGLISSYNCPROC glad_glIsSync; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -PFNGLUNIFORM2IPROC glad_glUniform2i; -PFNGLUNIFORM2FPROC glad_glUniform2f; -PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -PFNGLGENQUERIESPROC glad_glGenQueries; -PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -PFNGLISENABLEDIPROC glad_glIsEnabledi; -PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -PFNGLUNIFORM2IVPROC glad_glUniform2iv; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -PFNGLGETSHADERIVPROC glad_glGetShaderiv; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -PFNGLGETDOUBLEVPROC glad_glGetDoublev; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -PFNGLUNIFORM3FVPROC glad_glUniform3fv; -PFNGLDEPTHRANGEPROC glad_glDepthRange; -PFNGLMAPBUFFERPROC glad_glMapBuffer; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -PFNGLDELETESYNCPROC glad_glDeleteSync; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -PFNGLUNIFORM3IVPROC glad_glUniform3iv; -PFNGLPOLYGONMODEPROC glad_glPolygonMode; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -PFNGLUSEPROGRAMPROC glad_glUseProgram; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -PFNGLFINISHPROC glad_glFinish; -PFNGLDELETESHADERPROC glad_glDeleteShader; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -PFNGLVIEWPORTPROC glad_glViewport; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -PFNGLUNIFORM2UIPROC glad_glUniform2ui; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -PFNGLCLEARDEPTHPROC glad_glClearDepth; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -PFNGLTEXBUFFERPROC glad_glTexBuffer; -PFNGLPIXELSTOREIPROC glad_glPixelStorei; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -PFNGLPIXELSTOREFPROC glad_glPixelStoref; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -PFNGLLINKPROGRAMPROC glad_glLinkProgram; -PFNGLBINDTEXTUREPROC glad_glBindTexture; -PFNGLGETSTRINGPROC glad_glGetString; -PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -PFNGLDETACHSHADERPROC glad_glDetachShader; -PFNGLENDQUERYPROC glad_glEndQuery; -PFNGLNORMALP3UIPROC glad_glNormalP3ui; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -PFNGLUNIFORM1FPROC glad_glUniform1f; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -PFNGLUNIFORM1IPROC glad_glUniform1i; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -PFNGLDISABLEPROC glad_glDisable; -PFNGLLOGICOPPROC glad_glLogicOp; -PFNGLUNIFORM4UIPROC glad_glUniform4ui; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -PFNGLCULLFACEPROC glad_glCullFace; -PFNGLGETSTRINGIPROC glad_glGetStringi; -PFNGLATTACHSHADERPROC glad_glAttachShader; -PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -PFNGLDRAWELEMENTSPROC glad_glDrawElements; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -PFNGLUNIFORM1IVPROC glad_glUniform1iv; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -PFNGLREADBUFFERPROC glad_glReadBuffer; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -PFNGLBLENDCOLORPROC glad_glBlendColor; -PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -PFNGLISPROGRAMPROC glad_glIsProgram; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -PFNGLUNIFORM4IPROC glad_glUniform4i; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -PFNGLREADPIXELSPROC glad_glReadPixels; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -PFNGLUNIFORM4FPROC glad_glUniform4f; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -PFNGLSTENCILFUNCPROC glad_glStencilFunc; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -PFNGLCOLORP4UIPROC glad_glColorP4ui; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -PFNGLGENBUFFERSPROC glad_glGenBuffers; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -PFNGLBLENDFUNCPROC glad_glBlendFunc; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -PFNGLSCISSORPROC glad_glScissor; -PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -PFNGLCLEARCOLORPROC glad_glClearColor; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -PFNGLUNIFORM3UIPROC glad_glUniform3ui; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -PFNGLUNIFORM2FVPROC glad_glUniform2fv; -PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -PFNGLDEPTHFUNCPROC glad_glDepthFunc; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -PFNGLCOLORMASKPROC glad_glColorMask; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -PFNGLUNIFORM4FVPROC glad_glUniform4fv; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -PFNGLISSAMPLERPROC glad_glIsSampler; -PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -PFNGLDISABLEIPROC glad_glDisablei; -PFNGLSHADERSOURCEPROC glad_glShaderSource; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -PFNGLGETSYNCIVPROC glad_glGetSynciv; -PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -PFNGLBEGINQUERYPROC glad_glBeginQuery; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -PFNGLBINDBUFFERPROC glad_glBindBuffer; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -PFNGLBUFFERDATAPROC glad_glBufferData; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -PFNGLGETERRORPROC glad_glGetError; -PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -PFNGLGETFLOATVPROC glad_glGetFloatv; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -PFNGLGETINTEGERVPROC glad_glGetIntegerv; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -PFNGLISQUERYPROC glad_glIsQuery; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -PFNGLSTENCILMASKPROC glad_glStencilMask; -PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -PFNGLISTEXTUREPROC glad_glIsTexture; -PFNGLUNIFORM1FVPROC glad_glUniform1fv; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -PFNGLDEPTHMASKPROC glad_glDepthMask; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -PFNGLFRONTFACEPROC glad_glFrontFace; -int GLAD_GL_ARB_texture_compression; -int GLAD_GL_ARB_texture_swizzle; -int GLAD_GL_ATI_fragment_shader; -int GLAD_GL_EXT_texture_sRGB; -int GLAD_GL_ARB_explicit_attrib_location; -int GLAD_GL_ARB_ES3_compatibility; -int GLAD_GL_EXT_blend_color; -int GLAD_GL_EXT_framebuffer_sRGB; -int GLAD_GL_EXT_index_array_formats; -int GLAD_GL_ARB_vertex_shader; -int GLAD_GL_ARB_vertex_attrib_binding; -int GLAD_GL_ARB_vertex_program; -int GLAD_GL_EXT_texture_compression_s3tc; -int GLAD_GL_EXT_debug_marker; -int GLAD_GL_EXT_texture_swizzle; -int GLAD_GL_ARB_texture_multisample; -int GLAD_GL_ARB_texture_rg; -int GLAD_GL_ARB_texture_float; -int GLAD_GL_ARB_compressed_texture_pixel_storage; -int GLAD_GL_ARB_framebuffer_sRGB; -int GLAD_GL_ARB_vertex_array_object; -int GLAD_GL_ARB_depth_clamp; -int GLAD_GL_ARB_fragment_shader; -int GLAD_GL_ATI_vertex_array_object; -int GLAD_GL_ARB_vertex_buffer_object; -int GLAD_GL_ARB_fragment_program; -int GLAD_GL_EXT_framebuffer_multisample; -int GLAD_GL_ARB_framebuffer_object; -int GLAD_GL_ARB_draw_buffers_blend; -int GLAD_GL_EXT_vertex_shader; -int GLAD_GL_EXT_blend_func_separate; -int GLAD_GL_ARB_texture_non_power_of_two; -int GLAD_GL_EXT_texture; -int GLAD_GL_ARB_buffer_storage; -int GLAD_GL_ARB_explicit_uniform_location; -int GLAD_GL_EXT_framebuffer_object; -int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -int GLAD_GL_AMD_debug_output; -int GLAD_GL_ARB_depth_buffer_float; -int GLAD_GL_ARB_multisample; -int GLAD_GL_ARB_compatibility; -int GLAD_GL_ARB_depth_texture; -int GLAD_GL_ARB_sample_locations; -int GLAD_GL_ARB_ES2_compatibility; -int GLAD_GL_AMD_query_buffer_object; -int GLAD_GL_EXT_framebuffer_blit; -int GLAD_GL_EXT_vertex_array; -int GLAD_GL_ARB_draw_buffers; -int GLAD_GL_EXT_blend_equation_separate; -int GLAD_GL_ATI_element_array; -int GLAD_GL_ARB_debug_output; -int GLAD_GL_ARB_uniform_buffer_object; -PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -PFNGLSHADERBINARYPROC glad_glShaderBinary; -PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -PFNGLISBUFFERARBPROC glad_glIsBufferARB; -PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -static void load_GL_VERSION_1_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); - glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); - glad_glHint = (PFNGLHINTPROC)load("glHint"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); - glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); - glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); - glad_glClear = (PFNGLCLEARPROC)load("glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); - glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); - glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); - glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); - glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); - glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); - glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); - glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); - glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); - glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); - glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); -} -static void load_GL_VERSION_1_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); - glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); -} -static void load_GL_VERSION_1_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); -} -static void load_GL_VERSION_1_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); -} -static void load_GL_VERSION_1_4(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); -} -static void load_GL_VERSION_1_5(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); - glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); - glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); - glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); - glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); -} -static void load_GL_VERSION_2_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); -} -static void load_GL_VERSION_2_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); -} -static void load_GL_VERSION_3_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); - glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); - glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_VERSION_3_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_VERSION_3_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_VERSION_3_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_3) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); - glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_AMD_debug_output(GLADloadproc load) { - if(!GLAD_GL_AMD_debug_output) return; - glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); - glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); - glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); - glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); -} -static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES2_compatibility) return; - glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); - glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); - glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); - glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); - glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); -} -static void load_GL_ARB_buffer_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_buffer_storage) return; - glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); -} -static void load_GL_ARB_debug_output(GLADloadproc load) { - if(!GLAD_GL_ARB_debug_output) return; - glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); - glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); - glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); - glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); -} -static void load_GL_ARB_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers) return; - glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); -} -static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers_blend) return; - glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); - glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); - glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); - glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); -} -static void load_GL_ARB_fragment_program(GLADloadproc load) { - if(!GLAD_GL_ARB_fragment_program) return; - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_object) return; - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); -} -static void load_GL_ARB_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_multisample) return; - glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); -} -static void load_GL_ARB_sample_locations(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_locations) return; - glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); - glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); - glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); -} -static void load_GL_ARB_texture_compression(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_compression) return; - glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); - glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); - glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); - glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); - glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); - glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); - glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); -} -static void load_GL_ARB_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_multisample) return; - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_uniform_buffer_object) return; - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_ARB_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_array_object) return; - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_binding) return; - glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); - glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); - glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); - glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); - glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); - glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); -} -static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_buffer_object) return; - glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); - glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); - glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); - glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); - glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); - glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); - glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); - glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); - glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); - glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); - glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); -} -static void load_GL_ARB_vertex_program(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_program) return; - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_shader) return; - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); - glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); - glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); -} -static void load_GL_ATI_element_array(GLADloadproc load) { - if(!GLAD_GL_ATI_element_array) return; - glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); - glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); - glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); -} -static void load_GL_ATI_fragment_shader(GLADloadproc load) { - if(!GLAD_GL_ATI_fragment_shader) return; - glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); - glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); - glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); - glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); - glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); - glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); - glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); - glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); - glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); - glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); - glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); - glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); - glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); - glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); -} -static void load_GL_ATI_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_array_object) return; - glad_glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)load("glNewObjectBufferATI"); - glad_glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)load("glIsObjectBufferATI"); - glad_glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)load("glUpdateObjectBufferATI"); - glad_glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)load("glGetObjectBufferfvATI"); - glad_glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)load("glGetObjectBufferivATI"); - glad_glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)load("glFreeObjectBufferATI"); - glad_glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)load("glArrayObjectATI"); - glad_glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)load("glGetArrayObjectfvATI"); - glad_glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)load("glGetArrayObjectivATI"); - glad_glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)load("glVariantArrayObjectATI"); - glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); - glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); -} -static void load_GL_EXT_blend_color(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_color) return; - glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); -} -static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_equation_separate) return; - glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); -} -static void load_GL_EXT_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_func_separate) return; - glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); -} -static void load_GL_EXT_debug_marker(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_marker) return; - glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); - glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); - glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); -} -static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_blit) return; - glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); -} -static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_multisample) return; - glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); -} -static void load_GL_EXT_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_object) return; - glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); - glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); - glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); - glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); - glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); - glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); - glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); - glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); - glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); - glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); - glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); - glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); - glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); - glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); - glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); - glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); - glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); -} -static void load_GL_EXT_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_array) return; - glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); - glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); - glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); - glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); - glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); - glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); - glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); - glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); - glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); -} -static void load_GL_EXT_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_shader) return; - glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); - glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); - glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); - glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); - glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); - glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); - glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); - glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); - glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); - glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); - glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); - glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); - glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); - glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); - glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); - glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); - glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); - glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); - glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); - glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); - glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); - glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); - glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); - glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); - glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); - glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); - glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); - glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); - glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); - glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); - glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); - glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); - glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); - glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); - glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); - glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); - glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); - glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); - glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); - glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); - glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); - glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); -} -static int find_extensionsGL(void) { - if (!get_exts()) return 0; - GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); - GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); - GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); - GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); - GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); - GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); - GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); - GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); - GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); - GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); - GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); - GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); - GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); - GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); - GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); - GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); - GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); - GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); - GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); - GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); - GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); - GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); - GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); - GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); - GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); - GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); - GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); - GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); - GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); - GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); - GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); - GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); - GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); - GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); - GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); - GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); - GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); - GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); - GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); - GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); - GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); - GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); - GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); - GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); - GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); - GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); - GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); - GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); - GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); - GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); - GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); - GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); - free_exts(); - return 1; -} - -static void find_coreGL(void) { - - /* Thank you @elmindreda - * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 - * https://github.com/glfw/glfw/blob/master/src/context.c#L36 - */ - int i, major, minor; - - const char* version; - const char* prefixes[] = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - NULL - }; - - version = (const char*) glGetString(GL_VERSION); - if (!version) return; - - for (i = 0; prefixes[i]; i++) { - const size_t length = strlen(prefixes[i]); - if (strncmp(version, prefixes[i], length) == 0) { - version += length; - break; - } - } - -/* PR #18 */ -#ifdef _MSC_VER - sscanf_s(version, "%d.%d", &major, &minor); -#else - sscanf(version, "%d.%d", &major, &minor); -#endif - - GLVersion.major = major; GLVersion.minor = minor; - max_loaded_major = major; max_loaded_minor = minor; - GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; - GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; - GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; - GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; - GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; - GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; - GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; - GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; - GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; - if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { - max_loaded_major = 3; - max_loaded_minor = 3; - } -} - -int gladLoadGLLoader(GLADloadproc load) { - GLVersion.major = 0; GLVersion.minor = 0; - glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - if(glGetString == NULL) return 0; - if(glGetString(GL_VERSION) == NULL) return 0; - find_coreGL(); - load_GL_VERSION_1_0(load); - load_GL_VERSION_1_1(load); - load_GL_VERSION_1_2(load); - load_GL_VERSION_1_3(load); - load_GL_VERSION_1_4(load); - load_GL_VERSION_1_5(load); - load_GL_VERSION_2_0(load); - load_GL_VERSION_2_1(load); - load_GL_VERSION_3_0(load); - load_GL_VERSION_3_1(load); - load_GL_VERSION_3_2(load); - load_GL_VERSION_3_3(load); - - if (!find_extensionsGL()) return 0; - load_GL_AMD_debug_output(load); - load_GL_ARB_ES2_compatibility(load); - load_GL_ARB_buffer_storage(load); - load_GL_ARB_debug_output(load); - load_GL_ARB_draw_buffers(load); - load_GL_ARB_draw_buffers_blend(load); - load_GL_ARB_fragment_program(load); - load_GL_ARB_framebuffer_object(load); - load_GL_ARB_multisample(load); - load_GL_ARB_sample_locations(load); - load_GL_ARB_texture_compression(load); - load_GL_ARB_texture_multisample(load); - load_GL_ARB_uniform_buffer_object(load); - load_GL_ARB_vertex_array_object(load); - load_GL_ARB_vertex_attrib_binding(load); - load_GL_ARB_vertex_buffer_object(load); - load_GL_ARB_vertex_program(load); - load_GL_ARB_vertex_shader(load); - load_GL_ATI_element_array(load); - load_GL_ATI_fragment_shader(load); - load_GL_ATI_vertex_array_object(load); - load_GL_EXT_blend_color(load); - load_GL_EXT_blend_equation_separate(load); - load_GL_EXT_blend_func_separate(load); - load_GL_EXT_debug_marker(load); - load_GL_EXT_framebuffer_blit(load); - load_GL_EXT_framebuffer_multisample(load); - load_GL_EXT_framebuffer_object(load); - load_GL_EXT_vertex_array(load); - load_GL_EXT_vertex_shader(load); - return GLVersion.major != 0 || GLVersion.minor != 0; -} - -#endif // GLAD_IMPLEMENTATION diff --git a/raylib-sys/raygui.h b/raylib-sys/raygui.h deleted file mode 100755 index 2cb7e03b..00000000 --- a/raylib-sys/raygui.h +++ /dev/null @@ -1,3946 +0,0 @@ -/******************************************************************************************* -* -* raygui v2.8 - A simple and easy-to-use immediate-mode gui library -* -* DESCRIPTION: -* -* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also -* available as a standalone library, as long as input and drawing functions are provided. -* -* Controls provided: -* -* # Container/separators Controls -* - WindowBox -* - GroupBox -* - Line -* - Panel -* -* # Basic Controls -* - Label -* - Button -* - LabelButton --> Label -* - ImageButton --> Button -* - ImageButtonEx --> Button -* - Toggle -* - ToggleGroup --> Toggle -* - CheckBox -* - ComboBox -* - DropdownBox -* - TextBox -* - TextBoxMulti -* - ValueBox --> TextBox -* - Spinner --> Button, ValueBox -* - Slider -* - SliderBar --> Slider -* - ProgressBar -* - StatusBar -* - ScrollBar -* - ScrollPanel -* - DummyRec -* - Grid -* -* # Advance Controls -* - ListView -* - ColorPicker --> ColorPanel, ColorBarHue -* - MessageBox --> Window, Label, Button -* - TextInputBox --> Window, Label, TextBox, Button -* -* It also provides a set of functions for styling the controls based on its properties (size, color). -* -* CONFIGURATION: -* -* #define RAYGUI_IMPLEMENTATION -* Generates the implementation of the library into the included file. -* If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. -* -* #define RAYGUI_STATIC (defined by default) -* The generated implementation will stay private inside implementation file and all -* internal symbols and functions will only be visible inside that file. -* -* #define RAYGUI_STANDALONE -* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined -* internally in the library and input management and drawing functions must be provided by -* the user (check library implementation for further details). -* -* #define RAYGUI_SUPPORT_ICONS -* Includes riconsdata.h header defining a set of 128 icons (binary format) to be used on -* multiple controls and following raygui styles -* -* -* VERSIONS HISTORY: -* 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() -* 2.7 (20-Feb-2020) Added possible tooltips API -* 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() -* REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() -* REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() -* Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties -* Added 8 new custom styles ready to use -* Multiple minor tweaks and bugs corrected -* 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() -* 2.3 (29-Apr-2019) Added rIcons auxiliar library and support for it, multiple controls reviewed -* Refactor all controls drawing mechanism to use control state -* 2.2 (05-Feb-2019) Added GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls -* 2.1 (26-Dec-2018) Redesign of GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string -* Complete redesign of style system (breaking change) -* 2.0 (08-Nov-2018) Support controls guiLock and custom fonts, reviewed GuiComboBox(), GuiListView()... -* 1.9 (09-Oct-2018) Controls review: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... -* 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout -* 1.5 (21-Jun-2017) Working in an improved styles system -* 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) -* 1.3 (12-Jun-2017) Redesigned styles system -* 1.1 (01-Jun-2017) Complete review of the library -* 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. -* 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. -* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. -* -* CONTRIBUTORS: -* Ramon Santamaria: Supervision, review, redesign, update and maintenance... -* Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) -* Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) -* Adria Arranz: Testing and Implementation of additional controls (2018) -* Jordi Jorba: Testing and Implementation of additional controls (2018) -* Albert Martos: Review and testing of the library (2015) -* Ian Eito: Review and testing of the library (2015) -* Kevin Gato: Initial implementation of basic components (2014) -* Daniel Nicolas: Initial implementation of basic components (2014) -* -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2014-2020 Ramon Santamaria (@raysan5) -* -* 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. -* -**********************************************************************************************/ - -#ifndef RAYGUI_H -#define RAYGUI_H - -#define RAYGUI_VERSION "2.6-dev" - -#if !defined(RAYGUI_STANDALONE) -#include "raylib.h" -#endif - -// Define functions scope to be used internally (static) or externally (extern) to the module including this file -#if defined(RAYGUI_STATIC) -#define RAYGUIDEF static // Functions just visible to module including this file -#else -#ifdef __cplusplus -#define RAYGUIDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) -#else -// NOTE: By default any function declared in a C file is extern -#define RAYGUIDEF extern // Functions visible from other files -#endif -#endif - -#if defined(_WIN32) -#if defined(BUILD_LIBTYPE_SHARED) -#define RAYGUIDEF __declspec(dllexport) // We are building raygui as a Win32 shared library (.dll). -#elif defined(USE_LIBTYPE_SHARED) -#define RAYGUIDEF __declspec(dllimport) // We are using raygui as a Win32 shared library (.dll) -#endif -#endif - -#if !defined(RAYGUI_MALLOC) && !defined(RAYGUI_CALLOC) && !defined(RAYGUI_FREE) -#include // Required for: malloc(), calloc(), free() -#endif - -// Allow custom memory allocators -#ifndef RAYGUI_MALLOC -#define RAYGUI_MALLOC(sz) malloc(sz) -#endif -#ifndef RAYGUI_CALLOC -#define RAYGUI_CALLOC(n, sz) calloc(n, sz) -#endif -#ifndef RAYGUI_FREE -#define RAYGUI_FREE(p) free(p) -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define NUM_CONTROLS 16 // Number of standard controls -#define NUM_PROPS_DEFAULT 16 // Number of standard properties -#define NUM_PROPS_EXTENDED 8 // Number of extended properties - -#define TEXTEDIT_CURSOR_BLINK_FRAMES 20 // Text edit controls cursor blink timming - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -// NOTE: Some types are required for RAYGUI_STANDALONE usage -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) -#ifndef __cplusplus -// Boolean type -#ifndef true -typedef enum -{ - false, - true -} bool; -#endif -#endif - -// Vector2 type -typedef struct Vector2 -{ - float x; - float y; -} Vector2; - -// Vector3 type -typedef struct Vector3 -{ - float x; - float y; - float z; -} Vector3; - -// Color type, RGBA (32bit) -typedef struct Color -{ - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; - -// Rectangle type -typedef struct Rectangle -{ - float x; - float y; - float width; - float height; -} Rectangle; - -// TODO: Texture2D type is very coupled to raylib, mostly required by GuiImageButton() -// It should be redesigned to be provided by user -typedef struct Texture2D -{ - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Texture2D; - -// Font character info -typedef struct CharInfo CharInfo; - -// TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() -// It should be redesigned to be provided by user -typedef struct Font -{ - int baseSize; // Base size (default chars height) - int charsCount; // Number of characters - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - CharInfo *chars; // Characters info data -} Font; -#endif - -// Style property -typedef struct GuiStyleProp -{ - unsigned short controlId; - unsigned short propertyId; - int propertyValue; -} GuiStyleProp; - -// Gui control state -typedef enum -{ - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED, - GUI_STATE_PRESSED, - GUI_STATE_DISABLED, -} GuiControlState; - -// Gui control text alignment -typedef enum -{ - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER, - GUI_TEXT_ALIGN_RIGHT, -} GuiTextAlignment; - -// Gui controls -typedef enum -{ - DEFAULT = 0, - LABEL, // LABELBUTTON - BUTTON, // IMAGEBUTTON - TOGGLE, // TOGGLEGROUP - SLIDER, // SLIDERBAR - PROGRESSBAR, - CHECKBOX, - COMBOBOX, - DROPDOWNBOX, - TEXTBOX, // TEXTBOXMULTI - VALUEBOX, - SPINNER, - LISTVIEW, - COLORPICKER, - SCROLLBAR, - STATUSBAR -} GuiControl; - -// Gui base properties for every control -typedef enum -{ - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL, - TEXT_COLOR_NORMAL, - BORDER_COLOR_FOCUSED, - BASE_COLOR_FOCUSED, - TEXT_COLOR_FOCUSED, - BORDER_COLOR_PRESSED, - BASE_COLOR_PRESSED, - TEXT_COLOR_PRESSED, - BORDER_COLOR_DISABLED, - BASE_COLOR_DISABLED, - TEXT_COLOR_DISABLED, - BORDER_WIDTH, - TEXT_PADDING, - TEXT_ALIGNMENT, - RESERVED -} GuiControlProperty; - -// Gui extended properties depend on control -// NOTE: We reserve a fixed size of additional properties per control - -// DEFAULT properties -typedef enum -{ - TEXT_SIZE = 16, - TEXT_SPACING, - LINE_COLOR, - BACKGROUND_COLOR, -} GuiDefaultProperty; - -// Label -//typedef enum { } GuiLabelProperty; - -// Button -//typedef enum { } GuiButtonProperty; - -// Toggle / ToggleGroup -typedef enum -{ - GROUP_PADDING = 16, -} GuiToggleProperty; - -// Slider / SliderBar -typedef enum -{ - SLIDER_WIDTH = 16, - SLIDER_PADDING -} GuiSliderProperty; - -// ProgressBar -typedef enum -{ - PROGRESS_PADDING = 16, -} GuiProgressBarProperty; - -// CheckBox -typedef enum -{ - CHECK_PADDING = 16 -} GuiCheckBoxProperty; - -// ComboBox -typedef enum -{ - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING -} GuiComboBoxProperty; - -// DropdownBox -typedef enum -{ - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING -} GuiDropdownBoxProperty; - -// TextBox / TextBoxMulti / ValueBox / Spinner -typedef enum -{ - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING, - COLOR_SELECTED_FG, - COLOR_SELECTED_BG -} GuiTextBoxProperty; - -// Spinner -typedef enum -{ - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING, -} GuiSpinnerProperty; - -// ScrollBar -typedef enum -{ - ARROWS_SIZE = 16, - ARROWS_VISIBLE, - SCROLL_SLIDER_PADDING, - SCROLL_SLIDER_SIZE, - SCROLL_PADDING, - SCROLL_SPEED, -} GuiScrollBarProperty; - -// ScrollBar side -typedef enum -{ - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE -} GuiScrollBarSide; - -// ListView -typedef enum -{ - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING, - SCROLLBAR_WIDTH, - SCROLLBAR_SIDE, -} GuiListViewProperty; - -// ColorPicker -typedef enum -{ - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH, // Right hue bar width - HUEBAR_PADDING, // Right hue bar separation from panel - HUEBAR_SELECTOR_HEIGHT, // Right hue bar selector height - HUEBAR_SELECTOR_OVERFLOW // Right hue bar selector overflow -} GuiColorPickerProperty; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- - -// State modification functions -RAYGUIDEF void GuiEnable(void); // Enable gui controls (global state) -RAYGUIDEF void GuiDisable(void); // Disable gui controls (global state) -RAYGUIDEF void GuiLock(void); // Lock gui controls (global state) -RAYGUIDEF void GuiUnlock(void); // Unlock gui controls (global state) -RAYGUIDEF void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f -RAYGUIDEF void GuiSetState(int state); // Set gui state (global state) -RAYGUIDEF int GuiGetState(void); // Get gui state (global state) - -// Font set/get functions -RAYGUIDEF void GuiSetFont(Font font); // Set gui custom font (global state) -RAYGUIDEF Font GuiGetFont(void); // Get gui custom font (global state) - -// Style set/get functions -RAYGUIDEF void GuiSetStyle(int control, int property, int value); // Set one style property -RAYGUIDEF int GuiGetStyle(int control, int property); // Get one style property - -// Tooltips set functions -RAYGUIDEF void GuiEnableTooltip(void); // Enable gui tooltips -RAYGUIDEF void GuiDisableTooltip(void); // Disable gui tooltips -RAYGUIDEF void GuiSetTooltip(const char *tooltip); // Set current tooltip for display -RAYGUIDEF void GuiClearTooltip(void); // Clear any tooltip registered - -// Container/separator controls, useful for controls organization -RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed -RAYGUIDEF void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name -RAYGUIDEF void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text -RAYGUIDEF void GuiPanel(Rectangle bounds); // Panel control, useful to group controls -RAYGUIDEF Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll); // Scroll Panel control - -// Basic controls set -RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text -RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked -RAYGUIDEF bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked -RAYGUIDEF bool GuiImageButton(Rectangle bounds, const char *text, Texture2D texture); // Image button control, returns true when clicked -RAYGUIDEF bool GuiImageButtonEx(Rectangle bounds, const char *text, Texture2D texture, Rectangle texSource); // Image button extended control, returns true when clicked -RAYGUIDEF bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active -RAYGUIDEF int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index -RAYGUIDEF bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active -RAYGUIDEF int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index -RAYGUIDEF bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item -RAYGUIDEF bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value -RAYGUIDEF bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers -RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text -RAYGUIDEF bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines -RAYGUIDEF float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value -RAYGUIDEF float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value -RAYGUIDEF float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value -RAYGUIDEF void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text -RAYGUIDEF void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders -RAYGUIDEF int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control -RAYGUIDEF Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs); // Grid control - -// Advance controls set -RAYGUIDEF int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index -RAYGUIDEF int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters -RAYGUIDEF int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message -RAYGUIDEF int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text); // Text Input Box control, ask for text -RAYGUIDEF Color GuiColorPicker(Rectangle bounds, Color color); // Color Picker control (multiple color controls) -RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color); // Color Panel control -RAYGUIDEF float GuiColorBarAlpha(Rectangle bounds, float alpha); // Color Bar Alpha control -RAYGUIDEF float GuiColorBarHue(Rectangle bounds, float value); // Color Bar Hue control - -// Styles loading functions -RAYGUIDEF void GuiLoadStyle(const char *fileName); // Load style file (.rgs) -RAYGUIDEF void GuiLoadStyleDefault(void); // Load style default over global style - -/* -typedef GuiStyle (unsigned int *) -RAYGUIDEF GuiStyle LoadGuiStyle(const char *fileName); // Load style from file (.rgs) -RAYGUIDEF void UnloadGuiStyle(GuiStyle style); // Unload style -*/ - -RAYGUIDEF const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) - -#if defined(RAYGUI_SUPPORT_ICONS) -// Gui icons functionality -RAYGUIDEF void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color); - -RAYGUIDEF unsigned int *GuiGetIcons(void); // Get full icons data pointer -RAYGUIDEF unsigned int *GuiGetIconData(int iconId); // Get icon bit data -RAYGUIDEF void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data - -RAYGUIDEF void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value -RAYGUIDEF void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value -RAYGUIDEF bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value -#endif - -#endif // RAYGUI_H - -/*********************************************************************************** -* -* RAYGUI IMPLEMENTATION -* -************************************************************************************/ - -#if defined(RAYGUI_IMPLEMENTATION) - -#if defined(RAYGUI_SUPPORT_ICONS) -#define RICONS_IMPLEMENTATION -#include "ricons.h" // Required for: raygui icons data -#endif - -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() -#include // Required for: strlen() on GuiTextBox() -#include // Required for: roundf() on GuiColorPicker() - -#if defined(RAYGUI_STANDALONE) -#include // Required for: va_list, va_start(), vfprintf(), va_end() -#endif - -#ifdef __cplusplus -#define RAYGUI_CLITERAL(name) name -#else -#define RAYGUI_CLITERAL(name) (name) -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -//... - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -// Gui control property style color element -typedef enum -{ - BORDER = 0, - BASE, - TEXT, - OTHER -} GuiPropertyElement; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -static GuiControlState guiState = GUI_STATE_NORMAL; - -static Font guiFont = {0}; // Gui current font (WARNING: highly coupled to raylib) -static bool guiLocked = false; // Gui lock state (no inputs processed) -static float guiAlpha = 1.0f; // Gui element transpacency on drawing - -// Global gui style array (allocated on data segment by default) -// NOTE: In raygui we manage a single int array with all the possible style properties. -// When a new style is loaded, it loads over the global style... but default gui style -// could always be recovered with GuiLoadStyleDefault() -static unsigned int guiStyle[NUM_CONTROLS * (NUM_PROPS_DEFAULT + NUM_PROPS_EXTENDED)] = {0}; -static bool guiStyleLoaded = false; // Style loaded flag for lazy style initialization - -// Tooltips required variables -static const char *guiTooltip = NULL; // Gui tooltip currently active (user provided) -static bool guiTooltipEnabled = true; // Gui tooltips enabled - -//---------------------------------------------------------------------------------- -// Standalone Mode Functions Declaration -// -// NOTE: raygui depend on some raylib input and drawing functions -// To use raygui as standalone library, below functions must be defined by the user -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) - -#define KEY_RIGHT 262 -#define KEY_LEFT 263 -#define KEY_DOWN 264 -#define KEY_UP 265 -#define KEY_BACKSPACE 259 -#define KEY_ENTER 257 - -#define MOUSE_LEFT_BUTTON 0 - -// Input required functions -//------------------------------------------------------------------------------- -static Vector2 GetMousePosition(void); -static int GetMouseWheelMove(void); -static bool IsMouseButtonDown(int button); -static bool IsMouseButtonPressed(int button); -static bool IsMouseButtonReleased(int button); - -static bool IsKeyDown(int key); -static bool IsKeyPressed(int key); -static int GetKeyPressed(void); // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() -//------------------------------------------------------------------------------- - -// Drawing required functions -//------------------------------------------------------------------------------- -static void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle(), GuiDrawIcon() - -static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // -- GuiColorPicker() -static void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // -- GuiDropdownBox(), GuiScrollBar() -static void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // -- GuiImageButtonEx() - -static void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // -- GuiTextBoxMulti() -//------------------------------------------------------------------------------- - -// Text required functions -//------------------------------------------------------------------------------- -static Font GetFontDefault(void); // -- GuiLoadStyleDefault() -static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // -- GetTextWidth(), GuiTextBoxMulti() -static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() - -static Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // -- GuiLoadStyle() -static char *LoadText(const char *fileName); // -- GuiLoadStyle() -static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() -//------------------------------------------------------------------------------- - -// raylib functions already implemented in raygui -//------------------------------------------------------------------------------- -static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -static int ColorToInt(Color color); // Returns hexadecimal value for a Color -static Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -static const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' -static const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -static int TextToInteger(const char *text); // Get integer value from text - -static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw rectangle vertical gradient -//------------------------------------------------------------------------------- - -#endif // RAYGUI_STANDALONE - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static int GetTextWidth(const char *text); // Gui get text width using default font -static Rectangle GetTextBounds(int control, Rectangle bounds); // Get text bounds considering control bounds -static const char *GetTextIcon(const char *text, int *iconId); // Get text icon if provided and move text cursor - -static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint); // Gui draw text using default font -static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color); // Gui draw rectangle using default raygui style -static void GuiDrawTooltip(Rectangle bounds); // Draw tooltip relatively to bounds - -static const char **GuiTextSplit(const char *text, int *count, int *textRow); // Split controls text into multiple strings -static Vector3 ConvertHSVtoRGB(Vector3 hsv); // Convert color data from HSV to RGB -static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color data from RGB to HSV - -//---------------------------------------------------------------------------------- -// Gui Setup Functions Definition -//---------------------------------------------------------------------------------- -// Enable gui global state -void GuiEnable(void) { guiState = GUI_STATE_NORMAL; } - -// Disable gui global state -void GuiDisable(void) { guiState = GUI_STATE_DISABLED; } - -// Lock gui global state -void GuiLock(void) { guiLocked = true; } - -// Unlock gui global state -void GuiUnlock(void) { guiLocked = false; } - -// Set gui controls alpha global state -void GuiFade(float alpha) -{ - if (alpha < 0.0f) - alpha = 0.0f; - else if (alpha > 1.0f) - alpha = 1.0f; - - guiAlpha = alpha; -} - -// Set gui state (global state) -void GuiSetState(int state) { guiState = (GuiControlState)state; } - -// Get gui state (global state) -int GuiGetState(void) { return guiState; } - -// Set custom gui font -// NOTE: Font loading/unloading is external to raygui -void GuiSetFont(Font font) -{ - if (font.texture.id > 0) - { - // NOTE: If we try to setup a font but default style has not been - // lazily loaded before, it will be overwritten, so we need to force - // default style loading first - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - - guiFont = font; - GuiSetStyle(DEFAULT, TEXT_SIZE, font.baseSize); - } -} - -// Get custom gui font -Font GuiGetFont(void) -{ - return guiFont; -} - -// Set control style property value -void GuiSetStyle(int control, int property, int value) -{ - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - guiStyle[control * (NUM_PROPS_DEFAULT + NUM_PROPS_EXTENDED) + property] = value; - - // Default properties are propagated to all controls - if ((control == 0) && (property < NUM_PROPS_DEFAULT)) - { - for (int i = 1; i < NUM_CONTROLS; i++) - guiStyle[i * (NUM_PROPS_DEFAULT + NUM_PROPS_EXTENDED) + property] = value; - } -} - -// Get control style property value -int GuiGetStyle(int control, int property) -{ - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - return guiStyle[control * (NUM_PROPS_DEFAULT + NUM_PROPS_EXTENDED) + property]; -} - -// Enable gui tooltips -void GuiEnableTooltip(void) { guiTooltipEnabled = true; } - -// Disable gui tooltips -void GuiDisableTooltip(void) { guiTooltipEnabled = false; } - -// Set current tooltip for display -void GuiSetTooltip(const char *tooltip) { guiTooltip = tooltip; } - -// Clear any tooltip registered -void GuiClearTooltip(void) { guiTooltip = NULL; } - -//---------------------------------------------------------------------------------- -// Gui Controls Functions Definition -//---------------------------------------------------------------------------------- - -// Window Box control -bool GuiWindowBox(Rectangle bounds, const char *title) -{ -// NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() -#define WINDOW_STATUSBAR_HEIGHT 22 - - //GuiControlState state = guiState; - bool clicked = false; - - int statusBarHeight = WINDOW_STATUSBAR_HEIGHT + 2 * GuiGetStyle(STATUSBAR, BORDER_WIDTH); - statusBarHeight += (statusBarHeight % 2); - - Rectangle statusBar = {bounds.x, bounds.y, bounds.width, statusBarHeight}; - if (bounds.height < statusBarHeight * 2) - bounds.height = statusBarHeight * 2; - - Rectangle windowPanel = {bounds.x, bounds.y + statusBarHeight - 1, bounds.width, bounds.height - statusBarHeight}; - Rectangle closeButtonRec = {statusBar.x + statusBar.width - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - 20, - statusBar.y + statusBarHeight / 2 - 18 / 2, 18, 18}; - - // Update control - //-------------------------------------------------------------------- - // NOTE: Logic is directly managed by button - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiStatusBar(statusBar, title); // Draw window header as status bar - GuiPanel(windowPanel); // Draw window base - - // Draw window close button - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); -#if defined(RAYGUI_SUPPORT_ICONS) - clicked = GuiButton(closeButtonRec, GuiIconText(RICON_CROSS_SMALL, NULL)); -#else - clicked = GuiButton(closeButtonRec, "x"); -#endif - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlignment); - //-------------------------------------------------------------------- - - return clicked; -} - -// Group Box control with text name -void GuiGroupBox(Rectangle bounds, const char *text) -{ -#define GROUPBOX_LINE_THICK 1 -#define GROUPBOX_TEXT_PADDING 10 - - GuiControlState state = guiState; - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y, GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height - 1, bounds.width, GROUPBOX_LINE_THICK}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - 1, bounds.y, GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - - GuiLine(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y, bounds.width, 1}, text); - //-------------------------------------------------------------------- -} - -// Line control -void GuiLine(Rectangle bounds, const char *text) -{ -#define LINE_TEXT_PADDING 10 - - GuiControlState state = guiState; - - Color color = Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha); - - // Draw control - //-------------------------------------------------------------------- - if (text == NULL) - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height / 2, bounds.width, 1}, 0, BLANK, color); - else - { - Rectangle textBounds = {0}; - textBounds.width = GetTextWidth(text); // TODO: Consider text icon - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + LINE_TEXT_PADDING; - textBounds.y = bounds.y - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - // Draw line with embedded text label: "--- text --------------" - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y, LINE_TEXT_PADDING - 2, 1}, 0, BLANK, color); - GuiLabel(textBounds, text); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + LINE_TEXT_PADDING + textBounds.width + 4, bounds.y, bounds.width - textBounds.width - LINE_TEXT_PADDING - 4, 1}, 0, BLANK, color); - } - //-------------------------------------------------------------------- -} - -// Panel control -void GuiPanel(Rectangle bounds) -{ -#define PANEL_BORDER_WIDTH 1 - - GuiControlState state = guiState; - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, PANEL_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha), - Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED) ? BASE_COLOR_DISABLED : BACKGROUND_COLOR)), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Scroll Panel control -Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) -{ - GuiControlState state = guiState; - - Vector2 scrollPos = {0.0f, 0.0f}; - if (scroll != NULL) - scrollPos = *scroll; - - bool hasHorizontalScrollBar = (content.width > bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; - bool hasVerticalScrollBar = (content.height > bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; - - // Recheck to account for the other scrollbar being visible - if (!hasHorizontalScrollBar) - hasHorizontalScrollBar = (hasVerticalScrollBar && (content.width > (bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; - if (!hasVerticalScrollBar) - hasVerticalScrollBar = (hasHorizontalScrollBar && (content.height > (bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; - - const int horizontalScrollBarWidth = hasHorizontalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - const int verticalScrollBarWidth = hasVerticalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - const Rectangle horizontalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth}; - const Rectangle verticalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; - - // Calculate view area (area without the scrollbars) - Rectangle view = (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? RAYGUI_CLITERAL(Rectangle){bounds.x + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth} : RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth}; - - // Clip view area to the actual content size - if (view.width > content.width) - view.width = content.width; - if (view.height > content.height) - view.height = content.height; - - // TODO: Review! - const int horizontalMin = hasHorizontalScrollBar ? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? -verticalScrollBarWidth : 0) - GuiGetStyle(DEFAULT, BORDER_WIDTH) : ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? -verticalScrollBarWidth : 0) - GuiGetStyle(DEFAULT, BORDER_WIDTH); - const int horizontalMax = hasHorizontalScrollBar ? content.width - bounds.width + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? verticalScrollBarWidth : 0) : -GuiGetStyle(DEFAULT, BORDER_WIDTH); - const int verticalMin = hasVerticalScrollBar ? -GuiGetStyle(DEFAULT, BORDER_WIDTH) : -GuiGetStyle(DEFAULT, BORDER_WIDTH); - const int verticalMax = hasVerticalScrollBar ? content.height - bounds.height + horizontalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) : -GuiGetStyle(DEFAULT, BORDER_WIDTH); - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - - if (hasHorizontalScrollBar) - { - if (IsKeyDown(KEY_RIGHT)) - scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_LEFT)) - scrollPos.x += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - } - - if (hasVerticalScrollBar) - { - if (IsKeyDown(KEY_DOWN)) - scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_UP)) - scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - } - - scrollPos.y += GetMouseWheelMove() * 20; - } - } - - // Normalize scroll values - if (scrollPos.x > -horizontalMin) - scrollPos.x = -horizontalMin; - if (scrollPos.x < -horizontalMax) - scrollPos.x = -horizontalMax; - if (scrollPos.y > -verticalMin) - scrollPos.y = -verticalMin; - if (scrollPos.y < -verticalMax) - scrollPos.y = -verticalMax; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background - - // Save size of the scrollbar slider - const int slider = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); - - // Draw horizontal scrollbar if visible - if (hasHorizontalScrollBar) - { - // Change scrollbar slider size to show the diff in size between the content width and the widget width - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, ((bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth) / content.width) * (bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth)); - scrollPos.x = -GuiScrollBar(horizontalScrollBar, -scrollPos.x, horizontalMin, horizontalMax); - } - - // Draw vertical scrollbar if visible - if (hasVerticalScrollBar) - { - // Change scrollbar slider size to show the diff in size between the content height and the widget height - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, ((bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth) / content.height) * (bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth)); - scrollPos.y = -GuiScrollBar(verticalScrollBar, -scrollPos.y, verticalMin, verticalMax); - } - - // Draw detail corner rectangle if both scroll bars are visible - if (hasHorizontalScrollBar && hasVerticalScrollBar) - { - // TODO: Consider scroll bars side - Rectangle corner = {horizontalScrollBar.x + horizontalScrollBar.width + 2, verticalScrollBar.y + verticalScrollBar.height + 2, horizontalScrollBarWidth - 4, verticalScrollBarWidth - 4}; - GuiDrawRectangle(corner, 0, BLANK, Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT + (state * 3))), guiAlpha)); - } - - // Draw scrollbar lines depending on current state - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, (float)BORDER + (state * 3))), guiAlpha), BLANK); - - // Set scrollbar slider size back to the way it was before - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, slider); - //-------------------------------------------------------------------- - - if (scroll != NULL) - *scroll = scrollPos; - - return view; -} - -// Label control -void GuiLabel(Rectangle bounds, const char *text) -{ - GuiControlState state = guiState; - - // Update control - //-------------------------------------------------------------------- - // ... - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, (state == GUI_STATE_DISABLED) ? TEXT_COLOR_DISABLED : TEXT_COLOR_NORMAL)), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Button control, returns true when clicked -bool GuiButton(Rectangle bounds, const char *text) -{ - GuiControlState state = guiState; - bool pressed = false; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state * 3))), guiAlpha)); - GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state * 3))), guiAlpha)); - //------------------------------------------------------------------ - - return pressed; -} - -// Label button control -bool GuiLabelButton(Rectangle bounds, const char *text) -{ - GuiControlState state = guiState; - bool pressed = false; - - // NOTE: We force bounds.width to be all text - int textWidth = MeasureTextEx(guiFont, text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)).x; - if (bounds.width < textWidth) - bounds.width = textWidth; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check checkbox state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Image button control, returns true when clicked -bool GuiImageButton(Rectangle bounds, const char *text, Texture2D texture) -{ - return GuiImageButtonEx(bounds, text, texture, RAYGUI_CLITERAL(Rectangle){0, 0, (float)texture.width, (float)texture.height}); -} - -// Image button control, returns true when clicked -bool GuiImageButtonEx(Rectangle bounds, const char *text, Texture2D texture, Rectangle texSource) -{ - GuiControlState state = guiState; - bool clicked = false; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - clicked = true; - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state * 3))), guiAlpha)); - - if (text != NULL) - GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state * 3))), guiAlpha)); - if (texture.id > 0) - DrawTextureRec(texture, texSource, RAYGUI_CLITERAL(Vector2){bounds.x + bounds.width / 2 - texSource.width / 2, bounds.y + bounds.height / 2 - texSource.height / 2}, Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state * 3))), guiAlpha)); - //------------------------------------------------------------------ - - return clicked; -} - -// Toggle Button control, returns true when active -bool GuiToggle(Rectangle bounds, const char *text, bool active) -{ - GuiControlState state = guiState; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check toggle button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - state = GUI_STATE_NORMAL; - active = !active; - } - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == GUI_STATE_NORMAL) - { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BORDER_COLOR_PRESSED : (BORDER + state * 3)))), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BASE_COLOR_PRESSED : (BASE + state * 3)))), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? TEXT_COLOR_PRESSED : (TEXT + state * 3)))), guiAlpha)); - } - else - { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, BASE + state * 3)), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, TEXT + state * 3)), guiAlpha)); - } - //-------------------------------------------------------------------- - - return active; -} - -// Toggle Group control, returns toggled button index -int GuiToggleGroup(Rectangle bounds, const char *text, int active) -{ -#if !defined(TOGGLEGROUP_MAX_ELEMENTS) -#define TOGGLEGROUP_MAX_ELEMENTS 32 -#endif - - float initBoundsX = bounds.x; - - // Get substrings items from text (items pointers) - int rows[TOGGLEGROUP_MAX_ELEMENTS] = {0}; - int itemsCount = 0; - const char **items = GuiTextSplit(text, &itemsCount, rows); - - int prevRow = rows[0]; - - for (int i = 0; i < itemsCount; i++) - { - if (prevRow != rows[i]) - { - bounds.x = initBoundsX; - bounds.y += (bounds.height + GuiGetStyle(TOGGLE, GROUP_PADDING)); - prevRow = rows[i]; - } - - if (i == active) - GuiToggle(bounds, items[i], true); - else if (GuiToggle(bounds, items[i], false) == true) - active = i; - - bounds.x += (bounds.width + GuiGetStyle(TOGGLE, GROUP_PADDING)); - } - - return active; -} - -// Check Box control, returns true when active -bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) -{ - GuiControlState state = guiState; - - Rectangle textBounds = {0}; - - if (text != NULL) - { - textBounds.width = GetTextWidth(text); - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(CHECKBOX, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - Rectangle totalBounds = { - (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) ? textBounds.x : bounds.x, - bounds.y, - bounds.width + textBounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING), - bounds.height, - }; - - // Check checkbox state - if (CheckCollisionPointRec(mousePoint, totalBounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - checked = !checked; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(CHECKBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(CHECKBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - if (checked) - { - Rectangle check = {bounds.x + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.y + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.width - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)), - bounds.height - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING))}; - GuiDrawRectangle(check, 0, BLANK, Fade(GetColor(GuiGetStyle(CHECKBOX, TEXT + state * 3)), guiAlpha)); - } - - if (text != NULL) - GuiDrawText(text, textBounds, (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) ? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return checked; -} - -// Combo Box control, returns selected item index -int GuiComboBox(Rectangle bounds, const char *text, int active) -{ - GuiControlState state = guiState; - - bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING)); - - Rectangle selector = {(float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING), - (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height}; - - // Get substrings items from text (items pointers, lengths and count) - int itemsCount = 0; - const char **items = GuiTextSplit(text, &itemsCount, NULL); - - if (active < 0) - active = 0; - else if (active > itemsCount - 1) - active = itemsCount - 1; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked && (itemsCount > 1)) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - active += 1; - if (active >= itemsCount) - active = 0; - } - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - // Draw combo box main - GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state * 3))), guiAlpha)); - GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state * 3))), guiAlpha)); - - // Draw selector using a custom button - // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - - GuiButton(selector, TextFormat("%i/%i", active + 1, itemsCount)); - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - //-------------------------------------------------------------------- - - return active; -} - -// Dropdown Box control -// NOTE: Returns mouse click -bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode) -{ - GuiControlState state = guiState; - int itemSelected = *active; - int itemFocused = -1; - - // Get substrings items from text (items pointers, lengths and count) - int itemsCount = 0; - const char **items = GuiTextSplit(text, &itemsCount, NULL); - - Rectangle boundsOpen = bounds; - boundsOpen.height = (itemsCount + 1) * (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); - - Rectangle itemBounds = bounds; - - bool pressed = false; // Check mouse button pressed - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked && (itemsCount > 1)) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = GUI_STATE_PRESSED; - - // Check if mouse has been pressed or released outside limits - if (!CheckCollisionPointRec(mousePoint, boundsOpen)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - - // Check if already selected item has been pressed again - if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - - // Check focused and selected item - for (int i = 0; i < itemsCount; i++) - { - // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); - - if (CheckCollisionPointRec(mousePoint, itemBounds)) - { - itemFocused = i; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - itemSelected = i; - pressed = true; // Item selected, change to editMode = false - } - break; - } - } - - itemBounds = bounds; - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - pressed = true; - state = GUI_STATE_PRESSED; - } - else - state = GUI_STATE_FOCUSED; - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (editMode) - GuiPanel(boundsOpen); - - GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state * 3)), guiAlpha)); - GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state * 3)), guiAlpha)); - - if (editMode) - { - // Draw visible items - for (int i = 0; i < itemsCount; i++) - { - // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); - - if (i == itemSelected) - { - GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_PRESSED)), guiAlpha)); - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_PRESSED)), guiAlpha)); - } - else if (i == itemFocused) - { - GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_FOCUSED)), guiAlpha)); - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_FOCUSED)), guiAlpha)); - } - else - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha)); - } - } - - // TODO: Avoid this function, use icon instead or 'v' - DrawTriangle(RAYGUI_CLITERAL(Vector2){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height / 2 - 2}, - RAYGUI_CLITERAL(Vector2){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING) + 5, bounds.y + bounds.height / 2 - 2 + 5}, - RAYGUI_CLITERAL(Vector2){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING) + 10, bounds.y + bounds.height / 2 - 2}, - Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); - - //GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 }, - // GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); - //-------------------------------------------------------------------- - - *active = itemSelected; - return pressed; -} - -// Text Box control, updates input text -// NOTE 1: Requires static variables: framesCounter -// NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) -bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) -{ - static int framesCounter = 0; // Required for blinking cursor - - GuiControlState state = guiState; - bool pressed = false; - - Rectangle cursor = { - bounds.x + GuiGetStyle(TEXTBOX, TEXT_PADDING) + GetTextWidth(text) + 2, - bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE), - 1, - GuiGetStyle(DEFAULT, TEXT_SIZE) * 2}; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = GUI_STATE_PRESSED; - framesCounter++; - - int key = GetKeyPressed(); // Returns codepoint as Unicode - int keyCount = strlen(text); - - // Only allow keys in range [32..125] - if (keyCount < (textSize - 1)) - { - int maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) * 2)); - - if ((GetTextWidth(text) < (maxWidth - GuiGetStyle(DEFAULT, TEXT_SIZE))) && (key >= 32)) - { - int byteLength = 0; - const char *textUtf8 = CodepointToUtf8(key, &byteLength); - - for (int i = 0; i < byteLength; i++) - { - text[keyCount] = textUtf8[i]; - keyCount++; - } - - text[keyCount] = '\0'; - } - } - - // Delete text - if (keyCount > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - keyCount--; - text[keyCount] = '\0'; - framesCounter = 0; - if (keyCount < 0) - keyCount = 0; - } - else if (IsKeyDown(KEY_BACKSPACE)) - { - if ((framesCounter > TEXTEDIT_CURSOR_BLINK_FRAMES) && (framesCounter % 2) == 0) - keyCount--; - text[keyCount] = '\0'; - if (keyCount < 0) - keyCount = 0; - } - } - - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) - pressed = true; - - // Check text alignment to position cursor properly - int textAlignment = GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT); - if (textAlignment == GUI_TEXT_ALIGN_CENTER) - cursor.x = bounds.x + GetTextWidth(text) / 2 + bounds.width / 2 + 1; - else if (textAlignment == GUI_TEXT_ALIGN_RIGHT) - cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING); - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - - if (pressed) - framesCounter = 0; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == GUI_STATE_PRESSED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); - - // Draw blinking cursor - if (editMode && ((framesCounter / 20) % 2 == 0)) - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - } - else if (state == GUI_STATE_DISABLED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); - } - else - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - GuiDrawText(text, GetTextBounds(TEXTBOX, bounds), GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Spinner control, returns selected value -bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) -{ - GuiControlState state = guiState; - - bool pressed = false; - int tempValue = *value; - - Rectangle spinner = {bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING), bounds.y, - bounds.width - 2 * (GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING)), bounds.height}; - Rectangle leftButtonBound = {(float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; - Rectangle rightButtonBound = {(float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; - - Rectangle textBounds = {0}; - if (text != NULL) - { - textBounds.width = GetTextWidth(text); - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(SPINNER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check spinner state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - } - } - - if (!editMode) - { - if (tempValue < minValue) - tempValue = minValue; - if (tempValue > maxValue) - tempValue = maxValue; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - // TODO: Set Spinner properties for ValueBox - pressed = GuiValueBox(spinner, NULL, &tempValue, minValue, maxValue, editMode); - - // Draw value selector custom buttons - // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH)); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - -#if defined(RAYGUI_SUPPORT_ICONS) - if (GuiButton(leftButtonBound, GuiIconText(RICON_ARROW_LEFT_FILL, NULL))) - tempValue--; - if (GuiButton(rightButtonBound, GuiIconText(RICON_ARROW_RIGHT_FILL, NULL))) - tempValue++; -#else - if (GuiButton(leftButtonBound, "<")) - tempValue--; - if (GuiButton(rightButtonBound, ">")) - tempValue++; -#endif - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - - // Draw text label if provided - if (text != NULL) - GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) ? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - *value = tempValue; - return pressed; -} - -// Value Box control, updates input text with numbers -// NOTE: Requires static variables: framesCounter -bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) -{ -#if !defined(VALUEBOX_MAX_CHARS) -#define VALUEBOX_MAX_CHARS 32 -#endif - - static int framesCounter = 0; // Required for blinking cursor - - GuiControlState state = guiState; - bool pressed = false; - - char textValue[VALUEBOX_MAX_CHARS + 1] = "\0"; - sprintf(textValue, "%i", *value); - - Rectangle textBounds = {0}; - if (text != NULL) - { - textBounds.width = GetTextWidth(text); - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(VALUEBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - bool valueHasChanged = false; - - if (editMode) - { - state = GUI_STATE_PRESSED; - - framesCounter++; - - int keyCount = strlen(textValue); - - // Only allow keys in range [48..57] - if (keyCount < VALUEBOX_MAX_CHARS) - { - int maxWidth = bounds.width; - if (GetTextWidth(textValue) < maxWidth) - { - int key = GetKeyPressed(); - if ((key >= 48) && (key <= 57)) - { - textValue[keyCount] = (char)key; - keyCount++; - valueHasChanged = true; - } - } - } - - // Delete text - if (keyCount > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - keyCount--; - textValue[keyCount] = '\0'; - framesCounter = 0; - if (keyCount < 0) - keyCount = 0; - valueHasChanged = true; - } - else if (IsKeyDown(KEY_BACKSPACE)) - { - if ((framesCounter > TEXTEDIT_CURSOR_BLINK_FRAMES) && (framesCounter % 2) == 0) - keyCount--; - textValue[keyCount] = '\0'; - if (keyCount < 0) - keyCount = 0; - valueHasChanged = true; - } - } - - if (valueHasChanged) - *value = TextToInteger(textValue); - - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) - pressed = true; - } - else - { - if (*value > maxValue) - *value = maxValue; - else if (*value < minValue) - *value = minValue; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - - if (pressed) - framesCounter = 0; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - Color baseColor = BLANK; - if (state == GUI_STATE_PRESSED) - baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED)); - else if (state == GUI_STATE_DISABLED) - baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED)); - - // WARNING: BLANK color does not work properly with Fade() - GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state * 3))), guiAlpha), baseColor); - GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state * 3))), guiAlpha)); - - // Draw blinking cursor - if ((state == GUI_STATE_PRESSED) && (editMode && ((framesCounter / 20) % 2 == 0))) - { - // NOTE: ValueBox internal text is always centered - Rectangle cursor = {bounds.x + GetTextWidth(textValue) / 2 + bounds.width / 2 + 2, bounds.y + 2 * GuiGetStyle(VALUEBOX, BORDER_WIDTH), 1, bounds.height - 4 * GuiGetStyle(VALUEBOX, BORDER_WIDTH)}; - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - } - - // Draw text label if provided - if (text != NULL) - GuiDrawText(text, textBounds, (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) ? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Text Box control with multiple lines -bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) -{ - static int framesCounter = 0; // Required for blinking cursor - - GuiControlState state = guiState; - bool pressed = false; - - Rectangle textAreaBounds = { - bounds.x + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.y + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.width - 2 * GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.height - 2 * GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)}; - - // Cursor position, [x, y] values should be updated - Rectangle cursor = {0, 0, 1, GuiGetStyle(DEFAULT, TEXT_SIZE) + 2}; - - int textWidth = 0; - int currentLine = 0; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = GUI_STATE_PRESSED; - framesCounter++; - - int key = GetKeyPressed(); - int keyCount = strlen(text); - - // Introduce characters - if (keyCount < (textSize - 1)) - { - Vector2 textSize = MeasureTextEx(guiFont, text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); - - if (textSize.y < (textAreaBounds.height - GuiGetStyle(DEFAULT, TEXT_SIZE))) - { - if (IsKeyPressed(KEY_ENTER)) - { - text[keyCount] = '\n'; - keyCount++; - } - else if (((key >= 32) && (key < 255))) // TODO: Support Unicode inputs - { - text[keyCount] = (char)key; - keyCount++; - } - } - } - - // Delete characters - if (keyCount > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - keyCount--; - text[keyCount] = '\0'; - framesCounter = 0; - - if (keyCount < 0) - keyCount = 0; - } - else if (IsKeyDown(KEY_BACKSPACE)) - { - if ((framesCounter > TEXTEDIT_CURSOR_BLINK_FRAMES) && (framesCounter % 2) == 0) - keyCount--; - text[keyCount] = '\0'; - - if (keyCount < 0) - keyCount = 0; - } - } - - // Calculate cursor position considering text - char oneCharText[2] = {0}; - int lastBreakingPos = -1; - - for (int i = 0; i < keyCount && currentLine < keyCount; i++) - { - oneCharText[0] = text[i]; - textWidth += (GetTextWidth(oneCharText) + GuiGetStyle(DEFAULT, TEXT_SPACING)); - - if (text[i] == ' ' || text[i] == '\n') - lastBreakingPos = i; - - if (text[i] == '\n' || textWidth >= textAreaBounds.width) - { - currentLine++; - textWidth = 0; - - if (lastBreakingPos > 0) - i = lastBreakingPos; - else - textWidth += (GetTextWidth(oneCharText) + GuiGetStyle(DEFAULT, TEXT_SPACING)); - - lastBreakingPos = -1; - } - } - - cursor.x = bounds.x + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) + textWidth - GuiGetStyle(DEFAULT, TEXT_SPACING); - cursor.y = bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) / 2 + ((GuiGetStyle(DEFAULT, TEXT_SIZE) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)) * currentLine); - - // Exit edit mode - if (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - - if (pressed) - framesCounter = 0; // Reset blinking cursor - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == GUI_STATE_PRESSED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); - - // Draw blinking cursor - if (editMode && ((framesCounter / 20) % 2 == 0)) - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - } - else if (state == GUI_STATE_DISABLED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); - } - else - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - DrawTextRec(guiFont, text, textAreaBounds, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING), true, Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Slider control with pro parameters -// NOTE: Other GuiSlider*() controls use this one -float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue, int sliderWidth) -{ - GuiControlState state = guiState; - - int sliderValue = (int)(((value - minValue) / (maxValue - minValue)) * (bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH))); - - Rectangle slider = {bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING), - 0, bounds.height - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH) - 2 * GuiGetStyle(SLIDER, SLIDER_PADDING)}; - - if (sliderWidth > 0) // Slider - { - slider.x += (sliderValue - sliderWidth / 2); - slider.width = sliderWidth; - } - else if (sliderWidth == 0) // SliderBar - { - slider.x += GuiGetStyle(SLIDER, BORDER_WIDTH); - slider.width = sliderValue; - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = GUI_STATE_PRESSED; - - // Get equivalent value and slider position from mousePoint.x - value = ((maxValue - minValue) * (mousePoint.x - (float)(bounds.x + sliderWidth / 2))) / (float)(bounds.width - sliderWidth) + minValue; - - if (sliderWidth > 0) - slider.x = mousePoint.x - slider.width / 2; // Slider - else if (sliderWidth == 0) - slider.width = sliderValue; // SliderBar - } - else - state = GUI_STATE_FOCUSED; - } - - if (value > maxValue) - value = maxValue; - else if (value < minValue) - value = minValue; - } - - // Bar limits check - if (sliderWidth > 0) // Slider - { - if (slider.x <= (bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH))) - slider.x = bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH); - else if ((slider.x + slider.width) >= (bounds.x + bounds.width)) - slider.x = bounds.x + bounds.width - slider.width - GuiGetStyle(SLIDER, BORDER_WIDTH); - } - else if (sliderWidth == 0) // SliderBar - { - if (slider.width > bounds.width) - slider.width = bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH); - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != GUI_STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - - // Draw slider internal bar (depends on state) - if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == GUI_STATE_FOCUSED) - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha)); - - // Draw left/right text if provided - if (textLeft != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = GetTextWidth(textLeft); // TODO: Consider text icon - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); - } - - if (textRight != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = GetTextWidth(textRight); // TODO: Consider text icon - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); - } - //-------------------------------------------------------------------- - - return value; -} - -// Slider control extended, returns selected value and has text -float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, GuiGetStyle(SLIDER, SLIDER_WIDTH)); -} - -// Slider Bar control extended, returns selected value -float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, 0); -} - -// Progress Bar control extended, shows current progress value -float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - GuiControlState state = guiState; - - Rectangle progress = {bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), - bounds.y + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) + GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING), 0, - bounds.height - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) - 2 * GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING)}; - - // Update control - //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) - progress.width = (int)(value / (maxValue - minValue) * (float)(bounds.width - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(PROGRESSBAR, BORDER + (state * 3))), guiAlpha), BLANK); - - // Draw slider internal progress bar (depends on state) - if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) - GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == GUI_STATE_FOCUSED) - GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT_COLOR_FOCUSED)), guiAlpha)); - - // Draw left/right text if provided - if (textLeft != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = GetTextWidth(textLeft); // TODO: Consider text icon - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); - } - - if (textRight != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = GetTextWidth(textRight); // TODO: Consider text icon - textBounds.height = GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); - } - //-------------------------------------------------------------------- - - return value; -} - -// Status Bar control -void GuiStatusBar(Rectangle bounds, const char *text) -{ - GuiControlState state = guiState; - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(STATUSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED) ? BORDER_COLOR_NORMAL : BORDER_COLOR_DISABLED)), guiAlpha), - Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(STATUSBAR, bounds), GuiGetStyle(STATUSBAR, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Dummy rectangle control, intended for placeholding -void GuiDummyRec(Rectangle bounds, const char *text) -{ - GuiControlState state = guiState; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = GUI_STATE_PRESSED; - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(DEFAULT, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(BUTTON, (state != GUI_STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); - //------------------------------------------------------------------ -} - -// Scroll Bar control -// TODO: I feel GuiScrollBar could be simplified... -int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) -{ - GuiControlState state = guiState; - - // Is the scrollbar horizontal or vertical? - bool isVertical = (bounds.width > bounds.height) ? false : true; - - // The size (width or height depending on scrollbar type) of the spinner buttons - const int spinnerSize = GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE) ? (isVertical ? bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH) : bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)) : 0; - - // Arrow buttons [<] [>] [∧] [∨] - Rectangle arrowUpLeft = {0}; - Rectangle arrowDownRight = {0}; - - // Actual area of the scrollbar excluding the arrow buttons - Rectangle scrollbar = {0}; - - // Slider bar that moves --[///]----- - Rectangle slider = {0}; - - // Normalize value - if (value > maxValue) - value = maxValue; - if (value < minValue) - value = minValue; - - const int range = maxValue - minValue; - int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); - - // Calculate rectangles for all of the components - arrowUpLeft = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - - if (isVertical) - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + bounds.height - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING)), bounds.height - arrowUpLeft.height - arrowDownRight.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; - sliderSize = (sliderSize >= scrollbar.height) ? (scrollbar.height - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)scrollbar.y + (int)(((float)(value - minValue) / range) * (scrollbar.height - sliderSize)), (float)bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)), (float)sliderSize}; - } - else - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + bounds.width - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x + arrowUpLeft.width, bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), bounds.width - arrowUpLeft.width - arrowDownRight.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING))}; - sliderSize = (sliderSize >= scrollbar.width) ? (scrollbar.width - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){(float)scrollbar.x + (int)(((float)(value - minValue) / range) * (scrollbar.width - sliderSize)), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)sliderSize, (float)bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING))}; - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - - // Handle mouse wheel - int wheel = GetMouseWheelMove(); - if (wheel != 0) - value += wheel; - - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - if (CheckCollisionPointRec(mousePoint, arrowUpLeft)) - value -= range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - else if (CheckCollisionPointRec(mousePoint, arrowDownRight)) - value += range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - - state = GUI_STATE_PRESSED; - } - else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!isVertical) - { - Rectangle scrollArea = {arrowUpLeft.x + arrowUpLeft.width, arrowUpLeft.y, scrollbar.width, bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) - value = ((float)(mousePoint.x - scrollArea.x - slider.width / 2) * range) / (scrollArea.width - slider.width) + minValue; - } - else - { - Rectangle scrollArea = {arrowUpLeft.x, arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), scrollbar.height}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) - value = ((float)(mousePoint.y - scrollArea.y - slider.height / 2) * range) / (scrollArea.height - slider.height) + minValue; - } - } - } - - // Normalize value - if (value > maxValue) - value = maxValue; - if (value < minValue) - value = minValue; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SCROLLBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha)); // Draw the background - - GuiDrawRectangle(scrollbar, 0, BLANK, Fade(GetColor(GuiGetStyle(BUTTON, BASE_COLOR_NORMAL)), guiAlpha)); // Draw the scrollbar active area background - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BORDER + state * 3)), guiAlpha)); // Draw the slider bar - - // Draw arrows - const int padding = (spinnerSize - GuiGetStyle(SCROLLBAR, ARROWS_SIZE)) / 2; - const Vector2 lineCoords[] = - { - // Coordinates for < 0,1,2 - {arrowUpLeft.x + padding, arrowUpLeft.y + spinnerSize / 2}, - {arrowUpLeft.x + spinnerSize - padding, arrowUpLeft.y + padding}, - {arrowUpLeft.x + spinnerSize - padding, arrowUpLeft.y + spinnerSize - padding}, - - // Coordinates for > 3,4,5 - {arrowDownRight.x + padding, arrowDownRight.y + padding}, - {arrowDownRight.x + spinnerSize - padding, arrowDownRight.y + spinnerSize / 2}, - {arrowDownRight.x + padding, arrowDownRight.y + spinnerSize - padding}, - - // Coordinates for ∧ 6,7,8 - {arrowUpLeft.x + spinnerSize / 2, arrowUpLeft.y + padding}, - {arrowUpLeft.x + padding, arrowUpLeft.y + spinnerSize - padding}, - {arrowUpLeft.x + spinnerSize - padding, arrowUpLeft.y + spinnerSize - padding}, - - // Coordinates for ∨ 9,10,11 - {arrowDownRight.x + padding, arrowDownRight.y + padding}, - {arrowDownRight.x + spinnerSize / 2, arrowDownRight.y + spinnerSize - padding}, - {arrowDownRight.x + spinnerSize - padding, arrowDownRight.y + padding}}; - - Color lineColor = Fade(GetColor(GuiGetStyle(BUTTON, TEXT + state * 3)), guiAlpha); - - if (GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)) - { - if (isVertical) - { - DrawTriangle(lineCoords[6], lineCoords[7], lineCoords[8], lineColor); - DrawTriangle(lineCoords[9], lineCoords[10], lineCoords[11], lineColor); - } - else - { - DrawTriangle(lineCoords[2], lineCoords[1], lineCoords[0], lineColor); - DrawTriangle(lineCoords[5], lineCoords[4], lineCoords[3], lineColor); - } - } - //-------------------------------------------------------------------- - - return value; -} - -// List View control -int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active) -{ - int itemsCount = 0; - const char **items = NULL; - - if (text != NULL) - items = GuiTextSplit(text, &itemsCount, NULL); - - return GuiListViewEx(bounds, items, itemsCount, NULL, scrollIndex, active); -} - -// List View control with extended parameters -int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active) -{ - GuiControlState state = guiState; - int itemFocused = (focus == NULL) ? -1 : *focus; - int itemSelected = active; - - // Check if we need a scroll bar - bool useScrollBar = false; - if ((GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)) * count > bounds.height) - useScrollBar = true; - - // Define base item rectangle [0] - Rectangle itemBounds = {0}; - itemBounds.x = bounds.x + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING); - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); - itemBounds.width = bounds.width - 2 * GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) - GuiGetStyle(DEFAULT, BORDER_WIDTH); - itemBounds.height = GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT); - if (useScrollBar) - itemBounds.width -= GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH); - - // Get items on the list - int visibleItems = bounds.height / (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); - if (visibleItems > count) - visibleItems = count; - - int startIndex = (scrollIndex == NULL) ? 0 : *scrollIndex; - if ((startIndex < 0) || (startIndex > (count - visibleItems))) - startIndex = 0; - int endIndex = startIndex + visibleItems; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check mouse inside list view - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - - // Check focused and selected item - for (int i = 0; i < visibleItems; i++) - { - if (CheckCollisionPointRec(mousePoint, itemBounds)) - { - itemFocused = startIndex + i; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - if (itemSelected == (startIndex + i)) - itemSelected = -1; - else - itemSelected = startIndex + i; - } - break; - } - - // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); - } - - if (useScrollBar) - { - int wheelMove = GetMouseWheelMove(); - startIndex -= wheelMove; - - if (startIndex < 0) - startIndex = 0; - else if (startIndex > (count - visibleItems)) - startIndex = count - visibleItems; - - endIndex = startIndex + visibleItems; - if (endIndex > count) - endIndex = count; - } - } - else - itemFocused = -1; - - // Reset item rectangle y to [0] - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background - - // Draw visible items - for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) - { - if (state == GUI_STATE_DISABLED) - { - if ((startIndex + i) == itemSelected) - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_DISABLED)), guiAlpha)); - - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_DISABLED)), guiAlpha)); - } - else - { - if ((startIndex + i) == itemSelected) - { - // Draw item selected - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_PRESSED)), guiAlpha)); - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_PRESSED)), guiAlpha)); - } - else if ((startIndex + i) == itemFocused) - { - // Draw item focused - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_FOCUSED)), guiAlpha)); - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_FOCUSED)), guiAlpha)); - } - else - { - // Draw item normal - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_NORMAL)), guiAlpha)); - } - } - - // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); - } - - if (useScrollBar) - { - Rectangle scrollBarBounds = { - bounds.x + bounds.width - GuiGetStyle(LISTVIEW, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), - bounds.y + GuiGetStyle(LISTVIEW, BORDER_WIDTH), (float)GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), - bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; - - // Calculate percentage of visible items and apply same percentage to scrollbar - float percentVisible = (float)(endIndex - startIndex) / count; - float sliderSize = bounds.height * percentVisible; - - int prevSliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); // Save default slider size - int prevScrollSpeed = GuiGetStyle(SCROLLBAR, SCROLL_SPEED); // Save default scroll speed - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, sliderSize); // Change slider size - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, count - visibleItems); // Change scroll speed - - startIndex = GuiScrollBar(scrollBarBounds, startIndex, 0, count - visibleItems); - - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, prevScrollSpeed); // Reset scroll speed to default - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, prevSliderSize); // Reset slider size to default - } - //-------------------------------------------------------------------- - - if (focus != NULL) - *focus = itemFocused; - if (scrollIndex != NULL) - *scrollIndex = startIndex; - - return itemSelected; -} - -// Color Panel control -Color GuiColorPanelEx(Rectangle bounds, Color color, float hue) -{ - GuiControlState state = guiState; - Vector2 pickerSelector = {0}; - - Vector3 vcolor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f}; - Vector3 hsv = ConvertRGBtoHSV(vcolor); - - pickerSelector.x = bounds.x + (float)hsv.y * bounds.width; // HSV: Saturation - pickerSelector.y = bounds.y + (1.0f - (float)hsv.z) * bounds.height; // HSV: Value - - Vector3 maxHue = {hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f}; - Vector3 rgbHue = ConvertHSVtoRGB(maxHue); - Color maxHueCol = {(unsigned char)(255.0f * rgbHue.x), - (unsigned char)(255.0f * rgbHue.y), - (unsigned char)(255.0f * rgbHue.z), 255}; - - const Color colWhite = {255, 255, 255, 255}; - const Color colBlack = {0, 0, 0, 255}; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = GUI_STATE_PRESSED; - pickerSelector = mousePoint; - - // Calculate color from picker - Vector2 colorPick = {pickerSelector.x - bounds.x, pickerSelector.y - bounds.y}; - - colorPick.x /= (float)bounds.width; // Get normalized value on x - colorPick.y /= (float)bounds.height; // Get normalized value on y - - hsv.y = colorPick.x; - hsv.z = 1.0f - colorPick.y; - - Vector3 rgb = ConvertHSVtoRGB(hsv); - - // NOTE: Vector3ToColor() only available on raylib 1.8.1 - color = RAYGUI_CLITERAL(Color){(unsigned char)(255.0f * rgb.x), - (unsigned char)(255.0f * rgb.y), - (unsigned char)(255.0f * rgb.z), - (unsigned char)(255.0f * (float)color.a / 255.0f)}; - } - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) - { - DrawRectangleGradientEx(bounds, Fade(colWhite, guiAlpha), Fade(colWhite, guiAlpha), Fade(maxHueCol, guiAlpha), Fade(maxHueCol, guiAlpha)); - DrawRectangleGradientEx(bounds, Fade(colBlack, 0), Fade(colBlack, guiAlpha), Fade(colBlack, guiAlpha), Fade(colBlack, 0)); - - // Draw color picker: selector - Rectangle selector = {pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)}; - GuiDrawRectangle(selector, 0, BLANK, Fade(colWhite, guiAlpha)); - } - else - { - DrawRectangleGradientEx(bounds, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.6f), guiAlpha)); - } - - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - //-------------------------------------------------------------------- - - return color; -} - -Color GuiColorPanel(Rectangle bounds, Color color) -{ - return GuiColorPanelEx(bounds, color, -1.0f); -} - -// Color Bar Alpha control -// NOTE: Returns alpha value normalized [0..1] -float GuiColorBarAlpha(Rectangle bounds, float alpha) -{ -#define COLORBARALPHA_CHECKED_SIZE 10 - - GuiControlState state = guiState; - Rectangle selector = {(float)bounds.x + alpha * bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT), (float)bounds.height + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2}; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = GUI_STATE_PRESSED; - selector.x = mousePoint.x - selector.width / 2; - - alpha = (mousePoint.x - bounds.x) / bounds.width; - if (alpha <= 0.0f) - alpha = 0.0f; - if (alpha >= 1.0f) - alpha = 1.0f; - //selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; - } - else - state = GUI_STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - - // Draw alpha bar: checked background - if (state != GUI_STATE_DISABLED) - { - int checksX = bounds.width / COLORBARALPHA_CHECKED_SIZE; - int checksY = bounds.height / COLORBARALPHA_CHECKED_SIZE; - - for (int x = 0; x < checksX; x++) - { - for (int y = 0; y < checksY; y++) - { - Rectangle check = {bounds.x + x * COLORBARALPHA_CHECKED_SIZE, bounds.y + y * COLORBARALPHA_CHECKED_SIZE, COLORBARALPHA_CHECKED_SIZE, COLORBARALPHA_CHECKED_SIZE}; - GuiDrawRectangle(check, 0, BLANK, ((x + y) % 2) ? Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.4f), guiAlpha) : Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.4f), guiAlpha)); - } - } - - DrawRectangleGradientEx(bounds, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha)); - } - else - DrawRectangleGradientEx(bounds, Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - - // Draw alpha bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); - //-------------------------------------------------------------------- - - return alpha; -} - -// Color Bar Hue control -// NOTE: Returns hue value normalized [0..1] -float GuiColorBarHue(Rectangle bounds, float hue) -{ - GuiControlState state = guiState; - Rectangle selector = {(float)bounds.x - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y + hue / 360.0f * bounds.height - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2, (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)}; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = GUI_STATE_PRESSED; - selector.y = mousePoint.y - selector.height / 2; - - hue = (mousePoint.y - bounds.y) * 360 / bounds.height; - if (hue <= 0.0f) - hue = 0.0f; - if (hue >= 359.0f) - hue = 359.0f; - } - else - state = GUI_STATE_FOCUSED; - - /*if (IsKeyDown(KEY_UP)) - { - hue -= 2.0f; - if (hue <= 0.0f) hue = 0.0f; - } - else if (IsKeyDown(KEY_DOWN)) - { - hue += 2.0f; - if (hue >= 360.0f) hue = 360.0f; - }*/ - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) - { - // Draw hue bar:color bars - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6, Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha)); - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + (int)bounds.height / 6 + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6, Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha)); - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + 2 * ((int)bounds.height / 6) + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6, Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha)); - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + 3 * ((int)bounds.height / 6) + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6, Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha)); - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + 4 * ((int)bounds.height / 6) + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6, Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha)); - DrawRectangleGradientV(bounds.x + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.y + 5 * ((int)bounds.height / 6) + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) / 2, bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (int)bounds.height / 6 - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha)); - } - else - DrawRectangleGradientV(bounds.x, bounds.y, bounds.width, bounds.height, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - - // Draw hue bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); - //-------------------------------------------------------------------- - - return hue; -} - -// TODO: Color GuiColorBarSat() [WHITE->color] -// TODO: Color GuiColorBarValue() [BLACK->color], HSV / HSL -// TODO: float GuiColorBarLuminance() [BLACK->WHITE] - -// Color Picker control -// NOTE: It's divided in multiple controls: -// Color GuiColorPanel(Rectangle bounds, Color color) -// float GuiColorBarAlpha(Rectangle bounds, float alpha) -// float GuiColorBarHue(Rectangle bounds, float value) -// NOTE: bounds define GuiColorPanel() size -Color GuiColorPicker(Rectangle bounds, Color color) -{ - color = GuiColorPanel(bounds, color); - - Rectangle boundsHue = {(float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height}; - //Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; - - Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}); - hsv.x = GuiColorBarHue(boundsHue, hsv.x); - //color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); - Vector3 rgb = ConvertHSVtoRGB(hsv); - color = RAYGUI_CLITERAL(Color){(unsigned char)roundf(rgb.x * 255.0f), (unsigned char)roundf(rgb.y * 255.0f), (unsigned char)roundf(rgb.z * 255.0f), color.a}; - - return color; -} - -// Message Box control -int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons) -{ -#define MESSAGEBOX_BUTTON_HEIGHT 24 -#define MESSAGEBOX_BUTTON_PADDING 10 - - int clicked = -1; // Returns clicked button from buttons list, 0 refers to closed window button - - int buttonsCount = 0; - const char **buttonsText = GuiTextSplit(buttons, &buttonsCount, NULL); - Rectangle buttonBounds = {0}; - buttonBounds.x = bounds.x + MESSAGEBOX_BUTTON_PADDING; - buttonBounds.y = bounds.y + bounds.height - MESSAGEBOX_BUTTON_HEIGHT - MESSAGEBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - MESSAGEBOX_BUTTON_PADDING * (buttonsCount + 1)) / buttonsCount; - buttonBounds.height = MESSAGEBOX_BUTTON_HEIGHT; - - Vector2 textSize = MeasureTextEx(guiFont, message, GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - - Rectangle textBounds = {0}; - textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; - textBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT + (bounds.height - WINDOW_STATUSBAR_HEIGHT - MESSAGEBOX_BUTTON_HEIGHT - MESSAGEBOX_BUTTON_PADDING) / 2 - textSize.y / 2; - textBounds.width = textSize.x; - textBounds.height = textSize.y; - - // Draw control - //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) - clicked = 0; - - int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - GuiLabel(textBounds, message); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); - - prevTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - - for (int i = 0; i < buttonsCount; i++) - { - if (GuiButton(buttonBounds, buttonsText[i])) - clicked = i + 1; - buttonBounds.x += (buttonBounds.width + MESSAGEBOX_BUTTON_PADDING); - } - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevTextAlignment); - //-------------------------------------------------------------------- - - return clicked; -} - -// Text Input Box control, ask for text -int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text) -{ -#define TEXTINPUTBOX_BUTTON_HEIGHT 24 -#define TEXTINPUTBOX_BUTTON_PADDING 10 -#define TEXTINPUTBOX_HEIGHT 30 - -#define TEXTINPUTBOX_MAX_TEXT_LENGTH 256 - - // Used to enable text edit mode - // WARNING: No more than one GuiTextInputBox() should be open at the same time - static bool textEditMode = false; - - int btnIndex = -1; - - int buttonsCount = 0; - const char **buttonsText = GuiTextSplit(buttons, &buttonsCount, NULL); - Rectangle buttonBounds = {0}; - buttonBounds.x = bounds.x + TEXTINPUTBOX_BUTTON_PADDING; - buttonBounds.y = bounds.y + bounds.height - TEXTINPUTBOX_BUTTON_HEIGHT - TEXTINPUTBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - TEXTINPUTBOX_BUTTON_PADDING * (buttonsCount + 1)) / buttonsCount; - buttonBounds.height = TEXTINPUTBOX_BUTTON_HEIGHT; - - int messageInputHeight = bounds.height - WINDOW_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - TEXTINPUTBOX_BUTTON_HEIGHT - 2 * TEXTINPUTBOX_BUTTON_PADDING; - - Rectangle textBounds = {0}; - if (message != NULL) - { - Vector2 textSize = MeasureTextEx(guiFont, message, GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - - textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; - textBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT + messageInputHeight / 4 - textSize.y / 2; - textBounds.width = textSize.x; - textBounds.height = textSize.y; - } - - Rectangle textBoxBounds = {0}; - textBoxBounds.x = bounds.x + TEXTINPUTBOX_BUTTON_PADDING; - textBoxBounds.y = bounds.y + WINDOW_STATUSBAR_HEIGHT - TEXTINPUTBOX_HEIGHT / 2; - if (message == NULL) - textBoxBounds.y += messageInputHeight / 2; - else - textBoxBounds.y += (messageInputHeight / 2 + messageInputHeight / 4); - textBoxBounds.width = bounds.width - TEXTINPUTBOX_BUTTON_PADDING * 2; - textBoxBounds.height = TEXTINPUTBOX_HEIGHT; - - // Draw control - //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) - btnIndex = 0; - - // Draw message if available - if (message != NULL) - { - int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - GuiLabel(textBounds, message); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); - } - - if (GuiTextBox(textBoxBounds, text, TEXTINPUTBOX_MAX_TEXT_LENGTH, textEditMode)) - textEditMode = !textEditMode; - - int prevBtnTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - - for (int i = 0; i < buttonsCount; i++) - { - if (GuiButton(buttonBounds, buttonsText[i])) - btnIndex = i + 1; - buttonBounds.x += (buttonBounds.width + MESSAGEBOX_BUTTON_PADDING); - } - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevBtnTextAlignment); - //-------------------------------------------------------------------- - - return btnIndex; -} - -// Grid control -// NOTE: Returns grid mouse-hover selected cell -// About drawing lines at subpixel spacing, simple put, not easy solution: -// https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster -Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs) -{ -#if !defined(GRID_COLOR_ALPHA) -#define GRID_COLOR_ALPHA 0.15f // Grid lines alpha amount -#endif - - GuiControlState state = guiState; - Vector2 mousePoint = GetMousePosition(); - Vector2 currentCell = {-1, -1}; - - int linesV = ((int)(bounds.width / spacing)) * subdivs + 1; - int linesH = ((int)(bounds.height / spacing)) * subdivs + 1; - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - currentCell.x = (int)((mousePoint.x - bounds.x) / spacing); - currentCell.y = (int)((mousePoint.y - bounds.y) / spacing); - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (state) - { - case GUI_STATE_NORMAL: - { - if (subdivs > 0) - { - // Draw vertical grid lines - for (int i = 0; i < linesV; i++) - { - Rectangle lineV = {bounds.x + spacing * i / subdivs, bounds.y, 1, bounds.height}; - GuiDrawRectangle(lineV, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA)); - } - - // Draw horizontal grid lines - for (int i = 0; i < linesH; i++) - { - Rectangle lineH = {bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1}; - GuiDrawRectangle(lineH, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA)); - } - } - } - break; - default: - break; - } - - return currentCell; -} - -//---------------------------------------------------------------------------------- -// Styles loading functions -//---------------------------------------------------------------------------------- - -// Load raygui style file (.rgs) -void GuiLoadStyle(const char *fileName) -{ - bool tryBinary = false; - - // Try reading the files as text file first - FILE *rgsFile = fopen(fileName, "rt"); - - if (rgsFile != NULL) - { - char buffer[256] = {0}; - fgets(buffer, 256, rgsFile); - - if (buffer[0] == '#') - { - int controlId = 0; - int propertyId = 0; - unsigned int propertyValue = 0; - - while (!feof(rgsFile)) - { - switch (buffer[0]) - { - case 'p': - { - // Style property: p - - sscanf(buffer, "p %d %d 0x%x", &controlId, &propertyId, &propertyValue); - - GuiSetStyle(controlId, propertyId, (int)propertyValue); - } - break; - case 'f': - { - // Style font: f - - int fontSize = 0; - char charmapFileName[256] = {0}; - char fontFileName[256] = {0}; - sscanf(buffer, "f %d %s %[^\n]s", &fontSize, charmapFileName, fontFileName); - - Font font = {0}; - - if (charmapFileName[0] != '0') - { - // Load characters from charmap file, - // expected '\n' separated list of integer values - char *charValues = LoadText(charmapFileName); - if (charValues != NULL) - { - int charsCount = 0; - const char **chars = TextSplit(charValues, '\n', &charsCount); - - int *values = (int *)RAYGUI_MALLOC(charsCount * sizeof(int)); - for (int i = 0; i < charsCount; i++) - values[i] = TextToInteger(chars[i]); - - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, charsCount); - - RAYGUI_FREE(values); - } - } - else - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); - - if ((font.texture.id > 0) && (font.charsCount > 0)) - GuiSetFont(font); - } - break; - default: - break; - } - - fgets(buffer, 256, rgsFile); - } - } - else - tryBinary = true; - - fclose(rgsFile); - } - - if (tryBinary) - { - rgsFile = fopen(fileName, "rb"); - - if (rgsFile == NULL) - return; - - char signature[5] = ""; - short version = 0; - short reserved = 0; - int propertiesCount = 0; - - fread(signature, 1, 4, rgsFile); - fread(&version, 1, sizeof(short), rgsFile); - fread(&reserved, 1, sizeof(short), rgsFile); - fread(&propertiesCount, 1, sizeof(int), rgsFile); - - if ((signature[0] == 'r') && - (signature[1] == 'G') && - (signature[2] == 'S') && - (signature[3] == ' ')) - { - short controlId = 0; - short propertyId = 0; - int propertyValue = 0; - - for (int i = 0; i < propertiesCount; i++) - { - fread(&controlId, 1, sizeof(short), rgsFile); - fread(&propertyId, 1, sizeof(short), rgsFile); - fread(&propertyValue, 1, sizeof(int), rgsFile); - - if (controlId == 0) // DEFAULT control - { - // If a DEFAULT property is loaded, it is propagated to all controls - // NOTE: All DEFAULT properties should be defined first in the file - GuiSetStyle(0, (int)propertyId, propertyValue); - - if (propertyId < NUM_PROPS_DEFAULT) - for (int i = 1; i < NUM_CONTROLS; i++) - GuiSetStyle(i, (int)propertyId, propertyValue); - } - else - GuiSetStyle((int)controlId, (int)propertyId, propertyValue); - } - - // Font loading is highly dependant on raylib API to load font data and image - // TODO: Find some mechanism to support it in standalone mode -#if !defined(RAYGUI_STANDALONE) - // Load custom font if available - int fontDataSize = 0; - fread(&fontDataSize, 1, sizeof(int), rgsFile); - - if (fontDataSize > 0) - { - Font font = {0}; - int fontType = 0; // 0-Normal, 1-SDF - Rectangle whiteRec = {0}; - - fread(&font.baseSize, 1, sizeof(int), rgsFile); - fread(&font.charsCount, 1, sizeof(int), rgsFile); - fread(&fontType, 1, sizeof(int), rgsFile); - - // Load font white rectangle - fread(&whiteRec, 1, sizeof(Rectangle), rgsFile); - - // Load font image parameters - int fontImageSize = 0; - fread(&fontImageSize, 1, sizeof(int), rgsFile); - - if (fontImageSize > 0) - { - Image imFont = {0}; - imFont.mipmaps = 1; - fread(&imFont.width, 1, sizeof(int), rgsFile); - fread(&imFont.height, 1, sizeof(int), rgsFile); - fread(&imFont.format, 1, sizeof(int), rgsFile); - - imFont.data = (unsigned char *)RAYGUI_MALLOC(fontImageSize); - fread(imFont.data, 1, fontImageSize, rgsFile); - - font.texture = LoadTextureFromImage(imFont); - - UnloadImage(imFont); - } - - // Load font recs data - font.recs = (Rectangle *)RAYGUI_CALLOC(font.charsCount, sizeof(Rectangle)); - for (int i = 0; i < font.charsCount; i++) - fread(&font.recs[i], 1, sizeof(Rectangle), rgsFile); - - // Load font chars info data - font.chars = (CharInfo *)RAYGUI_CALLOC(font.charsCount, sizeof(CharInfo)); - for (int i = 0; i < font.charsCount; i++) - { - fread(&font.chars[i].value, 1, sizeof(int), rgsFile); - fread(&font.chars[i].offsetX, 1, sizeof(int), rgsFile); - fread(&font.chars[i].offsetY, 1, sizeof(int), rgsFile); - fread(&font.chars[i].advanceX, 1, sizeof(int), rgsFile); - } - - GuiSetFont(font); - - // Set font texture source rectangle to be used as white texture to draw shapes - // NOTE: This way, all gui can be draw using a single draw call - if ((whiteRec.width != 0) && (whiteRec.height != 0)) - SetShapesTexture(font.texture, whiteRec); - } -#endif - } - - fclose(rgsFile); - } -} - -// Load style default over global style -void GuiLoadStyleDefault(void) -{ - // We set this variable first to avoid cyclic function calls - // when calling GuiSetStyle() and GuiGetStyle() - guiStyleLoaded = true; - - // Initialize default LIGHT style property values - GuiSetStyle(DEFAULT, BORDER_COLOR_NORMAL, 0x838383ff); - GuiSetStyle(DEFAULT, BASE_COLOR_NORMAL, 0xc9c9c9ff); - GuiSetStyle(DEFAULT, TEXT_COLOR_NORMAL, 0x686868ff); - GuiSetStyle(DEFAULT, BORDER_COLOR_FOCUSED, 0x5bb2d9ff); - GuiSetStyle(DEFAULT, BASE_COLOR_FOCUSED, 0xc9effeff); - GuiSetStyle(DEFAULT, TEXT_COLOR_FOCUSED, 0x6c9bbcff); - GuiSetStyle(DEFAULT, BORDER_COLOR_PRESSED, 0x0492c7ff); - GuiSetStyle(DEFAULT, BASE_COLOR_PRESSED, 0x97e8ffff); - GuiSetStyle(DEFAULT, TEXT_COLOR_PRESSED, 0x368bafff); - GuiSetStyle(DEFAULT, BORDER_COLOR_DISABLED, 0xb5c1c2ff); - GuiSetStyle(DEFAULT, BASE_COLOR_DISABLED, 0xe6e9e9ff); - GuiSetStyle(DEFAULT, TEXT_COLOR_DISABLED, 0xaeb7b8ff); - GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_PADDING, 0); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); // WARNING: Some controls use other values - - // Initialize control-specific property values - // NOTE: Those properties are in default list but require specific values by control type - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 2); - GuiSetStyle(SLIDER, TEXT_PADDING, 5); - GuiSetStyle(CHECKBOX, TEXT_PADDING, 5); - GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_RIGHT); - GuiSetStyle(TEXTBOX, TEXT_PADDING, 5); - GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); - GuiSetStyle(VALUEBOX, TEXT_PADDING, 4); - GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); - GuiSetStyle(SPINNER, TEXT_PADDING, 4); - GuiSetStyle(SPINNER, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); - GuiSetStyle(STATUSBAR, TEXT_PADDING, 6); - GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); - - // Initialize extended property values - // NOTE: By default, extended property values are initialized to 0 - GuiSetStyle(DEFAULT, TEXT_SIZE, 10); // DEFAULT, shared by all controls - GuiSetStyle(DEFAULT, TEXT_SPACING, 1); // DEFAULT, shared by all controls - GuiSetStyle(DEFAULT, LINE_COLOR, 0x90abb5ff); // DEFAULT specific property - GuiSetStyle(DEFAULT, BACKGROUND_COLOR, 0xf5f5f5ff); // DEFAULT specific property - GuiSetStyle(TOGGLE, GROUP_PADDING, 2); - GuiSetStyle(SLIDER, SLIDER_WIDTH, 15); - GuiSetStyle(SLIDER, SLIDER_PADDING, 1); - GuiSetStyle(PROGRESSBAR, PROGRESS_PADDING, 1); - GuiSetStyle(CHECKBOX, CHECK_PADDING, 1); - GuiSetStyle(COMBOBOX, COMBO_BUTTON_WIDTH, 30); - GuiSetStyle(COMBOBOX, COMBO_BUTTON_PADDING, 2); - GuiSetStyle(DROPDOWNBOX, ARROW_PADDING, 16); - GuiSetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING, 2); - GuiSetStyle(TEXTBOX, TEXT_LINES_PADDING, 5); - GuiSetStyle(TEXTBOX, TEXT_INNER_PADDING, 4); - GuiSetStyle(TEXTBOX, COLOR_SELECTED_FG, 0xf0fffeff); - GuiSetStyle(TEXTBOX, COLOR_SELECTED_BG, 0x839affe0); - GuiSetStyle(SPINNER, SPIN_BUTTON_WIDTH, 20); - GuiSetStyle(SPINNER, SPIN_BUTTON_PADDING, 2); - GuiSetStyle(SCROLLBAR, BORDER_WIDTH, 0); - GuiSetStyle(SCROLLBAR, ARROWS_VISIBLE, 0); - GuiSetStyle(SCROLLBAR, ARROWS_SIZE, 6); - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING, 0); - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, 16); - GuiSetStyle(SCROLLBAR, SCROLL_PADDING, 0); - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, 10); - GuiSetStyle(LISTVIEW, LIST_ITEMS_HEIGHT, 0x1e); - GuiSetStyle(LISTVIEW, LIST_ITEMS_PADDING, 2); - GuiSetStyle(LISTVIEW, SCROLLBAR_WIDTH, 10); - GuiSetStyle(LISTVIEW, SCROLLBAR_SIDE, SCROLLBAR_RIGHT_SIDE); - GuiSetStyle(COLORPICKER, COLOR_SELECTOR_SIZE, 6); - GuiSetStyle(COLORPICKER, HUEBAR_WIDTH, 0x14); - GuiSetStyle(COLORPICKER, HUEBAR_PADDING, 0xa); - GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT, 6); - GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW, 2); - - guiFont = GetFontDefault(); // Initialize default font -} - -// Get text with icon id prepended -// NOTE: Useful to add icons by name id (enum) instead of -// a number that can change between ricon versions -const char *GuiIconText(int iconId, const char *text) -{ -#if defined(RAYGUI_SUPPORT_ICONS) - static char buffer[1024] = {0}; - memset(buffer, 0, 1024); - - sprintf(buffer, "#%03i#", iconId); - - if (text != NULL) - { - for (int i = 5; i < 1024; i++) - { - buffer[i] = text[i - 5]; - if (text[i - 5] == '\0') - break; - } - } - - return buffer; -#else - return NULL; -#endif -} - -#if defined(RAYGUI_SUPPORT_ICONS) - -// Get full icons data pointer -unsigned int *GuiGetIcons(void) { return guiIcons; } - -// Load raygui icons file (.rgi) -// NOTE: In case nameIds are required, they can be requested with loadIconsName, -// they are returned as a guiIconsName[iconsCount][RICON_MAX_NAME_LENGTH], -// guiIconsName[]][] memory should be manually freed! -char **GuiLoadIcons(const char *fileName, bool loadIconsName) -{ - // Style File Structure (.rgi) - // ------------------------------------------------------ - // Offset | Size | Type | Description - // ------------------------------------------------------ - // 0 | 4 | char | Signature: "rGI " - // 4 | 2 | short | Version: 100 - // 6 | 2 | short | reserved - - // 8 | 2 | short | Num icons (N) - // 10 | 2 | short | Icons size (Options: 16, 32, 64) (S) - - // Icons name id (32 bytes per name id) - // foreach (icon) - // { - // 12+32*i | 32 | char | Icon NameId - // } - - // Icons data: One bit per pixel, stored as unsigned int array (depends on icon size) - // S*S pixels/32bit per unsigned int = K unsigned int per icon - // foreach (icon) - // { - // ... | K | unsigned int | Icon Data - // } - - FILE *rgiFile = fopen(fileName, "rb"); - - char **guiIconsName = NULL; - - if (rgiFile != NULL) - { - char signature[5] = ""; - short version = 0; - short reserved = 0; - short iconsCount = 0; - short iconsSize = 0; - - fread(signature, 1, 4, rgiFile); - fread(&version, 1, sizeof(short), rgiFile); - fread(&reserved, 1, sizeof(short), rgiFile); - fread(&iconsCount, 1, sizeof(short), rgiFile); - fread(&iconsSize, 1, sizeof(short), rgiFile); - - if ((signature[0] == 'r') && - (signature[1] == 'G') && - (signature[2] == 'I') && - (signature[3] == ' ')) - { - if (loadIconsName) - { - guiIconsName = (char **)RAYGUI_MALLOC(iconsCount * sizeof(char **)); - for (int i = 0; i < iconsCount; i++) - { - guiIconsName[i] = (char *)RAYGUI_MALLOC(RICON_MAX_NAME_LENGTH); - fread(guiIconsName[i], 32, 1, rgiFile); - } - } - - // Read icons data directly over guiIcons data array - fread(guiIcons, iconsCount * (iconsSize * iconsSize / 32), sizeof(unsigned int), rgiFile); - } - - fclose(rgiFile); - } - - return guiIconsName; -} - -// Draw selected icon using rectangles pixel-by-pixel -void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color) -{ -#define BIT_CHECK(a, b) ((a) & (1 << (b))) - - for (int i = 0, y = 0; i < RICON_SIZE * RICON_SIZE / 32; i++) - { - for (int k = 0; k < 32; k++) - { - if (BIT_CHECK(guiIcons[iconId * RICON_DATA_ELEMENTS + i], k)) - { -#if !defined(RAYGUI_STANDALONE) - DrawRectangle(position.x + (k % RICON_SIZE) * pixelSize, position.y + y * pixelSize, pixelSize, pixelSize, color); -#endif - } - - if ((k == 15) || (k == 31)) - y++; - } - } -} - -// Get icon bit data -// NOTE: Bit data array grouped as unsigned int (ICON_SIZE*ICON_SIZE/32 elements) -unsigned int *GuiGetIconData(int iconId) -{ - static unsigned int iconData[RICON_DATA_ELEMENTS] = {0}; - memset(iconData, 0, RICON_DATA_ELEMENTS * sizeof(unsigned int)); - - if (iconId < RICON_MAX_ICONS) - memcpy(iconData, &guiIcons[iconId * RICON_DATA_ELEMENTS], RICON_DATA_ELEMENTS * sizeof(unsigned int)); - - return iconData; -} - -// Set icon bit data -// NOTE: Data must be provided as unsigned int array (ICON_SIZE*ICON_SIZE/32 elements) -void GuiSetIconData(int iconId, unsigned int *data) -{ - if (iconId < RICON_MAX_ICONS) - memcpy(&guiIcons[iconId * RICON_DATA_ELEMENTS], data, RICON_DATA_ELEMENTS * sizeof(unsigned int)); -} - -// Set icon pixel value -void GuiSetIconPixel(int iconId, int x, int y) -{ -#define BIT_SET(a, b) ((a) |= (1 << (b))) - - // This logic works for any RICON_SIZE pixels icons, - // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_SET(guiIcons[iconId * RICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RICON_SIZE) * RICON_SIZE)); -} - -// Clear icon pixel value -void GuiClearIconPixel(int iconId, int x, int y) -{ -#define BIT_CLEAR(a, b) ((a) &= ~((1) << (b))) - - // This logic works for any RICON_SIZE pixels icons, - // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_CLEAR(guiIcons[iconId * RICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RICON_SIZE) * RICON_SIZE)); -} - -// Check icon pixel value -bool GuiCheckIconPixel(int iconId, int x, int y) -{ -#define BIT_CHECK(a, b) ((a) & (1 << (b))) - - return (BIT_CHECK(guiIcons[iconId * 8 + y / 2], x + (y % 2 * 16))); -} -#endif // RAYGUI_SUPPORT_ICONS - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- -// Gui get text width using default font -static int GetTextWidth(const char *text) -{ - Vector2 size = {0}; - - if ((text != NULL) && (text[0] != '\0')) - size = MeasureTextEx(guiFont, text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); - - // TODO: Consider text icon width here??? - - return (int)size.x; -} - -// Get text bounds considering control bounds -static Rectangle GetTextBounds(int control, Rectangle bounds) -{ - Rectangle textBounds = bounds; - - textBounds.x = bounds.x + GuiGetStyle(control, BORDER_WIDTH); - textBounds.y = bounds.y + GuiGetStyle(control, BORDER_WIDTH); - textBounds.width = bounds.width - 2 * GuiGetStyle(control, BORDER_WIDTH); - textBounds.height = bounds.height - 2 * GuiGetStyle(control, BORDER_WIDTH); - - // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT - switch (control) - { - case COMBOBOX: - bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_PADDING)); - break; - case VALUEBOX: - break; // NOTE: ValueBox text value always centered, text padding applies to label - default: - { - if (GuiGetStyle(control, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) - textBounds.x -= GuiGetStyle(control, TEXT_PADDING); - else - textBounds.x += GuiGetStyle(control, TEXT_PADDING); - } - break; - } - - // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?) - // More special cases (label side): CHECKBOX, SLIDER, VALUEBOX, SPINNER - - return textBounds; -} - -// Get text icon if provided and move text cursor -// NOTE: We support up to 999 values for iconId -static const char *GetTextIcon(const char *text, int *iconId) -{ -#if defined(RAYGUI_SUPPORT_ICONS) - *iconId = -1; - if (text[0] == '#') // Maybe we have an icon! - { - char iconValue[4] = {0}; // Maximum length for icon value: 3 digits + '\0' - - int pos = 1; - while ((pos < 4) && (text[pos] >= '0') && (text[pos] <= '9')) - { - iconValue[pos - 1] = text[pos]; - pos++; - } - - if (text[pos] == '#') - { - *iconId = TextToInteger(iconValue); - - // Move text pointer after icon - // WARNING: If only icon provided, it could point to EOL character! - if (*iconId >= 0) - text += (pos + 1); - } - } -#endif - - return text; -} - -// Gui draw text using default font -static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint) -{ -#define TEXT_VALIGN_PIXEL_OFFSET(h) ((int)h % 2) // Vertical alignment for pixel perfect - - if ((text != NULL) && (text[0] != '\0')) - { - int iconId = 0; - text = GetTextIcon(text, &iconId); // Check text for icon and move cursor - -// Get text position depending on alignment and iconId -//--------------------------------------------------------------------------------- -#define ICON_TEXT_PADDING 4 - - Vector2 position = {bounds.x, bounds.y}; - - // NOTE: We get text size after icon been processed - int textWidth = GetTextWidth(text); - int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); - -#if defined(RAYGUI_SUPPORT_ICONS) - if (iconId >= 0) - { - textWidth += RICON_SIZE; - - // WARNING: If only icon provided, text could be pointing to eof character! - if ((text != NULL) && (text[0] != '\0')) - textWidth += ICON_TEXT_PADDING; - } -#endif - // Check guiTextAlign global variables - switch (alignment) - { - case GUI_TEXT_ALIGN_LEFT: - { - position.x = bounds.x; - position.y = bounds.y + bounds.height / 2 - textHeight / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - case GUI_TEXT_ALIGN_CENTER: - { - position.x = bounds.x + bounds.width / 2 - textWidth / 2; - position.y = bounds.y + bounds.height / 2 - textHeight / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - case GUI_TEXT_ALIGN_RIGHT: - { - position.x = bounds.x + bounds.width - textWidth; - position.y = bounds.y + bounds.height / 2 - textHeight / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - default: - break; - } - - // NOTE: Make sure we get pixel-perfect coordinates, - // In case of decimals we got weird text positioning - position.x = (float)((int)position.x); - position.y = (float)((int)position.y); - //--------------------------------------------------------------------------------- - - // Draw text (with icon if available) - //--------------------------------------------------------------------------------- -#if defined(RAYGUI_SUPPORT_ICONS) - if (iconId >= 0) - { - // NOTE: We consider icon height, probably different than text size - GuiDrawIcon(iconId, RAYGUI_CLITERAL(Vector2){position.x, bounds.y + bounds.height / 2 - RICON_SIZE / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height)}, 1, tint); - position.x += (RICON_SIZE + ICON_TEXT_PADDING); - } -#endif - DrawTextEx(guiFont, text, position, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING), tint); - //--------------------------------------------------------------------------------- - } -} - -// Gui draw rectangle using default raygui plain style with borders -static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color) -{ - if (color.a > 0) - { - // Draw rectangle filled with color - DrawRectangle(rec.x, rec.y, rec.width, rec.height, color); - } - - if (borderWidth > 0) - { - // Draw rectangle border lines with color - DrawRectangle(rec.x, rec.y, rec.width, borderWidth, borderColor); - DrawRectangle(rec.x, rec.y + borderWidth, borderWidth, rec.height - 2 * borderWidth, borderColor); - DrawRectangle(rec.x + rec.width - borderWidth, rec.y + borderWidth, borderWidth, rec.height - 2 * borderWidth, borderColor); - DrawRectangle(rec.x, rec.y + rec.height - borderWidth, rec.width, borderWidth, borderColor); - } - - // TODO: For n-patch-based style we would need: [state] and maybe [control] - // In this case all controls drawing logic should be moved to this function... I don't like it... -} - -// Draw tooltip relatively to bounds -static void GuiDrawTooltip(Rectangle bounds) -{ - //static int tooltipFramesCounter = 0; // Not possible gets reseted at second function call! - - if (guiTooltipEnabled && (guiTooltip != NULL) && CheckCollisionPointRec(GetMousePosition(), bounds)) - { - Vector2 mousePosition = GetMousePosition(); - Vector2 textSize = MeasureTextEx(guiFont, guiTooltip, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); - Rectangle tooltipBounds = {mousePosition.x, mousePosition.y, textSize.x + 20, textSize.y * 2}; - - GuiDrawRectangle(tooltipBounds, 1, Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha)); - - tooltipBounds.x += 10; - GuiLabel(tooltipBounds, guiTooltip); - } -} - -// Split controls text into multiple strings -// Also check for multiple columns (required by GuiToggleGroup()) -static const char **GuiTextSplit(const char *text, int *count, int *textRow) -{ - // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) - // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, - // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_TEXT_ELEMENTS - // 2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_LENGTH - // NOTE: Those definitions could be externally provided if required - -#if !defined(TEXTSPLIT_MAX_TEXT_LENGTH) -#define TEXTSPLIT_MAX_TEXT_LENGTH 1024 -#endif - -#if !defined(TEXTSPLIT_MAX_TEXT_ELEMENTS) -#define TEXTSPLIT_MAX_TEXT_ELEMENTS 128 -#endif - - static const char *result[TEXTSPLIT_MAX_TEXT_ELEMENTS] = {NULL}; - static char buffer[TEXTSPLIT_MAX_TEXT_LENGTH] = {0}; - memset(buffer, 0, TEXTSPLIT_MAX_TEXT_LENGTH); - - result[0] = buffer; - int counter = 1; - - if (textRow != NULL) - textRow[0] = 0; - - // Count how many substrings we have on text and point to every one - for (int i = 0; i < TEXTSPLIT_MAX_TEXT_LENGTH; i++) - { - buffer[i] = text[i]; - if (buffer[i] == '\0') - break; - else if ((buffer[i] == ';') || (buffer[i] == '\n')) - { - result[counter] = buffer + i + 1; - - if (textRow != NULL) - { - if (buffer[i] == '\n') - textRow[counter] = textRow[counter - 1] + 1; - else - textRow[counter] = textRow[counter - 1]; - } - - buffer[i] = '\0'; // Set an end of string at this point - - counter++; - if (counter == TEXTSPLIT_MAX_TEXT_ELEMENTS) - break; - } - } - - *count = counter; - - return result; -} - -// Convert color data from RGB to HSV -// NOTE: Color data should be passed normalized -static Vector3 ConvertRGBtoHSV(Vector3 rgb) -{ - Vector3 hsv = {0}; - float min = 0.0f; - float max = 0.0f; - float delta = 0.0f; - - min = (rgb.x < rgb.y) ? rgb.x : rgb.y; - min = (min < rgb.z) ? min : rgb.z; - - max = (rgb.x > rgb.y) ? rgb.x : rgb.y; - max = (max > rgb.z) ? max : rgb.z; - - hsv.z = max; // Value - delta = max - min; - - if (delta < 0.00001f) - { - hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? - return hsv; - } - - if (max > 0.0f) - { - // NOTE: If max is 0, this divide would cause a crash - hsv.y = (delta / max); // Saturation - } - else - { - // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined - hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? - return hsv; - } - - // NOTE: Comparing float values could not work properly - if (rgb.x >= max) - hsv.x = (rgb.y - rgb.z) / delta; // Between yellow & magenta - else - { - if (rgb.y >= max) - hsv.x = 2.0f + (rgb.z - rgb.x) / delta; // Between cyan & yellow - else - hsv.x = 4.0f + (rgb.x - rgb.y) / delta; // Between magenta & cyan - } - - hsv.x *= 60.0f; // Convert to degrees - - if (hsv.x < 0.0f) - hsv.x += 360.0f; - - return hsv; -} - -// Convert color data from HSV to RGB -// NOTE: Color data should be passed normalized -static Vector3 ConvertHSVtoRGB(Vector3 hsv) -{ - Vector3 rgb = {0}; - float hh = 0.0f, p = 0.0f, q = 0.0f, t = 0.0f, ff = 0.0f; - long i = 0; - - // NOTE: Comparing float values could not work properly - if (hsv.y <= 0.0f) - { - rgb.x = hsv.z; - rgb.y = hsv.z; - rgb.z = hsv.z; - return rgb; - } - - hh = hsv.x; - if (hh >= 360.0f) - hh = 0.0f; - hh /= 60.0f; - - i = (long)hh; - ff = hh - i; - p = hsv.z * (1.0f - hsv.y); - q = hsv.z * (1.0f - (hsv.y * ff)); - t = hsv.z * (1.0f - (hsv.y * (1.0f - ff))); - - switch (i) - { - case 0: - { - rgb.x = hsv.z; - rgb.y = t; - rgb.z = p; - } - break; - case 1: - { - rgb.x = q; - rgb.y = hsv.z; - rgb.z = p; - } - break; - case 2: - { - rgb.x = p; - rgb.y = hsv.z; - rgb.z = t; - } - break; - case 3: - { - rgb.x = p; - rgb.y = q; - rgb.z = hsv.z; - } - break; - case 4: - { - rgb.x = t; - rgb.y = p; - rgb.z = hsv.z; - } - break; - case 5: - default: - { - rgb.x = hsv.z; - rgb.y = p; - rgb.z = q; - } - break; - } - - return rgb; -} - -#if defined(RAYGUI_STANDALONE) -// Returns a Color struct from hexadecimal value -static Color GetColor(int hexValue) -{ - Color color; - - color.r = (unsigned char)(hexValue >> 24) & 0xFF; - color.g = (unsigned char)(hexValue >> 16) & 0xFF; - color.b = (unsigned char)(hexValue >> 8) & 0xFF; - color.a = (unsigned char)hexValue & 0xFF; - - return color; -} - -// Returns hexadecimal value for a Color -static int ColorToInt(Color color) -{ - return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); -} - -// Check if point is inside rectangle -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) -{ - bool collision = false; - - if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && - (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) - collision = true; - - return collision; -} - -// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f -static Color Fade(Color color, float alpha) -{ - if (alpha < 0.0f) - alpha = 0.0f; - else if (alpha > 1.0f) - alpha = 1.0f; - - Color result = {color.r, color.g, color.b, (unsigned char)(255.0f * alpha)}; - - return result; -} - -// Formatting of text with variables to 'embed' -static const char *TextFormat(const char *text, ...) -{ -#define MAX_FORMATTEXT_LENGTH 64 - - static char buffer[MAX_FORMATTEXT_LENGTH]; - - va_list args; - va_start(args, text); - vsprintf(buffer, text, args); - va_end(args); - - return buffer; -} - -// Draw rectangle with vertical gradient fill color -// NOTE: This function is only used by GuiColorPicker() -static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2) -{ - Rectangle bounds = {(float)posX, (float)posY, (float)width, (float)height}; - DrawRectangleGradientEx(bounds, color1, color2, color2, color1); -} - -#define TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH 1024 // Size of static buffer: TextSplit() -#define TEXTSPLIT_MAX_SUBSTRINGS_COUNT 128 // Size of static pointers array: TextSplit() - -// Split string into multiple strings -const char **TextSplit(const char *text, char delimiter, int *count) -{ - // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) - // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, - // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_SUBSTRINGS_COUNT - // 2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH - - static const char *result[TEXTSPLIT_MAX_SUBSTRINGS_COUNT] = {NULL}; - static char buffer[TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH] = {0}; - memset(buffer, 0, TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH); - - result[0] = buffer; - int counter = 0; - - if (text != NULL) - { - counter = 1; - - // Count how many substrings we have on text and point to every one - for (int i = 0; i < TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH; i++) - { - buffer[i] = text[i]; - if (buffer[i] == '\0') - break; - else if (buffer[i] == delimiter) - { - buffer[i] = '\0'; // Set an end of string at this point - result[counter] = buffer + i + 1; - counter++; - - if (counter == TEXTSPLIT_MAX_SUBSTRINGS_COUNT) - break; - } - } - } - - *count = counter; - return result; -} - -// Get integer value from text -// NOTE: This function replaces atoi() [stdlib.h] -static int TextToInteger(const char *text) -{ - int value = 0; - int sign = 1; - - if ((text[0] == '+') || (text[0] == '-')) - { - if (text[0] == '-') - sign = -1; - text++; - } - - for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) - value = value * 10 + (int)(text[i] - '0'); - - return value * sign; -} - -// Encode codepoint into utf8 text (char array length returned as parameter) -static const char *CodepointToUtf8(int codepoint, int *byteLength) -{ - static char utf8[6] = {0}; - int length = 0; - - if (codepoint <= 0x7f) - { - utf8[0] = (char)codepoint; - length = 1; - } - else if (codepoint <= 0x7ff) - { - utf8[0] = (char)(((codepoint >> 6) & 0x1f) | 0xc0); - utf8[1] = (char)((codepoint & 0x3f) | 0x80); - length = 2; - } - else if (codepoint <= 0xffff) - { - utf8[0] = (char)(((codepoint >> 12) & 0x0f) | 0xe0); - utf8[1] = (char)(((codepoint >> 6) & 0x3f) | 0x80); - utf8[2] = (char)((codepoint & 0x3f) | 0x80); - length = 3; - } - else if (codepoint <= 0x10ffff) - { - utf8[0] = (char)(((codepoint >> 18) & 0x07) | 0xf0); - utf8[1] = (char)(((codepoint >> 12) & 0x3f) | 0x80); - utf8[2] = (char)(((codepoint >> 6) & 0x3f) | 0x80); - utf8[3] = (char)((codepoint & 0x3f) | 0x80); - length = 4; - } - - *byteLength = length; - - return utf8; -} -#endif // RAYGUI_STANDALONE - -#endif // RAYGUI_IMPLEMENTATION diff --git a/raylib-sys/raylib b/raylib-sys/raylib index b6c8d343..08519603 160000 --- a/raylib-sys/raylib +++ b/raylib-sys/raylib @@ -1 +1 @@ -Subproject commit b6c8d343dca2ef19c23c50975328a028124cf3cb +Subproject commit 0851960397f02a477d80eda2239f90fae14dec64 diff --git a/raylib-sys/raylib.h b/raylib-sys/raylib.h deleted file mode 100644 index a9fbe6b4..00000000 --- a/raylib-sys/raylib.h +++ /dev/null @@ -1,1519 +0,0 @@ -/********************************************************************************************** -* -* raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) -* -* FEATURES: -* - NO external dependencies, all required libraries included with raylib -* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, -* MacOS, Haiku, UWP, Android, Raspberry Pi, HTML5. -* - Written in plain C code (C99) in PascalCase/camelCase notation -* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile) -* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] -* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) -* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) -* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! -* - Flexible Materials system, supporting classic maps and PBR maps -* - Animated 3D models supported (skeletal bones animation) (IQM, glTF) -* - Shaders support, including Model shaders and Postprocessing shaders -* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] -* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) -* - VR stereo rendering with configurable HMD device parameters -* - Bindings to multiple programming languages available! -* -* NOTES: -* One default Font is loaded on InitWindow()->LoadFontDefault() [core, text] -* One default Texture2D is loaded on rlglInit() [rlgl] (OpenGL 3.3 or ES2) -* One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2) -* One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2) -* -* DEPENDENCIES (included): -* [core] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP) -* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP) -* [raudio] miniaudio (David Reid - github.com/dr-soft/miniaudio) for audio device/context management -* -* OPTIONAL DEPENDENCIES (included): -* [core] msf_gif (Miles Fogle) for GIF recording -* [core] sinfl (Micha Mettke) for DEFLATE decompression algorythm -* [core] sdefl (Micha Mettke) for DEFLATE compression algorythm -* [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) -* [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG) -* [textures] stb_image_resize (Sean Barret) for image resizing algorithms -* [textures] stb_perlin (Sean Barret) for Perlin noise image generation -* [text] stb_truetype (Sean Barret) for ttf fonts loading -* [text] stb_rect_pack (Sean Barret) for rectangles packing -* [models] par_shapes (Philip Rideout) for parametric 3d shapes generation -* [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) -* [models] cgltf (Johannes Kuhlmann) for models loading (glTF) -* [raudio] dr_wav (David Reid) for WAV audio file loading -* [raudio] dr_flac (David Reid) for FLAC audio file loading -* [raudio] dr_mp3 (David Reid) for MP3 audio file loading -* [raudio] stb_vorbis (Sean Barret) for OGG audio loading -* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading -* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading -* -* -* LICENSE: zlib/libpng -* -* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2013-2021 Ramon Santamaria (@raysan5) -* -* 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. -* -**********************************************************************************************/ - -#ifndef RAYLIB_H -#define RAYLIB_H - -#include // Required for: va_list - Only used by TraceLogCallback - -#if defined(_WIN32) - // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll - #if defined(BUILD_LIBTYPE_SHARED) - #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll) - #elif defined(USE_LIBTYPE_SHARED) - #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) - #else - #define RLAPI // We are building or using raylib as a static library - #endif -#else - #define RLAPI // We are building or using raylib as a static library (or Linux shared library) -#endif - -//---------------------------------------------------------------------------------- -// Some basic Defines -//---------------------------------------------------------------------------------- -#ifndef PI - #define PI 3.14159265358979323846f -#endif - -#define DEG2RAD (PI/180.0f) -#define RAD2DEG (180.0f/PI) - -// Allow custom memory allocators -#ifndef RL_MALLOC - #define RL_MALLOC(sz) malloc(sz) -#endif -#ifndef RL_CALLOC - #define RL_CALLOC(n,sz) calloc(n,sz) -#endif -#ifndef RL_REALLOC - #define RL_REALLOC(ptr,sz) realloc(ptr,sz) -#endif -#ifndef RL_FREE - #define RL_FREE(ptr) free(ptr) -#endif - -// NOTE: MSVC C++ compiler does not support compound literals (C99 feature) -// Plain structures in C++ (without constructors) can be initialized from { } initializers. -#if defined(__cplusplus) - #define CLITERAL(type) type -#else - #define CLITERAL(type) (type) -#endif - -// Some Basic Colors -// NOTE: Custom raylib color palette for amazing visuals on WHITE background -#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray -#define GRAY CLITERAL(Color){ 130, 130, 130, 255 } // Gray -#define DARKGRAY CLITERAL(Color){ 80, 80, 80, 255 } // Dark Gray -#define YELLOW CLITERAL(Color){ 253, 249, 0, 255 } // Yellow -#define GOLD CLITERAL(Color){ 255, 203, 0, 255 } // Gold -#define ORANGE CLITERAL(Color){ 255, 161, 0, 255 } // Orange -#define PINK CLITERAL(Color){ 255, 109, 194, 255 } // Pink -#define RED CLITERAL(Color){ 230, 41, 55, 255 } // Red -#define MAROON CLITERAL(Color){ 190, 33, 55, 255 } // Maroon -#define GREEN CLITERAL(Color){ 0, 228, 48, 255 } // Green -#define LIME CLITERAL(Color){ 0, 158, 47, 255 } // Lime -#define DARKGREEN CLITERAL(Color){ 0, 117, 44, 255 } // Dark Green -#define SKYBLUE CLITERAL(Color){ 102, 191, 255, 255 } // Sky Blue -#define BLUE CLITERAL(Color){ 0, 121, 241, 255 } // Blue -#define DARKBLUE CLITERAL(Color){ 0, 82, 172, 255 } // Dark Blue -#define PURPLE CLITERAL(Color){ 200, 122, 255, 255 } // Purple -#define VIOLET CLITERAL(Color){ 135, 60, 190, 255 } // Violet -#define DARKPURPLE CLITERAL(Color){ 112, 31, 126, 255 } // Dark Purple -#define BEIGE CLITERAL(Color){ 211, 176, 131, 255 } // Beige -#define BROWN CLITERAL(Color){ 127, 106, 79, 255 } // Brown -#define DARKBROWN CLITERAL(Color){ 76, 63, 47, 255 } // Dark Brown - -#define WHITE CLITERAL(Color){ 255, 255, 255, 255 } // White -#define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black -#define BLANK CLITERAL(Color){ 0, 0, 0, 0 } // Blank (Transparent) -#define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta -#define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) - -// Temporal hacks to avoid breaking old codebases using -// deprecated raylib implementation or definitions -#define FormatText TextFormat -#define LoadText LoadFileText -#define GetExtension GetFileExtension -#define GetImageData LoadImageColors -#define FILTER_POINT TEXTURE_FILTER_POINT -#define FILTER_BILINEAR TEXTURE_FILTER_BILINEAR -#define MAP_DIFFUSE MATERIAL_MAP_DIFFUSE -#define PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 PIXELFORMAT_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 - -//---------------------------------------------------------------------------------- -// Structures Definition -//---------------------------------------------------------------------------------- -// Boolean type -#if defined(__STDC__) && __STDC_VERSION__ >= 199901L - #include -#elif !defined(__cplusplus) && !defined(bool) - typedef enum { false, true } bool; -#endif - -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; - -// Vector3 type -typedef struct Vector3 { - float x; - float y; - float z; -} Vector3; - -// Vector4 type -typedef struct Vector4 { - float x; - float y; - float z; - float w; -} Vector4; - -// Quaternion type, same as Vector4 -typedef Vector4 Quaternion; - -// Matrix type (OpenGL style 4x4 - right handed, column major) -typedef struct Matrix { - float m0, m4, m8, m12; - float m1, m5, m9, m13; - float m2, m6, m10, m14; - float m3, m7, m11, m15; -} Matrix; - -// Color type, RGBA (32bit) -typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; - -// Rectangle type -typedef struct Rectangle { - float x; - float y; - float width; - float height; -} Rectangle; - -// Image type, bpp always RGBA (32bit) -// NOTE: Data stored in CPU memory (RAM) -typedef struct Image { - void *data; // Image raw data - int width; // Image base width - int height; // Image base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Image; - -// Texture type -// NOTE: Data stored in GPU memory -typedef struct Texture { - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Texture; - -// Texture2D type, same as Texture -typedef Texture Texture2D; - -// TextureCubemap type, actually, same as Texture -typedef Texture TextureCubemap; - -// RenderTexture type, for texture rendering -typedef struct RenderTexture { - unsigned int id; // OpenGL framebuffer object id - Texture texture; // Color buffer attachment texture - Texture depth; // Depth buffer attachment texture -} RenderTexture; - -// RenderTexture2D type, same as RenderTexture -typedef RenderTexture RenderTexture2D; - -// N-Patch layout info -typedef struct NPatchInfo { - Rectangle source; // Texture source rectangle - int left; // Left border offset - int top; // Top border offset - int right; // Right border offset - int bottom; // Bottom border offset - int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1 -} NPatchInfo; - -// Font character info -typedef struct CharInfo { - int value; // Character value (Unicode) - int offsetX; // Character offset X when drawing - int offsetY; // Character offset Y when drawing - int advanceX; // Character advance position X - Image image; // Character image data -} CharInfo; - -// Font type, includes texture and charSet array data -typedef struct Font { - int baseSize; // Base size (default chars height) - int charsCount; // Number of characters - int charsPadding; // Padding around the chars - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - CharInfo *chars; // Characters info data -} Font; - -#define SpriteFont Font // SpriteFont type fallback, defaults to Font - -// Camera type, defines a camera position/orientation in 3d space -typedef struct Camera3D { - Vector3 position; // Camera position - Vector3 target; // Camera target it looks-at - Vector3 up; // Camera up vector (rotation over its axis) - float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC -} Camera3D; - -typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D - -// Camera2D type, defines a 2d camera -typedef struct Camera2D { - Vector2 offset; // Camera offset (displacement from target) - Vector2 target; // Camera target (rotation and zoom origin) - float rotation; // Camera rotation in degrees - float zoom; // Camera zoom (scaling), should be 1.0f by default -} Camera2D; - -// Vertex data definning a mesh -// NOTE: Data stored in CPU memory (and GPU) -typedef struct Mesh { - int vertexCount; // Number of vertices stored in arrays - int triangleCount; // Number of triangles stored (indexed or not) - - // Default vertex data - float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices;// Vertex indices (in case vertex data comes indexed) - - // Animation vertex data - float *animVertices; // Animated vertex positions (after bones transformations) - float *animNormals; // Animated normals (after bones transformations) - int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) - float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) - - // OpenGL identifiers - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) -} Mesh; - -// Shader type (generic) -typedef struct Shader { - unsigned int id; // Shader program id - int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) -} Shader; - -// Material texture map -typedef struct MaterialMap { - Texture2D texture; // Material map texture - Color color; // Material map color - float value; // Material map value -} MaterialMap; - -// Material type (generic) -typedef struct Material { - Shader shader; // Material shader - MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) - float params[4]; // Material generic parameters (if required) -} Material; - -// Transformation properties -typedef struct Transform { - Vector3 translation; // Translation - Quaternion rotation; // Rotation - Vector3 scale; // Scale -} Transform; - -// Bone information -typedef struct BoneInfo { - char name[32]; // Bone name - int parent; // Bone parent -} BoneInfo; - -// Model type -typedef struct Model { - Matrix transform; // Local transform matrix - - int meshCount; // Number of meshes - int materialCount; // Number of materials - Mesh *meshes; // Meshes array - Material *materials; // Materials array - int *meshMaterial; // Mesh material number - - // Animation data - int boneCount; // Number of bones - BoneInfo *bones; // Bones information (skeleton) - Transform *bindPose; // Bones base transformation (pose) -} Model; - -// Model animation -typedef struct ModelAnimation { - int boneCount; // Number of bones - int frameCount; // Number of animation frames - BoneInfo *bones; // Bones information (skeleton) - Transform **framePoses; // Poses array by frame -} ModelAnimation; - -// Ray type (useful for raycast) -typedef struct Ray { - Vector3 position; // Ray position (origin) - Vector3 direction; // Ray direction -} Ray; - -// Raycast hit information -typedef struct RayHitInfo { - bool hit; // Did the ray hit something? - float distance; // Distance to nearest hit - Vector3 position; // Position of nearest hit - Vector3 normal; // Surface normal of hit -} RayHitInfo; - -// Bounding box type -typedef struct BoundingBox { - Vector3 min; // Minimum vertex box-corner - Vector3 max; // Maximum vertex box-corner -} BoundingBox; - -// Wave type, defines audio wave data -typedef struct Wave { - unsigned int sampleCount; // Total number of samples - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) - void *data; // Buffer data pointer -} Wave; - -typedef struct rAudioBuffer rAudioBuffer; - -// Audio stream type -// NOTE: Useful to create custom audio streams not bound to a specific file -typedef struct AudioStream { - rAudioBuffer *buffer; // Pointer to internal data used by the audio system - - unsigned int sampleRate; // Frequency (samples per second) - unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels (1-mono, 2-stereo) -} AudioStream; - -// Sound source type -typedef struct Sound { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples -} Sound; - -// Music stream type (audio file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed -typedef struct Music { - AudioStream stream; // Audio stream - unsigned int sampleCount; // Total number of samples - bool looping; // Music looping enable - - int ctxType; // Type of music context (audio filetype) - void *ctxData; // Audio context data, depends on type -} Music; - -// Head-Mounted-Display device parameters -typedef struct VrDeviceInfo { - int hResolution; // Horizontal resolution in pixels - int vResolution; // Vertical resolution in pixels - float hScreenSize; // Horizontal size in meters - float vScreenSize; // Vertical size in meters - float vScreenCenter; // Screen center in meters - float eyeToScreenDistance; // Distance between eye and display in meters - float lensSeparationDistance; // Lens separation distance in meters - float interpupillaryDistance; // IPD (distance between pupils) in meters - float lensDistortionValues[4]; // Lens distortion constant parameters - float chromaAbCorrection[4]; // Chromatic aberration correction parameters -} VrDeviceInfo; - -// VR Stereo rendering configuration for simulator -typedef struct VrStereoConfig { - Matrix projection[2]; // VR projection matrices (per eye) - Matrix viewOffset[2]; // VR view offset matrices (per eye) - float leftLensCenter[2]; // VR left lens center - float rightLensCenter[2]; // VR right lens center - float leftScreenCenter[2]; // VR left screen center - float rightScreenCenter[2]; // VR right screen center - float scale[2]; // VR distortion scale - float scaleIn[2]; // VR distortion scale in -} VrStereoConfig; - -//---------------------------------------------------------------------------------- -// Enumerators Definition -//---------------------------------------------------------------------------------- -// System/Window config flags -// NOTE: Every bit registers one state (use it with bit masks) -// By default all flags are set to 0 -typedef enum { - FLAG_VSYNC_HINT = 0x00000040, // Set to try enabling V-Sync on GPU - FLAG_FULLSCREEN_MODE = 0x00000002, // Set to run program in fullscreen - FLAG_WINDOW_RESIZABLE = 0x00000004, // Set to allow resizable window - FLAG_WINDOW_UNDECORATED = 0x00000008, // Set to disable window decoration (frame and buttons) - FLAG_WINDOW_HIDDEN = 0x00000080, // Set to hide window - FLAG_WINDOW_MINIMIZED = 0x00000200, // Set to minimize window (iconify) - FLAG_WINDOW_MAXIMIZED = 0x00000400, // Set to maximize window (expanded to monitor) - FLAG_WINDOW_UNFOCUSED = 0x00000800, // Set to window non focused - FLAG_WINDOW_TOPMOST = 0x00001000, // Set to window always on top - FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized - FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer - FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI - FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X - FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) -} ConfigFlags; - -// Trace log level -typedef enum { - LOG_ALL = 0, // Display all logs - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, - LOG_NONE // Disable logging -} TraceLogLevel; - -// Keyboard keys (US keyboard layout) -// NOTE: Use GetKeyPressed() to allow redefining -// required keys for alternative layouts -typedef enum { - KEY_NULL = 0, - // Alphanumeric keys - KEY_APOSTROPHE = 39, - KEY_COMMA = 44, - KEY_MINUS = 45, - KEY_PERIOD = 46, - KEY_SLASH = 47, - KEY_ZERO = 48, - KEY_ONE = 49, - KEY_TWO = 50, - KEY_THREE = 51, - KEY_FOUR = 52, - KEY_FIVE = 53, - KEY_SIX = 54, - KEY_SEVEN = 55, - KEY_EIGHT = 56, - KEY_NINE = 57, - KEY_SEMICOLON = 59, - KEY_EQUAL = 61, - KEY_A = 65, - KEY_B = 66, - KEY_C = 67, - KEY_D = 68, - KEY_E = 69, - KEY_F = 70, - KEY_G = 71, - KEY_H = 72, - KEY_I = 73, - KEY_J = 74, - KEY_K = 75, - KEY_L = 76, - KEY_M = 77, - KEY_N = 78, - KEY_O = 79, - KEY_P = 80, - KEY_Q = 81, - KEY_R = 82, - KEY_S = 83, - KEY_T = 84, - KEY_U = 85, - KEY_V = 86, - KEY_W = 87, - KEY_X = 88, - KEY_Y = 89, - KEY_Z = 90, - - // Function keys - KEY_SPACE = 32, - KEY_ESCAPE = 256, - KEY_ENTER = 257, - KEY_TAB = 258, - KEY_BACKSPACE = 259, - KEY_INSERT = 260, - KEY_DELETE = 261, - KEY_RIGHT = 262, - KEY_LEFT = 263, - KEY_DOWN = 264, - KEY_UP = 265, - KEY_PAGE_UP = 266, - KEY_PAGE_DOWN = 267, - KEY_HOME = 268, - KEY_END = 269, - KEY_CAPS_LOCK = 280, - KEY_SCROLL_LOCK = 281, - KEY_NUM_LOCK = 282, - KEY_PRINT_SCREEN = 283, - KEY_PAUSE = 284, - KEY_F1 = 290, - KEY_F2 = 291, - KEY_F3 = 292, - KEY_F4 = 293, - KEY_F5 = 294, - KEY_F6 = 295, - KEY_F7 = 296, - KEY_F8 = 297, - KEY_F9 = 298, - KEY_F10 = 299, - KEY_F11 = 300, - KEY_F12 = 301, - KEY_LEFT_SHIFT = 340, - KEY_LEFT_CONTROL = 341, - KEY_LEFT_ALT = 342, - KEY_LEFT_SUPER = 343, - KEY_RIGHT_SHIFT = 344, - KEY_RIGHT_CONTROL = 345, - KEY_RIGHT_ALT = 346, - KEY_RIGHT_SUPER = 347, - KEY_KB_MENU = 348, - KEY_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - - // Keypad keys - KEY_KP_0 = 320, - KEY_KP_1 = 321, - KEY_KP_2 = 322, - KEY_KP_3 = 323, - KEY_KP_4 = 324, - KEY_KP_5 = 325, - KEY_KP_6 = 326, - KEY_KP_7 = 327, - KEY_KP_8 = 328, - KEY_KP_9 = 329, - KEY_KP_DECIMAL = 330, - KEY_KP_DIVIDE = 331, - KEY_KP_MULTIPLY = 332, - KEY_KP_SUBTRACT = 333, - KEY_KP_ADD = 334, - KEY_KP_ENTER = 335, - KEY_KP_EQUAL = 336, - // Android key buttons - KEY_BACK = 4, - KEY_MENU = 82, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25 -} KeyboardKey; - -// Mouse buttons -typedef enum { - MOUSE_LEFT_BUTTON = 0, - MOUSE_RIGHT_BUTTON = 1, - MOUSE_MIDDLE_BUTTON = 2 -} MouseButton; - -// Mouse cursor -typedef enum { - MOUSE_CURSOR_DEFAULT = 0, - MOUSE_CURSOR_ARROW = 1, - MOUSE_CURSOR_IBEAM = 2, - MOUSE_CURSOR_CROSSHAIR = 3, - MOUSE_CURSOR_POINTING_HAND = 4, - MOUSE_CURSOR_RESIZE_EW = 5, // The horizontal resize/move arrow shape - MOUSE_CURSOR_RESIZE_NS = 6, // The vertical resize/move arrow shape - MOUSE_CURSOR_RESIZE_NWSE = 7, // The top-left to bottom-right diagonal resize/move arrow shape - MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape - MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape - MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape -} MouseCursor; - -// Gamepad buttons -typedef enum { - // This is here just for error checking - GAMEPAD_BUTTON_UNKNOWN = 0, - - // This is normally a DPAD - GAMEPAD_BUTTON_LEFT_FACE_UP, - GAMEPAD_BUTTON_LEFT_FACE_RIGHT, - GAMEPAD_BUTTON_LEFT_FACE_DOWN, - GAMEPAD_BUTTON_LEFT_FACE_LEFT, - - // This normally corresponds with PlayStation and Xbox controllers - // XBOX: [Y,X,A,B] - // PS3: [Triangle,Square,Cross,Circle] - // No support for 6 button controllers though.. - GAMEPAD_BUTTON_RIGHT_FACE_UP, - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, - GAMEPAD_BUTTON_RIGHT_FACE_DOWN, - GAMEPAD_BUTTON_RIGHT_FACE_LEFT, - - // Triggers - GAMEPAD_BUTTON_LEFT_TRIGGER_1, - GAMEPAD_BUTTON_LEFT_TRIGGER_2, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2, - - // These are buttons in the center of the gamepad - GAMEPAD_BUTTON_MIDDLE_LEFT, // PS3 Select - GAMEPAD_BUTTON_MIDDLE, // PS Button/XBOX Button - GAMEPAD_BUTTON_MIDDLE_RIGHT, // PS3 Start - - // These are the joystick press in buttons - GAMEPAD_BUTTON_LEFT_THUMB, - GAMEPAD_BUTTON_RIGHT_THUMB -} GamepadButton; - -// Gamepad axis -typedef enum { - // Left stick - GAMEPAD_AXIS_LEFT_X = 0, - GAMEPAD_AXIS_LEFT_Y = 1, - - // Right stick - GAMEPAD_AXIS_RIGHT_X = 2, - GAMEPAD_AXIS_RIGHT_Y = 3, - - // Pressure levels for the back triggers - GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level) - GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) -} GamepadAxis; - -// Material map index -typedef enum { - MATERIAL_MAP_ALBEDO = 0, // MATERIAL_MAP_DIFFUSE - MATERIAL_MAP_METALNESS = 1, // MATERIAL_MAP_SPECULAR - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION, - MATERIAL_MAP_EMISSION, - MATERIAL_MAP_HEIGHT, - MATERIAL_MAP_BRDG, - MATERIAL_MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MATERIAL_MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP - MATERIAL_MAP_PREFILTER // NOTE: Uses GL_TEXTURE_CUBE_MAP -} MaterialMapIndex; - -#define MATERIAL_MAP_DIFFUSE MATERIAL_MAP_ALBEDO -#define MATERIAL_MAP_SPECULAR MATERIAL_MAP_METALNESS - -// Shader location index -typedef enum { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01, - SHADER_LOC_VERTEX_TEXCOORD02, - SHADER_LOC_VERTEX_NORMAL, - SHADER_LOC_VERTEX_TANGENT, - SHADER_LOC_VERTEX_COLOR, - SHADER_LOC_MATRIX_MVP, - SHADER_LOC_MATRIX_VIEW, - SHADER_LOC_MATRIX_PROJECTION, - SHADER_LOC_MATRIX_MODEL, - SHADER_LOC_MATRIX_NORMAL, - SHADER_LOC_VECTOR_VIEW, - SHADER_LOC_COLOR_DIFFUSE, - SHADER_LOC_COLOR_SPECULAR, - SHADER_LOC_COLOR_AMBIENT, - SHADER_LOC_MAP_ALBEDO, // SHADER_LOC_MAP_DIFFUSE - SHADER_LOC_MAP_METALNESS, // SHADER_LOC_MAP_SPECULAR - SHADER_LOC_MAP_NORMAL, - SHADER_LOC_MAP_ROUGHNESS, - SHADER_LOC_MAP_OCCLUSION, - SHADER_LOC_MAP_EMISSION, - SHADER_LOC_MAP_HEIGHT, - SHADER_LOC_MAP_CUBEMAP, - SHADER_LOC_MAP_IRRADIANCE, - SHADER_LOC_MAP_PREFILTER, - SHADER_LOC_MAP_BRDF -} ShaderLocationIndex; - -#define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO -#define SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS - -// Shader uniform data type -typedef enum { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2, - SHADER_UNIFORM_VEC3, - SHADER_UNIFORM_VEC4, - SHADER_UNIFORM_INT, - SHADER_UNIFORM_IVEC2, - SHADER_UNIFORM_IVEC3, - SHADER_UNIFORM_IVEC4, - SHADER_UNIFORM_SAMPLER2D -} ShaderUniformDataType; - -// Pixel formats -// NOTE: Support depends on OpenGL version and platform -typedef enum { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) - PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp - PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp - PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) - PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) - PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) - PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp -} PixelFormat; - -// Texture parameters: filter mode -// NOTE 1: Filtering considers mipmaps if available in the texture -// NOTE 2: Filter is accordingly set for minification and magnification -typedef enum { - TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation - TEXTURE_FILTER_BILINEAR, // Linear filtering - TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) - TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x - TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x - TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x -} TextureFilter; - -// Texture parameters: wrap mode -typedef enum { - TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode - TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode - TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode - TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode -} TextureWrap; - -// Cubemap layouts -typedef enum { - CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type - CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces - CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces - CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirectangular map) -} CubemapLayout; - -// Font type, defines generation method -typedef enum { - FONT_DEFAULT = 0, // Default font generation, anti-aliased - FONT_BITMAP, // Bitmap font generation, no anti-aliasing - FONT_SDF // SDF font generation, requires external shader -} FontType; - -// Color blending modes (pre-defined) -typedef enum { - BLEND_ALPHA = 0, // Blend textures considering alpha (default) - BLEND_ADDITIVE, // Blend textures adding colors - BLEND_MULTIPLIED, // Blend textures multiplying colors - BLEND_ADD_COLORS, // Blend textures adding colors (alternative) - BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) - BLEND_CUSTOM // Belnd textures using custom src/dst factors (use rlSetBlendMode()) -} BlendMode; - -// Gestures -// NOTE: It could be used as flags to enable only some gestures -typedef enum { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512 -} Gestures; - -// Camera system modes -typedef enum { - CAMERA_CUSTOM = 0, - CAMERA_FREE, - CAMERA_ORBITAL, - CAMERA_FIRST_PERSON, - CAMERA_THIRD_PERSON -} CameraMode; - -// Camera projection -typedef enum { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC -} CameraProjection; - -// N-patch layout -typedef enum { - NPATCH_NINE_PATCH = 0, // Npatch layout: 3x3 tiles - NPATCH_THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles - NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles -} NPatchLayout; - -// Callbacks to hook some internal functions -// WARNING: This callbacks are intended for advance users -typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages -typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // FileIO: Load binary data -typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data -typedef char *(*LoadFileTextCallback)(const char* fileName); // FileIO: Load text data -typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data - - -#if defined(__cplusplus) -extern "C" { // Prevents name mangling of functions -#endif - -//------------------------------------------------------------------------------------ -// Global Variables Definition -//------------------------------------------------------------------------------------ -// It's lonely here... - -//------------------------------------------------------------------------------------ -// Window and Graphics Device Functions (Module: core) -//------------------------------------------------------------------------------------ - -// Window-related functions -RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context -RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed -RLAPI void CloseWindow(void); // Close window and unload OpenGL context -RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully -RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen -RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) -RLAPI bool IsWindowResized(void); // Check if window has been resized last frame -RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags -RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags -RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) -RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) -RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) -RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) -RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) -RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) -RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void *GetWindowHandle(void); // Get native window handle -RLAPI int GetScreenWidth(void); // Get current screen width -RLAPI int GetScreenHeight(void); // Get current screen height -RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get current connected monitor -RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position -RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (max available by monitor) -RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (max available by monitor) -RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres -RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres -RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate -RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor -RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor -RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor -RLAPI void SetClipboardText(const char *text); // Set clipboard text content -RLAPI const char *GetClipboardText(void); // Get clipboard text content - -// Cursor-related functions -RLAPI void ShowCursor(void); // Shows cursor -RLAPI void HideCursor(void); // Hides cursor -RLAPI bool IsCursorHidden(void); // Check if cursor is not visible -RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) -RLAPI void DisableCursor(void); // Disables cursor (lock cursor) -RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen. - -// Drawing-related functions -RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) -RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing -RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) -RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D) -RLAPI void EndMode2D(void); // Ends 2D mode with custom camera -RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D) -RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode -RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing -RLAPI void EndTextureMode(void); // Ends drawing to render texture -RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing -RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) -RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) -RLAPI void EndScissorMode(void); // End scissor mode -RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) -RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) - -// VR stereo config functions for VR simulator -RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters -RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config - -// Shader management functions -// NOTE: Shader functionality is not available on OpenGL 1.1 -RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations -RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location -RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value -RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector -RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) -RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) -RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) - -// Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position -RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) -RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Returns camera 2d transform matrix -RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position -RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Returns size position for a 3d world space position -RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Returns the screen space position for a 2d camera world space position -RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns the world space position for a 2d camera screen space position - -// Timing-related functions -RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) -RLAPI int GetFPS(void); // Returns current FPS -RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn (delta time) -RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() - -// Misc. functions -RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) -RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) -RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) - -RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) -RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level -RLAPI void *MemAlloc(int size); // Internal memory allocator -RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator -RLAPI void MemFree(void *ptr); // Internal memory free - -// Set custom callbacks -// WARNING: Callbacks setup is intended for advance users -RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log -RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader -RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver -RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader -RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver - -// Files management functions -RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) -RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() -RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success -RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string -RLAPI void UnloadFileText(unsigned char *text); // Unload file text data allocated by LoadFileText() -RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success -RLAPI bool FileExists(const char *fileName); // Check if file exists -RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists -RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension (including point: .png, .wav) -RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: ".png") -RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string -RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) -RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) -RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) -RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) -RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) -RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) -RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success -RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) -RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) - -RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) -RLAPI unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) - -// Persistent storage management -RLAPI bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success -RLAPI int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) - -RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) - -//------------------------------------------------------------------------------------ -// Input Handling Functions (Module: core) -//------------------------------------------------------------------------------------ - -// Input-related functions: keyboard -RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once -RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed -RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once -RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed -RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued -RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued - -// Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available -RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available) -RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed -RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis -RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) - -// Input-related functions: mouse -RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once -RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed -RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once -RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed -RLAPI int GetMouseX(void); // Returns mouse position X -RLAPI int GetMouseY(void); // Returns mouse position Y -RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY -RLAPI void SetMousePosition(int x, int y); // Set mouse position XY -RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset -RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y -RLAPI void SetMouseCursor(int cursor); // Set mouse cursor - -// Input-related functions: touch -RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) -RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) -RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) - -//------------------------------------------------------------------------------------ -// Gestures and Touch Handling Functions (Module: gestures) -//------------------------------------------------------------------------------------ -RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected -RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI int GetTouchPointsCount(void); // Get touch points count -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle - -//------------------------------------------------------------------------------------ -// Camera System Functions (Module: camera) -//------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode - -RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) -RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) -RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) -RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) - -//------------------------------------------------------------------------------------ -// Basic Shapes Drawing Functions (Module: shapes) -//------------------------------------------------------------------------------------ -// Set texture and rectangle to be used on shapes drawing -// NOTE: It can be useful when using basic shapes and one single font, -// defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); - -// Basic shapes drawing functions -RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel -RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) -RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line -RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) -RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness -RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out -RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); //Draw line using quadratic bezier curves with a control point -RLAPI void DrawLineStrip(Vector2 *points, int pointsCount, Color color); // Draw lines sequence -RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle -RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle -RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) -RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline -RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse -RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring -RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline -RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors -RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters -RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline -RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -RLAPI void DrawTriangleFan(Vector2 *points, int pointsCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -RLAPI void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color); // Draw a triangle strip defined by points -RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides - -// Basic shapes collision detection functions -RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle -RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision - -//------------------------------------------------------------------------------------ -// Texture Loading and Drawing Functions (Module: textures) -//------------------------------------------------------------------------------------ - -// Image loading functions -// NOTE: This functions do not require GPU access -RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) -RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. ".png" -RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) -RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success -RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success - -// Image generation functions -RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color -RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient -RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient -RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient -RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked -RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise -RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise -RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells - -// Image manipulation functions -RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece -RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) -RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format -RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) -RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value -RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color -RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image -RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel -RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) -RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color -RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image -RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -RLAPI void ImageFlipVertical(Image *image); // Flip image vertically -RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally -RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg -RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg -RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint -RLAPI void ImageColorInvert(Image *image); // Modify image color: invert -RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale -RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color -RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) -RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorsCount); // Load colors palette from image as a Color array (RGBA - 32bit) -RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() -RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() -RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle - -// Image drawing functions -// NOTE: Image software-rendering functions (CPU) -RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color -RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image -RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) -RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image -RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) -RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image -RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) -RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) -RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image -RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) -RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) -RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) - -// Texture loading functions -// NOTE: These functions require GPU access -RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) -RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data -RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported -RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) -RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data -RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image -RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot) - -// Texture configuration functions -RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode -RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode - -// Texture drawing functions -RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D -RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters -RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. -RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely -RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointsCount, Color tint); // Draw a textured polygon - -// Color/pixel related functions -RLAPI Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color -RLAPI Vector4 ColorNormalize(Color color); // Returns Color normalized as float [0..1] -RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns Color from normalized values [0..1] -RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color, hue [0..360], saturation/value [0..1] -RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Returns a Color from HSV values, hue [0..360], saturation/value [0..1] -RLAPI Color ColorAlpha(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Returns src alpha-blended into dst color with tint -RLAPI Color GetColor(int hexValue); // Get Color structure from hexadecimal value -RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format -RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer -RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format - -//------------------------------------------------------------------------------------ -// Font Loading and Text Drawing Functions (Module: text) -//------------------------------------------------------------------------------------ - -// Font loading/unloading functions -RLAPI Font GetFontDefault(void); // Get the default Font -RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters -RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount); // Load font from memory buffer, fileType refers to extension: i.e. ".ttf" -RLAPI CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use -RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -RLAPI void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM) -RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) - -// Text drawing functions -RLAPI void DrawFPS(int posX, int posY); // Draw current FPS -RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits -RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, - int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection -RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) - -// Text misc. functions -RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font -RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -RLAPI int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font - -// Text strings management functions (no utf8 strings, only byte chars) -// NOTE: Some strings allocate memory internally for returned strings, just be careful! -RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied -RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal -RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending -RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style) -RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!) -RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!) -RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! -RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string -RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string -RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) -RLAPI char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!) - -// UTF8 text strings management functions -RLAPI int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters -RLAPI int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string -RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure -RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter) - -//------------------------------------------------------------------------------------ -// Basic 3d Shapes Drawing Functions (Module: models) -//------------------------------------------------------------------------------------ - -// Basic geometric 3D shapes drawing functions -RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line -RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space -RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointsCount, Color color); // Draw a triangle strip defined by points -RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube -RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires -RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) -RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured -RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters -RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone -RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line -RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) - -//------------------------------------------------------------------------------------ -// Model 3d Loading and Drawing Functions (Module: models) -//------------------------------------------------------------------------------------ - -// Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) - -// Mesh loading/unloading functions -RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids -RLAPI void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index -RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform -RLAPI void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success - -// Material loading/unloading functions -RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) -RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh - -// Model animations loading/unloading functions -RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose -RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -RLAPI void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data -RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match - -// Mesh generation functions -RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data - -// Mesh manipulation functions -RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals - -// Model drawing functions -RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint); // Draw a billboard texture defined by source - -// Collision detection functions -RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Detect collision between two spheres -RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes -RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere -RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere -RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point -RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model -RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) - -//------------------------------------------------------------------------------------ -// Audio Loading and Playing Functions (Module: audio) -//------------------------------------------------------------------------------------ - -// Audio device management functions -RLAPI void InitAudioDevice(void); // Initialize audio device and context -RLAPI void CloseAudioDevice(void); // Close the audio device and context -RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -RLAPI void SetMasterVolume(float volume); // Set master volume (listener) - -// Wave/Sound loading/unloading functions -RLAPI Wave LoadWave(const char *fileName); // Load wave data from file -RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. ".wav" -RLAPI Sound LoadSound(const char *fileName); // Load sound from file -RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data -RLAPI void UnloadWave(Wave wave); // Unload wave data -RLAPI void UnloadSound(Sound sound); // Unload sound -RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success -RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success - -// Wave/Sound management functions -RLAPI void PlaySound(Sound sound); // Play a sound -RLAPI void StopSound(Sound sound); // Stop playing a sound -RLAPI void PauseSound(Sound sound); // Pause a sound -RLAPI void ResumeSound(Sound sound); // Resume a paused sound -RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) -RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) -RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel -RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing -RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) -RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format -RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave -RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array -RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() - -// Music management functions -RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file -RLAPI Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize); // Load music stream from data -RLAPI void UnloadMusicStream(Music music); // Unload music stream -RLAPI void PlayMusicStream(Music music); // Start music playing -RLAPI bool IsMusicPlaying(Music music); // Check if music is playing -RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming -RLAPI void StopMusicStream(Music music); // Stop music playing -RLAPI void PauseMusicStream(Music music); // Pause music playing -RLAPI void ResumeMusicStream(Music music); // Resume playing paused music -RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) -RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) -RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) -RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) - -// AudioStream management functions -RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) -RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data -RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory -RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream -RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream -RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream -RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing -RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream -RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) -RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams - -#if defined(__cplusplus) -} -#endif - -#endif // RAYLIB_H diff --git a/raylib-sys/raymath.h b/raylib-sys/raymath.h deleted file mode 100644 index 7f05ea4e..00000000 --- a/raylib-sys/raymath.h +++ /dev/null @@ -1,1516 +0,0 @@ -/********************************************************************************************** -* -* raymath v1.2 - Math functions to work with Vector3, Matrix and Quaternions -* -* CONFIGURATION: -* -* #define RAYMATH_IMPLEMENTATION -* Generates the implementation of the library into the included file. -* If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. -* -* #define RAYMATH_HEADER_ONLY -* Define static inline functions code, so #include header suffices for use. -* This may use up lots of memory. -* -* #define RAYMATH_STANDALONE -* Avoid raylib.h header inclusion in this file. -* Vector3 and Matrix data types are defined internally in raymath module. -* -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2015-2020 Ramon Santamaria (@raysan5) -* -* 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. -* -**********************************************************************************************/ - -#ifndef RAYMATH_H -#define RAYMATH_H - -//#define RAYMATH_STANDALONE // NOTE: To use raymath as standalone lib, just uncomment this line -//#define RAYMATH_HEADER_ONLY // NOTE: To compile functions as static inline, uncomment this line - -#ifndef RAYMATH_STANDALONE - #include "raylib.h" // Required for structs: Vector3, Matrix -#endif - -#if defined(RAYMATH_IMPLEMENTATION) && defined(RAYMATH_HEADER_ONLY) - #error "Specifying both RAYMATH_IMPLEMENTATION and RAYMATH_HEADER_ONLY is contradictory" -#endif - -#if defined(RAYMATH_IMPLEMENTATION) - #if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED) - #define RMDEF __declspec(dllexport) extern inline // We are building raylib as a Win32 shared library (.dll). - #elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED) - #define RMDEF __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) - #else - #define RMDEF extern inline // Provide external definition - #endif -#elif defined(RAYMATH_HEADER_ONLY) - #define RMDEF static inline // Functions may be inlined, no external out-of-line definition -#else - #if defined(__TINYC__) - #define RMDEF static inline // plain inline not supported by tinycc (See issue #435) - #else - #define RMDEF inline // Functions may be inlined or external definition used - #endif -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#ifndef PI - #define PI 3.14159265358979323846 -#endif - -#ifndef DEG2RAD - #define DEG2RAD (PI/180.0f) -#endif - -#ifndef RAD2DEG - #define RAD2DEG (180.0f/PI) -#endif - -// Return float vector for Matrix -#ifndef MatrixToFloat - #define MatrixToFloat(mat) (MatrixToFloatV(mat).v) -#endif - -// Return float vector for Vector3 -#ifndef Vector3ToFloat - #define Vector3ToFloat(vec) (Vector3ToFloatV(vec).v) -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- - -#if defined(RAYMATH_STANDALONE) - // Vector2 type - typedef struct Vector2 { - float x; - float y; - } Vector2; - - // Vector3 type - typedef struct Vector3 { - float x; - float y; - float z; - } Vector3; - - // Vector4 type - typedef struct Vector4 { - float x; - float y; - float z; - float w; - } Vector4; - - // Quaternion type - typedef Vector4 Quaternion; - - // Matrix type (OpenGL style 4x4 - right handed, column major) - typedef struct Matrix { - float m0, m4, m8, m12; - float m1, m5, m9, m13; - float m2, m6, m10, m14; - float m3, m7, m11, m15; - } Matrix; -#endif - -// NOTE: Helper types to be used instead of array return types for *ToFloat functions -typedef struct float3 { float v[3]; } float3; -typedef struct float16 { float v[16]; } float16; - -#include // Required for: sinf(), cosf(), sqrtf(), tan(), fabs() - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Utils math -//---------------------------------------------------------------------------------- - -// Clamp float value -RMDEF float Clamp(float value, float min, float max) -{ - const float res = value < min ? min : value; - return res > max ? max : res; -} - -// Calculate linear interpolation between two floats -RMDEF float Lerp(float start, float end, float amount) -{ - return start + amount*(end - start); -} - -// Normalize input value within input range -RMDEF float Normalize(float value, float start, float end) -{ - return (value - start) / (end - start); -} - -// Remap input value within input range to output range -RMDEF float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) -{ - return (value - inputStart) / (inputEnd - inputStart) * (outputEnd - outputStart) + outputStart; -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Vector2 math -//---------------------------------------------------------------------------------- - -// Vector with components value 0.0f -RMDEF Vector2 Vector2Zero(void) -{ - Vector2 result = { 0.0f, 0.0f }; - return result; -} - -// Vector with components value 1.0f -RMDEF Vector2 Vector2One(void) -{ - Vector2 result = { 1.0f, 1.0f }; - return result; -} - -// Add two vectors (v1 + v2) -RMDEF Vector2 Vector2Add(Vector2 v1, Vector2 v2) -{ - Vector2 result = { v1.x + v2.x, v1.y + v2.y }; - return result; -} - -// Add vector and float value -RMDEF Vector2 Vector2AddValue(Vector2 v, float add) -{ - Vector2 result = { v.x + add, v.y + add }; - return result; -} - -// Subtract two vectors (v1 - v2) -RMDEF Vector2 Vector2Subtract(Vector2 v1, Vector2 v2) -{ - Vector2 result = { v1.x - v2.x, v1.y - v2.y }; - return result; -} - -// Subtract vector by float value -RMDEF Vector2 Vector2SubtractValue(Vector2 v, float sub) -{ - Vector2 result = { v.x - sub, v.y - sub }; - return result; -} - -// Calculate vector length -RMDEF float Vector2Length(Vector2 v) -{ - float result = sqrtf((v.x*v.x) + (v.y*v.y)); - return result; -} - -// Calculate vector square length -RMDEF float Vector2LengthSqr(Vector2 v) -{ - float result = (v.x*v.x) + (v.y*v.y); - return result; -} - -// Calculate two vectors dot product -RMDEF float Vector2DotProduct(Vector2 v1, Vector2 v2) -{ - float result = (v1.x*v2.x + v1.y*v2.y); - return result; -} - -// Calculate distance between two vectors -RMDEF float Vector2Distance(Vector2 v1, Vector2 v2) -{ - float result = sqrtf((v1.x - v2.x)*(v1.x - v2.x) + (v1.y - v2.y)*(v1.y - v2.y)); - return result; -} - -// Calculate angle from two vectors in X-axis -RMDEF float Vector2Angle(Vector2 v1, Vector2 v2) -{ - float result = atan2f(v2.y - v1.y, v2.x - v1.x)*(180.0f/PI); - if (result < 0) result += 360.0f; - return result; -} - -// Scale vector (multiply by value) -RMDEF Vector2 Vector2Scale(Vector2 v, float scale) -{ - Vector2 result = { v.x*scale, v.y*scale }; - return result; -} - -// Multiply vector by vector -RMDEF Vector2 Vector2Multiply(Vector2 v1, Vector2 v2) -{ - Vector2 result = { v1.x*v2.x, v1.y*v2.y }; - return result; -} - -// Negate vector -RMDEF Vector2 Vector2Negate(Vector2 v) -{ - Vector2 result = { -v.x, -v.y }; - return result; -} - -// Divide vector by vector -RMDEF Vector2 Vector2Divide(Vector2 v1, Vector2 v2) -{ - Vector2 result = { v1.x/v2.x, v1.y/v2.y }; - return result; -} - -// Normalize provided vector -RMDEF Vector2 Vector2Normalize(Vector2 v) -{ - Vector2 result = Vector2Scale(v, 1/Vector2Length(v)); - return result; -} - -// Calculate linear interpolation between two vectors -RMDEF Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount) -{ - Vector2 result = { 0 }; - - result.x = v1.x + amount*(v2.x - v1.x); - result.y = v1.y + amount*(v2.y - v1.y); - - return result; -} - -// Calculate reflected vector to normal -RMDEF Vector2 Vector2Reflect(Vector2 v, Vector2 normal) -{ - Vector2 result = { 0 }; - - float dotProduct = Vector2DotProduct(v, normal); - - result.x = v.x - (2.0f*normal.x)*dotProduct; - result.y = v.y - (2.0f*normal.y)*dotProduct; - - return result; -} - -// Rotate Vector by float in Degrees. -RMDEF Vector2 Vector2Rotate(Vector2 v, float degs) -{ - float rads = degs*DEG2RAD; - Vector2 result = {v.x * cosf(rads) - v.y * sinf(rads) , v.x * sinf(rads) + v.y * cosf(rads) }; - return result; -} - -// Move Vector towards target -RMDEF Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance) -{ - Vector2 result = { 0 }; - float dx = target.x - v.x; - float dy = target.y - v.y; - float value = (dx*dx) + (dy*dy); - - if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance))) result = target; - - float dist = sqrtf(value); - - result.x = v.x + dx/dist*maxDistance; - result.y = v.y + dy/dist*maxDistance; - - return result; -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Vector3 math -//---------------------------------------------------------------------------------- - -// Vector with components value 0.0f -RMDEF Vector3 Vector3Zero(void) -{ - Vector3 result = { 0.0f, 0.0f, 0.0f }; - return result; -} - -// Vector with components value 1.0f -RMDEF Vector3 Vector3One(void) -{ - Vector3 result = { 1.0f, 1.0f, 1.0f }; - return result; -} - -// Add two vectors -RMDEF Vector3 Vector3Add(Vector3 v1, Vector3 v2) -{ - Vector3 result = { v1.x + v2.x, v1.y + v2.y, v1.z + v2.z }; - return result; -} - -// Add vector and float value -RMDEF Vector3 Vector3AddValue(Vector3 v, float add) -{ - Vector3 result = { v.x + add, v.y + add, v.z + add }; - return result; -} - -// Subtract two vectors -RMDEF Vector3 Vector3Subtract(Vector3 v1, Vector3 v2) -{ - Vector3 result = { v1.x - v2.x, v1.y - v2.y, v1.z - v2.z }; - return result; -} - -// Subtract vector by float value -RMDEF Vector3 Vector3SubtractValue(Vector3 v, float sub) -{ - Vector3 result = { v.x - sub, v.y - sub, v.z - sub }; - return result; -} - -// Multiply vector by scalar -RMDEF Vector3 Vector3Scale(Vector3 v, float scalar) -{ - Vector3 result = { v.x*scalar, v.y*scalar, v.z*scalar }; - return result; -} - -// Multiply vector by vector -RMDEF Vector3 Vector3Multiply(Vector3 v1, Vector3 v2) -{ - Vector3 result = { v1.x*v2.x, v1.y*v2.y, v1.z*v2.z }; - return result; -} - -// Calculate two vectors cross product -RMDEF Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2) -{ - Vector3 result = { v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x }; - return result; -} - -// Calculate one vector perpendicular vector -RMDEF Vector3 Vector3Perpendicular(Vector3 v) -{ - Vector3 result = { 0 }; - - float min = (float) fabs(v.x); - Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f}; - - if (fabs(v.y) < min) - { - min = (float) fabs(v.y); - Vector3 tmp = {0.0f, 1.0f, 0.0f}; - cardinalAxis = tmp; - } - - if (fabs(v.z) < min) - { - Vector3 tmp = {0.0f, 0.0f, 1.0f}; - cardinalAxis = tmp; - } - - result = Vector3CrossProduct(v, cardinalAxis); - - return result; -} - -// Calculate vector length -RMDEF float Vector3Length(const Vector3 v) -{ - float result = sqrtf(v.x*v.x + v.y*v.y + v.z*v.z); - return result; -} - -// Calculate vector square length -RMDEF float Vector3LengthSqr(const Vector3 v) -{ - float result = v.x*v.x + v.y*v.y + v.z*v.z; - return result; -} - -// Calculate two vectors dot product -RMDEF float Vector3DotProduct(Vector3 v1, Vector3 v2) -{ - float result = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); - return result; -} - -// Calculate distance between two vectors -RMDEF float Vector3Distance(Vector3 v1, Vector3 v2) -{ - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - float result = sqrtf(dx*dx + dy*dy + dz*dz); - return result; -} - -// Negate provided vector (invert direction) -RMDEF Vector3 Vector3Negate(Vector3 v) -{ - Vector3 result = { -v.x, -v.y, -v.z }; - return result; -} - -// Divide vector by vector -RMDEF Vector3 Vector3Divide(Vector3 v1, Vector3 v2) -{ - Vector3 result = { v1.x/v2.x, v1.y/v2.y, v1.z/v2.z }; - return result; -} - -// Normalize provided vector -RMDEF Vector3 Vector3Normalize(Vector3 v) -{ - Vector3 result = v; - - float length, ilength; - length = Vector3Length(v); - if (length == 0.0f) length = 1.0f; - ilength = 1.0f/length; - - result.x *= ilength; - result.y *= ilength; - result.z *= ilength; - - return result; -} - -// Orthonormalize provided vectors -// Makes vectors normalized and orthogonal to each other -// Gram-Schmidt function implementation -RMDEF void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2) -{ - *v1 = Vector3Normalize(*v1); - Vector3 vn = Vector3CrossProduct(*v1, *v2); - vn = Vector3Normalize(vn); - *v2 = Vector3CrossProduct(vn, *v1); -} - -// Transforms a Vector3 by a given Matrix -RMDEF Vector3 Vector3Transform(Vector3 v, Matrix mat) -{ - Vector3 result = { 0 }; - float x = v.x; - float y = v.y; - float z = v.z; - - result.x = mat.m0*x + mat.m4*y + mat.m8*z + mat.m12; - result.y = mat.m1*x + mat.m5*y + mat.m9*z + mat.m13; - result.z = mat.m2*x + mat.m6*y + mat.m10*z + mat.m14; - - return result; -} - -// Transform a vector by quaternion rotation -RMDEF Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q) -{ - Vector3 result = { 0 }; - - result.x = v.x*(q.x*q.x + q.w*q.w - q.y*q.y - q.z*q.z) + v.y*(2*q.x*q.y - 2*q.w*q.z) + v.z*(2*q.x*q.z + 2*q.w*q.y); - result.y = v.x*(2*q.w*q.z + 2*q.x*q.y) + v.y*(q.w*q.w - q.x*q.x + q.y*q.y - q.z*q.z) + v.z*(-2*q.w*q.x + 2*q.y*q.z); - result.z = v.x*(-2*q.w*q.y + 2*q.x*q.z) + v.y*(2*q.w*q.x + 2*q.y*q.z)+ v.z*(q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z); - - return result; -} - -// Calculate linear interpolation between two vectors -RMDEF Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount) -{ - Vector3 result = { 0 }; - - result.x = v1.x + amount*(v2.x - v1.x); - result.y = v1.y + amount*(v2.y - v1.y); - result.z = v1.z + amount*(v2.z - v1.z); - - return result; -} - -// Calculate reflected vector to normal -RMDEF Vector3 Vector3Reflect(Vector3 v, Vector3 normal) -{ - // I is the original vector - // N is the normal of the incident plane - // R = I - (2*N*( DotProduct[ I,N] )) - - Vector3 result = { 0 }; - - float dotProduct = Vector3DotProduct(v, normal); - - result.x = v.x - (2.0f*normal.x)*dotProduct; - result.y = v.y - (2.0f*normal.y)*dotProduct; - result.z = v.z - (2.0f*normal.z)*dotProduct; - - return result; -} - -// Return min value for each pair of components -RMDEF Vector3 Vector3Min(Vector3 v1, Vector3 v2) -{ - Vector3 result = { 0 }; - - result.x = fminf(v1.x, v2.x); - result.y = fminf(v1.y, v2.y); - result.z = fminf(v1.z, v2.z); - - return result; -} - -// Return max value for each pair of components -RMDEF Vector3 Vector3Max(Vector3 v1, Vector3 v2) -{ - Vector3 result = { 0 }; - - result.x = fmaxf(v1.x, v2.x); - result.y = fmaxf(v1.y, v2.y); - result.z = fmaxf(v1.z, v2.z); - - return result; -} - -// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) -// NOTE: Assumes P is on the plane of the triangle -RMDEF Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c) -{ - //Vector v0 = b - a, v1 = c - a, v2 = p - a; - - Vector3 v0 = Vector3Subtract(b, a); - Vector3 v1 = Vector3Subtract(c, a); - Vector3 v2 = Vector3Subtract(p, a); - float d00 = Vector3DotProduct(v0, v0); - float d01 = Vector3DotProduct(v0, v1); - float d11 = Vector3DotProduct(v1, v1); - float d20 = Vector3DotProduct(v2, v0); - float d21 = Vector3DotProduct(v2, v1); - - float denom = d00*d11 - d01*d01; - - Vector3 result = { 0 }; - - result.y = (d11*d20 - d01*d21)/denom; - result.z = (d00*d21 - d01*d20)/denom; - result.x = 1.0f - (result.z + result.y); - - return result; -} - -// Returns Vector3 as float array -RMDEF float3 Vector3ToFloatV(Vector3 v) -{ - float3 buffer = { 0 }; - - buffer.v[0] = v.x; - buffer.v[1] = v.y; - buffer.v[2] = v.z; - - return buffer; -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Matrix math -//---------------------------------------------------------------------------------- - -// Compute matrix determinant -RMDEF float MatrixDeterminant(Matrix mat) -{ - // Cache the matrix values (speed optimization) - float a00 = mat.m0, a01 = mat.m1, a02 = mat.m2, a03 = mat.m3; - float a10 = mat.m4, a11 = mat.m5, a12 = mat.m6, a13 = mat.m7; - float a20 = mat.m8, a21 = mat.m9, a22 = mat.m10, a23 = mat.m11; - float a30 = mat.m12, a31 = mat.m13, a32 = mat.m14, a33 = mat.m15; - - float result = a30*a21*a12*a03 - a20*a31*a12*a03 - a30*a11*a22*a03 + a10*a31*a22*a03 + - a20*a11*a32*a03 - a10*a21*a32*a03 - a30*a21*a02*a13 + a20*a31*a02*a13 + - a30*a01*a22*a13 - a00*a31*a22*a13 - a20*a01*a32*a13 + a00*a21*a32*a13 + - a30*a11*a02*a23 - a10*a31*a02*a23 - a30*a01*a12*a23 + a00*a31*a12*a23 + - a10*a01*a32*a23 - a00*a11*a32*a23 - a20*a11*a02*a33 + a10*a21*a02*a33 + - a20*a01*a12*a33 - a00*a21*a12*a33 - a10*a01*a22*a33 + a00*a11*a22*a33; - - return result; -} - -// Returns the trace of the matrix (sum of the values along the diagonal) -RMDEF float MatrixTrace(Matrix mat) -{ - float result = (mat.m0 + mat.m5 + mat.m10 + mat.m15); - return result; -} - -// Transposes provided matrix -RMDEF Matrix MatrixTranspose(Matrix mat) -{ - Matrix result = { 0 }; - - result.m0 = mat.m0; - result.m1 = mat.m4; - result.m2 = mat.m8; - result.m3 = mat.m12; - result.m4 = mat.m1; - result.m5 = mat.m5; - result.m6 = mat.m9; - result.m7 = mat.m13; - result.m8 = mat.m2; - result.m9 = mat.m6; - result.m10 = mat.m10; - result.m11 = mat.m14; - result.m12 = mat.m3; - result.m13 = mat.m7; - result.m14 = mat.m11; - result.m15 = mat.m15; - - return result; -} - -// Invert provided matrix -RMDEF Matrix MatrixInvert(Matrix mat) -{ - Matrix result = { 0 }; - - // Cache the matrix values (speed optimization) - float a00 = mat.m0, a01 = mat.m1, a02 = mat.m2, a03 = mat.m3; - float a10 = mat.m4, a11 = mat.m5, a12 = mat.m6, a13 = mat.m7; - float a20 = mat.m8, a21 = mat.m9, a22 = mat.m10, a23 = mat.m11; - float a30 = mat.m12, a31 = mat.m13, a32 = mat.m14, a33 = mat.m15; - - float b00 = a00*a11 - a01*a10; - float b01 = a00*a12 - a02*a10; - float b02 = a00*a13 - a03*a10; - float b03 = a01*a12 - a02*a11; - float b04 = a01*a13 - a03*a11; - float b05 = a02*a13 - a03*a12; - float b06 = a20*a31 - a21*a30; - float b07 = a20*a32 - a22*a30; - float b08 = a20*a33 - a23*a30; - float b09 = a21*a32 - a22*a31; - float b10 = a21*a33 - a23*a31; - float b11 = a22*a33 - a23*a32; - - // Calculate the invert determinant (inlined to avoid double-caching) - float invDet = 1.0f/(b00*b11 - b01*b10 + b02*b09 + b03*b08 - b04*b07 + b05*b06); - - result.m0 = (a11*b11 - a12*b10 + a13*b09)*invDet; - result.m1 = (-a01*b11 + a02*b10 - a03*b09)*invDet; - result.m2 = (a31*b05 - a32*b04 + a33*b03)*invDet; - result.m3 = (-a21*b05 + a22*b04 - a23*b03)*invDet; - result.m4 = (-a10*b11 + a12*b08 - a13*b07)*invDet; - result.m5 = (a00*b11 - a02*b08 + a03*b07)*invDet; - result.m6 = (-a30*b05 + a32*b02 - a33*b01)*invDet; - result.m7 = (a20*b05 - a22*b02 + a23*b01)*invDet; - result.m8 = (a10*b10 - a11*b08 + a13*b06)*invDet; - result.m9 = (-a00*b10 + a01*b08 - a03*b06)*invDet; - result.m10 = (a30*b04 - a31*b02 + a33*b00)*invDet; - result.m11 = (-a20*b04 + a21*b02 - a23*b00)*invDet; - result.m12 = (-a10*b09 + a11*b07 - a12*b06)*invDet; - result.m13 = (a00*b09 - a01*b07 + a02*b06)*invDet; - result.m14 = (-a30*b03 + a31*b01 - a32*b00)*invDet; - result.m15 = (a20*b03 - a21*b01 + a22*b00)*invDet; - - return result; -} - -// Normalize provided matrix -RMDEF Matrix MatrixNormalize(Matrix mat) -{ - Matrix result = { 0 }; - - float det = MatrixDeterminant(mat); - - result.m0 = mat.m0/det; - result.m1 = mat.m1/det; - result.m2 = mat.m2/det; - result.m3 = mat.m3/det; - result.m4 = mat.m4/det; - result.m5 = mat.m5/det; - result.m6 = mat.m6/det; - result.m7 = mat.m7/det; - result.m8 = mat.m8/det; - result.m9 = mat.m9/det; - result.m10 = mat.m10/det; - result.m11 = mat.m11/det; - result.m12 = mat.m12/det; - result.m13 = mat.m13/det; - result.m14 = mat.m14/det; - result.m15 = mat.m15/det; - - return result; -} - -// Returns identity matrix -RMDEF Matrix MatrixIdentity(void) -{ - Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f }; - - return result; -} - -// Add two matrices -RMDEF Matrix MatrixAdd(Matrix left, Matrix right) -{ - Matrix result = MatrixIdentity(); - - result.m0 = left.m0 + right.m0; - result.m1 = left.m1 + right.m1; - result.m2 = left.m2 + right.m2; - result.m3 = left.m3 + right.m3; - result.m4 = left.m4 + right.m4; - result.m5 = left.m5 + right.m5; - result.m6 = left.m6 + right.m6; - result.m7 = left.m7 + right.m7; - result.m8 = left.m8 + right.m8; - result.m9 = left.m9 + right.m9; - result.m10 = left.m10 + right.m10; - result.m11 = left.m11 + right.m11; - result.m12 = left.m12 + right.m12; - result.m13 = left.m13 + right.m13; - result.m14 = left.m14 + right.m14; - result.m15 = left.m15 + right.m15; - - return result; -} - -// Subtract two matrices (left - right) -RMDEF Matrix MatrixSubtract(Matrix left, Matrix right) -{ - Matrix result = MatrixIdentity(); - - result.m0 = left.m0 - right.m0; - result.m1 = left.m1 - right.m1; - result.m2 = left.m2 - right.m2; - result.m3 = left.m3 - right.m3; - result.m4 = left.m4 - right.m4; - result.m5 = left.m5 - right.m5; - result.m6 = left.m6 - right.m6; - result.m7 = left.m7 - right.m7; - result.m8 = left.m8 - right.m8; - result.m9 = left.m9 - right.m9; - result.m10 = left.m10 - right.m10; - result.m11 = left.m11 - right.m11; - result.m12 = left.m12 - right.m12; - result.m13 = left.m13 - right.m13; - result.m14 = left.m14 - right.m14; - result.m15 = left.m15 - right.m15; - - return result; -} - -// Returns two matrix multiplication -// NOTE: When multiplying matrices... the order matters! -RMDEF Matrix MatrixMultiply(Matrix left, Matrix right) -{ - Matrix result = { 0 }; - - result.m0 = left.m0*right.m0 + left.m1*right.m4 + left.m2*right.m8 + left.m3*right.m12; - result.m1 = left.m0*right.m1 + left.m1*right.m5 + left.m2*right.m9 + left.m3*right.m13; - result.m2 = left.m0*right.m2 + left.m1*right.m6 + left.m2*right.m10 + left.m3*right.m14; - result.m3 = left.m0*right.m3 + left.m1*right.m7 + left.m2*right.m11 + left.m3*right.m15; - result.m4 = left.m4*right.m0 + left.m5*right.m4 + left.m6*right.m8 + left.m7*right.m12; - result.m5 = left.m4*right.m1 + left.m5*right.m5 + left.m6*right.m9 + left.m7*right.m13; - result.m6 = left.m4*right.m2 + left.m5*right.m6 + left.m6*right.m10 + left.m7*right.m14; - result.m7 = left.m4*right.m3 + left.m5*right.m7 + left.m6*right.m11 + left.m7*right.m15; - result.m8 = left.m8*right.m0 + left.m9*right.m4 + left.m10*right.m8 + left.m11*right.m12; - result.m9 = left.m8*right.m1 + left.m9*right.m5 + left.m10*right.m9 + left.m11*right.m13; - result.m10 = left.m8*right.m2 + left.m9*right.m6 + left.m10*right.m10 + left.m11*right.m14; - result.m11 = left.m8*right.m3 + left.m9*right.m7 + left.m10*right.m11 + left.m11*right.m15; - result.m12 = left.m12*right.m0 + left.m13*right.m4 + left.m14*right.m8 + left.m15*right.m12; - result.m13 = left.m12*right.m1 + left.m13*right.m5 + left.m14*right.m9 + left.m15*right.m13; - result.m14 = left.m12*right.m2 + left.m13*right.m6 + left.m14*right.m10 + left.m15*right.m14; - result.m15 = left.m12*right.m3 + left.m13*right.m7 + left.m14*right.m11 + left.m15*right.m15; - - return result; -} - -// Returns translation matrix -RMDEF Matrix MatrixTranslate(float x, float y, float z) -{ - Matrix result = { 1.0f, 0.0f, 0.0f, x, - 0.0f, 1.0f, 0.0f, y, - 0.0f, 0.0f, 1.0f, z, - 0.0f, 0.0f, 0.0f, 1.0f }; - - return result; -} - -// Create rotation matrix from axis and angle -// NOTE: Angle should be provided in radians -RMDEF Matrix MatrixRotate(Vector3 axis, float angle) -{ - Matrix result = { 0 }; - - float x = axis.x, y = axis.y, z = axis.z; - - float length = sqrtf(x*x + y*y + z*z); - - if ((length != 1.0f) && (length != 0.0f)) - { - length = 1.0f/length; - x *= length; - y *= length; - z *= length; - } - - float sinres = sinf(angle); - float cosres = cosf(angle); - float t = 1.0f - cosres; - - result.m0 = x*x*t + cosres; - result.m1 = y*x*t + z*sinres; - result.m2 = z*x*t - y*sinres; - result.m3 = 0.0f; - - result.m4 = x*y*t - z*sinres; - result.m5 = y*y*t + cosres; - result.m6 = z*y*t + x*sinres; - result.m7 = 0.0f; - - result.m8 = x*z*t + y*sinres; - result.m9 = y*z*t - x*sinres; - result.m10 = z*z*t + cosres; - result.m11 = 0.0f; - - result.m12 = 0.0f; - result.m13 = 0.0f; - result.m14 = 0.0f; - result.m15 = 1.0f; - - return result; -} - -// Returns x-rotation matrix (angle in radians) -RMDEF Matrix MatrixRotateX(float angle) -{ - Matrix result = MatrixIdentity(); - - float cosres = cosf(angle); - float sinres = sinf(angle); - - result.m5 = cosres; - result.m6 = -sinres; - result.m9 = sinres; - result.m10 = cosres; - - return result; -} - -// Returns y-rotation matrix (angle in radians) -RMDEF Matrix MatrixRotateY(float angle) -{ - Matrix result = MatrixIdentity(); - - float cosres = cosf(angle); - float sinres = sinf(angle); - - result.m0 = cosres; - result.m2 = sinres; - result.m8 = -sinres; - result.m10 = cosres; - - return result; -} - -// Returns z-rotation matrix (angle in radians) -RMDEF Matrix MatrixRotateZ(float angle) -{ - Matrix result = MatrixIdentity(); - - float cosres = cosf(angle); - float sinres = sinf(angle); - - result.m0 = cosres; - result.m1 = -sinres; - result.m4 = sinres; - result.m5 = cosres; - - return result; -} - - -// Returns xyz-rotation matrix (angles in radians) -RMDEF Matrix MatrixRotateXYZ(Vector3 ang) -{ - Matrix result = MatrixIdentity(); - - float cosz = cosf(-ang.z); - float sinz = sinf(-ang.z); - float cosy = cosf(-ang.y); - float siny = sinf(-ang.y); - float cosx = cosf(-ang.x); - float sinx = sinf(-ang.x); - - result.m0 = cosz * cosy; - result.m4 = (cosz * siny * sinx) - (sinz * cosx); - result.m8 = (cosz * siny * cosx) + (sinz * sinx); - - result.m1 = sinz * cosy; - result.m5 = (sinz * siny * sinx) + (cosz * cosx); - result.m9 = (sinz * siny * cosx) - (cosz * sinx); - - result.m2 = -siny; - result.m6 = cosy * sinx; - result.m10= cosy * cosx; - - return result; -} - -// Returns zyx-rotation matrix (angles in radians) -// TODO: This solution is suboptimal, it should be possible to create this matrix in one go -// instead of using a 3 matrix multiplication -RMDEF Matrix MatrixRotateZYX(Vector3 ang) -{ - Matrix result = MatrixRotateZ(ang.z); - result = MatrixMultiply(result, MatrixRotateY(ang.y)); - result = MatrixMultiply(result, MatrixRotateX(ang.x)); - - return result; -} - -// Returns scaling matrix -RMDEF Matrix MatrixScale(float x, float y, float z) -{ - Matrix result = { x, 0.0f, 0.0f, 0.0f, - 0.0f, y, 0.0f, 0.0f, - 0.0f, 0.0f, z, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f }; - - return result; -} - -// Returns perspective projection matrix -RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far) -{ - Matrix result = { 0 }; - - float rl = (float)(right - left); - float tb = (float)(top - bottom); - float fn = (float)(far - near); - - result.m0 = ((float) near*2.0f)/rl; - result.m1 = 0.0f; - result.m2 = 0.0f; - result.m3 = 0.0f; - - result.m4 = 0.0f; - result.m5 = ((float) near*2.0f)/tb; - result.m6 = 0.0f; - result.m7 = 0.0f; - - result.m8 = ((float)right + (float)left)/rl; - result.m9 = ((float)top + (float)bottom)/tb; - result.m10 = -((float)far + (float)near)/fn; - result.m11 = -1.0f; - - result.m12 = 0.0f; - result.m13 = 0.0f; - result.m14 = -((float)far*(float)near*2.0f)/fn; - result.m15 = 0.0f; - - return result; -} - -// Returns perspective projection matrix -// NOTE: Angle should be provided in radians -RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double far) -{ - double top = near*tan(fovy*0.5); - double right = top*aspect; - Matrix result = MatrixFrustum(-right, right, -top, top, near, far); - - return result; -} - -// Returns orthographic projection matrix -RMDEF Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far) -{ - Matrix result = { 0 }; - - float rl = (float)(right - left); - float tb = (float)(top - bottom); - float fn = (float)(far - near); - - result.m0 = 2.0f/rl; - result.m1 = 0.0f; - result.m2 = 0.0f; - result.m3 = 0.0f; - result.m4 = 0.0f; - result.m5 = 2.0f/tb; - result.m6 = 0.0f; - result.m7 = 0.0f; - result.m8 = 0.0f; - result.m9 = 0.0f; - result.m10 = -2.0f/fn; - result.m11 = 0.0f; - result.m12 = -((float)left + (float)right)/rl; - result.m13 = -((float)top + (float)bottom)/tb; - result.m14 = -((float)far + (float)near)/fn; - result.m15 = 1.0f; - - return result; -} - -// Returns camera look-at matrix (view matrix) -RMDEF Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) -{ - Matrix result = { 0 }; - - Vector3 z = Vector3Subtract(eye, target); - z = Vector3Normalize(z); - Vector3 x = Vector3CrossProduct(up, z); - x = Vector3Normalize(x); - Vector3 y = Vector3CrossProduct(z, x); - - result.m0 = x.x; - result.m1 = y.x; - result.m2 = z.x; - result.m3 = 0.0f; - result.m4 = x.y; - result.m5 = y.y; - result.m6 = z.y; - result.m7 = 0.0f; - result.m8 = x.z; - result.m9 = y.z; - result.m10 = z.z; - result.m11 = 0.0f; - result.m12 = -Vector3DotProduct(x, eye); - result.m13 = -Vector3DotProduct(y, eye); - result.m14 = -Vector3DotProduct(z, eye); - result.m15 = 1.0f; - - return result; -} - -// Returns float array of matrix data -RMDEF float16 MatrixToFloatV(Matrix mat) -{ - float16 buffer = { 0 }; - - buffer.v[0] = mat.m0; - buffer.v[1] = mat.m1; - buffer.v[2] = mat.m2; - buffer.v[3] = mat.m3; - buffer.v[4] = mat.m4; - buffer.v[5] = mat.m5; - buffer.v[6] = mat.m6; - buffer.v[7] = mat.m7; - buffer.v[8] = mat.m8; - buffer.v[9] = mat.m9; - buffer.v[10] = mat.m10; - buffer.v[11] = mat.m11; - buffer.v[12] = mat.m12; - buffer.v[13] = mat.m13; - buffer.v[14] = mat.m14; - buffer.v[15] = mat.m15; - - return buffer; -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Quaternion math -//---------------------------------------------------------------------------------- - -// Add two quaternions -RMDEF Quaternion QuaternionAdd(Quaternion q1, Quaternion q2) -{ - Quaternion result = {q1.x + q2.x, q1.y + q2.y, q1.z + q2.z, q1.w + q2.w}; - return result; -} - -// Add quaternion and float value -RMDEF Quaternion QuaternionAddValue(Quaternion q, float add) -{ - Quaternion result = {q.x + add, q.y + add, q.z + add, q.w + add}; - return result; -} - -// Subtract two quaternions -RMDEF Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2) -{ - Quaternion result = {q1.x - q2.x, q1.y - q2.y, q1.z - q2.z, q1.w - q2.w}; - return result; -} - -// Subtract quaternion and float value -RMDEF Quaternion QuaternionSubtractValue(Quaternion q, float sub) -{ - Quaternion result = {q.x - sub, q.y - sub, q.z - sub, q.w - sub}; - return result; -} - -// Returns identity quaternion -RMDEF Quaternion QuaternionIdentity(void) -{ - Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f }; - return result; -} - -// Computes the length of a quaternion -RMDEF float QuaternionLength(Quaternion q) -{ - float result = (float)sqrt(q.x*q.x + q.y*q.y + q.z*q.z + q.w*q.w); - return result; -} - -// Normalize provided quaternion -RMDEF Quaternion QuaternionNormalize(Quaternion q) -{ - Quaternion result = { 0 }; - - float length, ilength; - length = QuaternionLength(q); - if (length == 0.0f) length = 1.0f; - ilength = 1.0f/length; - - result.x = q.x*ilength; - result.y = q.y*ilength; - result.z = q.z*ilength; - result.w = q.w*ilength; - - return result; -} - -// Invert provided quaternion -RMDEF Quaternion QuaternionInvert(Quaternion q) -{ - Quaternion result = q; - float length = QuaternionLength(q); - float lengthSq = length*length; - - if (lengthSq != 0.0) - { - float i = 1.0f/lengthSq; - - result.x *= -i; - result.y *= -i; - result.z *= -i; - result.w *= i; - } - - return result; -} - -// Calculate two quaternion multiplication -RMDEF Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2) -{ - Quaternion result = { 0 }; - - float qax = q1.x, qay = q1.y, qaz = q1.z, qaw = q1.w; - float qbx = q2.x, qby = q2.y, qbz = q2.z, qbw = q2.w; - - result.x = qax*qbw + qaw*qbx + qay*qbz - qaz*qby; - result.y = qay*qbw + qaw*qby + qaz*qbx - qax*qbz; - result.z = qaz*qbw + qaw*qbz + qax*qby - qay*qbx; - result.w = qaw*qbw - qax*qbx - qay*qby - qaz*qbz; - - return result; -} - -// Scale quaternion by float value -RMDEF Quaternion QuaternionScale(Quaternion q, float mul) -{ - Quaternion result = { 0 }; - - float qax = q.x, qay = q.y, qaz = q.z, qaw = q.w; - - result.x = qax * mul + qaw * mul + qay * mul - qaz * mul; - result.y = qay * mul + qaw * mul + qaz * mul - qax * mul; - result.z = qaz * mul + qaw * mul + qax * mul - qay * mul; - result.w = qaw * mul - qax * mul - qay * mul - qaz * mul; - - return result; -} - -// Divide two quaternions -RMDEF Quaternion QuaternionDivide(Quaternion q1, Quaternion q2) -{ - Quaternion result = {q1.x / q2.x, q1.y / q2.y, q1.z / q2.z, q1.w / q2.w}; - return result; -} - -// Calculate linear interpolation between two quaternions -RMDEF Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount) -{ - Quaternion result = { 0 }; - - result.x = q1.x + amount*(q2.x - q1.x); - result.y = q1.y + amount*(q2.y - q1.y); - result.z = q1.z + amount*(q2.z - q1.z); - result.w = q1.w + amount*(q2.w - q1.w); - - return result; -} - -// Calculate slerp-optimized interpolation between two quaternions -RMDEF Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount) -{ - Quaternion result = QuaternionLerp(q1, q2, amount); - result = QuaternionNormalize(result); - - return result; -} - -// Calculates spherical linear interpolation between two quaternions -RMDEF Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount) -{ - Quaternion result = { 0 }; - - float cosHalfTheta = q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w; - - if (fabs(cosHalfTheta) >= 1.0f) result = q1; - else if (cosHalfTheta > 0.95f) result = QuaternionNlerp(q1, q2, amount); - else - { - float halfTheta = acosf(cosHalfTheta); - float sinHalfTheta = sqrtf(1.0f - cosHalfTheta*cosHalfTheta); - - if (fabs(sinHalfTheta) < 0.001f) - { - result.x = (q1.x*0.5f + q2.x*0.5f); - result.y = (q1.y*0.5f + q2.y*0.5f); - result.z = (q1.z*0.5f + q2.z*0.5f); - result.w = (q1.w*0.5f + q2.w*0.5f); - } - else - { - float ratioA = sinf((1 - amount)*halfTheta)/sinHalfTheta; - float ratioB = sinf(amount*halfTheta)/sinHalfTheta; - - result.x = (q1.x*ratioA + q2.x*ratioB); - result.y = (q1.y*ratioA + q2.y*ratioB); - result.z = (q1.z*ratioA + q2.z*ratioB); - result.w = (q1.w*ratioA + q2.w*ratioB); - } - } - - return result; -} - -// Calculate quaternion based on the rotation from one vector to another -RMDEF Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to) -{ - Quaternion result = { 0 }; - - float cos2Theta = Vector3DotProduct(from, to); - Vector3 cross = Vector3CrossProduct(from, to); - - result.x = cross.x; - result.y = cross.y; - result.z = cross.z; - result.w = 1.0f + cos2Theta; // NOTE: Added QuaternioIdentity() - - // Normalize to essentially nlerp the original and identity to 0.5 - result = QuaternionNormalize(result); - - // Above lines are equivalent to: - //Quaternion result = QuaternionNlerp(q, QuaternionIdentity(), 0.5f); - - return result; -} - -// Returns a quaternion for a given rotation matrix -RMDEF Quaternion QuaternionFromMatrix(Matrix mat) -{ - Quaternion result = { 0 }; - - if ((mat.m0 > mat.m5) && (mat.m0 > mat.m10)) - { - float s = sqrtf(1.0f + mat.m0 - mat.m5 - mat.m10)*2; - - result.x = 0.25f*s; - result.y = (mat.m4 + mat.m1)/s; - result.z = (mat.m2 + mat.m8)/s; - result.w = (mat.m9 - mat.m6)/s; - } - else if (mat.m5 > mat.m10) - { - float s = sqrtf(1.0f + mat.m5 - mat.m0 - mat.m10)*2; - result.x = (mat.m4 + mat.m1)/s; - result.y = 0.25f*s; - result.z = (mat.m9 + mat.m6)/s; - result.w = (mat.m2 - mat.m8)/s; - } - else - { - float s = sqrtf(1.0f + mat.m10 - mat.m0 - mat.m5)*2; - result.x = (mat.m2 + mat.m8)/s; - result.y = (mat.m9 + mat.m6)/s; - result.z = 0.25f*s; - result.w = (mat.m4 - mat.m1)/s; - } - - return result; -} - -// Returns a matrix for a given quaternion -RMDEF Matrix QuaternionToMatrix(Quaternion q) -{ - Matrix result = MatrixIdentity(); - - float a2 = 2*(q.x*q.x), b2=2*(q.y*q.y), c2=2*(q.z*q.z); //, d2=2*(q.w*q.w); - - float ab = 2*(q.x*q.y), ac=2*(q.x*q.z), bc=2*(q.y*q.z); - float ad = 2*(q.x*q.w), bd=2*(q.y*q.w), cd=2*(q.z*q.w); - - result.m0 = 1 - b2 - c2; - result.m1 = ab - cd; - result.m2 = ac + bd; - - result.m4 = ab + cd; - result.m5 = 1 - a2 - c2; - result.m6 = bc - ad; - - result.m8 = ac - bd; - result.m9 = bc + ad; - result.m10 = 1 - a2 - b2; - - return result; -} - -// Returns rotation quaternion for an angle and axis -// NOTE: angle must be provided in radians -RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle) -{ - Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f }; - - if (Vector3Length(axis) != 0.0f) - - angle *= 0.5f; - - axis = Vector3Normalize(axis); - - float sinres = sinf(angle); - float cosres = cosf(angle); - - result.x = axis.x*sinres; - result.y = axis.y*sinres; - result.z = axis.z*sinres; - result.w = cosres; - - result = QuaternionNormalize(result); - - return result; -} - -// Returns the rotation angle and axis for a given quaternion -RMDEF void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle) -{ - if (fabs(q.w) > 1.0f) q = QuaternionNormalize(q); - - Vector3 resAxis = { 0.0f, 0.0f, 0.0f }; - float resAngle = 2.0f*acosf(q.w); - float den = sqrtf(1.0f - q.w*q.w); - - if (den > 0.0001f) - { - resAxis.x = q.x/den; - resAxis.y = q.y/den; - resAxis.z = q.z/den; - } - else - { - // This occurs when the angle is zero. - // Not a problem: just set an arbitrary normalized axis. - resAxis.x = 1.0f; - } - - *outAxis = resAxis; - *outAngle = resAngle; -} - -// Returns he quaternion equivalent to Euler angles -RMDEF Quaternion QuaternionFromEuler(float roll, float pitch, float yaw) -{ - Quaternion q = { 0 }; - - float x0 = cosf(roll*0.5f); - float x1 = sinf(roll*0.5f); - float y0 = cosf(pitch*0.5f); - float y1 = sinf(pitch*0.5f); - float z0 = cosf(yaw*0.5f); - float z1 = sinf(yaw*0.5f); - - q.x = x1*y0*z0 - x0*y1*z1; - q.y = x0*y1*z0 + x1*y0*z1; - q.z = x0*y0*z1 - x1*y1*z0; - q.w = x0*y0*z0 + x1*y1*z1; - - return q; -} - -// Return the Euler angles equivalent to quaternion (roll, pitch, yaw) -// NOTE: Angles are returned in a Vector3 struct in degrees -RMDEF Vector3 QuaternionToEuler(Quaternion q) -{ - Vector3 result = { 0 }; - - // roll (x-axis rotation) - float x0 = 2.0f*(q.w*q.x + q.y*q.z); - float x1 = 1.0f - 2.0f*(q.x*q.x + q.y*q.y); - result.x = atan2f(x0, x1)*RAD2DEG; - - // pitch (y-axis rotation) - float y0 = 2.0f*(q.w*q.y - q.z*q.x); - y0 = y0 > 1.0f ? 1.0f : y0; - y0 = y0 < -1.0f ? -1.0f : y0; - result.y = asinf(y0)*RAD2DEG; - - // yaw (z-axis rotation) - float z0 = 2.0f*(q.w*q.z + q.x*q.y); - float z1 = 1.0f - 2.0f*(q.y*q.y + q.z*q.z); - result.z = atan2f(z0, z1)*RAD2DEG; - - return result; -} - -// Transform a quaternion given a transformation matrix -RMDEF Quaternion QuaternionTransform(Quaternion q, Matrix mat) -{ - Quaternion result = { 0 }; - - result.x = mat.m0*q.x + mat.m4*q.y + mat.m8*q.z + mat.m12*q.w; - result.y = mat.m1*q.x + mat.m5*q.y + mat.m9*q.z + mat.m13*q.w; - result.z = mat.m2*q.x + mat.m6*q.y + mat.m10*q.z + mat.m14*q.w; - result.w = mat.m3*q.x + mat.m7*q.y + mat.m11*q.z + mat.m15*q.w; - - return result; -} - -// Projects a Vector3 from screen space into object space -RMDEF Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view) -{ - Vector3 result = { 0.0f, 0.0f, 0.0f }; - - // Calculate unproject matrix (multiply view patrix by projection matrix) and invert it - Matrix matViewProj = MatrixMultiply(view, projection); - matViewProj = MatrixInvert(matViewProj); - - // Create quaternion from source point - Quaternion quat = { source.x, source.y, source.z, 1.0f }; - - // Multiply quat point by unproject matrix - quat = QuaternionTransform(quat, matViewProj); - - // Normalized world points in vectors - result.x = quat.x/quat.w; - result.y = quat.y/quat.w; - result.z = quat.z/quat.w; - - return result; -} - -#endif // RAYMATH_H diff --git a/raylib-sys/ricons.h b/raylib-sys/ricons.h deleted file mode 100755 index 62445828..00000000 --- a/raylib-sys/ricons.h +++ /dev/null @@ -1,557 +0,0 @@ -/********************************************************************************************** -* -* rIcons - Icons pack intended for tools development with raygui -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2019-2020 Ramon Santamaria (@raysan5) -* -**********************************************************************************************/ - -#ifndef RICONS_H -#define RICONS_H - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define RICON_MAX_ICONS 256 // Maximum number of icons -#define RICON_SIZE 16 // Size of icons (squared) - -#define RICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id - -// Icons data is defined by bit array (every bit represents one pixel) -// Those arrays are stored as unsigned int data arrays, so every array -// element defines 32 pixels (bits) of information -// Number of elemens depend on RICON_SIZE (by default 16x16 pixels) -#define RICON_DATA_ELEMENTS (RICON_SIZE * RICON_SIZE / 32) - -//---------------------------------------------------------------------------------- -// Icons enumeration -//---------------------------------------------------------------------------------- -typedef enum -{ - RICON_NONE = 0, - RICON_FOLDER_FILE_OPEN = 1, - RICON_FILE_SAVE_CLASSIC = 2, - RICON_FOLDER_OPEN = 3, - RICON_FOLDER_SAVE = 4, - RICON_FILE_OPEN = 5, - RICON_FILE_SAVE = 6, - RICON_FILE_EXPORT = 7, - RICON_FILE_NEW = 8, - RICON_FILE_DELETE = 9, - RICON_FILETYPE_TEXT = 10, - RICON_FILETYPE_AUDIO = 11, - RICON_FILETYPE_IMAGE = 12, - RICON_FILETYPE_PLAY = 13, - RICON_FILETYPE_VIDEO = 14, - RICON_FILETYPE_INFO = 15, - RICON_FILE_COPY = 16, - RICON_FILE_CUT = 17, - RICON_FILE_PASTE = 18, - RICON_CURSOR_HAND = 19, - RICON_CURSOR_POINTER = 20, - RICON_CURSOR_CLASSIC = 21, - RICON_PENCIL = 22, - RICON_PENCIL_BIG = 23, - RICON_BRUSH_CLASSIC = 24, - RICON_BRUSH_PAINTER = 25, - RICON_WATER_DROP = 26, - RICON_COLOR_PICKER = 27, - RICON_RUBBER = 28, - RICON_COLOR_BUCKET = 29, - RICON_TEXT_T = 30, - RICON_TEXT_A = 31, - RICON_SCALE = 32, - RICON_RESIZE = 33, - RICON_FILTER_POINT = 34, - RICON_FILTER_BILINEAR = 35, - RICON_CROP = 36, - RICON_CROP_ALPHA = 37, - RICON_SQUARE_TOGGLE = 38, - RICON_SYMMETRY = 39, - RICON_SYMMETRY_HORIZONTAL = 40, - RICON_SYMMETRY_VERTICAL = 41, - RICON_LENS = 42, - RICON_LENS_BIG = 43, - RICON_EYE_ON = 44, - RICON_EYE_OFF = 45, - RICON_FILTER_TOP = 46, - RICON_FILTER = 47, - RICON_TARGET_POINT = 48, - RICON_TARGET_SMALL = 49, - RICON_TARGET_BIG = 50, - RICON_TARGET_MOVE = 51, - RICON_CURSOR_MOVE = 52, - RICON_CURSOR_SCALE = 53, - RICON_CURSOR_SCALE_RIGHT = 54, - RICON_CURSOR_SCALE_LEFT = 55, - RICON_UNDO = 56, - RICON_REDO = 57, - RICON_REREDO = 58, - RICON_MUTATE = 59, - RICON_ROTATE = 60, - RICON_REPEAT = 61, - RICON_SHUFFLE = 62, - RICON_EMPTYBOX = 63, - RICON_TARGET = 64, - RICON_TARGET_SMALL_FILL = 65, - RICON_TARGET_BIG_FILL = 66, - RICON_TARGET_MOVE_FILL = 67, - RICON_CURSOR_MOVE_FILL = 68, - RICON_CURSOR_SCALE_FILL = 69, - RICON_CURSOR_SCALE_RIGHT_FILL = 70, - RICON_CURSOR_SCALE_LEFT_FILL = 71, - RICON_UNDO_FILL = 72, - RICON_REDO_FILL = 73, - RICON_REREDO_FILL = 74, - RICON_MUTATE_FILL = 75, - RICON_ROTATE_FILL = 76, - RICON_REPEAT_FILL = 77, - RICON_SHUFFLE_FILL = 78, - RICON_EMPTYBOX_SMALL = 79, - RICON_BOX = 80, - RICON_BOX_TOP = 81, - RICON_BOX_TOP_RIGHT = 82, - RICON_BOX_RIGHT = 83, - RICON_BOX_BOTTOM_RIGHT = 84, - RICON_BOX_BOTTOM = 85, - RICON_BOX_BOTTOM_LEFT = 86, - RICON_BOX_LEFT = 87, - RICON_BOX_TOP_LEFT = 88, - RICON_BOX_CENTER = 89, - RICON_BOX_CIRCLE_MASK = 90, - RICON_POT = 91, - RICON_ALPHA_MULTIPLY = 92, - RICON_ALPHA_CLEAR = 93, - RICON_DITHERING = 94, - RICON_MIPMAPS = 95, - RICON_BOX_GRID = 96, - RICON_GRID = 97, - RICON_BOX_CORNERS_SMALL = 98, - RICON_BOX_CORNERS_BIG = 99, - RICON_FOUR_BOXES = 100, - RICON_GRID_FILL = 101, - RICON_BOX_MULTISIZE = 102, - RICON_ZOOM_SMALL = 103, - RICON_ZOOM_MEDIUM = 104, - RICON_ZOOM_BIG = 105, - RICON_ZOOM_ALL = 106, - RICON_ZOOM_CENTER = 107, - RICON_BOX_DOTS_SMALL = 108, - RICON_BOX_DOTS_BIG = 109, - RICON_BOX_CONCENTRIC = 110, - RICON_BOX_GRID_BIG = 111, - RICON_OK_TICK = 112, - RICON_CROSS = 113, - RICON_ARROW_LEFT = 114, - RICON_ARROW_RIGHT = 115, - RICON_ARROW_BOTTOM = 116, - RICON_ARROW_TOP = 117, - RICON_ARROW_LEFT_FILL = 118, - RICON_ARROW_RIGHT_FILL = 119, - RICON_ARROW_BOTTOM_FILL = 120, - RICON_ARROW_TOP_FILL = 121, - RICON_AUDIO = 122, - RICON_FX = 123, - RICON_WAVE = 124, - RICON_WAVE_SINUS = 125, - RICON_WAVE_SQUARE = 126, - RICON_WAVE_TRIANGULAR = 127, - RICON_CROSS_SMALL = 128, - RICON_PLAYER_PREVIOUS = 129, - RICON_PLAYER_PLAY_BACK = 130, - RICON_PLAYER_PLAY = 131, - RICON_PLAYER_PAUSE = 132, - RICON_PLAYER_STOP = 133, - RICON_PLAYER_NEXT = 134, - RICON_PLAYER_RECORD = 135, - RICON_MAGNET = 136, - RICON_LOCK_CLOSE = 137, - RICON_LOCK_OPEN = 138, - RICON_CLOCK = 139, - RICON_TOOLS = 140, - RICON_GEAR = 141, - RICON_GEAR_BIG = 142, - RICON_BIN = 143, - RICON_HAND_POINTER = 144, - RICON_LASER = 145, - RICON_COIN = 146, - RICON_EXPLOSION = 147, - RICON_1UP = 148, - RICON_PLAYER = 149, - RICON_PLAYER_JUMP = 150, - RICON_KEY = 151, - RICON_DEMON = 152, - RICON_TEXT_POPUP = 153, - RICON_GEAR_EX = 154, - RICON_CRACK = 155, - RICON_CRACK_POINTS = 156, - RICON_STAR = 157, - RICON_DOOR = 158, - RICON_EXIT = 159, - RICON_MODE_2D = 160, - RICON_MODE_3D = 161, - RICON_CUBE = 162, - RICON_CUBE_FACE_TOP = 163, - RICON_CUBE_FACE_LEFT = 164, - RICON_CUBE_FACE_FRONT = 165, - RICON_CUBE_FACE_BOTTOM = 166, - RICON_CUBE_FACE_RIGHT = 167, - RICON_CUBE_FACE_BACK = 168, - RICON_CAMERA = 169, - RICON_SPECIAL = 170, - RICON_LINK_NET = 171, - RICON_LINK_BOXES = 172, - RICON_LINK_MULTI = 173, - RICON_LINK = 174, - RICON_LINK_BROKE = 175, - RICON_TEXT_NOTES = 176, - RICON_NOTEBOOK = 177, - RICON_SUITCASE = 178, - RICON_SUITCASE_ZIP = 179, - RICON_MAILBOX = 180, - RICON_MONITOR = 181, - RICON_PRINTER = 182, - RICON_PHOTO_CAMERA = 183, - RICON_PHOTO_CAMERA_FLASH = 184, - RICON_HOUSE = 185, - RICON_HEART = 186, - RICON_CORNER = 187, - RICON_VERTICAL_BARS = 188, - RICON_VERTICAL_BARS_FILL = 189, - RICON_LIFE_BARS = 190, - RICON_INFO = 191, - RICON_CROSSLINE = 192, - RICON_HELP = 193, - RICON_FILETYPE_ALPHA = 194, - RICON_FILETYPE_HOME = 195, - RICON_LAYERS_VISIBLE = 196, - RICON_LAYERS = 197, - RICON_WINDOW = 198, - RICON_HIDPI = 199, - RICON_200 = 200, - RICON_201 = 201, - RICON_202 = 202, - RICON_203 = 203, - RICON_204 = 204, - RICON_205 = 205, - RICON_206 = 206, - RICON_207 = 207, - RICON_208 = 208, - RICON_209 = 209, - RICON_210 = 210, - RICON_211 = 211, - RICON_212 = 212, - RICON_213 = 213, - RICON_214 = 214, - RICON_215 = 215, - RICON_216 = 216, - RICON_217 = 217, - RICON_218 = 218, - RICON_219 = 219, - RICON_220 = 220, - RICON_221 = 221, - RICON_222 = 222, - RICON_223 = 223, - RICON_224 = 224, - RICON_225 = 225, - RICON_226 = 226, - RICON_227 = 227, - RICON_228 = 228, - RICON_229 = 229, - RICON_230 = 230, - RICON_231 = 231, - RICON_232 = 232, - RICON_233 = 233, - RICON_234 = 234, - RICON_235 = 235, - RICON_236 = 236, - RICON_237 = 237, - RICON_238 = 238, - RICON_239 = 239, - RICON_240 = 240, - RICON_241 = 241, - RICON_242 = 242, - RICON_243 = 243, - RICON_244 = 244, - RICON_245 = 245, - RICON_246 = 246, - RICON_247 = 247, - RICON_248 = 248, - RICON_249 = 249, - RICON_250 = 250, - RICON_251 = 251, - RICON_252 = 252, - RICON_253 = 253, - RICON_254 = 254, - RICON_255 = 255, -} guiIconName; - -#endif // RICONS_H - -#if defined(RICONS_IMPLEMENTATION) -//---------------------------------------------------------------------------------- -// Icons data (allocated on memory data section by default) -// NOTE: A new icon set could be loaded over this array using GuiLoadIcons(), -// just note that loaded icons set must be same RICON_SIZE -//---------------------------------------------------------------------------------- -static unsigned int guiIcons[RICON_MAX_ICONS * RICON_DATA_ELEMENTS] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_NONE - 0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // RICON_FOLDER_FILE_OPEN - 0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // RICON_FILE_SAVE_CLASSIC - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024002, 0x44424282, 0x793e4102, 0x00000100, // RICON_FOLDER_OPEN - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024102, 0x44424102, 0x793e4282, 0x00000000, // RICON_FOLDER_SAVE - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x24442284, 0x21042104, 0x20042104, 0x00003ffc, // RICON_FILE_OPEN - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x21042104, 0x22842444, 0x20042104, 0x00003ffc, // RICON_FILE_SAVE - 0x3ff00000, 0x201c2010, 0x00042004, 0x20041004, 0x20844784, 0x00841384, 0x20042784, 0x00003ffc, // RICON_FILE_EXPORT - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x22042204, 0x22042f84, 0x20042204, 0x00003ffc, // RICON_FILE_NEW - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x25042884, 0x25042204, 0x20042884, 0x00003ffc, // RICON_FILE_DELETE - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RICON_FILETYPE_TEXT - 0x3ff00000, 0x201c2010, 0x27042004, 0x244424c4, 0x26442444, 0x20642664, 0x20042004, 0x00003ffc, // RICON_FILETYPE_AUDIO - 0x3ff00000, 0x201c2010, 0x26042604, 0x20042004, 0x35442884, 0x2414222c, 0x20042004, 0x00003ffc, // RICON_FILETYPE_IMAGE - 0x3ff00000, 0x201c2010, 0x20c42004, 0x22442144, 0x22442444, 0x20c42144, 0x20042004, 0x00003ffc, // RICON_FILETYPE_PLAY - 0x3ff00000, 0x3ffc2ff0, 0x3f3c2ff4, 0x3dbc2eb4, 0x3dbc2bb4, 0x3f3c2eb4, 0x3ffc2ff4, 0x00002ff4, // RICON_FILETYPE_VIDEO - 0x3ff00000, 0x201c2010, 0x21842184, 0x21842004, 0x21842184, 0x21842184, 0x20042184, 0x00003ffc, // RICON_FILETYPE_INFO - 0x0ff00000, 0x381c0810, 0x28042804, 0x28042804, 0x28042804, 0x28042804, 0x20102ffc, 0x00003ff0, // RICON_FILE_COPY - 0x00000000, 0x701c0000, 0x079c1e14, 0x55a000f0, 0x079c00f0, 0x701c1e14, 0x00000000, 0x00000000, // RICON_FILE_CUT - 0x01c00000, 0x13e41bec, 0x3f841004, 0x204420c4, 0x20442044, 0x20442044, 0x207c2044, 0x00003fc0, // RICON_FILE_PASTE - 0x00000000, 0x3aa00fe0, 0x2abc2aa0, 0x2aa42aa4, 0x20042aa4, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_CURSOR_HAND - 0x00000000, 0x003c000c, 0x030800c8, 0x30100c10, 0x10202020, 0x04400840, 0x01800280, 0x00000000, // RICON_CURSOR_POINTER - 0x00000000, 0x00180000, 0x01f00078, 0x03e007f0, 0x07c003e0, 0x04000e40, 0x00000000, 0x00000000, // RICON_CURSOR_CLASSIC - 0x00000000, 0x04000000, 0x11000a00, 0x04400a80, 0x01100220, 0x00580088, 0x00000038, 0x00000000, // RICON_PENCIL - 0x04000000, 0x15000a00, 0x50402880, 0x14102820, 0x05040a08, 0x015c028c, 0x007c00bc, 0x00000000, // RICON_PENCIL_BIG - 0x01c00000, 0x01400140, 0x01400140, 0x0ff80140, 0x0ff80808, 0x0aa80808, 0x0aa80aa8, 0x00000ff8, // RICON_BRUSH_CLASSIC - 0x1ffc0000, 0x5ffc7ffe, 0x40004000, 0x00807f80, 0x01c001c0, 0x01c001c0, 0x01c001c0, 0x00000080, // RICON_BRUSH_PAINTER - 0x00000000, 0x00800000, 0x01c00080, 0x03e001c0, 0x07f003e0, 0x036006f0, 0x000001c0, 0x00000000, // RICON_WATER_DROP - 0x00000000, 0x3e003800, 0x1f803f80, 0x0c201e40, 0x02080c10, 0x00840104, 0x00380044, 0x00000000, // RICON_COLOR_PICKER - 0x00000000, 0x07800300, 0x1fe00fc0, 0x3f883fd0, 0x0e021f04, 0x02040402, 0x00f00108, 0x00000000, // RICON_RUBBER - 0x00c00000, 0x02800140, 0x08200440, 0x20081010, 0x2ffe3004, 0x03f807fc, 0x00e001f0, 0x00000040, // RICON_COLOR_BUCKET - 0x00000000, 0x21843ffc, 0x01800180, 0x01800180, 0x01800180, 0x01800180, 0x03c00180, 0x00000000, // RICON_TEXT_T - 0x00800000, 0x01400180, 0x06200340, 0x0c100620, 0x1ff80c10, 0x380c1808, 0x70067004, 0x0000f80f, // RICON_TEXT_A - 0x78000000, 0x50004000, 0x00004800, 0x03c003c0, 0x03c003c0, 0x00100000, 0x0002000a, 0x0000000e, // RICON_SCALE - 0x75560000, 0x5e004002, 0x54001002, 0x41001202, 0x408200fe, 0x40820082, 0x40820082, 0x00006afe, // RICON_RESIZE - 0x00000000, 0x3f003f00, 0x3f003f00, 0x3f003f00, 0x00400080, 0x001c0020, 0x001c001c, 0x00000000, // RICON_FILTER_POINT - 0x6d800000, 0x00004080, 0x40804080, 0x40800000, 0x00406d80, 0x001c0020, 0x001c001c, 0x00000000, // RICON_FILTER_BILINEAR - 0x40080000, 0x1ffe2008, 0x14081008, 0x11081208, 0x10481088, 0x10081028, 0x10047ff8, 0x00001002, // RICON_CROP - 0x00100000, 0x3ffc0010, 0x2ab03550, 0x22b02550, 0x20b02150, 0x20302050, 0x2000fff0, 0x00002000, // RICON_CROP_ALPHA - 0x40000000, 0x1ff82000, 0x04082808, 0x01082208, 0x00482088, 0x00182028, 0x35542008, 0x00000002, // RICON_SQUARE_TOGGLE - 0x00000000, 0x02800280, 0x06c006c0, 0x0ea00ee0, 0x1e901eb0, 0x3e883e98, 0x7efc7e8c, 0x00000000, // RICON_SIMMETRY - 0x01000000, 0x05600100, 0x1d480d50, 0x7d423d44, 0x3d447d42, 0x0d501d48, 0x01000560, 0x00000100, // RICON_SIMMETRY_HORIZONTAL - 0x01800000, 0x04200240, 0x10080810, 0x00001ff8, 0x00007ffe, 0x0ff01ff8, 0x03c007e0, 0x00000180, // RICON_SIMMETRY_VERTICAL - 0x00000000, 0x010800f0, 0x02040204, 0x02040204, 0x07f00308, 0x1c000e00, 0x30003800, 0x00000000, // RICON_LENS - 0x00000000, 0x061803f0, 0x08240c0c, 0x08040814, 0x0c0c0804, 0x23f01618, 0x18002400, 0x00000000, // RICON_LENS_BIG - 0x00000000, 0x00000000, 0x1c7007c0, 0x638e3398, 0x1c703398, 0x000007c0, 0x00000000, 0x00000000, // RICON_EYE_ON - 0x00000000, 0x10002000, 0x04700fc0, 0x610e3218, 0x1c703098, 0x001007a0, 0x00000008, 0x00000000, // RICON_EYE_OFF - 0x00000000, 0x00007ffc, 0x40047ffc, 0x10102008, 0x04400820, 0x02800280, 0x02800280, 0x00000100, // RICON_FILTER_TOP - 0x00000000, 0x40027ffe, 0x10082004, 0x04200810, 0x02400240, 0x02400240, 0x01400240, 0x000000c0, // RICON_FILTER - 0x00800000, 0x00800080, 0x00000080, 0x3c9e0000, 0x00000000, 0x00800080, 0x00800080, 0x00000000, // RICON_TARGET_POINT - 0x00800000, 0x00800080, 0x00800080, 0x3f7e01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RICON_TARGET_SMALL - 0x00800000, 0x00800080, 0x03e00080, 0x3e3e0220, 0x03e00220, 0x00800080, 0x00800080, 0x00000000, // RICON_TARGET_BIG - 0x01000000, 0x04400280, 0x01000100, 0x43842008, 0x43849ab2, 0x01002008, 0x04400100, 0x01000280, // RICON_TARGET_MOVE - 0x01000000, 0x04400280, 0x01000100, 0x41042108, 0x41049ff2, 0x01002108, 0x04400100, 0x01000280, // RICON_CURSOR_MOVE - 0x781e0000, 0x500a4002, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x4002500a, 0x0000781e, // RICON_CURSOR_SCALE - 0x00000000, 0x20003c00, 0x24002800, 0x01000200, 0x00400080, 0x00140024, 0x003c0004, 0x00000000, // RICON_CURSOR_SCALE_RIGHT - 0x00000000, 0x0004003c, 0x00240014, 0x00800040, 0x02000100, 0x28002400, 0x3c002000, 0x00000000, // RICON_CURSOR_SCALE_LEFT - 0x00000000, 0x00100020, 0x10101fc8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RICON_UNDO - 0x00000000, 0x08000400, 0x080813f8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RICON_REDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3f902020, 0x00400020, 0x00000000, // RICON_REREDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3fc82010, 0x00200010, 0x00000000, // RICON_MUTATE - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18101020, 0x00100fc8, 0x00000020, // RICON_ROTATE - 0x00000000, 0x04000200, 0x240429fc, 0x20042204, 0x20442004, 0x3f942024, 0x00400020, 0x00000000, // RICON_REPEAT - 0x00000000, 0x20001000, 0x22104c0e, 0x00801120, 0x11200040, 0x4c0e2210, 0x10002000, 0x00000000, // RICON_SHUFFLE - 0x7ffe0000, 0x50024002, 0x44024802, 0x41024202, 0x40424082, 0x40124022, 0x4002400a, 0x00007ffe, // RICON_EMPTYBOX - 0x00800000, 0x03e00080, 0x08080490, 0x3c9e0808, 0x08080808, 0x03e00490, 0x00800080, 0x00000000, // RICON_TARGET - 0x00800000, 0x00800080, 0x00800080, 0x3ffe01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RICON_TARGET_SMALL_FILL - 0x00800000, 0x00800080, 0x03e00080, 0x3ffe03e0, 0x03e003e0, 0x00800080, 0x00800080, 0x00000000, // RICON_TARGET_BIG_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x638c2008, 0x638cfbbe, 0x01002008, 0x07c00100, 0x01000380, // RICON_TARGET_MOVE_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x610c2108, 0x610cfffe, 0x01002108, 0x07c00100, 0x01000380, // RICON_CURSOR_MOVE_FILL - 0x781e0000, 0x6006700e, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x700e6006, 0x0000781e, // RICON_CURSOR_SCALE_FILL - 0x00000000, 0x38003c00, 0x24003000, 0x01000200, 0x00400080, 0x000c0024, 0x003c001c, 0x00000000, // RICON_CURSOR_SCALE_RIGHT - 0x00000000, 0x001c003c, 0x0024000c, 0x00800040, 0x02000100, 0x30002400, 0x3c003800, 0x00000000, // RICON_CURSOR_SCALE_LEFT - 0x00000000, 0x00300020, 0x10301ff8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RICON_UNDO_FILL - 0x00000000, 0x0c000400, 0x0c081ff8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RICON_REDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3ff02060, 0x00400060, 0x00000000, // RICON_REREDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3ff82030, 0x00200030, 0x00000000, // RICON_MUTATE_FILL - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18301020, 0x00300ff8, 0x00000020, // RICON_ROTATE_FILL - 0x00000000, 0x06000200, 0x26042ffc, 0x20042204, 0x20442004, 0x3ff42064, 0x00400060, 0x00000000, // RICON_REPEAT_FILL - 0x00000000, 0x30001000, 0x32107c0e, 0x00801120, 0x11200040, 0x7c0e3210, 0x10003000, 0x00000000, // RICON_SHUFFLE_FILL - 0x00000000, 0x30043ffc, 0x24042804, 0x21042204, 0x20442084, 0x20142024, 0x3ffc200c, 0x00000000, // RICON_EMPTYBOX_SMALL - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX - 0x00000000, 0x23c43ffc, 0x23c423c4, 0x200423c4, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_TOP - 0x00000000, 0x3e043ffc, 0x3e043e04, 0x20043e04, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_TOP_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x3e043e04, 0x3e043e04, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x3e042004, 0x3e043e04, 0x3ffc3e04, 0x00000000, // RICON_BOX_BOTTOM_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x23c42004, 0x23c423c4, 0x3ffc23c4, 0x00000000, // RICON_BOX_BOTTOM - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x207c2004, 0x207c207c, 0x3ffc207c, 0x00000000, // RICON_BOX_BOTTOM_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x207c207c, 0x207c207c, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_LEFT - 0x00000000, 0x207c3ffc, 0x207c207c, 0x2004207c, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_TOP_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x23c423c4, 0x23c423c4, 0x20042004, 0x3ffc2004, 0x00000000, // RICON_BOX_CIRCLE_MASK - 0x7ffe0000, 0x40024002, 0x47e24182, 0x4ff247e2, 0x47e24ff2, 0x418247e2, 0x40024002, 0x00007ffe, // RICON_BOX_CENTER - 0x7fff0000, 0x40014001, 0x40014001, 0x49555ddd, 0x4945495d, 0x400149c5, 0x40014001, 0x00007fff, // RICON_POT - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x404e40ce, 0x48125432, 0x4006540e, 0x00007ffe, // RICON_ALPHA_MULTIPLY - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x5c4e40ce, 0x44124432, 0x40065c0e, 0x00007ffe, // RICON_ALPHA_CLEAR - 0x7ffe0000, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x00007ffe, // RICON_DITHERING - 0x07fe0000, 0x1ffa0002, 0x7fea000a, 0x402a402a, 0x5b2a512a, 0x5128552a, 0x40205128, 0x00007fe0, // RICON_MIPMAPS - 0x00000000, 0x1ff80000, 0x12481248, 0x12481ff8, 0x1ff81248, 0x12481248, 0x00001ff8, 0x00000000, // RICON_BOX_GRID - 0x12480000, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x00001248, // RICON_GRID - 0x00000000, 0x1c380000, 0x1c3817e8, 0x08100810, 0x08100810, 0x17e81c38, 0x00001c38, 0x00000000, // RICON_BOX_CORNERS_SMALL - 0x700e0000, 0x700e5ffa, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x5ffa700e, 0x0000700e, // RICON_BOX_CORNERS_BIG - 0x3f7e0000, 0x21422142, 0x21422142, 0x00003f7e, 0x21423f7e, 0x21422142, 0x3f7e2142, 0x00000000, // RICON_FOUR_BOXES - 0x00000000, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x00000000, // RICON_GRID_FILL - 0x7ffe0000, 0x7ffe7ffe, 0x77fe7000, 0x77fe77fe, 0x777e7700, 0x777e777e, 0x777e777e, 0x0000777e, // RICON_BOX_MULTISIZE - 0x781e0000, 0x40024002, 0x00004002, 0x01800000, 0x00000180, 0x40020000, 0x40024002, 0x0000781e, // RICON_ZOOM_SMALL - 0x781e0000, 0x40024002, 0x00004002, 0x03c003c0, 0x03c003c0, 0x40020000, 0x40024002, 0x0000781e, // RICON_ZOOM_MEDIUM - 0x781e0000, 0x40024002, 0x07e04002, 0x07e007e0, 0x07e007e0, 0x400207e0, 0x40024002, 0x0000781e, // RICON_ZOOM_BIG - 0x781e0000, 0x5ffa4002, 0x1ff85ffa, 0x1ff81ff8, 0x1ff81ff8, 0x5ffa1ff8, 0x40025ffa, 0x0000781e, // RICON_ZOOM_ALL - 0x00000000, 0x2004381c, 0x00002004, 0x00000000, 0x00000000, 0x20040000, 0x381c2004, 0x00000000, // RICON_ZOOM_CENTER - 0x00000000, 0x1db80000, 0x10081008, 0x10080000, 0x00001008, 0x10081008, 0x00001db8, 0x00000000, // RICON_BOX_DOTS_SMALL - 0x35560000, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x35562002, 0x00000000, // RICON_BOX_DOTS_BIG - 0x7ffe0000, 0x40024002, 0x48124ff2, 0x49924812, 0x48124992, 0x4ff24812, 0x40024002, 0x00007ffe, // RICON_BOX_CONCENTRIC - 0x00000000, 0x10841ffc, 0x10841084, 0x1ffc1084, 0x10841084, 0x10841084, 0x00001ffc, 0x00000000, // RICON_BOX_GRID_BIG - 0x00000000, 0x00000000, 0x10000000, 0x04000800, 0x01040200, 0x00500088, 0x00000020, 0x00000000, // RICON_OK_TICK - 0x00000000, 0x10080000, 0x04200810, 0x01800240, 0x02400180, 0x08100420, 0x00001008, 0x00000000, // RICON_CROSS - 0x00000000, 0x02000000, 0x00800100, 0x00200040, 0x00200010, 0x00800040, 0x02000100, 0x00000000, // RICON_ARROW_LEFT - 0x00000000, 0x00400000, 0x01000080, 0x04000200, 0x04000800, 0x01000200, 0x00400080, 0x00000000, // RICON_ARROW_RIGHT - 0x00000000, 0x00000000, 0x00000000, 0x08081004, 0x02200410, 0x00800140, 0x00000000, 0x00000000, // RICON_ARROW_BOTTOM - 0x00000000, 0x00000000, 0x01400080, 0x04100220, 0x10040808, 0x00000000, 0x00000000, 0x00000000, // RICON_ARROW_TOP - 0x00000000, 0x02000000, 0x03800300, 0x03e003c0, 0x03e003f0, 0x038003c0, 0x02000300, 0x00000000, // RICON_ARROW_LEFT_FILL - 0x00000000, 0x00400000, 0x01c000c0, 0x07c003c0, 0x07c00fc0, 0x01c003c0, 0x004000c0, 0x00000000, // RICON_ARROW_RIGHT_FILL - 0x00000000, 0x00000000, 0x00000000, 0x0ff81ffc, 0x03e007f0, 0x008001c0, 0x00000000, 0x00000000, // RICON_ARROW_BOTTOM_FILL - 0x00000000, 0x00000000, 0x01c00080, 0x07f003e0, 0x1ffc0ff8, 0x00000000, 0x00000000, 0x00000000, // RICON_ARROW_TOP_FILL - 0x00000000, 0x18a008c0, 0x32881290, 0x24822686, 0x26862482, 0x12903288, 0x08c018a0, 0x00000000, // RICON_AUDIO - 0x00000000, 0x04800780, 0x004000c0, 0x662000f0, 0x08103c30, 0x130a0e18, 0x0000318e, 0x00000000, // RICON_FX - 0x00000000, 0x00800000, 0x08880888, 0x2aaa0a8a, 0x0a8a2aaa, 0x08880888, 0x00000080, 0x00000000, // RICON_WAVE - 0x00000000, 0x00600000, 0x01080090, 0x02040108, 0x42044204, 0x24022402, 0x00001800, 0x00000000, // RICON_WAVE_SINUS - 0x00000000, 0x07f80000, 0x04080408, 0x04080408, 0x04080408, 0x7c0e0408, 0x00000000, 0x00000000, // RICON_WAVE_SQUARE - 0x00000000, 0x00000000, 0x00a00040, 0x22084110, 0x08021404, 0x00000000, 0x00000000, 0x00000000, // RICON_WAVE_TRIANGULAR - 0x00000000, 0x00000000, 0x04200000, 0x01800240, 0x02400180, 0x00000420, 0x00000000, 0x00000000, // RICON_CROSS_SMALL - 0x00000000, 0x18380000, 0x12281428, 0x10a81128, 0x112810a8, 0x14281228, 0x00001838, 0x00000000, // RICON_PLAYER_PREVIOUS - 0x00000000, 0x18000000, 0x11801600, 0x10181060, 0x10601018, 0x16001180, 0x00001800, 0x00000000, // RICON_PLAYER_PLAY_BACK - 0x00000000, 0x00180000, 0x01880068, 0x18080608, 0x06081808, 0x00680188, 0x00000018, 0x00000000, // RICON_PLAYER_PLAY - 0x00000000, 0x1e780000, 0x12481248, 0x12481248, 0x12481248, 0x12481248, 0x00001e78, 0x00000000, // RICON_PLAYER_PAUSE - 0x00000000, 0x1ff80000, 0x10081008, 0x10081008, 0x10081008, 0x10081008, 0x00001ff8, 0x00000000, // RICON_PLAYER_STOP - 0x00000000, 0x1c180000, 0x14481428, 0x15081488, 0x14881508, 0x14281448, 0x00001c18, 0x00000000, // RICON_PLAYER_NEXT - 0x00000000, 0x03c00000, 0x08100420, 0x10081008, 0x10081008, 0x04200810, 0x000003c0, 0x00000000, // RICON_PLAYER_RECORD - 0x00000000, 0x0c3007e0, 0x13c81818, 0x14281668, 0x14281428, 0x1c381c38, 0x08102244, 0x00000000, // RICON_MAGNET - 0x07c00000, 0x08200820, 0x3ff80820, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RICON_LOCK_CLOSE - 0x07c00000, 0x08000800, 0x3ff80800, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RICON_LOCK_OPEN - 0x01c00000, 0x0c180770, 0x3086188c, 0x60832082, 0x60034781, 0x30062002, 0x0c18180c, 0x01c00770, // RICON_CLOCK - 0x0a200000, 0x1b201b20, 0x04200e20, 0x04200420, 0x04700420, 0x0e700e70, 0x0e700e70, 0x04200e70, // RICON_TOOLS - 0x01800000, 0x3bdc318c, 0x0ff01ff8, 0x7c3e1e78, 0x1e787c3e, 0x1ff80ff0, 0x318c3bdc, 0x00000180, // RICON_GEAR - 0x01800000, 0x3ffc318c, 0x1c381ff8, 0x781e1818, 0x1818781e, 0x1ff81c38, 0x318c3ffc, 0x00000180, // RICON_GEAR_BIG - 0x00000000, 0x08080ff8, 0x08081ffc, 0x0aa80aa8, 0x0aa80aa8, 0x0aa80aa8, 0x08080aa8, 0x00000ff8, // RICON_BIN - 0x00000000, 0x00000000, 0x20043ffc, 0x08043f84, 0x04040f84, 0x04040784, 0x000007fc, 0x00000000, // RICON_HAND_POINTER - 0x00000000, 0x24400400, 0x00001480, 0x6efe0e00, 0x00000e00, 0x24401480, 0x00000400, 0x00000000, // RICON_LASER - 0x00000000, 0x03c00000, 0x08300460, 0x11181118, 0x11181118, 0x04600830, 0x000003c0, 0x00000000, // RICON_COIN - 0x00000000, 0x10880080, 0x06c00810, 0x366c07e0, 0x07e00240, 0x00001768, 0x04200240, 0x00000000, // RICON_EXPLOSION - 0x00000000, 0x3d280000, 0x2528252c, 0x3d282528, 0x05280528, 0x05e80528, 0x00000000, 0x00000000, // RICON_1UP - 0x01800000, 0x03c003c0, 0x018003c0, 0x0ff007e0, 0x0bd00bd0, 0x0a500bd0, 0x02400240, 0x02400240, // RICON_PLAYER - 0x01800000, 0x03c003c0, 0x118013c0, 0x03c81ff8, 0x07c003c8, 0x04400440, 0x0c080478, 0x00000000, // RICON_PLAYER_JUMP - 0x3ff80000, 0x30183ff8, 0x30183018, 0x3ff83ff8, 0x03000300, 0x03c003c0, 0x03e00300, 0x000003e0, // RICON_KEY - 0x3ff80000, 0x3ff83ff8, 0x33983ff8, 0x3ff83398, 0x3ff83ff8, 0x00000540, 0x0fe00aa0, 0x00000fe0, // RICON_DEMON - 0x00000000, 0x0ff00000, 0x20041008, 0x25442004, 0x10082004, 0x06000bf0, 0x00000300, 0x00000000, // RICON_TEXT_POPUP - 0x00000000, 0x11440000, 0x07f00be8, 0x1c1c0e38, 0x1c1c0c18, 0x07f00e38, 0x11440be8, 0x00000000, // RICON_GEAR_EX - 0x00000000, 0x20080000, 0x0c601010, 0x07c00fe0, 0x07c007c0, 0x0c600fe0, 0x20081010, 0x00000000, // RICON_CRACK - 0x00000000, 0x20080000, 0x0c601010, 0x04400fe0, 0x04405554, 0x0c600fe0, 0x20081010, 0x00000000, // RICON_CRACK_POINTS - 0x00000000, 0x00800080, 0x01c001c0, 0x1ffc3ffe, 0x03e007f0, 0x07f003e0, 0x0c180770, 0x00000808, // RICON_STAR - 0x0ff00000, 0x08180810, 0x08100818, 0x0a100810, 0x08180810, 0x08100818, 0x08100810, 0x00001ff8, // RICON_DOOR - 0x0ff00000, 0x08100810, 0x08100810, 0x10100010, 0x4f902010, 0x10102010, 0x08100010, 0x00000ff0, // RICON_EXIT - 0x00040000, 0x001f000e, 0x0ef40004, 0x12f41284, 0x0ef41214, 0x10040004, 0x7ffc3004, 0x10003000, // RICON_MODE_2D - 0x78040000, 0x501f600e, 0x0ef44004, 0x12f41284, 0x0ef41284, 0x10140004, 0x7ffc300c, 0x10003000, // RICON_MODE_3D - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RICON_CUBE - 0x7fe00000, 0x5ff87ff0, 0x47fe4ffc, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RICON_CUBE_FACE_TOP - 0x7fe00000, 0x50386030, 0x47fe483c, 0x443e443e, 0x443e443e, 0x241e75fe, 0x0c06140e, 0x000007fe, // RICON_CUBE_FACE_LEFT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x47fe47fe, 0x47fe47fe, 0x27fe77fe, 0x0ffe17fe, 0x000007fe, // RICON_CUBE_FACE_FRONT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x3ff27fe2, 0x0ffe1ffa, 0x000007fe, // RICON_CUBE_FACE_BOTTOM - 0x7fe00000, 0x70286030, 0x7ffe7804, 0x7c227c02, 0x7c227c22, 0x3c127de2, 0x0c061c0a, 0x000007fe, // RICON_CUBE_FACE_RIGHT - 0x7fe00000, 0x7fe87ff0, 0x7ffe7fe4, 0x7fe27fe2, 0x7fe27fe2, 0x24127fe2, 0x0c06140a, 0x000007fe, // RICON_CUBE_FACE_BACK - 0x00000000, 0x2a0233fe, 0x22022602, 0x22022202, 0x2a022602, 0x00a033fe, 0x02080110, 0x00000000, // RICON_CAMERA - 0x00000000, 0x200c3ffc, 0x000c000c, 0x3ffc000c, 0x30003000, 0x30003000, 0x3ffc3004, 0x00000000, // RICON_SPECIAL - 0x00000000, 0x0022003e, 0x012201e2, 0x0100013e, 0x01000100, 0x79000100, 0x4f004900, 0x00007800, // RICON_LINK_NET - 0x00000000, 0x44007c00, 0x45004600, 0x00627cbe, 0x00620022, 0x45007cbe, 0x44004600, 0x00007c00, // RICON_LINK_BOXES - 0x00000000, 0x0044007c, 0x0010007c, 0x3f100010, 0x3f1021f0, 0x3f100010, 0x3f0021f0, 0x00000000, // RICON_LINK_MULTI - 0x00000000, 0x0044007c, 0x00440044, 0x0010007c, 0x00100010, 0x44107c10, 0x440047f0, 0x00007c00, // RICON_LINK - 0x00000000, 0x0044007c, 0x00440044, 0x0000007c, 0x00000010, 0x44007c10, 0x44004550, 0x00007c00, // RICON_LINK_BROKE - 0x02a00000, 0x22a43ffc, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RICON_TEXT_NOTES - 0x3ffc0000, 0x20042004, 0x245e27c4, 0x27c42444, 0x2004201e, 0x201e2004, 0x20042004, 0x00003ffc, // RICON_NOTEBOOK - 0x00000000, 0x07e00000, 0x04200420, 0x24243ffc, 0x24242424, 0x24242424, 0x3ffc2424, 0x00000000, // RICON_SUITCASE - 0x00000000, 0x0fe00000, 0x08200820, 0x40047ffc, 0x7ffc5554, 0x40045554, 0x7ffc4004, 0x00000000, // RICON_SUITCASE_ZIP - 0x00000000, 0x20043ffc, 0x3ffc2004, 0x13c81008, 0x100813c8, 0x10081008, 0x1ff81008, 0x00000000, // RICON_MAILBOX - 0x00000000, 0x40027ffe, 0x5ffa5ffa, 0x5ffa5ffa, 0x40025ffa, 0x03c07ffe, 0x1ff81ff8, 0x00000000, // RICON_MONITOR - 0x0ff00000, 0x6bfe7ffe, 0x7ffe7ffe, 0x68167ffe, 0x08106816, 0x08100810, 0x0ff00810, 0x00000000, // RICON_PRINTER - 0x3ff80000, 0xfffe2008, 0x870a8002, 0x904a888a, 0x904a904a, 0x870a888a, 0xfffe8002, 0x00000000, // RICON_PHOTO_CAMERA - 0x0fc00000, 0xfcfe0cd8, 0x8002fffe, 0x84428382, 0x84428442, 0x80028382, 0xfffe8002, 0x00000000, // RICON_PHOTO_CAMERA_FLASH - 0x00000000, 0x02400180, 0x08100420, 0x20041008, 0x23c42004, 0x22442244, 0x3ffc2244, 0x00000000, // RICON_HOUSE - 0x00000000, 0x1c700000, 0x3ff83ef8, 0x3ff83ff8, 0x0fe01ff0, 0x038007c0, 0x00000100, 0x00000000, // RICON_HEART - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0xe000c000, // RICON_CORNER - 0x00000000, 0x14001c00, 0x15c01400, 0x15401540, 0x155c1540, 0x15541554, 0x1ddc1554, 0x00000000, // RICON_VERTICAL_BARS - 0x00000000, 0x03000300, 0x1b001b00, 0x1b601b60, 0x1b6c1b60, 0x1b6c1b6c, 0x1b6c1b6c, 0x00000000, // RICON_VERTICAL_BARS_FILL - 0x00000000, 0x00000000, 0x403e7ffe, 0x7ffe403e, 0x7ffe0000, 0x43fe43fe, 0x00007ffe, 0x00000000, // RICON_LIFE_BARS - 0x7ffc0000, 0x43844004, 0x43844284, 0x43844004, 0x42844284, 0x42844284, 0x40044384, 0x00007ffc, // RICON_INFO - 0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // RICON_CROSSLINE - 0x00000000, 0x1ff01ff0, 0x18301830, 0x1f001830, 0x03001f00, 0x00000300, 0x03000300, 0x00000000, // RICON_HELP - 0x3ff00000, 0x2abc3550, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x00003ffc, // RICON_FILETYPE_ALPHA - 0x3ff00000, 0x201c2010, 0x22442184, 0x28142424, 0x29942814, 0x2ff42994, 0x20042004, 0x00003ffc, // RICON_FILETYPE_HOME - 0x07fe0000, 0x04020402, 0x7fe20402, 0x44224422, 0x44224422, 0x402047fe, 0x40204020, 0x00007fe0, // RICON_LAYERS_VISIBLE - 0x07fe0000, 0x04020402, 0x7c020402, 0x44024402, 0x44024402, 0x402047fe, 0x40204020, 0x00007fe0, // RICON_LAYERS - 0x00000000, 0x40027ffe, 0x7ffe4002, 0x40024002, 0x40024002, 0x40024002, 0x7ffe4002, 0x00000000, // RICON_WINDOW - 0x09100000, 0x09f00910, 0x09100910, 0x00000910, 0x24a2779e, 0x27a224a2, 0x709e20a2, 0x00000000, // RICON_HIDPI - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_200 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_201 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_202 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_203 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_204 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_205 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_206 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_207 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_208 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_209 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_210 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_211 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_212 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_213 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_214 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_215 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_216 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_217 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_218 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_219 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_220 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_221 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_222 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_223 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_224 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_225 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_226 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_227 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_228 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_229 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_230 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_231 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_232 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_233 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_234 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_235 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_236 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_237 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_238 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_239 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_240 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_241 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_242 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_243 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_244 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_245 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_246 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_247 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_248 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_249 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_250 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_251 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_252 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_253 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_254 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_255 -}; -#endif // RICONS_IMPLEMENTATION diff --git a/raylib-sys/rlgl.h b/raylib-sys/rlgl.h deleted file mode 100644 index 917b7921..00000000 --- a/raylib-sys/rlgl.h +++ /dev/null @@ -1,4069 +0,0 @@ -/********************************************************************************************** -* -* rlgl v3.7 - raylib OpenGL abstraction layer -* -* rlgl is a wrapper for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) to -* pseudo-OpenGL 1.1 style functions (rlVertex, rlTranslate, rlRotate...). -* -* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal -* VBO buffers (and VAOs if available). It requires calling 3 functions: -* rlglInit() - Initialize internal buffers and auxiliary resources -* rlglClose() - De-initialize internal buffers data and other auxiliar resources -* -* CONFIGURATION: -* -* #define GRAPHICS_API_OPENGL_11 -* #define GRAPHICS_API_OPENGL_21 -* #define GRAPHICS_API_OPENGL_33 -* #define GRAPHICS_API_OPENGL_ES2 -* Use selected OpenGL graphics backend, should be supported by platform -* Those preprocessor defines are only used on rlgl module, if OpenGL version is -* required by any other module, use rlGetVersion() to check it -* -* #define RLGL_IMPLEMENTATION -* Generates the implementation of the library into the included file. -* If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. -* -* #define RLGL_STANDALONE -* Use rlgl as standalone library (no raylib dependency) -* -* #define SUPPORT_GL_DETAILS_INFO -* Show OpenGL extensions and capabilities detailed logs on init -* -* DEPENDENCIES: -* raymath - 3D math functionality (Vector3, Matrix, Quaternion) -* GLAD - OpenGL extensions loading (OpenGL 3.3 Core only) -* -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2014-2021 Ramon Santamaria (@raysan5) -* -* 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. -* -**********************************************************************************************/ - -#ifndef RLGL_H -#define RLGL_H - -#if defined(RLGL_STANDALONE) - #define RAYMATH_STANDALONE - #define RAYMATH_HEADER_ONLY - - #define RLAPI // We are building or using rlgl as a static library (or Linux shared library) - - #if defined(_WIN32) - #if defined(BUILD_LIBTYPE_SHARED) - #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll) - #elif defined(USE_LIBTYPE_SHARED) - #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) - #endif - #endif - - // Support TRACELOG macros - #if !defined(TRACELOG) - #define TRACELOG(level, ...) (void)0 - #define TRACELOGD(...) (void)0 - #endif - - // Allow custom memory allocators - #ifndef RL_MALLOC - #define RL_MALLOC(sz) malloc(sz) - #endif - #ifndef RL_CALLOC - #define RL_CALLOC(n,sz) calloc(n,sz) - #endif - #ifndef RL_REALLOC - #define RL_REALLOC(n,sz) realloc(n,sz) - #endif - #ifndef RL_FREE - #define RL_FREE(p) free(p) - #endif -#else - #include "raylib.h" // Required for: Shader, Texture2D -#endif - -#include "raymath.h" // Required for: Vector3, Matrix - -// Security check in case no GRAPHICS_API_OPENGL_* defined -#if !defined(GRAPHICS_API_OPENGL_11) && \ - !defined(GRAPHICS_API_OPENGL_21) && \ - !defined(GRAPHICS_API_OPENGL_33) && \ - !defined(GRAPHICS_API_OPENGL_ES2) - #define GRAPHICS_API_OPENGL_33 -#endif - -// Security check in case multiple GRAPHICS_API_OPENGL_* defined -#if defined(GRAPHICS_API_OPENGL_11) - #if defined(GRAPHICS_API_OPENGL_21) - #undef GRAPHICS_API_OPENGL_21 - #endif - #if defined(GRAPHICS_API_OPENGL_33) - #undef GRAPHICS_API_OPENGL_33 - #endif - #if defined(GRAPHICS_API_OPENGL_ES2) - #undef GRAPHICS_API_OPENGL_ES2 - #endif -#endif - -// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality -// WARNING: Specific parts are checked with #if defines -#if defined(GRAPHICS_API_OPENGL_21) - #define GRAPHICS_API_OPENGL_33 -#endif - -#define SUPPORT_RENDER_TEXTURES_HINT - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -// Default internal render batch limits -#ifndef DEFAULT_BATCH_BUFFER_ELEMENTS - #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - // This is the maximum amount of elements (quads) per batch - // NOTE: Be careful with text, every letter maps to a quad - #define DEFAULT_BATCH_BUFFER_ELEMENTS 8192 - #endif - #if defined(GRAPHICS_API_OPENGL_ES2) - // We reduce memory sizes for embedded systems (RPI and HTML5) - // NOTE: On HTML5 (emscripten) this is allocated on heap, - // by default it's only 16MB!...just take care... - #define DEFAULT_BATCH_BUFFER_ELEMENTS 2048 - #endif -#endif -#ifndef DEFAULT_BATCH_BUFFERS - #define DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering) -#endif -#ifndef DEFAULT_BATCH_DRAWCALLS - #define DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) -#endif -#ifndef MAX_BATCH_ACTIVE_TEXTURES - #define MAX_BATCH_ACTIVE_TEXTURES 4 // Maximum number of additional textures that can be activated on batch drawing (SetShaderValueTexture()) -#endif - -// Internal Matrix stack -#ifndef MAX_MATRIX_STACK_SIZE - #define MAX_MATRIX_STACK_SIZE 32 // Maximum size of Matrix stack -#endif - -// Vertex buffers id limit -#ifndef MAX_MESH_VERTEX_BUFFERS - #define MAX_MESH_VERTEX_BUFFERS 7 // Maximum vertex buffers (VBO) per mesh -#endif - -// Shader and material limits -#ifndef MAX_SHADER_LOCATIONS - #define MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported -#endif -#ifndef MAX_MATERIAL_MAPS - #define MAX_MATERIAL_MAPS 12 // Maximum number of shader maps supported -#endif - -// Projection matrix culling -#ifndef RL_CULL_DISTANCE_NEAR - #define RL_CULL_DISTANCE_NEAR 0.01 // Default near cull distance -#endif -#ifndef RL_CULL_DISTANCE_FAR - #define RL_CULL_DISTANCE_FAR 1000.0 // Default far cull distance -#endif - -// Texture parameters (equivalent to OpenGL defines) -#define RL_TEXTURE_WRAP_S 0x2802 // GL_TEXTURE_WRAP_S -#define RL_TEXTURE_WRAP_T 0x2803 // GL_TEXTURE_WRAP_T -#define RL_TEXTURE_MAG_FILTER 0x2800 // GL_TEXTURE_MAG_FILTER -#define RL_TEXTURE_MIN_FILTER 0x2801 // GL_TEXTURE_MIN_FILTER - -#define RL_TEXTURE_FILTER_NEAREST 0x2600 // GL_NEAREST -#define RL_TEXTURE_FILTER_LINEAR 0x2601 // GL_LINEAR -#define RL_TEXTURE_FILTER_MIP_NEAREST 0x2700 // GL_NEAREST_MIPMAP_NEAREST -#define RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR 0x2702 // GL_NEAREST_MIPMAP_LINEAR -#define RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x2701 // GL_LINEAR_MIPMAP_NEAREST -#define RL_TEXTURE_FILTER_MIP_LINEAR 0x2703 // GL_LINEAR_MIPMAP_LINEAR -#define RL_TEXTURE_FILTER_ANISOTROPIC 0x3000 // Anisotropic filter (custom identifier) - -#define RL_TEXTURE_WRAP_REPEAT 0x2901 // GL_REPEAT -#define RL_TEXTURE_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE -#define RL_TEXTURE_WRAP_MIRROR_REPEAT 0x8370 // GL_MIRRORED_REPEAT -#define RL_TEXTURE_WRAP_MIRROR_CLAMP 0x8742 // GL_MIRROR_CLAMP_EXT - -// Matrix modes (equivalent to OpenGL) -#define RL_MODELVIEW 0x1700 // GL_MODELVIEW -#define RL_PROJECTION 0x1701 // GL_PROJECTION -#define RL_TEXTURE 0x1702 // GL_TEXTURE - -// Primitive assembly draw modes -#define RL_LINES 0x0001 // GL_LINES -#define RL_TRIANGLES 0x0004 // GL_TRIANGLES -#define RL_QUADS 0x0007 // GL_QUADS - -// GL equivalent data types -#define RL_UNSIGNED_BYTE 0x1401 // GL_UNSIGNED_BYTE -#define RL_FLOAT 0x1406 // GL_FLOAT - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; - -typedef enum { - RL_ATTACHMENT_COLOR_CHANNEL0 = 0, - RL_ATTACHMENT_COLOR_CHANNEL1, - RL_ATTACHMENT_COLOR_CHANNEL2, - RL_ATTACHMENT_COLOR_CHANNEL3, - RL_ATTACHMENT_COLOR_CHANNEL4, - RL_ATTACHMENT_COLOR_CHANNEL5, - RL_ATTACHMENT_COLOR_CHANNEL6, - RL_ATTACHMENT_COLOR_CHANNEL7, - RL_ATTACHMENT_DEPTH = 100, - RL_ATTACHMENT_STENCIL = 200, -} FramebufferAttachType; - -typedef enum { - RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_X, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Y, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y, - RL_ATTACHMENT_CUBEMAP_POSITIVE_Z, - RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z, - RL_ATTACHMENT_TEXTURE2D = 100, - RL_ATTACHMENT_RENDERBUFFER = 200, -} FramebufferAttachTextureType; - -// Dynamic vertex buffers (position + texcoords + colors + indices arrays) -typedef struct VertexBuffer { - int elementsCount; // Number of elements in the buffer (QUADS) - - int vCounter; // Vertex position counter to process (and draw) from full buffer - int tcCounter; // Vertex texcoord counter to process (and draw) from full buffer - int cCounter; // Vertex color counter to process (and draw) from full buffer - - float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - unsigned int *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - unsigned short *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad) -#endif - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data) -} VertexBuffer; - -// Draw call type -// NOTE: Only texture changes register a new draw, other state-change-related elements are not -// used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any -// of those state-change happens (this is done in core module) -typedef struct DrawCall { - int mode; // Drawing mode: LINES, TRIANGLES, QUADS - int vertexCount; // Number of vertex of the draw - int vertexAlignment; // Number of vertex required for index alignment (LINES, TRIANGLES) - //unsigned int vaoId; // Vertex array id to be used on the draw -> Using RLGL.currentBatch->vertexBuffer.vaoId - //unsigned int shaderId; // Shader id to be used on the draw -> Using RLGL.currentShader.id - unsigned int textureId; // Texture id to be used on the draw -> Use to create new draw call if changes - - //Matrix projection; // Projection matrix for this draw -> Using RLGL.projection by default - //Matrix modelview; // Modelview matrix for this draw -> Using RLGL.modelview by default -} DrawCall; - -// RenderBatch type -typedef struct RenderBatch { - int buffersCount; // Number of vertex buffers (multi-buffering support) - int currentBuffer; // Current buffer tracking in case of multi-buffering - VertexBuffer *vertexBuffer; // Dynamic buffer(s) for vertex data - - DrawCall *draws; // Draw calls array, depends on textureId - int drawsCounter; // Draw calls counter - float currentDepth; // Current depth value for next draw -} RenderBatch; - -// Shader attribute data types -typedef enum { - SHADER_ATTRIB_FLOAT = 0, - SHADER_ATTRIB_VEC2, - SHADER_ATTRIB_VEC3, - SHADER_ATTRIB_VEC4 -} ShaderAttributeDataType; - -#if defined(RLGL_STANDALONE) - #ifndef __cplusplus - // Boolean type - typedef enum { false, true } bool; - #endif - - // Color type, RGBA (32bit) - typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; - } Color; - - // Texture type - // NOTE: Data stored in GPU memory - typedef struct Texture2D { - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat) - } Texture2D; - - // Shader type (generic) - typedef struct Shader { - unsigned int id; // Shader program id - int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) - } Shader; - - // TraceLog message types - typedef enum { - LOG_ALL, - LOG_TRACE, - LOG_DEBUG, - LOG_INFO, - LOG_WARNING, - LOG_ERROR, - LOG_FATAL, - LOG_NONE - } TraceLogLevel; - - // Texture formats (support depends on OpenGL version) - typedef enum { - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, - PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp - PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) - PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp - PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) - PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) - PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) - PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp - PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp - } PixelFormat; - - // Texture parameters: filter mode - // NOTE 1: Filtering considers mipmaps if available in the texture - // NOTE 2: Filter is accordingly set for minification and magnification - typedef enum { - TEXTURE_FILTER_POINT = 0, // No filter, just pixel aproximation - TEXTURE_FILTER_BILINEAR, // Linear filtering - TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) - TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x - TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x - TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x - } TextureFilter; - - // Texture parameters: wrap mode - typedef enum { - TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode - TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode - TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode - TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode - } TextureWrap; - - // Color blending modes (pre-defined) - typedef enum { - BLEND_ALPHA = 0, // Blend textures considering alpha (default) - BLEND_ADDITIVE, // Blend textures adding colors - BLEND_MULTIPLIED, // Blend textures multiplying colors - BLEND_ADD_COLORS, // Blend textures adding colors (alternative) - BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) - BLEND_CUSTOM // Belnd textures using custom src/dst factors (use SetBlendModeCustom()) - } BlendMode; - - // Shader location point type - typedef enum { - SHADER_LOC_VERTEX_POSITION = 0, - SHADER_LOC_VERTEX_TEXCOORD01, - SHADER_LOC_VERTEX_TEXCOORD02, - SHADER_LOC_VERTEX_NORMAL, - SHADER_LOC_VERTEX_TANGENT, - SHADER_LOC_VERTEX_COLOR, - SHADER_LOC_MATRIX_MVP, - SHADER_LOC_MATRIX_MODEL, - SHADER_LOC_MATRIX_VIEW, - SHADER_LOC_MATRIX_NORMAL, - SHADER_LOC_MATRIX_PROJECTION, - SHADER_LOC_VECTOR_VIEW, - SHADER_LOC_COLOR_DIFFUSE, - SHADER_LOC_COLOR_SPECULAR, - SHADER_LOC_COLOR_AMBIENT, - SHADER_LOC_MAP_ALBEDO, // SHADER_LOC_MAP_DIFFUSE - SHADER_LOC_MAP_METALNESS, // SHADER_LOC_MAP_SPECULAR - SHADER_LOC_MAP_NORMAL, - SHADER_LOC_MAP_ROUGHNESS, - SHADER_LOC_MAP_OCCLUSION, - SHADER_LOC_MAP_EMISSION, - SHADER_LOC_MAP_HEIGHT, - SHADER_LOC_MAP_CUBEMAP, - SHADER_LOC_MAP_IRRADIANCE, - SHADER_LOC_MAP_PREFILTER, - SHADER_LOC_MAP_BRDF - } ShaderLocationIndex; - - #define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO - #define SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS - - // Shader uniform data types - typedef enum { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2, - SHADER_UNIFORM_VEC3, - SHADER_UNIFORM_VEC4, - SHADER_UNIFORM_INT, - SHADER_UNIFORM_IVEC2, - SHADER_UNIFORM_IVEC3, - SHADER_UNIFORM_IVEC4, - SHADER_UNIFORM_SAMPLER2D - } ShaderUniformDataType; -#endif - -#if defined(__cplusplus) -extern "C" { // Prevents name mangling of functions -#endif - -//------------------------------------------------------------------------------------ -// Functions Declaration - Matrix operations -//------------------------------------------------------------------------------------ -RLAPI void rlMatrixMode(int mode); // Choose the current matrix to be transformed -RLAPI void rlPushMatrix(void); // Push the current matrix to stack -RLAPI void rlPopMatrix(void); // Pop lattest inserted matrix from stack -RLAPI void rlLoadIdentity(void); // Reset current matrix to identity matrix -RLAPI void rlTranslatef(float x, float y, float z); // Multiply the current matrix by a translation matrix -RLAPI void rlRotatef(float angleDeg, float x, float y, float z); // Multiply the current matrix by a rotation matrix -RLAPI void rlScalef(float x, float y, float z); // Multiply the current matrix by a scaling matrix -RLAPI void rlMultMatrixf(float *matf); // Multiply the current matrix by another matrix -RLAPI void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar); -RLAPI void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar); -RLAPI void rlViewport(int x, int y, int width, int height); // Set the viewport area - -//------------------------------------------------------------------------------------ -// Functions Declaration - Vertex level operations -//------------------------------------------------------------------------------------ -RLAPI void rlBegin(int mode); // Initialize drawing mode (how to organize vertex) -RLAPI void rlEnd(void); // Finish vertex providing -RLAPI void rlVertex2i(int x, int y); // Define one vertex (position) - 2 int -RLAPI void rlVertex2f(float x, float y); // Define one vertex (position) - 2 float -RLAPI void rlVertex3f(float x, float y, float z); // Define one vertex (position) - 3 float -RLAPI void rlTexCoord2f(float x, float y); // Define one vertex (texture coordinate) - 2 float -RLAPI void rlNormal3f(float x, float y, float z); // Define one vertex (normal) - 3 float -RLAPI void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Define one vertex (color) - 4 byte -RLAPI void rlColor3f(float x, float y, float z); // Define one vertex (color) - 3 float -RLAPI void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) - 4 float - -//------------------------------------------------------------------------------------ -// Functions Declaration - OpenGL style functions (common to 1.1, 3.3+, ES2) -// NOTE: This functions are used to completely abstract raylib code from OpenGL layer, -// some of them are direct wrappers over OpenGL calls, some others are custom -//------------------------------------------------------------------------------------ - -// Vertex buffers state -RLAPI bool rlEnableVertexArray(unsigned int vaoId); // Enable vertex array (VAO, if supported) -RLAPI void rlDisableVertexArray(void); // Disable vertex array (VAO, if supported) -RLAPI void rlEnableVertexBuffer(unsigned int id); // Enable vertex buffer (VBO) -RLAPI void rlDisableVertexBuffer(void); // Disable vertex buffer (VBO) -RLAPI void rlEnableVertexBufferElement(unsigned int id);// Enable vertex buffer element (VBO element) -RLAPI void rlDisableVertexBufferElement(void); // Disable vertex buffer element (VBO element) -RLAPI void rlEnableVertexAttribute(unsigned int index); // Enable vertex attribute index -RLAPI void rlDisableVertexAttribute(unsigned int index);// Disable vertex attribute index -#if defined(GRAPHICS_API_OPENGL_11) -RLAPI void rlEnableStatePointer(int vertexAttribType, void *buffer); -RLAPI void rlDisableStatePointer(int vertexAttribType); -#endif - -// Textures state -RLAPI void rlActiveTextureSlot(int slot); // Select and active a texture slot -RLAPI void rlEnableTexture(unsigned int id); // Enable texture -RLAPI void rlDisableTexture(void); // Disable texture -RLAPI void rlEnableTextureCubemap(unsigned int id); // Enable texture cubemap -RLAPI void rlDisableTextureCubemap(void); // Disable texture cubemap -RLAPI void rlTextureParameters(unsigned int id, int param, int value); // Set texture parameters (filter, wrap) - -// Shader state -RLAPI void rlEnableShader(unsigned int id); // Enable shader program -RLAPI void rlDisableShader(void); // Disable shader program - -// Framebuffer state -RLAPI void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo) -RLAPI void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer - -// General render state -RLAPI void rlEnableDepthTest(void); // Enable depth test -RLAPI void rlDisableDepthTest(void); // Disable depth test -RLAPI void rlEnableDepthMask(void); // Enable depth write -RLAPI void rlDisableDepthMask(void); // Disable depth write -RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling -RLAPI void rlDisableBackfaceCulling(void); // Disable backface culling -RLAPI void rlEnableScissorTest(void); // Enable scissor test -RLAPI void rlDisableScissorTest(void); // Disable scissor test -RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test -RLAPI void rlEnableWireMode(void); // Enable wire mode -RLAPI void rlDisableWireMode(void); // Disable wire mode -RLAPI void rlSetLineWidth(float width); // Set the line drawing width -RLAPI float rlGetLineWidth(void); // Get the line drawing width -RLAPI void rlEnableSmoothLines(void); // Enable line aliasing -RLAPI void rlDisableSmoothLines(void); // Disable line aliasing -RLAPI void rlEnableStereoRender(void); // Enable stereo rendering -RLAPI void rlDisableStereoRender(void); // Disable stereo rendering -RLAPI bool rlIsStereoRenderEnabled(void); // Check if stereo render is enabled - -RLAPI void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Clear color buffer with color -RLAPI void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth) -RLAPI void rlCheckErrors(void); // Check and log OpenGL error codes -RLAPI void rlSetBlendMode(int mode); // Set blending mode -RLAPI void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); // Set blending mode factor and equation (using OpenGL factors) - -//------------------------------------------------------------------------------------ -// Functions Declaration - rlgl functionality -//------------------------------------------------------------------------------------ -// rlgl initialization functions -RLAPI void rlglInit(int width, int height); // Initialize rlgl (buffers, shaders, textures, states) -RLAPI void rlglClose(void); // De-inititialize rlgl (buffers, shaders, textures) -RLAPI void rlLoadExtensions(void* loader); // Load OpenGL extensions (loader function pointer required) -RLAPI int rlGetVersion(void); // Returns current OpenGL version -RLAPI int rlGetFramebufferWidth(void); // Get default framebuffer width -RLAPI int rlGetFramebufferHeight(void); // Get default framebuffer height - -RLAPI Shader rlGetShaderDefault(void); // Get default shader -RLAPI Texture2D rlGetTextureDefault(void); // Get default texture - -// Render batch management -// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode -// but this render batch API is exposed in case of custom batches are required -RLAPI RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); // Load a render batch system -RLAPI void rlUnloadRenderBatch(RenderBatch batch); // Unload render batch system -RLAPI void rlDrawRenderBatch(RenderBatch *batch); // Draw render batch data (Update->Draw->Reset) -RLAPI void rlSetRenderBatchActive(RenderBatch *batch); // Set the active render batch for rlgl (NULL for default internal) -RLAPI void rlDrawRenderBatchActive(void); // Update and draw internal render batch -RLAPI bool rlCheckRenderBatchLimit(int vCount); // Check internal buffer overflow for a given number of vertex -RLAPI void rlSetTexture(unsigned int id); // Set current texture for render batch and check buffers limits - -//------------------------------------------------------------------------------------------------------------------------ - -// Vertex buffers management -RLAPI unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported -RLAPI unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic); // Load a vertex buffer attribute -RLAPI unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic); // Load a new attributes element buffer -RLAPI void rlUpdateVertexBuffer(int bufferId, void *data, int dataSize, int offset); // Update GPU buffer with new data -RLAPI void rlUnloadVertexArray(unsigned int vaoId); -RLAPI void rlUnloadVertexBuffer(unsigned int vboId); -RLAPI void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer); -RLAPI void rlSetVertexAttributeDivisor(unsigned int index, int divisor); -RLAPI void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value -RLAPI void rlDrawVertexArray(int offset, int count); -RLAPI void rlDrawVertexArrayElements(int offset, int count, void *buffer); -RLAPI void rlDrawVertexArrayInstanced(int offset, int count, int instances); -RLAPI void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances); - -// Textures management -RLAPI unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU -RLAPI unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo) -RLAPI unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap -RLAPI void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data -RLAPI void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats -RLAPI void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory -RLAPI void rlGenerateMipmaps(Texture2D *texture); // Generate mipmap data for selected texture -RLAPI void *rlReadTexturePixels(Texture2D texture); // Read texture pixel data -RLAPI unsigned char *rlReadScreenPixels(int width, int height); // Read screen pixel data (color buffer) - -// Framebuffer management (fbo) -RLAPI unsigned int rlLoadFramebuffer(int width, int height); // Load an empty framebuffer -RLAPI void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel); // Attach texture/renderbuffer to a framebuffer -RLAPI bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete -RLAPI void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU - -// Shaders management -RLAPI unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings -RLAPI unsigned int rlCompileShader(const char *shaderCode, int type); // Compile custom shader and return shader id (type: GL_VERTEX_SHADER, GL_FRAGMENT_SHADER) -RLAPI unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId); // Load custom shader program -RLAPI void rlUnloadShaderProgram(unsigned int id); // Unload shader program -RLAPI int rlGetLocationUniform(unsigned int shaderId, const char *uniformName); // Get shader location uniform -RLAPI int rlGetLocationAttrib(unsigned int shaderId, const char *attribName); // Get shader location attribute -RLAPI void rlSetUniform(int locIndex, const void *value, int uniformType, int count); // Set shader value uniform -RLAPI void rlSetUniformMatrix(int locIndex, Matrix mat); // Set shader value matrix -RLAPI void rlSetUniformSampler(int locIndex, unsigned int textureId); // Set shader value sampler -RLAPI void rlSetShader(Shader shader); // Set shader currently active - -// Matrix state management -RLAPI Matrix rlGetMatrixModelview(void); // Get internal modelview matrix -RLAPI Matrix rlGetMatrixProjection(void); // Get internal projection matrix -RLAPI Matrix rlGetMatrixTransform(void); // Get internal accumulated transform matrix -RLAPI Matrix rlGetMatrixProjectionStereo(int eye); // Get internal projection matrix for stereo render (selected eye) -RLAPI Matrix rlGetMatrixViewOffsetStereo(int eye); // Get internal view offset matrix for stereo render (selected eye) -RLAPI void rlSetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) -RLAPI void rlSetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI void rlSetMatrixProjectionStereo(Matrix right, Matrix left); // Set eyes projection matrices for stereo rendering -RLAPI void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left); // Set eyes view offsets matrices for stereo rendering - -// Quick and dirty cube/quad buffers load->draw->unload -RLAPI void rlLoadDrawCube(void); // Load and draw a cube -RLAPI void rlLoadDrawQuad(void); // Load and draw a quad -#if defined(__cplusplus) -} -#endif - -#endif // RLGL_H - -/*********************************************************************************** -* -* RLGL IMPLEMENTATION -* -************************************************************************************/ - -#if defined(RLGL_IMPLEMENTATION) - -#if !defined(RLGL_STANDALONE) - // Check if config flags have been externally provided on compilation line - #if !defined(EXTERNAL_CONFIG_FLAGS) - #include "config.h" // Defines module configuration flags - #endif - #include "raymath.h" // Required for: Vector3 and Matrix functions -#endif - -#include // Required for: malloc(), free() -#include // Required for: strcmp(), strlen() [Used in rlglInit(), on extensions loading] - -#if defined(GRAPHICS_API_OPENGL_11) - #if defined(__APPLE__) - #include // OpenGL 1.1 library for OSX - #include - #else - // APIENTRY for OpenGL function pointer declarations is required - #ifndef APIENTRY - #if defined(_WIN32) - #define APIENTRY __stdcall - #else - #define APIENTRY - #endif - #endif - // WINGDIAPI definition. Some Windows OpenGL headers need it - #if !defined(WINGDIAPI) && defined(_WIN32) - #define WINGDIAPI __declspec(dllimport) - #endif - - #include // OpenGL 1.1 library - #endif -#endif - -#if defined(GRAPHICS_API_OPENGL_33) - #if defined(__APPLE__) - #include // OpenGL 3 library for OSX - #include // OpenGL 3 extensions library for OSX - #else - #define GLAD_REALLOC RL_REALLOC - #define GLAD_FREE RL_FREE - - #define GLAD_IMPLEMENTATION - #if defined(RLGL_STANDALONE) - #include "glad.h" // GLAD extensions loading library, includes OpenGL headers - #else - #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers - #endif - #endif -#endif - -#if defined(GRAPHICS_API_OPENGL_ES2) - #define GL_GLEXT_PROTOTYPES - #include // EGL library - #include // OpenGL ES 2.0 library - #include // OpenGL ES 2.0 extensions library - - // It seems OpenGL ES 2.0 instancing entry points are not defined on Raspberry Pi - // provided headers (despite being defined in official Khronos GLES2 headers) - #if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) - typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); - typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); - typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); - #endif -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#ifndef GL_SHADING_LANGUAGE_VERSION - #define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#endif - -#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT - #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#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_ETC1_RGB8_OES - #define GL_ETC1_RGB8_OES 0x8D64 -#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_RGB_PVRTC_4BPPV1_IMG - #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#endif -#ifndef GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG - #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#endif -#ifndef GL_COMPRESSED_RGBA_ASTC_4x4_KHR - #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93b0 -#endif -#ifndef GL_COMPRESSED_RGBA_ASTC_8x8_KHR - #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93b7 -#endif - -#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT - #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif -#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT - #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#endif - -#if defined(GRAPHICS_API_OPENGL_11) - #define GL_UNSIGNED_SHORT_5_6_5 0x8363 - #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 - #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#endif - -#if defined(GRAPHICS_API_OPENGL_21) - #define GL_LUMINANCE 0x1909 - #define GL_LUMINANCE_ALPHA 0x190A -#endif - -#if defined(GRAPHICS_API_OPENGL_ES2) - #define glClearDepth glClearDepthf - #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER - #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER -#endif - -// Default shader vertex attribute names to set location points -#ifndef DEFAULT_SHADER_ATTRIB_NAME_POSITION - #define DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Binded by default to shader location: 0 -#endif -#ifndef DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD - #define DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Binded by default to shader location: 1 -#endif -#ifndef DEFAULT_SHADER_ATTRIB_NAME_NORMAL - #define DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Binded by default to shader location: 2 -#endif -#ifndef DEFAULT_SHADER_ATTRIB_NAME_COLOR - #define DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Binded by default to shader location: 3 -#endif -#ifndef DEFAULT_SHADER_ATTRIB_NAME_TANGENT - #define DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Binded by default to shader location: 4 -#endif -#ifndef DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 - #define DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Binded by default to shader location: 5 -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -typedef struct rlglData { - RenderBatch *currentBatch; // Current render batch - RenderBatch defaultBatch; // Default internal render batch - - struct { - int currentMatrixMode; // Current matrix mode - Matrix *currentMatrix; // Current matrix pointer - Matrix modelview; // Default modelview matrix - Matrix projection; // Default projection matrix - Matrix transform; // Transform matrix to be used with rlTranslate, rlRotate, rlScale - bool transformRequired; // Require transform matrix application to current draw-call vertex (if required) - Matrix stack[MAX_MATRIX_STACK_SIZE];// Matrix stack for push/pop - int stackCounter; // Matrix stack counter - - unsigned int defaultTextureId; // Default texture used on shapes/poly drawing (required by shader) - unsigned int activeTextureId[MAX_BATCH_ACTIVE_TEXTURES]; // Active texture ids to be enabled on batch drawing (0 active by default) - unsigned int defaultVShaderId; // Default vertex shader id (used by default shader program) - unsigned int defaultFShaderId; // Default fragment shader Id (used by default shader program) - Shader defaultShader; // Basic shader, support vertex color and diffuse texture - Shader currentShader; // Shader to be used on rendering (by default, defaultShader) - - bool stereoRender; // Stereo rendering flag - Matrix projectionStereo[2]; // VR stereo rendering eyes projection matrices - Matrix viewOffsetStereo[2]; // VR stereo rendering eyes view offset matrices - - int currentBlendMode; // Blending mode active - int glBlendSrcFactor; // Blending source factor - int glBlendDstFactor; // Blending destination factor - int glBlendEquation; // Blending equation - - int framebufferWidth; // Default framebuffer width - int framebufferHeight; // Default framebuffer height - - } State; // Renderer state - struct { - bool vao; // VAO support (OpenGL ES2 could not support VAO extension) (GL_ARB_vertex_array_object) - bool instancing; // Instancing supported (GL_ANGLE_instanced_arrays, GL_EXT_draw_instanced + GL_EXT_instanced_arrays) - bool texNPOT; // NPOT textures full support (GL_ARB_texture_non_power_of_two, GL_OES_texture_npot) - bool texDepth; // Depth textures supported (GL_ARB_depth_texture, GL_WEBGL_depth_texture, GL_OES_depth_texture) - bool texFloat32; // float textures support (32 bit per channel) (GL_OES_texture_float) - bool texCompDXT; // DDS texture compression support (GL_EXT_texture_compression_s3tc, GL_WEBGL_compressed_texture_s3tc, GL_WEBKIT_WEBGL_compressed_texture_s3tc) - bool texCompETC1; // ETC1 texture compression support (GL_OES_compressed_ETC1_RGB8_texture, GL_WEBGL_compressed_texture_etc1) - bool texCompETC2; // ETC2/EAC texture compression support (GL_ARB_ES3_compatibility) - bool texCompPVRT; // PVR texture compression support (GL_IMG_texture_compression_pvrtc) - bool texCompASTC; // ASTC texture compression support (GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr) - bool texMirrorClamp; // Clamp mirror wrap mode supported (GL_EXT_texture_mirror_clamp) - bool texAnisoFilter; // Anisotropic texture filtering support (GL_EXT_texture_filter_anisotropic) - - float maxAnisotropyLevel; // Maximum anisotropy level supported (minimum is 2.0f) - int maxDepthBits; // Maximum bits for depth component - - } ExtSupported; // Extensions supported flags -} rlglData; -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -static rlglData RLGL = { 0 }; -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 - -#if defined(GRAPHICS_API_OPENGL_ES2) -// NOTE: VAO functionality is exposed through extensions (OES) -static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL; -static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL; -static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL; - -// NOTE: Instancing functionality could also be available through extension -static PFNGLDRAWARRAYSINSTANCEDEXTPROC glDrawArraysInstanced = NULL; -static PFNGLDRAWELEMENTSINSTANCEDEXTPROC glDrawElementsInstanced = NULL; -static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL; -#endif - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -static void rlLoadShaderDefault(void); // Load default shader (RLGL.State.defaultShader) -static void rlUnloadShaderDefault(void); // Unload default shader (RLGL.State.defaultShader) -#if defined(SUPPORT_GL_DETAILS_INFO) -static char *rlGetCompressedFormatName(int format); // Get compressed format official GL identifier name -#endif // SUPPORT_GL_DETAILS_INFO -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 -#if defined(GRAPHICS_API_OPENGL_11) -static int rlGenerateMipmapsData(unsigned char *data, int baseWidth, int baseHeight); // Generate mipmaps data on CPU side -static Color *rlGenNextMipmapData(Color *srcData, int srcWidth, int srcHeight); // Generate next mipmap level on CPU side -#endif -static int rlGetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Matrix operations -//---------------------------------------------------------------------------------- - -#if defined(GRAPHICS_API_OPENGL_11) -// Fallback to OpenGL 1.1 function calls -//--------------------------------------- -void rlMatrixMode(int mode) -{ - switch (mode) - { - case RL_PROJECTION: glMatrixMode(GL_PROJECTION); break; - case RL_MODELVIEW: glMatrixMode(GL_MODELVIEW); break; - case RL_TEXTURE: glMatrixMode(GL_TEXTURE); break; - default: break; - } -} - -void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar) -{ - glFrustum(left, right, bottom, top, znear, zfar); -} - -void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar) -{ - glOrtho(left, right, bottom, top, znear, zfar); -} - -void rlPushMatrix(void) { glPushMatrix(); } -void rlPopMatrix(void) { glPopMatrix(); } -void rlLoadIdentity(void) { glLoadIdentity(); } -void rlTranslatef(float x, float y, float z) { glTranslatef(x, y, z); } -void rlRotatef(float angleDeg, float x, float y, float z) { glRotatef(angleDeg, x, y, z); } -void rlScalef(float x, float y, float z) { glScalef(x, y, z); } -void rlMultMatrixf(float *matf) { glMultMatrixf(matf); } -#endif -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -// Choose the current matrix to be transformed -void rlMatrixMode(int mode) -{ - if (mode == RL_PROJECTION) RLGL.State.currentMatrix = &RLGL.State.projection; - else if (mode == RL_MODELVIEW) RLGL.State.currentMatrix = &RLGL.State.modelview; - //else if (mode == RL_TEXTURE) // Not supported - - RLGL.State.currentMatrixMode = mode; -} - -// Push the current matrix into RLGL.State.stack -void rlPushMatrix(void) -{ - if (RLGL.State.stackCounter >= MAX_MATRIX_STACK_SIZE) TRACELOG(LOG_ERROR, "RLGL: Matrix stack overflow (MAX_MATRIX_STACK_SIZE)"); - - if (RLGL.State.currentMatrixMode == RL_MODELVIEW) - { - RLGL.State.transformRequired = true; - RLGL.State.currentMatrix = &RLGL.State.transform; - } - - RLGL.State.stack[RLGL.State.stackCounter] = *RLGL.State.currentMatrix; - RLGL.State.stackCounter++; -} - -// Pop lattest inserted matrix from RLGL.State.stack -void rlPopMatrix(void) -{ - if (RLGL.State.stackCounter > 0) - { - Matrix mat = RLGL.State.stack[RLGL.State.stackCounter - 1]; - *RLGL.State.currentMatrix = mat; - RLGL.State.stackCounter--; - } - - if ((RLGL.State.stackCounter == 0) && (RLGL.State.currentMatrixMode == RL_MODELVIEW)) - { - RLGL.State.currentMatrix = &RLGL.State.modelview; - RLGL.State.transformRequired = false; - } -} - -// Reset current matrix to identity matrix -void rlLoadIdentity(void) -{ - *RLGL.State.currentMatrix = MatrixIdentity(); -} - -// Multiply the current matrix by a translation matrix -void rlTranslatef(float x, float y, float z) -{ - Matrix matTranslation = MatrixTranslate(x, y, z); - - // NOTE: We transpose matrix with multiplication order - *RLGL.State.currentMatrix = MatrixMultiply(matTranslation, *RLGL.State.currentMatrix); -} - -// Multiply the current matrix by a rotation matrix -void rlRotatef(float angleDeg, float x, float y, float z) -{ - Matrix matRotation = MatrixIdentity(); - - Vector3 axis = Vector3{ x, y, z }; - matRotation = MatrixRotate(Vector3Normalize(axis), angleDeg*DEG2RAD); - - // NOTE: We transpose matrix with multiplication order - *RLGL.State.currentMatrix = MatrixMultiply(matRotation, *RLGL.State.currentMatrix); -} - -// Multiply the current matrix by a scaling matrix -void rlScalef(float x, float y, float z) -{ - Matrix matScale = MatrixScale(x, y, z); - - // NOTE: We transpose matrix with multiplication order - *RLGL.State.currentMatrix = MatrixMultiply(matScale, *RLGL.State.currentMatrix); -} - -// Multiply the current matrix by another matrix -void rlMultMatrixf(float *matf) -{ - // Matrix creation from array - Matrix mat = { matf[0], matf[4], matf[8], matf[12], - matf[1], matf[5], matf[9], matf[13], - matf[2], matf[6], matf[10], matf[14], - matf[3], matf[7], matf[11], matf[15] }; - - *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, mat); -} - -// Multiply the current matrix by a perspective matrix generated by parameters -void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar) -{ - Matrix matPerps = MatrixFrustum(left, right, bottom, top, znear, zfar); - - *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matPerps); -} - -// Multiply the current matrix by an orthographic matrix generated by parameters -void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar) -{ - // NOTE: If left-right and top-botton values are equal it could create - // a division by zero on MatrixOrtho(), response to it is platform/compiler dependant - Matrix matOrtho = MatrixOrtho(left, right, bottom, top, znear, zfar); - - *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho); -} -#endif - -// Set the viewport area (transformation from normalized device coordinates to window coordinates) -void rlViewport(int x, int y, int width, int height) -{ - glViewport(x, y, width, height); -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - Vertex level operations -//---------------------------------------------------------------------------------- -#if defined(GRAPHICS_API_OPENGL_11) -// Fallback to OpenGL 1.1 function calls -//--------------------------------------- -void rlBegin(int mode) -{ - switch (mode) - { - case RL_LINES: glBegin(GL_LINES); break; - case RL_TRIANGLES: glBegin(GL_TRIANGLES); break; - case RL_QUADS: glBegin(GL_QUADS); break; - default: break; - } -} - -void rlEnd() { glEnd(); } -void rlVertex2i(int x, int y) { glVertex2i(x, y); } -void rlVertex2f(float x, float y) { glVertex2f(x, y); } -void rlVertex3f(float x, float y, float z) { glVertex3f(x, y, z); } -void rlTexCoord2f(float x, float y) { glTexCoord2f(x, y); } -void rlNormal3f(float x, float y, float z) { glNormal3f(x, y, z); } -void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a) { glColor4ub(r, g, b, a); } -void rlColor3f(float x, float y, float z) { glColor3f(x, y, z); } -void rlColor4f(float x, float y, float z, float w) { glColor4f(x, y, z, w); } -#endif -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -// Initialize drawing mode (how to organize vertex) -void rlBegin(int mode) -{ - // Draw mode can be RL_LINES, RL_TRIANGLES and RL_QUADS - // NOTE: In all three cases, vertex are accumulated over default internal vertex buffer - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode != mode) - { - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount > 0) - { - // Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4, - // that way, following QUADS drawing will keep aligned with index processing - // It implies adding some extra alignment vertex at the end of the draw, - // those vertex are not processed but they are considered as an additional offset - // for the next set of vertex to be drawn - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_LINES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount : RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4); - else if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_TRIANGLES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? 1 : (4 - (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4))); - else RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = 0; - - if (!rlCheckRenderBatchLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - - RLGL.currentBatch->drawsCounter++; - } - } - - if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch); - - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode = mode; - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount = 0; - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId = RLGL.State.defaultTextureId; - } -} - -// Finish vertex providing -void rlEnd(void) -{ - // Make sure vertexCount is the same for vertices, texcoords, colors and normals - // NOTE: In OpenGL 1.1, one glColor call can be made for all the subsequent glVertex calls - - // Make sure colors count match vertex count - if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter != RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter) - { - int addColors = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter; - - for (int i = 0; i < addColors; i++) - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter] = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter - 4]; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 1] = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter - 3]; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 2] = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter - 2]; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 3] = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter - 1]; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter++; - } - } - - // Make sure texcoords count match vertex count - if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter != RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter) - { - int addTexCoords = RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter; - - for (int i = 0; i < addTexCoords; i++) - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter] = 0.0f; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter + 1] = 0.0f; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter++; - } - } - - // TODO: Make sure normals count match vertex count... if normals support is added in a future... :P - - // NOTE: Depth increment is dependant on rlOrtho(): z-near and z-far values, - // as well as depth buffer bit-depth (16bit or 24bit or 32bit) - // Correct increment formula would be: depthInc = (zfar - znear)/pow(2, bits) - RLGL.currentBatch->currentDepth += (1.0f/20000.0f); - - // Verify internal buffers limits - // NOTE: This check is combined with usage of rlCheckRenderBatchLimit() - if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter) >= - (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4 - 4)) - { - // WARNING: If we are between rlPushMatrix() and rlPopMatrix() and we need to force a rlDrawRenderBatch(), - // we need to call rlPopMatrix() before to recover *RLGL.State.currentMatrix (RLGL.State.modelview) for the next forced draw call! - // If we have multiple matrix pushed, it will require "RLGL.State.stackCounter" pops before launching the draw - for (int i = RLGL.State.stackCounter; i >= 0; i--) rlPopMatrix(); - rlDrawRenderBatch(RLGL.currentBatch); - } -} - -// Define one vertex (position) -// NOTE: Vertex position data is the basic information required for drawing -void rlVertex3f(float x, float y, float z) -{ - Vector3 vec = { x, y, z }; - - // Transform provided vector if required - if (RLGL.State.transformRequired) vec = Vector3Transform(vec, RLGL.State.transform); - - // Verify that current vertex buffer elements limit has not been reached - if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter < (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4)) - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vertices[3*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter] = vec.x; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vertices[3*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + 1] = vec.y; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vertices[3*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + 2] = vec.z; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter++; - - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount++; - } - else TRACELOG(LOG_ERROR, "RLGL: Batch elements overflow"); -} - -// Define one vertex (position) -void rlVertex2f(float x, float y) -{ - rlVertex3f(x, y, RLGL.currentBatch->currentDepth); -} - -// Define one vertex (position) -void rlVertex2i(int x, int y) -{ - rlVertex3f((float)x, (float)y, RLGL.currentBatch->currentDepth); -} - -// Define one vertex (texture coordinate) -// NOTE: Texture coordinates are limited to QUADS only -void rlTexCoord2f(float x, float y) -{ - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter] = x; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter + 1] = y; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter++; -} - -// Define one vertex (normal) -// NOTE: Normals limited to TRIANGLES only? -void rlNormal3f(float x, float y, float z) -{ - // TODO: Normals usage... -} - -// Define one vertex (color) -void rlColor4ub(unsigned char x, unsigned char y, unsigned char z, unsigned char w) -{ - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter] = x; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 1] = y; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 2] = z; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter + 3] = w; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter++; -} - -// Define one vertex (color) -void rlColor4f(float r, float g, float b, float a) -{ - rlColor4ub((unsigned char)(r*255), (unsigned char)(g*255), (unsigned char)(b*255), (unsigned char)(a*255)); -} - -// Define one vertex (color) -void rlColor3f(float x, float y, float z) -{ - rlColor4ub((unsigned char)(x*255), (unsigned char)(y*255), (unsigned char)(z*255), 255); -} - -#endif - -//-------------------------------------------------------------------------------------- -// Module Functions Definition - OpenGL style functions (common to 1.1, 3.3+, ES2) -//-------------------------------------------------------------------------------------- - -// Set current texture to use -void rlSetTexture(unsigned int id) -{ - if (id == 0) - { -#if defined(GRAPHICS_API_OPENGL_11) - rlDisableTexture(); -#else - // NOTE: If quads batch limit is reached, we force a draw call and next batch starts - if (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter >= - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4) - { - rlDrawRenderBatch(RLGL.currentBatch); - } -#endif - } - else - { -#if defined(GRAPHICS_API_OPENGL_11) - rlEnableTexture(id); -#else - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId != id) - { - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount > 0) - { - // Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4, - // that way, following QUADS drawing will keep aligned with index processing - // It implies adding some extra alignment vertex at the end of the draw, - // those vertex are not processed but they are considered as an additional offset - // for the next set of vertex to be drawn - if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_LINES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount : RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4); - else if (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].mode == RL_TRIANGLES) RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = ((RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount < 4)? 1 : (4 - (RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount%4))); - else RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment = 0; - - if (!rlCheckRenderBatchLimit(RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment)) - { - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].cCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].tcCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexAlignment; - - RLGL.currentBatch->drawsCounter++; - } - } - - if (RLGL.currentBatch->drawsCounter >= DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch); - - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].textureId = id; - RLGL.currentBatch->draws[RLGL.currentBatch->drawsCounter - 1].vertexCount = 0; - } -#endif - } -} - -// Select and active a texture slot -void rlActiveTextureSlot(int slot) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glActiveTexture(GL_TEXTURE0 + slot); -#endif -} - -// Enable texture -void rlEnableTexture(unsigned int id) -{ -#if defined(GRAPHICS_API_OPENGL_11) - glEnable(GL_TEXTURE_2D); -#endif - glBindTexture(GL_TEXTURE_2D, id); -} - -// Disable texture -void rlDisableTexture(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) - glDisable(GL_TEXTURE_2D); -#endif - glBindTexture(GL_TEXTURE_2D, 0); -} - -// Enable texture cubemap -void rlEnableTextureCubemap(unsigned int id) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glEnable(GL_TEXTURE_CUBE_MAP); // Core in OpenGL 1.4 - glBindTexture(GL_TEXTURE_CUBE_MAP, id); -#endif -} - -// Disable texture cubemap -void rlDisableTextureCubemap(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDisable(GL_TEXTURE_CUBE_MAP); - glBindTexture(GL_TEXTURE_CUBE_MAP, 0); -#endif -} - -// Set texture parameters (wrap mode/filter mode) -void rlTextureParameters(unsigned int id, int param, int value) -{ - glBindTexture(GL_TEXTURE_2D, id); - - switch (param) - { - case RL_TEXTURE_WRAP_S: - case RL_TEXTURE_WRAP_T: - { - if (value == RL_TEXTURE_WRAP_MIRROR_CLAMP) - { -#if !defined(GRAPHICS_API_OPENGL_11) - if (RLGL.ExtSupported.texMirrorClamp) glTexParameteri(GL_TEXTURE_2D, param, value); - else TRACELOG(LOG_WARNING, "GL: Clamp mirror wrap mode not supported (GL_MIRROR_CLAMP_EXT)"); -#endif - } - else glTexParameteri(GL_TEXTURE_2D, param, value); - - } break; - case RL_TEXTURE_MAG_FILTER: - case RL_TEXTURE_MIN_FILTER: glTexParameteri(GL_TEXTURE_2D, param, value); break; - case RL_TEXTURE_FILTER_ANISOTROPIC: - { -#if !defined(GRAPHICS_API_OPENGL_11) - if (value <= RLGL.ExtSupported.maxAnisotropyLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); - else if (RLGL.ExtSupported.maxAnisotropyLevel > 0.0f) - { - TRACELOG(LOG_WARNING, "GL: Maximum anisotropic filter level supported is %iX", id, RLGL.ExtSupported.maxAnisotropyLevel); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); - } - else TRACELOG(LOG_WARNING, "GL: Anisotropic filtering not supported"); -#endif - } break; - default: break; - } - - glBindTexture(GL_TEXTURE_2D, 0); -} - -// Enable shader program -void rlEnableShader(unsigned int id) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) - glUseProgram(id); -#endif -} - -// Disable shader program -void rlDisableShader(void) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) - glUseProgram(0); -#endif -} - -// Enable rendering to texture (fbo) -void rlEnableFramebuffer(unsigned int id) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - glBindFramebuffer(GL_FRAMEBUFFER, id); -#endif -} - -// Disable rendering to texture -void rlDisableFramebuffer(void) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - glBindFramebuffer(GL_FRAMEBUFFER, 0); -#endif -} - -// Enable depth test -void rlEnableDepthTest(void) { glEnable(GL_DEPTH_TEST); } - -// Disable depth test -void rlDisableDepthTest(void) { glDisable(GL_DEPTH_TEST); } - -// Enable depth write -void rlEnableDepthMask(void) { glDepthMask(GL_TRUE); } - -// Disable depth write -void rlDisableDepthMask(void) { glDepthMask(GL_FALSE); } - -// Enable backface culling -void rlEnableBackfaceCulling(void) { glEnable(GL_CULL_FACE); } - -// Disable backface culling -void rlDisableBackfaceCulling(void) { glDisable(GL_CULL_FACE); } - -// Enable scissor test -void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); } - -// Disable scissor test -void rlDisableScissorTest(void) { glDisable(GL_SCISSOR_TEST); } - -// Scissor test -void rlScissor(int x, int y, int width, int height) { glScissor(x, y, width, height); } - -// Enable wire mode -void rlEnableWireMode(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - // NOTE: glPolygonMode() not available on OpenGL ES - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); -#endif -} - -// Disable wire mode -void rlDisableWireMode(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - // NOTE: glPolygonMode() not available on OpenGL ES - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); -#endif -} -// Set the line drawing width -void rlSetLineWidth(float width) -{ - glLineWidth(width); -} - -// Get the line drawing width -float rlGetLineWidth(void) -{ - float width = 0; - glGetFloatv(GL_LINE_WIDTH, &width); - return width; -} - -// Enable line aliasing -void rlEnableSmoothLines(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_11) - glEnable(GL_LINE_SMOOTH); -#endif -} - -// Disable line aliasing -void rlDisableSmoothLines(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_11) - glDisable(GL_LINE_SMOOTH); -#endif -} - -// Enable stereo rendering -void rlEnableStereoRender(void) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) - RLGL.State.stereoRender = true; -#endif -} - -// Disable stereo rendering -void rlDisableStereoRender(void) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) - RLGL.State.stereoRender = false; -#endif -} - -// Check if stereo render is enabled -bool rlIsStereoRenderEnabled(void) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) - return RLGL.State.stereoRender; -#else - return false; -#endif -} - -// Clear color buffer with color -void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - // Color values clamp to 0.0f(0) and 1.0f(255) - float cr = (float)r/255; - float cg = (float)g/255; - float cb = (float)b/255; - float ca = (float)a/255; - - glClearColor(cr, cg, cb, ca); -} - -// Clear used screen buffers (color and depth) -void rlClearScreenBuffers(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear used buffers: Color and Depth (Depth is used for 3D) - //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Stencil buffer not used... -} - -// Check and log OpenGL error codes -void rlCheckErrors() -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - int check = 1; - while (check) - { - const GLenum err = glGetError(); - switch (err) - { - case GL_NO_ERROR: check = 0; break; - case 0x0500: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_ENUM"); break; - case 0x0501: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_VALUE"); break; - case 0x0502: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_OPERATION"); break; - case 0x0503: TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_OVERFLOW"); break; - case 0x0504: TRACELOG(LOG_WARNING, "GL: Error detected: GL_STACK_UNDERFLOW"); break; - case 0x0505: TRACELOG(LOG_WARNING, "GL: Error detected: GL_OUT_OF_MEMORY"); break; - case 0x0506: TRACELOG(LOG_WARNING, "GL: Error detected: GL_INVALID_FRAMEBUFFER_OPERATION"); break; - default: TRACELOG(LOG_WARNING, "GL: Error detected: Unknown error code: %x", err); break; - } - } -#endif -} - -// Set blend mode -void rlSetBlendMode(int mode) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.State.currentBlendMode != mode) - { - rlDrawRenderBatch(RLGL.currentBatch); - - switch (mode) - { - case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_ADD_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_ADD); break; - case BLEND_SUBTRACT_COLORS: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_SUBTRACT); break; - case BLEND_CUSTOM: glBlendFunc(RLGL.State.glBlendSrcFactor, RLGL.State.glBlendDstFactor); glBlendEquation(RLGL.State.glBlendEquation); break; - default: break; - } - - RLGL.State.currentBlendMode = mode; - } -#endif -} - -// Set blending mode factor and equation -void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.glBlendSrcFactor = glSrcFactor; - RLGL.State.glBlendDstFactor = glDstFactor; - RLGL.State.glBlendEquation = glEquation; -#endif -} - -//---------------------------------------------------------------------------------- -// Module Functions Definition - rlgl functionality -//---------------------------------------------------------------------------------- - -// Initialize rlgl: OpenGL extensions, default buffers/shaders/textures, OpenGL states -void rlglInit(int width, int height) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Init default white texture - unsigned char pixels[4] = { 255, 255, 255, 255 }; // 1 pixel RGBA (4 bytes) - RLGL.State.defaultTextureId = rlLoadTexture(pixels, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 1); - - if (RLGL.State.defaultTextureId != 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Default texture loaded successfully", RLGL.State.defaultTextureId); - else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load default texture"); - - // Init default Shader (customized for GL 3.3 and ES2) - rlLoadShaderDefault(); // RLGL.State.defaultShader - RLGL.State.currentShader = RLGL.State.defaultShader; - - // Init default vertex arrays buffers - RLGL.defaultBatch = rlLoadRenderBatch(DEFAULT_BATCH_BUFFERS, DEFAULT_BATCH_BUFFER_ELEMENTS); - RLGL.currentBatch = &RLGL.defaultBatch; - - // Init stack matrices (emulating OpenGL 1.1) - for (int i = 0; i < MAX_MATRIX_STACK_SIZE; i++) RLGL.State.stack[i] = MatrixIdentity(); - - // Init internal matrices - RLGL.State.transform = MatrixIdentity(); - RLGL.State.projection = MatrixIdentity(); - RLGL.State.modelview = MatrixIdentity(); - RLGL.State.currentMatrix = &RLGL.State.modelview; -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 - - // Initialize OpenGL default states - //---------------------------------------------------------- - // Init state: Depth test - glDepthFunc(GL_LEQUAL); // Type of depth testing to apply - glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) - - // Init state: Blending mode - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Color blending function (how colors are mixed) - glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) - - // Init state: Culling - // NOTE: All shapes/models triangles are drawn CCW - glCullFace(GL_BACK); // Cull the back face (default) - glFrontFace(GL_CCW); // Front face are defined counter clockwise (default) - glEnable(GL_CULL_FACE); // Enable backface culling - - // Init state: Cubemap seamless -#if defined(GRAPHICS_API_OPENGL_33) - glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); // Seamless cubemaps (not supported on OpenGL ES 2.0) -#endif - -#if defined(GRAPHICS_API_OPENGL_11) - // Init state: Color hints (deprecated in OpenGL 3.0+) - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation - glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) -#endif - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Store screen size into global variables - RLGL.State.framebufferWidth = width; - RLGL.State.framebufferHeight = height; - - TRACELOG(LOG_INFO, "RLGL: Default OpenGL state initialized successfully"); - //---------------------------------------------------------- -#endif - - // Init state: Color/Depth buffers clear - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) - glClearDepth(1.0f); // Set clear depth value (default) - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) -} - -// Vertex Buffer Object deinitialization (memory free) -void rlglClose(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlUnloadRenderBatch(RLGL.defaultBatch); - - rlUnloadShaderDefault(); // Unload default shader - - glDeleteTextures(1, &RLGL.State.defaultTextureId); // Unload default texture - TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Default texture unloaded successfully", RLGL.State.defaultTextureId); -#endif -} - -// Load OpenGL extensions -// NOTE: External loader function could be passed as a pointer -void rlLoadExtensions(void *loader) -{ -#if defined(GRAPHICS_API_OPENGL_33) // Also defined for GRAPHICS_API_OPENGL_21 - // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) - #if !defined(__APPLE__) - if (!gladLoadGLLoader((GLADloadproc)loader)) TRACELOG(LOG_WARNING, "GLAD: Cannot load OpenGL extensions"); - else TRACELOG(LOG_INFO, "GLAD: OpenGL extensions loaded successfully"); - #endif - - // Get number of supported extensions - GLint numExt = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); - TRACELOG(LOG_INFO, "GL: Supported extensions count: %i", numExt); - -#if defined(SUPPORT_GL_DETAILS_INFO) - // Get supported extensions list - // WARNING: glGetStringi() not available on OpenGL 2.1 - char **extList = RL_MALLOC(sizeof(char *)*numExt); - TRACELOG(LOG_INFO, "GL: OpenGL extensions:"); - for (int i = 0; i < numExt; i++) - { - extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i); - TRACELOG(LOG_INFO, " %s", extList[i]); - } - RL_FREE(extList); // Free extensions pointers -#endif - - // Register supported extensions flags - // OpenGL 3.3 extensions supported by default (core) - RLGL.ExtSupported.vao = true; - RLGL.ExtSupported.instancing = true; - RLGL.ExtSupported.texNPOT = true; - RLGL.ExtSupported.texFloat32 = true; - RLGL.ExtSupported.texDepth = true; - RLGL.ExtSupported.maxDepthBits = 32; - RLGL.ExtSupported.texAnisoFilter = true; - RLGL.ExtSupported.texMirrorClamp = true; - #if !defined(__APPLE__) - // NOTE: With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans - if (GLAD_GL_EXT_texture_compression_s3tc) RLGL.ExtSupported.texCompDXT = true; // Texture compression: DXT - if (GLAD_GL_ARB_ES3_compatibility) RLGL.ExtSupported.texCompETC2 = true; // Texture compression: ETC2/EAC - #endif -#endif // GRAPHICS_API_OPENGL_33 - -#if defined(GRAPHICS_API_OPENGL_ES2) - // Get supported extensions list - GLint numExt = 0; - const char **extList = RL_MALLOC(512*sizeof(const char *)); // Allocate 512 strings pointers (2 KB) - const char *extensions = (const char *)glGetString(GL_EXTENSIONS); // One big const string - - // NOTE: We have to duplicate string because glGetString() returns a const string - int len = strlen(extensions) + 1; - char *extensionsDup = (char *)RL_CALLOC(len, sizeof(char)); - strcpy(extensionsDup, extensions); - extList[numExt] = extensionsDup; - - for (int i = 0; i < len; i++) - { - if (extensionsDup[i] == ' ') - { - extensionsDup[i] = '\0'; - numExt++; - extList[numExt] = &extensionsDup[i + 1]; - } - } - - TRACELOG(LOG_INFO, "GL: Supported extensions count: %i", numExt); - -#if defined(SUPPORT_GL_DETAILS_INFO) - TRACELOG(LOG_INFO, "GL: OpenGL extensions:"); - for (int i = 0; i < numExt; i++) TRACELOG(LOG_INFO, " %s", extList[i]); -#endif - - // Check required extensions - for (int i = 0; i < numExt; i++) - { - // Check VAO support - // NOTE: Only check on OpenGL ES, OpenGL 3.3 has VAO support as core feature - if (strcmp(extList[i], (const char *)"GL_OES_vertex_array_object") == 0) - { - // The extension is supported by our hardware and driver, try to get related functions pointers - // NOTE: emscripten does not support VAOs natively, it uses emulation and it reduces overall performance... - glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES"); - glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); - glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); - //glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted - - if ((glGenVertexArrays != NULL) && (glBindVertexArray != NULL) && (glDeleteVertexArrays != NULL)) RLGL.ExtSupported.vao = true; - } - - // Check instanced rendering support - if (strcmp(extList[i], (const char *)"GL_ANGLE_instanced_arrays") == 0) // Web ANGLE - { - glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)eglGetProcAddress("glDrawArraysInstancedANGLE"); - glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)eglGetProcAddress("glDrawElementsInstancedANGLE"); - glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)eglGetProcAddress("glVertexAttribDivisorANGLE"); - - if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; - } - else - { - if ((strcmp(extList[i], (const char *)"GL_EXT_draw_instanced") == 0) && // Standard EXT - (strcmp(extList[i], (const char *)"GL_EXT_instanced_arrays") == 0)) - { - glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)eglGetProcAddress("glDrawArraysInstancedEXT"); - glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)eglGetProcAddress("glDrawElementsInstancedEXT"); - glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOREXTPROC)eglGetProcAddress("glVertexAttribDivisorEXT"); - - if ((glDrawArraysInstanced != NULL) && (glDrawElementsInstanced != NULL) && (glVertexAttribDivisor != NULL)) RLGL.ExtSupported.instancing = true; - } - } - - // Check NPOT textures support - // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature - if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) RLGL.ExtSupported.texNPOT = true; - - // Check texture float support - if (strcmp(extList[i], (const char *)"GL_OES_texture_float") == 0) RLGL.ExtSupported.texFloat32 = true; - - // Check depth texture support - if ((strcmp(extList[i], (const char *)"GL_OES_depth_texture") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_depth_texture") == 0)) RLGL.ExtSupported.texDepth = true; - - if (strcmp(extList[i], (const char *)"GL_OES_depth24") == 0) RLGL.ExtSupported.maxDepthBits = 24; - if (strcmp(extList[i], (const char *)"GL_OES_depth32") == 0) RLGL.ExtSupported.maxDepthBits = 32; - - // Check texture compression support: DXT - if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_s3tc") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) RLGL.ExtSupported.texCompDXT = true; - - // Check texture compression support: ETC1 - if ((strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_etc1") == 0)) RLGL.ExtSupported.texCompETC1 = true; - - // Check texture compression support: ETC2/EAC - if (strcmp(extList[i], (const char *)"GL_ARB_ES3_compatibility") == 0) RLGL.ExtSupported.texCompETC2 = true; - - // Check texture compression support: PVR - if (strcmp(extList[i], (const char *)"GL_IMG_texture_compression_pvrtc") == 0) RLGL.ExtSupported.texCompPVRT = true; - - // Check texture compression support: ASTC - if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) RLGL.ExtSupported.texCompASTC = true; - - // Check anisotropic texture filter support - if (strcmp(extList[i], (const char *)"GL_EXT_texture_filter_anisotropic") == 0) RLGL.ExtSupported.texAnisoFilter = true; - - // Check clamp mirror wrap mode support - if (strcmp(extList[i], (const char *)"GL_EXT_texture_mirror_clamp") == 0) RLGL.ExtSupported.texMirrorClamp = true; - } - - // Free extensions pointers - RL_FREE(extList); - RL_FREE(extensionsDup); // Duplicated string must be deallocated -#endif // GRAPHICS_API_OPENGL_ES2 - - // Check OpenGL information and capabilities - //------------------------------------------------------------------------------ - // Show current OpenGL and GLSL version - TRACELOG(LOG_INFO, "GL: OpenGL device information:"); - TRACELOG(LOG_INFO, " > Vendor: %s", glGetString(GL_VENDOR)); - TRACELOG(LOG_INFO, " > Renderer: %s", glGetString(GL_RENDERER)); - TRACELOG(LOG_INFO, " > Version: %s", glGetString(GL_VERSION)); - TRACELOG(LOG_INFO, " > GLSL: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // NOTE: Anisotropy levels capability is an extension - #ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT - #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF - #endif - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &RLGL.ExtSupported.maxAnisotropyLevel); - -#if defined(SUPPORT_GL_DETAILS_INFO) - // Show some OpenGL GPU capabilities - TRACELOG(LOG_INFO, "GL: OpenGL capabilities:"); - GLint capability = 0; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &capability); - TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_SIZE: %i", capability); - glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &capability); - TRACELOG(LOG_INFO, " GL_MAX_CUBE_MAP_TEXTURE_SIZE: %i", capability); - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &capability); - TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_IMAGE_UNITS: %i", capability); - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &capability); - TRACELOG(LOG_INFO, " GL_MAX_VERTEX_ATTRIBS: %i", capability); - #if !defined(GRAPHICS_API_OPENGL_ES2) - glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &capability); - TRACELOG(LOG_INFO, " GL_MAX_UNIFORM_BLOCK_SIZE: %i", capability); - glGetIntegerv(GL_MAX_DRAW_BUFFERS, &capability); - TRACELOG(LOG_INFO, " GL_MAX_DRAW_BUFFERS: %i", capability); - if (RLGL.ExtSupported.texAnisoFilter) TRACELOG(LOG_INFO, " GL_MAX_TEXTURE_MAX_ANISOTROPY: %.0f", RLGL.ExtSupported.maxAnisotropyLevel); - #endif - glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &capability); - TRACELOG(LOG_INFO, " GL_NUM_COMPRESSED_TEXTURE_FORMATS: %i", capability); - GLint format[32] = { 0 }; - glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, format); - for (int i = 0; i < capability; i++) TRACELOG(LOG_INFO, " %s", rlGetCompressedFormatName(format[i])); - - /* - // Following capabilities are only supported by OpenGL 4.3 or greater - glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &capability); - TRACELOG(LOG_INFO, " GL_MAX_VERTEX_ATTRIB_BINDINGS: %i", capability); - glGetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &capability); - TRACELOG(LOG_INFO, " GL_MAX_UNIFORM_LOCATIONS: %i", capability); - */ -#else // SUPPORT_GL_DETAILS_INFO - - // Show some basic info about GL supported features - #if defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.vao) TRACELOG(LOG_INFO, "GL: VAO extension detected, VAO functions loaded successfully"); - else TRACELOG(LOG_WARNING, "GL: VAO extension not found, VAO not supported"); - if (RLGL.ExtSupported.texNPOT) TRACELOG(LOG_INFO, "GL: NPOT textures extension detected, full NPOT textures supported"); - else TRACELOG(LOG_WARNING, "GL: NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)"); - #endif - if (RLGL.ExtSupported.texCompDXT) TRACELOG(LOG_INFO, "GL: DXT compressed textures supported"); - if (RLGL.ExtSupported.texCompETC1) TRACELOG(LOG_INFO, "GL: ETC1 compressed textures supported"); - if (RLGL.ExtSupported.texCompETC2) TRACELOG(LOG_INFO, "GL: ETC2/EAC compressed textures supported"); - if (RLGL.ExtSupported.texCompPVRT) TRACELOG(LOG_INFO, "GL: PVRT compressed textures supported"); - if (RLGL.ExtSupported.texCompASTC) TRACELOG(LOG_INFO, "GL: ASTC compressed textures supported"); -#endif // SUPPORT_GL_DETAILS_INFO - -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 -} - -// Returns current OpenGL version -int rlGetVersion(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) - return OPENGL_11; -#endif -#if defined(GRAPHICS_API_OPENGL_21) - #if defined(__APPLE__) - return OPENGL_33; // NOTE: Force OpenGL 3.3 on OSX - #else - return OPENGL_21; - #endif -#elif defined(GRAPHICS_API_OPENGL_33) - return OPENGL_33; -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - return OPENGL_ES_20; -#endif -} - -// Get default framebuffer width -int rlGetFramebufferWidth(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return RLGL.State.framebufferWidth; -#else - return 0; -#endif -} - -// Get default framebuffer height -int rlGetFramebufferHeight(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return RLGL.State.framebufferHeight; -#else - return 0; -#endif -} - -// Get default internal shader (simple texture + tint color) -Shader rlGetShaderDefault(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return RLGL.State.defaultShader; -#else - Shader shader = { 0 }; - return shader; -#endif -} - -// Get default internal texture (white texture) -Texture2D rlGetTextureDefault(void) -{ - Texture2D texture = { 0 }; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - texture.id = RLGL.State.defaultTextureId; - texture.width = 1; - texture.height = 1; - texture.mipmaps = 1; - texture.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; -#endif - return texture; -} - -// Render batch management -//------------------------------------------------------------------------------------------------ -// Load render batch -RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements) -{ - RenderBatch batch = { 0 }; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Initialize CPU (RAM) vertex buffers (position, texcoord, color data and indexes) - //-------------------------------------------------------------------------------------------- - batch.vertexBuffer = (VertexBuffer *)RL_MALLOC(sizeof(VertexBuffer)*numBuffers); - - for (int i = 0; i < numBuffers; i++) - { - batch.vertexBuffer[i].elementsCount = bufferElements; - - batch.vertexBuffer[i].vertices = (float *)RL_MALLOC(bufferElements*3*4*sizeof(float)); // 3 float by vertex, 4 vertex by quad - batch.vertexBuffer[i].texcoords = (float *)RL_MALLOC(bufferElements*2*4*sizeof(float)); // 2 float by texcoord, 4 texcoord by quad - batch.vertexBuffer[i].colors = (unsigned char *)RL_MALLOC(bufferElements*4*4*sizeof(unsigned char)); // 4 float by color, 4 colors by quad -#if defined(GRAPHICS_API_OPENGL_33) - batch.vertexBuffer[i].indices = (unsigned int *)RL_MALLOC(bufferElements*6*sizeof(unsigned int)); // 6 int by quad (indices) -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - batch.vertexBuffer[i].indices = (unsigned short *)RL_MALLOC(bufferElements*6*sizeof(unsigned short)); // 6 int by quad (indices) -#endif - - for (int j = 0; j < (3*4*bufferElements); j++) batch.vertexBuffer[i].vertices[j] = 0.0f; - for (int j = 0; j < (2*4*bufferElements); j++) batch.vertexBuffer[i].texcoords[j] = 0.0f; - for (int j = 0; j < (4*4*bufferElements); j++) batch.vertexBuffer[i].colors[j] = 0; - - int k = 0; - - // Indices can be initialized right now - for (int j = 0; j < (6*bufferElements); j += 6) - { - batch.vertexBuffer[i].indices[j] = 4*k; - batch.vertexBuffer[i].indices[j + 1] = 4*k + 1; - batch.vertexBuffer[i].indices[j + 2] = 4*k + 2; - batch.vertexBuffer[i].indices[j + 3] = 4*k; - batch.vertexBuffer[i].indices[j + 4] = 4*k + 2; - batch.vertexBuffer[i].indices[j + 5] = 4*k + 3; - - k++; - } - - batch.vertexBuffer[i].vCounter = 0; - batch.vertexBuffer[i].tcCounter = 0; - batch.vertexBuffer[i].cCounter = 0; - } - - TRACELOG(LOG_INFO, "RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)"); - //-------------------------------------------------------------------------------------------- - - // Upload to GPU (VRAM) vertex data and initialize VAOs/VBOs - //-------------------------------------------------------------------------------------------- - for (int i = 0; i < numBuffers; i++) - { - if (RLGL.ExtSupported.vao) - { - // Initialize Quads VAO - glGenVertexArrays(1, &batch.vertexBuffer[i].vaoId); - glBindVertexArray(batch.vertexBuffer[i].vaoId); - } - - // Quads - Vertex buffers binding and attributes enable - // Vertex position buffer (shader-location = 0) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[0]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[0]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*3*4*sizeof(float), batch.vertexBuffer[i].vertices, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); - - // Vertex texcoord buffer (shader-location = 1) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[1]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[1]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*2*4*sizeof(float), batch.vertexBuffer[i].texcoords, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); - - // Vertex color buffer (shader-location = 3) - glGenBuffers(1, &batch.vertexBuffer[i].vboId[2]); - glBindBuffer(GL_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[2]); - glBufferData(GL_ARRAY_BUFFER, bufferElements*4*4*sizeof(unsigned char), batch.vertexBuffer[i].colors, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - - // Fill index buffer - glGenBuffers(1, &batch.vertexBuffer[i].vboId[3]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch.vertexBuffer[i].vboId[3]); -#if defined(GRAPHICS_API_OPENGL_33) - glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(int), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferElements*6*sizeof(short), batch.vertexBuffer[i].indices, GL_STATIC_DRAW); -#endif - } - - TRACELOG(LOG_INFO, "RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)"); - - // Unbind the current VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - //-------------------------------------------------------------------------------------------- - - // Init draw calls tracking system - //-------------------------------------------------------------------------------------------- - batch.draws = (DrawCall *)RL_MALLOC(DEFAULT_BATCH_DRAWCALLS*sizeof(DrawCall)); - - for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) - { - batch.draws[i].mode = RL_QUADS; - batch.draws[i].vertexCount = 0; - batch.draws[i].vertexAlignment = 0; - //batch.draws[i].vaoId = 0; - //batch.draws[i].shaderId = 0; - batch.draws[i].textureId = RLGL.State.defaultTextureId; - //batch.draws[i].RLGL.State.projection = MatrixIdentity(); - //batch.draws[i].RLGL.State.modelview = MatrixIdentity(); - } - - batch.buffersCount = numBuffers; // Record buffer count - batch.drawsCounter = 1; // Reset draws counter - batch.currentDepth = -1.0f; // Reset depth value - //-------------------------------------------------------------------------------------------- -#endif - - return batch; -} - -// Unload default internal buffers vertex data from CPU and GPU -void rlUnloadRenderBatch(RenderBatch batch) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Unbind everything - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - glDisableVertexAttribArray(0); - glDisableVertexAttribArray(1); - glDisableVertexAttribArray(2); - glDisableVertexAttribArray(3); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - - // Unload all vertex buffers data - for (int i = 0; i < batch.buffersCount; i++) - { - // Delete VBOs from GPU (VRAM) - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[0]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[1]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[2]); - glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[3]); - - // Delete VAOs from GPU (VRAM) - if (RLGL.ExtSupported.vao) glDeleteVertexArrays(1, &batch.vertexBuffer[i].vaoId); - - // Free vertex arrays memory from CPU (RAM) - RL_FREE(batch.vertexBuffer[i].vertices); - RL_FREE(batch.vertexBuffer[i].texcoords); - RL_FREE(batch.vertexBuffer[i].colors); - RL_FREE(batch.vertexBuffer[i].indices); - } - - // Unload arrays - RL_FREE(batch.vertexBuffer); - RL_FREE(batch.draws); -#endif -} - -// Draw render batch -// NOTE: We require a pointer to reset batch and increase current buffer (multi-buffer) -void rlDrawRenderBatch(RenderBatch *batch) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Update batch vertex buffers - //------------------------------------------------------------------------------------------------------------ - // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) - // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) - if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) - { - // Activate elements VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); - - // Vertex positions buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*3*sizeof(float), batch->vertexBuffer[batch->currentBuffer].vertices); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].vertices, GL_DYNAMIC_DRAW); // Update all buffer - - // Texture coordinates buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*2*sizeof(float), batch->vertexBuffer[batch->currentBuffer].texcoords); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].texcoords, GL_DYNAMIC_DRAW); // Update all buffer - - // Colors buffer - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); - glBufferSubData(GL_ARRAY_BUFFER, 0, batch->vertexBuffer[batch->currentBuffer].vCounter*4*sizeof(unsigned char), batch->vertexBuffer[batch->currentBuffer].colors); - //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*4*batch->vertexBuffer[batch->currentBuffer].elementsCount, batch->vertexBuffer[batch->currentBuffer].colors, GL_DYNAMIC_DRAW); // Update all buffer - - // NOTE: glMapBuffer() causes sync issue. - // If GPU is working with this buffer, glMapBuffer() will wait(stall) until GPU to finish its job. - // To avoid waiting (idle), you can call first glBufferData() with NULL pointer before glMapBuffer(). - // If you do that, the previous data in PBO will be discarded and glMapBuffer() returns a new - // allocated pointer immediately even if GPU is still working with the previous data. - - // Another option: map the buffer object into client's memory - // Probably this code could be moved somewhere else... - // batch->vertexBuffer[batch->currentBuffer].vertices = (float *)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); - // if (batch->vertexBuffer[batch->currentBuffer].vertices) - // { - // Update vertex data - // } - // glUnmapBuffer(GL_ARRAY_BUFFER); - - // Unbind the current VAO - if (RLGL.ExtSupported.vao) glBindVertexArray(0); - } - //------------------------------------------------------------------------------------------------------------ - - // Draw batch vertex buffers (considering VR stereo if required) - //------------------------------------------------------------------------------------------------------------ - Matrix matProjection = RLGL.State.projection; - Matrix matModelView = RLGL.State.modelview; - - int eyesCount = 1; - if (RLGL.State.stereoRender) eyesCount = 2; - - for (int eye = 0; eye < eyesCount; eye++) - { - if (eyesCount == 2) - { - // Setup current eye viewport (half screen width) - rlViewport(eye*RLGL.State.framebufferWidth/2, 0, RLGL.State.framebufferWidth/2, RLGL.State.framebufferHeight); - - // Set current eye view offset to modelview matrix - rlSetMatrixModelview(MatrixMultiply(matModelView, RLGL.State.viewOffsetStereo[eye])); - // Set current eye projection matrix - rlSetMatrixProjection(RLGL.State.projectionStereo[eye]); - } - - // Draw buffers - if (batch->vertexBuffer[batch->currentBuffer].vCounter > 0) - { - // Set current shader and upload current MVP matrix - glUseProgram(RLGL.State.currentShader.id); - - // Create modelview-projection matrix and upload to shader - Matrix matMVP = MatrixMultiply(RLGL.State.modelview, RLGL.State.projection); - glUniformMatrix4fv(RLGL.State.currentShader.locs[SHADER_LOC_MATRIX_MVP], 1, false, MatrixToFloat(matMVP)); - - if (RLGL.ExtSupported.vao) glBindVertexArray(batch->vertexBuffer[batch->currentBuffer].vaoId); - else - { - // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[0]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_POSITION]); - - // Bind vertex attrib: texcoord (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[1]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01], 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_TEXCOORD01]); - - // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[2]); - glVertexAttribPointer(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR], 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(RLGL.State.currentShader.locs[SHADER_LOC_VERTEX_COLOR]); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batch->vertexBuffer[batch->currentBuffer].vboId[3]); - } - - // Setup some default shader values - glUniform4f(RLGL.State.currentShader.locs[SHADER_LOC_COLOR_DIFFUSE], 1.0f, 1.0f, 1.0f, 1.0f); - glUniform1i(RLGL.State.currentShader.locs[SHADER_LOC_MAP_DIFFUSE], 0); // Active default sampler2D: texture0 - - // Activate additional sampler textures - // Those additional textures will be common for all draw calls of the batch - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) - { - if (RLGL.State.activeTextureId[i] > 0) - { - glActiveTexture(GL_TEXTURE0 + 1 + i); - glBindTexture(GL_TEXTURE_2D, RLGL.State.activeTextureId[i]); - } - } - - // Activate default sampler2D texture0 (one texture is always active for default batch shader) - // NOTE: Batch system accumulates calls by texture0 changes, additional textures are enabled for all the draw calls - glActiveTexture(GL_TEXTURE0); - - for (int i = 0, vertexOffset = 0; i < batch->drawsCounter; i++) - { - // Bind current draw call texture, activated as GL_TEXTURE0 and binded to sampler2D texture0 by default - glBindTexture(GL_TEXTURE_2D, batch->draws[i].textureId); - - if ((batch->draws[i].mode == RL_LINES) || (batch->draws[i].mode == RL_TRIANGLES)) glDrawArrays(batch->draws[i].mode, vertexOffset, batch->draws[i].vertexCount); - else - { -#if defined(GRAPHICS_API_OPENGL_33) - // We need to define the number of indices to be processed: quadsCount*6 - // NOTE: The final parameter tells the GPU the offset in bytes from the - // start of the index buffer to the location of the first index to process - glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_INT, (GLvoid *)(vertexOffset/4*6*sizeof(GLuint))); -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, batch->draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(vertexOffset/4*6*sizeof(GLushort))); -#endif - } - - vertexOffset += (batch->draws[i].vertexCount + batch->draws[i].vertexAlignment); - } - - if (!RLGL.ExtSupported.vao) - { - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } - - glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures - } - - if (RLGL.ExtSupported.vao) glBindVertexArray(0); // Unbind VAO - - glUseProgram(0); // Unbind shader program - } - //------------------------------------------------------------------------------------------------------------ - - // Reset batch buffers - //------------------------------------------------------------------------------------------------------------ - // Reset vertex counters for next frame - batch->vertexBuffer[batch->currentBuffer].vCounter = 0; - batch->vertexBuffer[batch->currentBuffer].tcCounter = 0; - batch->vertexBuffer[batch->currentBuffer].cCounter = 0; - - // Reset depth for next draw - batch->currentDepth = -1.0f; - - // Restore projection/modelview matrices - RLGL.State.projection = matProjection; - RLGL.State.modelview = matModelView; - - // Reset RLGL.currentBatch->draws array - for (int i = 0; i < DEFAULT_BATCH_DRAWCALLS; i++) - { - batch->draws[i].mode = RL_QUADS; - batch->draws[i].vertexCount = 0; - batch->draws[i].textureId = RLGL.State.defaultTextureId; - } - - // Reset active texture units for next batch - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) RLGL.State.activeTextureId[i] = 0; - - // Reset draws counter to one draw for the batch - batch->drawsCounter = 1; - //------------------------------------------------------------------------------------------------------------ - - // Change to next buffer in the list (in case of multi-buffering) - batch->currentBuffer++; - if (batch->currentBuffer >= batch->buffersCount) batch->currentBuffer = 0; -#endif -} - -// Set the active render batch for rlgl -void rlSetRenderBatchActive(RenderBatch *batch) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlDrawRenderBatch(RLGL.currentBatch); - - if (batch != NULL) RLGL.currentBatch = batch; - else RLGL.currentBatch = &RLGL.defaultBatch; -#endif -} - -// Update and draw internal render batch -void rlDrawRenderBatchActive(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside -#endif -} - -// Check internal buffer overflow for a given number of vertex -// and force a RenderBatch draw call if required -bool rlCheckRenderBatchLimit(int vCount) -{ - bool overflow = false; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >= - (RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementsCount*4)) - { - overflow = true; - rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside - } -#endif - - return overflow; -} - -// Textures data management -//----------------------------------------------------------------------------------------- -// Convert image data to OpenGL texture (returns OpenGL valid Id) -unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount) -{ - glBindTexture(GL_TEXTURE_2D, 0); // Free any old binding - - unsigned int id = 0; - - // Check texture format support by OpenGL 1.1 (compressed textures not supported) -#if defined(GRAPHICS_API_OPENGL_11) - if (format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) - { - TRACELOG(LOG_WARNING, "GL: OpenGL 1.1 does not support GPU compressed texture formats"); - return id; - } -#else - if ((!RLGL.ExtSupported.texCompDXT) && ((format == PIXELFORMAT_COMPRESSED_DXT1_RGB) || (format == PIXELFORMAT_COMPRESSED_DXT1_RGBA) || - (format == PIXELFORMAT_COMPRESSED_DXT3_RGBA) || (format == PIXELFORMAT_COMPRESSED_DXT5_RGBA))) - { - TRACELOG(LOG_WARNING, "GL: DXT compressed texture format not supported"); - return id; - } -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((!RLGL.ExtSupported.texCompETC1) && (format == PIXELFORMAT_COMPRESSED_ETC1_RGB)) - { - TRACELOG(LOG_WARNING, "GL: ETC1 compressed texture format not supported"); - return id; - } - - if ((!RLGL.ExtSupported.texCompETC2) && ((format == PIXELFORMAT_COMPRESSED_ETC2_RGB) || (format == PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA))) - { - TRACELOG(LOG_WARNING, "GL: ETC2 compressed texture format not supported"); - return id; - } - - if ((!RLGL.ExtSupported.texCompPVRT) && ((format == PIXELFORMAT_COMPRESSED_PVRT_RGB) || (format == PIXELFORMAT_COMPRESSED_PVRT_RGBA))) - { - TRACELOG(LOG_WARNING, "GL: PVRT compressed texture format not supported"); - return id; - } - - if ((!RLGL.ExtSupported.texCompASTC) && ((format == PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA) || (format == PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA))) - { - TRACELOG(LOG_WARNING, "GL: ASTC compressed texture format not supported"); - return id; - } -#endif -#endif // GRAPHICS_API_OPENGL_11 - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - glGenTextures(1, &id); // Generate texture id - - glBindTexture(GL_TEXTURE_2D, id); - - int mipWidth = width; - int mipHeight = height; - int mipOffset = 0; // Mipmap data offset - - // Load the different mipmap levels - for (int i = 0; i < mipmapCount; i++) - { - unsigned int mipSize = rlGetPixelDataSize(mipWidth, mipHeight, format); - - unsigned int glInternalFormat, glFormat, glType; - rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); - - TRACELOGD("TEXTURE: Load mipmap level %i (%i x %i), size: %i, offset: %i", i, mipWidth, mipHeight, mipSize, mipOffset); - - if (glInternalFormat != -1) - { - if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, glFormat, glType, (unsigned char *)data + mipOffset); -#if !defined(GRAPHICS_API_OPENGL_11) - else glCompressedTexImage2D(GL_TEXTURE_2D, i, glInternalFormat, mipWidth, mipHeight, 0, mipSize, (unsigned char *)data + mipOffset); -#endif - -#if defined(GRAPHICS_API_OPENGL_33) - if (format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) - { - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - } - else if (format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) - { -#if defined(GRAPHICS_API_OPENGL_21) - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA }; -#elif defined(GRAPHICS_API_OPENGL_33) - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_GREEN }; -#endif - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - } -#endif - } - - mipWidth /= 2; - mipHeight /= 2; - mipOffset += mipSize; - - // Security check for NPOT textures - if (mipWidth < 1) mipWidth = 1; - if (mipHeight < 1) mipHeight = 1; - } - - // Texture parameters configuration - // NOTE: glTexParameteri does NOT affect texture uploading, just the way it's used -#if defined(GRAPHICS_API_OPENGL_ES2) - // NOTE: OpenGL ES 2.0 with no GL_OES_texture_npot support (i.e. WebGL) has limited NPOT support, so CLAMP_TO_EDGE must be used - if (RLGL.ExtSupported.texNPOT) - { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // Set texture to repeat on x-axis - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Set texture to repeat on y-axis - } - else - { - // NOTE: If using negative texture coordinates (LoadOBJ()), it does not work! - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); // Set texture to clamp on x-axis - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Set texture to clamp on y-axis - } -#else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // Set texture to repeat on x-axis - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Set texture to repeat on y-axis -#endif - - // Magnification and minification filters - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // Alternative: GL_LINEAR - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // Alternative: GL_LINEAR - -#if defined(GRAPHICS_API_OPENGL_33) - if (mipmapCount > 1) - { - // Activate Trilinear filtering if mipmaps are available - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - } -#endif - - // At this point we have the texture loaded in GPU and texture parameters configured - - // NOTE: If mipmaps were not in data, they are not generated automatically - - // Unbind current texture - glBindTexture(GL_TEXTURE_2D, 0); - - if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Texture loaded successfully (%ix%i - %i mipmaps)", id, width, height, mipmapCount); - else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load texture"); - - return id; -} - -// Load depth texture/renderbuffer (to be attached to fbo) -// WARNING: OpenGL ES 2.0 requires GL_OES_depth_texture/WEBGL_depth_texture extensions -unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer) -{ - unsigned int id = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // In case depth textures not supported, we force renderbuffer usage - if (!RLGL.ExtSupported.texDepth) useRenderBuffer = true; - - // NOTE: We let the implementation to choose the best bit-depth - // Possible formats: GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32 and GL_DEPTH_COMPONENT32F - unsigned int glInternalFormat = GL_DEPTH_COMPONENT; - -#if defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.maxDepthBits == 32) glInternalFormat = GL_DEPTH_COMPONENT32_OES; - else if (RLGL.ExtSupported.maxDepthBits == 24) glInternalFormat = GL_DEPTH_COMPONENT24_OES; - else glInternalFormat = GL_DEPTH_COMPONENT16; -#endif - - if (!useRenderBuffer && RLGL.ExtSupported.texDepth) - { - glGenTextures(1, &id); - glBindTexture(GL_TEXTURE_2D, id); - glTexImage2D(GL_TEXTURE_2D, 0, glInternalFormat, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - glBindTexture(GL_TEXTURE_2D, 0); - - TRACELOG(LOG_INFO, "TEXTURE: Depth texture loaded successfully"); - } - else - { - // Create the renderbuffer that will serve as the depth attachment for the framebuffer - // NOTE: A renderbuffer is simpler than a texture and could offer better performance on embedded devices - glGenRenderbuffers(1, &id); - glBindRenderbuffer(GL_RENDERBUFFER, id); - glRenderbufferStorage(GL_RENDERBUFFER, glInternalFormat, width, height); - - glBindRenderbuffer(GL_RENDERBUFFER, 0); - - TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Depth renderbuffer loaded successfully (%i bits)", id, (RLGL.ExtSupported.maxDepthBits >= 24)? RLGL.ExtSupported.maxDepthBits : 16); - } -#endif - - return id; -} - -// Load texture cubemap -// NOTE: Cubemap data is expected to be 6 images in a single data array (one after the other), -// expected the following convention: +X, -X, +Y, -Y, +Z, -Z -unsigned int rlLoadTextureCubemap(void *data, int size, int format) -{ - unsigned int id = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - unsigned int dataSize = rlGetPixelDataSize(size, size, format); - - glGenTextures(1, &id); - glBindTexture(GL_TEXTURE_CUBE_MAP, id); - - unsigned int glInternalFormat, glFormat, glType; - rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); - - if (glInternalFormat != -1) - { - // Load cubemap faces - for (unsigned int i = 0; i < 6; i++) - { - if (data == NULL) - { - if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) - { - if (format == PIXELFORMAT_UNCOMPRESSED_R32G32B32) - { - // Instead of using a sized internal texture format (GL_RGB16F, GL_RGB32F), we let the driver to choose the better format for us (GL_RGB) - if (RLGL.ExtSupported.texFloat32) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB, size, size, 0, GL_RGB, GL_FLOAT, NULL); - else TRACELOG(LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); - } - else if ((format == PIXELFORMAT_UNCOMPRESSED_R32) || (format == PIXELFORMAT_UNCOMPRESSED_R32G32B32A32)) TRACELOG(LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); - else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, NULL); - } - else TRACELOG(LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format"); - } - else - { - if (format < PIXELFORMAT_COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize); - else glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, dataSize, (unsigned char *)data + i*dataSize); - } - -#if defined(GRAPHICS_API_OPENGL_33) - if (format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) - { - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; - glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - } - else if (format == PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA) - { -#if defined(GRAPHICS_API_OPENGL_21) - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA }; -#elif defined(GRAPHICS_API_OPENGL_33) - GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_GREEN }; -#endif - glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - } -#endif - } - } - - // Set cubemap texture sampling parameters - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -#if defined(GRAPHICS_API_OPENGL_33) - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); // Flag not supported on OpenGL ES 2.0 -#endif - - glBindTexture(GL_TEXTURE_CUBE_MAP, 0); -#endif - - if (id > 0) TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Cubemap texture loaded successfully (%ix%i)", id, size, size); - else TRACELOG(LOG_WARNING, "TEXTURE: Failed to load cubemap texture"); - - return id; -} - -// Update already loaded texture in GPU with new data -// NOTE: We don't know safely if internal texture format is the expected one... -void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data) -{ - glBindTexture(GL_TEXTURE_2D, id); - - unsigned int glInternalFormat, glFormat, glType; - rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); - - if ((glInternalFormat != -1) && (format < PIXELFORMAT_COMPRESSED_DXT1_RGB)) - { - glTexSubImage2D(GL_TEXTURE_2D, 0, offsetX, offsetY, width, height, glFormat, glType, (unsigned char *)data); - } - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to update for current texture format (%i)", id, format); -} - -// Get OpenGL internal formats and data type from raylib PixelFormat -void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType) -{ - *glInternalFormat = -1; - *glFormat = -1; - *glType = -1; - - switch (format) - { - #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_ES2) - // NOTE: on OpenGL ES 2.0 (WebGL), internalFormat must match format and options allowed are: GL_LUMINANCE, GL_RGB, GL_RGBA - case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_LUMINANCE_ALPHA; *glFormat = GL_LUMINANCE_ALPHA; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; - case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; - #if !defined(GRAPHICS_API_OPENGL_11) - case PIXELFORMAT_UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float - case PIXELFORMAT_UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float - case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float - #endif - #elif defined(GRAPHICS_API_OPENGL_33) - case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_R8; *glFormat = GL_RED; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_RG8; *glFormat = GL_RG; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB565; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB8; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGB5_A1; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; - case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA4; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *glInternalFormat = GL_RGBA8; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_BYTE; break; - case PIXELFORMAT_UNCOMPRESSED_R32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_R32F; *glFormat = GL_RED; *glType = GL_FLOAT; break; - case PIXELFORMAT_UNCOMPRESSED_R32G32B32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGB32F; *glFormat = GL_RGB; *glType = GL_FLOAT; break; - case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: if (RLGL.ExtSupported.texFloat32) *glInternalFormat = GL_RGBA32F; *glFormat = GL_RGBA; *glType = GL_FLOAT; break; - #endif - #if !defined(GRAPHICS_API_OPENGL_11) - case PIXELFORMAT_COMPRESSED_DXT1_RGB: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; break; - case PIXELFORMAT_COMPRESSED_DXT1_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; - case PIXELFORMAT_COMPRESSED_DXT3_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; - case PIXELFORMAT_COMPRESSED_DXT5_RGBA: if (RLGL.ExtSupported.texCompDXT) *glInternalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; - case PIXELFORMAT_COMPRESSED_ETC1_RGB: if (RLGL.ExtSupported.texCompETC1) *glInternalFormat = GL_ETC1_RGB8_OES; break; // NOTE: Requires OpenGL ES 2.0 or OpenGL 4.3 - case PIXELFORMAT_COMPRESSED_ETC2_RGB: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGB8_ETC2; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 - case PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: if (RLGL.ExtSupported.texCompETC2) *glInternalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3 - case PIXELFORMAT_COMPRESSED_PVRT_RGB: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU - case PIXELFORMAT_COMPRESSED_PVRT_RGBA: if (RLGL.ExtSupported.texCompPVRT) *glInternalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU - case PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 - case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: if (RLGL.ExtSupported.texCompASTC) *glInternalFormat = GL_COMPRESSED_RGBA_ASTC_8x8_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3 - #endif - default: TRACELOG(LOG_WARNING, "TEXTURE: Current format not supported (%i)", format); break; - } -} - -// Unload texture from GPU memory -void rlUnloadTexture(unsigned int id) -{ - glDeleteTextures(1, &id); -} - -// Generate mipmap data for selected texture -void rlGenerateMipmaps(Texture2D *texture) -{ - glBindTexture(GL_TEXTURE_2D, texture->id); - - // Check if texture is power-of-two (POT) - bool texIsPOT = false; - - if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && - ((texture->height > 0) && ((texture->height & (texture->height - 1)) == 0))) texIsPOT = true; - -#if defined(GRAPHICS_API_OPENGL_11) - if (texIsPOT) - { - // WARNING: Manual mipmap generation only works for RGBA 32bit textures! - if (texture->format == PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) - { - // Retrieve texture data from VRAM - void *texData = rlReadTexturePixels(*texture); - - // NOTE: Texture data size is reallocated to fit mipmaps data - // NOTE: CPU mipmap generation only supports RGBA 32bit data - int mipmapCount = rlGenerateMipmapsData(texData, texture->width, texture->height); - - int size = texture->width*texture->height*4; - int offset = size; - - int mipWidth = texture->width/2; - int mipHeight = texture->height/2; - - // Load the mipmaps - for (int level = 1; level < mipmapCount; level++) - { - glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, mipWidth, mipHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char *)texData + offset); - - size = mipWidth*mipHeight*4; - offset += size; - - mipWidth /= 2; - mipHeight /= 2; - } - - texture->mipmaps = mipmapCount + 1; - RL_FREE(texData); // Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data - - TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Mipmaps generated manually on CPU side, total: %i", texture->id, texture->mipmaps); - } - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps for provided texture format", texture->id); - } -#endif -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if ((texIsPOT) || (RLGL.ExtSupported.texNPOT)) - { - //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE - glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps - - #define MIN(a,b) (((a)<(b))?(a):(b)) - #define MAX(a,b) (((a)>(b))?(a):(b)) - - texture->mipmaps = 1 + (int)floor(log(MAX(texture->width, texture->height))/log(2)); - TRACELOG(LOG_INFO, "TEXTURE: [ID %i] Mipmaps generated automatically, total: %i", texture->id, texture->mipmaps); - } -#endif - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Failed to generate mipmaps", texture->id); - - glBindTexture(GL_TEXTURE_2D, 0); -} - - -// Read texture pixel data -void *rlReadTexturePixels(Texture2D texture) -{ - void *pixels = NULL; - -#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - glBindTexture(GL_TEXTURE_2D, texture.id); - - // NOTE: Using texture.id, we can retrieve some texture info (but not on OpenGL ES 2.0) - // Possible texture info: GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE - //int width, height, format; - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); - //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); - - // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. - // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. - // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) - // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.) - glPixelStorei(GL_PACK_ALIGNMENT, 1); - - unsigned int glInternalFormat, glFormat, glType; - rlGetGlTextureFormats(texture.format, &glInternalFormat, &glFormat, &glType); - unsigned int size = rlGetPixelDataSize(texture.width, texture.height, texture.format); - - if ((glInternalFormat != -1) && (texture.format < PIXELFORMAT_COMPRESSED_DXT1_RGB)) - { - pixels = RL_MALLOC(size); - glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); - } - else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Data retrieval not suported for pixel format (%i)", texture.id, texture.format); - - glBindTexture(GL_TEXTURE_2D, 0); -#endif - -#if defined(GRAPHICS_API_OPENGL_ES2) - // glGetTexImage() is not available on OpenGL ES 2.0 - // Texture width and height are required on OpenGL ES 2.0. There is no way to get it from texture id. - // Two possible Options: - // 1 - Bind texture to color fbo attachment and glReadPixels() - // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() - // We are using Option 1, just need to care for texture format on retrieval - // NOTE: This behaviour could be conditioned by graphic driver... - unsigned int fboId = rlLoadFramebuffer(texture.width, texture.height); - - // TODO: Create depth texture/renderbuffer for fbo? - - glBindFramebuffer(GL_FRAMEBUFFER, fboId); - glBindTexture(GL_TEXTURE_2D, 0); - - // Attach our texture to FBO - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.id, 0); - - // We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format - pixels = (unsigned char *)RL_MALLOC(rlGetPixelDataSize(texture.width, texture.height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)); - glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - // Clean up temporal fbo - rlUnloadFramebuffer(fboId); -#endif - - return pixels; -} - - -// Read screen pixel data (color buffer) -unsigned char *rlReadScreenPixels(int width, int height) -{ - unsigned char *screenData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); - - // NOTE 1: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer - // NOTE 2: We are getting alpha channel! Be careful, it can be transparent if not cleared properly! - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); - - // Flip image vertically! - unsigned char *imgData = (unsigned char *)RL_MALLOC(width*height*4*sizeof(unsigned char)); - - for (int y = height - 1; y >= 0; y--) - { - for (int x = 0; x < (width*4); x++) - { - imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; // Flip line - - // Set alpha component value to 255 (no trasparent image retrieval) - // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! - if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255; - } - } - - RL_FREE(screenData); - - return imgData; // NOTE: image data should be freed -} - -// Framebuffer management (fbo) -//----------------------------------------------------------------------------------------- -// Load a framebuffer to be used for rendering -// NOTE: No textures attached -unsigned int rlLoadFramebuffer(int width, int height) -{ - unsigned int fboId = 0; - -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - glGenFramebuffers(1, &fboId); // Create the framebuffer object - glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind any framebuffer -#endif - - return fboId; -} - -// Attach color buffer texture to an fbo (unloads previous attachment) -// NOTE: Attach type: 0-Color, 1-Depth renderbuffer, 2-Depth texture -void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - glBindFramebuffer(GL_FRAMEBUFFER, fboId); - - switch (attachType) - { - case RL_ATTACHMENT_COLOR_CHANNEL0: - case RL_ATTACHMENT_COLOR_CHANNEL1: - case RL_ATTACHMENT_COLOR_CHANNEL2: - case RL_ATTACHMENT_COLOR_CHANNEL3: - case RL_ATTACHMENT_COLOR_CHANNEL4: - case RL_ATTACHMENT_COLOR_CHANNEL5: - case RL_ATTACHMENT_COLOR_CHANNEL6: - case RL_ATTACHMENT_COLOR_CHANNEL7: - { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_2D, texId, mipLevel); - else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_RENDERBUFFER, texId); - else if (texType >= RL_ATTACHMENT_CUBEMAP_POSITIVE_X) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + attachType, GL_TEXTURE_CUBE_MAP_POSITIVE_X + texType, texId, mipLevel); - - } break; - case RL_ATTACHMENT_DEPTH: - { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, texId, mipLevel); - else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, texId); - - } break; - case RL_ATTACHMENT_STENCIL: - { - if (texType == RL_ATTACHMENT_TEXTURE2D) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, texId, mipLevel); - else if (texType == RL_ATTACHMENT_RENDERBUFFER) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, texId); - - } break; - default: break; - } - - glBindFramebuffer(GL_FRAMEBUFFER, 0); -#endif -} - -// Verify render texture is complete -bool rlFramebufferComplete(unsigned int id) -{ - bool result = false; - -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - glBindFramebuffer(GL_FRAMEBUFFER, id); - - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - - if (status != GL_FRAMEBUFFER_COMPLETE) - { - switch (status) - { - case GL_FRAMEBUFFER_UNSUPPORTED: TRACELOG(LOG_WARNING, "FBO: [ID %i] Framebuffer is unsupported", id); break; - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: TRACELOG(LOG_WARNING, "FBO: [ID %i] Framebuffer has incomplete attachment", id); break; -#if defined(GRAPHICS_API_OPENGL_ES2) - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: TRACELOG(LOG_WARNING, "FBO: [ID %i] Framebuffer has incomplete dimensions", id); break; -#endif - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: TRACELOG(LOG_WARNING, "FBO: [ID %i] Framebuffer has a missing attachment", id); break; - default: break; - } - } - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - result = (status == GL_FRAMEBUFFER_COMPLETE); -#endif - - return result; -} - -// Unload framebuffer from GPU memory -// NOTE: All attached textures/cubemaps/renderbuffers are also deleted -void rlUnloadFramebuffer(unsigned int id) -{ -#if (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)) && defined(SUPPORT_RENDER_TEXTURES_HINT) - - // Query depth attachment to automatically delete texture/renderbuffer - int depthType = 0, depthId = 0; - glBindFramebuffer(GL_FRAMEBUFFER, id); // Bind framebuffer to query depth texture type - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &depthType); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &depthId); - - unsigned int depthIdU = (unsigned int)depthId; - if (depthType == GL_RENDERBUFFER) glDeleteRenderbuffers(1, &depthIdU); - else if (depthType == GL_RENDERBUFFER) glDeleteTextures(1, &depthIdU); - - // NOTE: If a texture object is deleted while its image is attached to the *currently bound* framebuffer, - // the texture image is automatically detached from the currently bound framebuffer. - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &id); - - TRACELOG(LOG_INFO, "FBO: [ID %i] Unloaded framebuffer from VRAM (GPU)", id); -#endif -} - -// Vertex data management -//----------------------------------------------------------------------------------------- -// Load a new attributes buffer -unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic) -{ - unsigned int id = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glGenBuffers(1, &id); - glBindBuffer(GL_ARRAY_BUFFER, id); - glBufferData(GL_ARRAY_BUFFER, size, buffer, dynamic? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); -#endif - - return id; -} - -// Load a new attributes element buffer -unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic) -{ - unsigned int id = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glGenBuffers(1, &id); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, buffer, dynamic? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); -#endif - - return id; -} - -void rlEnableVertexBuffer(unsigned int id) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ARRAY_BUFFER, id); -#endif -} - -void rlDisableVertexBuffer(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ARRAY_BUFFER, 0); -#endif -} - -void rlEnableVertexBufferElement(unsigned int id) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id); -#endif -} - -void rlDisableVertexBufferElement(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); -#endif -} - -// Update GPU buffer with new data -// NOTE: dataSize and offset must be provided in bytes -void rlUpdateVertexBuffer(int bufferId, void *data, int dataSize, int offset) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindBuffer(GL_ARRAY_BUFFER, bufferId); - glBufferSubData(GL_ARRAY_BUFFER, offset, dataSize, data); -#endif -} - -bool rlEnableVertexArray(unsigned int vaoId) -{ - bool result = false; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.vao) - { - glBindVertexArray(vaoId); - result = true; - } -#endif - return result; -} - -void rlDisableVertexArray(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.vao) glBindVertexArray(0); -#endif -} - -void rlEnableVertexAttribute(unsigned int index) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glEnableVertexAttribArray(index); -#endif -} - -void rlDisableVertexAttribute(unsigned int index) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDisableVertexAttribArray(index); -#endif -} - -void rlDrawVertexArray(int offset, int count) -{ - glDrawArrays(GL_TRIANGLES, offset, count); -} - -void rlDrawVertexArrayElements(int offset, int count, void *buffer) -{ - glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short*)buffer + offset); -} - -void rlDrawVertexArrayInstanced(int offset, int count, int instances) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDrawArraysInstanced(GL_TRIANGLES, 0, count, instances); -#endif -} - -void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short*)buffer + offset, instances); -#endif -} - -#if defined(GRAPHICS_API_OPENGL_11) -void rlEnableStatePointer(int vertexAttribType, void *buffer) -{ - if (buffer != NULL) glEnableClientState(vertexAttribType); - switch (vertexAttribType) - { - case GL_VERTEX_ARRAY: glVertexPointer(3, GL_FLOAT, 0, buffer); break; - case GL_TEXTURE_COORD_ARRAY: glTexCoordPointer(2, GL_FLOAT, 0, buffer); break; - case GL_NORMAL_ARRAY: if (buffer != NULL) glNormalPointer(GL_FLOAT, 0, buffer); break; - case GL_COLOR_ARRAY: if (buffer != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, buffer); break; - //case GL_INDEX_ARRAY: if (buffer != NULL) glIndexPointer(GL_SHORT, 0, buffer); break; // Indexed colors - default: break; - } -} - -void rlDisableStatePointer(int vertexAttribType) -{ - glDisableClientState(vertexAttribType); -} -#endif - -unsigned int rlLoadVertexArray(void) -{ - unsigned int vaoId = 0; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glGenVertexArrays(1, &vaoId); -#endif - return vaoId; -} - -void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glVertexAttribPointer(index, compSize, type, normalized, stride, pointer); -#endif -} - -void rlSetVertexAttributeDivisor(unsigned int index, int divisor) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glVertexAttribDivisor(index, divisor); -#endif -} - -void rlUnloadVertexArray(unsigned int vaoId) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.ExtSupported.vao) - { - glBindVertexArray(0); - glDeleteVertexArrays(1, &vaoId); - TRACELOG(LOG_INFO, "VAO: [ID %i] Unloaded vertex array data from VRAM (GPU)", vaoId); - } -#endif -} - -void rlUnloadVertexBuffer(unsigned int vboId) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteBuffers(1, &vboId); - //TRACELOG(LOG_INFO, "VBO: Unloaded vertex data from VRAM (GPU)"); -#endif -} - -// Shaders management -//----------------------------------------------------------------------------------------------- -// Load shader from code strings -// NOTE: If shader string is NULL, using default vertex/fragment shaders -unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode) -{ - unsigned int id = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - unsigned int vertexShaderId = RLGL.State.defaultVShaderId; - unsigned int fragmentShaderId = RLGL.State.defaultFShaderId; - - if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER); - if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER); - - if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShader.id; - else - { - id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId); - - if (vertexShaderId != RLGL.State.defaultVShaderId) - { - // Detach shader before deletion to make sure memory is freed - glDetachShader(id, vertexShaderId); - glDeleteShader(vertexShaderId); - } - if (fragmentShaderId != RLGL.State.defaultFShaderId) - { - // Detach shader before deletion to make sure memory is freed - glDetachShader(id, fragmentShaderId); - glDeleteShader(fragmentShaderId); - } - - if (id == 0) - { - TRACELOG(LOG_WARNING, "SHADER: Failed to load custom shader code"); - id = RLGL.State.defaultShader.id; - } - } - - // Get available shader uniforms - // NOTE: This information is useful for debug... - int uniformCount = -1; - - glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount); - - for (int i = 0; i < uniformCount; i++) - { - int namelen = -1; - int num = -1; - char name[256]; // Assume no variable names longer than 256 - GLenum type = GL_ZERO; - - // Get the name of the uniforms - glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name); - - name[namelen] = 0; - - TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name)); - } -#endif - - return id; -} - -// Compile custom shader and return shader id -unsigned int rlCompileShader(const char *shaderCode, int type) -{ - unsigned int shader = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - shader = glCreateShader(type); - glShaderSource(shader, 1, &shaderCode, NULL); - - GLint success = 0; - glCompileShader(shader); - glGetShaderiv(shader, GL_COMPILE_STATUS, &success); - - if (success == GL_FALSE) - { - switch (type) - { - case GL_VERTEX_SHADER: TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to compile vertex shader code", shader); break; - case GL_FRAGMENT_SHADER: TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to compile fragment shader code", shader); break; - //case GL_GEOMETRY_SHADER: - //case GL_COMPUTE_SHADER: - default: break; - } - - int maxLength = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength); - - if (maxLength > 0) - { - int length = 0; - char *log = (char *)RL_CALLOC(maxLength, sizeof(char)); - glGetShaderInfoLog(shader, maxLength, &length, log); - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Compile error: %s", shader, log); - RL_FREE(log); - } - } - else - { - switch (type) - { - case GL_VERTEX_SHADER: TRACELOG(LOG_INFO, "SHADER: [ID %i] Vertex shader compiled successfully", shader); break; - case GL_FRAGMENT_SHADER: TRACELOG(LOG_INFO, "SHADER: [ID %i] Fragment shader compiled successfully", shader); break; - //case GL_GEOMETRY_SHADER: - //case GL_COMPUTE_SHADER: - default: break; - } - } -#endif - - return shader; -} - -// Load custom shader strings and return program id -unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) -{ - unsigned int program = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - GLint success = 0; - program = glCreateProgram(); - - glAttachShader(program, vShaderId); - glAttachShader(program, fShaderId); - - // NOTE: Default attribute shader locations must be binded before linking - glBindAttribLocation(program, 0, DEFAULT_SHADER_ATTRIB_NAME_POSITION); - glBindAttribLocation(program, 1, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD); - glBindAttribLocation(program, 2, DEFAULT_SHADER_ATTRIB_NAME_NORMAL); - glBindAttribLocation(program, 3, DEFAULT_SHADER_ATTRIB_NAME_COLOR); - glBindAttribLocation(program, 4, DEFAULT_SHADER_ATTRIB_NAME_TANGENT); - glBindAttribLocation(program, 5, DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2); - - // NOTE: If some attrib name is no found on the shader, it locations becomes -1 - - glLinkProgram(program); - - // NOTE: All uniform variables are intitialised to 0 when a program links - - glGetProgramiv(program, GL_LINK_STATUS, &success); - - if (success == GL_FALSE) - { - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to link shader program", program); - - int maxLength = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); - - if (maxLength > 0) - { - int length = 0; - char *log = (char *)RL_CALLOC(maxLength, sizeof(char)); - glGetProgramInfoLog(program, maxLength, &length, log); - TRACELOG(LOG_WARNING, "SHADER: [ID %i] Link error: %s", program, log); - RL_FREE(log); - } - - glDeleteProgram(program); - - program = 0; - } - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Program shader loaded successfully", program); -#endif - return program; -} - -// Unload shader program -void rlUnloadShaderProgram(unsigned int id) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteProgram(id); - - TRACELOG(LOG_INFO, "SHADER: [ID %i] Unloaded shader program data from VRAM (GPU)", id); -#endif -} - -// Get shader location uniform -int rlGetLocationUniform(unsigned int shaderId, const char *uniformName) -{ - int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - location = glGetUniformLocation(shaderId, uniformName); - - if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader uniform: %s", shaderId, uniformName); - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader uniform (%s) set at location: %i", shaderId, uniformName, location); -#endif - return location; -} - -// Get shader location attribute -int rlGetLocationAttrib(unsigned int shaderId, const char *attribName) -{ - int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - location = glGetAttribLocation(shaderId, attribName); - - if (location == -1) TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to find shader attribute: %s", shaderId, attribName); - else TRACELOG(LOG_INFO, "SHADER: [ID %i] Shader attribute (%s) set at location: %i", shaderId, attribName, location); -#endif - return location; -} - -// Set shader value uniform -void rlSetUniform(int locIndex, const void *value, int uniformType, int count) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - switch (uniformType) - { - case SHADER_UNIFORM_FLOAT: glUniform1fv(locIndex, count, (float *)value); break; - case SHADER_UNIFORM_VEC2: glUniform2fv(locIndex, count, (float *)value); break; - case SHADER_UNIFORM_VEC3: glUniform3fv(locIndex, count, (float *)value); break; - case SHADER_UNIFORM_VEC4: glUniform4fv(locIndex, count, (float *)value); break; - case SHADER_UNIFORM_INT: glUniform1iv(locIndex, count, (int *)value); break; - case SHADER_UNIFORM_IVEC2: glUniform2iv(locIndex, count, (int *)value); break; - case SHADER_UNIFORM_IVEC3: glUniform3iv(locIndex, count, (int *)value); break; - case SHADER_UNIFORM_IVEC4: glUniform4iv(locIndex, count, (int *)value); break; - case SHADER_UNIFORM_SAMPLER2D: glUniform1iv(locIndex, count, (int *)value); break; - default: TRACELOG(LOG_WARNING, "SHADER: Failed to set uniform value, data type not recognized"); - } -#endif -} - -// Set shader value attribute -void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - switch (attribType) - { - case SHADER_ATTRIB_FLOAT: if (count == 1) glVertexAttrib1fv(locIndex, (float *)value); break; - case SHADER_ATTRIB_VEC2: if (count == 2) glVertexAttrib2fv(locIndex, (float *)value); break; - case SHADER_ATTRIB_VEC3: if (count == 3) glVertexAttrib3fv(locIndex, (float *)value); break; - case SHADER_ATTRIB_VEC4: if (count == 4) glVertexAttrib4fv(locIndex, (float *)value); break; - default: TRACELOG(LOG_WARNING, "SHADER: Failed to set attrib default value, data type not recognized"); - } -#endif -} - -// Set shader value uniform matrix -void rlSetUniformMatrix(int locIndex, Matrix mat) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUniformMatrix4fv(locIndex, 1, false, MatrixToFloat(mat)); -#endif -} - -// Set shader value uniform sampler -void rlSetUniformSampler(int locIndex, unsigned int textureId) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Check if texture is already active - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) if (RLGL.State.activeTextureId[i] == textureId) return; - - // Register a new active texture for the internal batch system - // NOTE: Default texture is always activated as GL_TEXTURE0 - for (int i = 0; i < MAX_BATCH_ACTIVE_TEXTURES; i++) - { - if (RLGL.State.activeTextureId[i] == 0) - { - glUniform1i(locIndex, 1 + i); // Activate new texture unit - RLGL.State.activeTextureId[i] = textureId; // Save texture id for binding on drawing - break; - } - } -#endif -} - -// Set shader currently active -void rlSetShader(Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (RLGL.State.currentShader.id != shader.id) - { - rlDrawRenderBatch(RLGL.currentBatch); - RLGL.State.currentShader = shader; - } -#endif -} - -// Matrix state management -//----------------------------------------------------------------------------------------- -// Return internal modelview matrix -Matrix rlGetMatrixModelview(void) -{ - Matrix matrix = MatrixIdentity(); -#if defined(GRAPHICS_API_OPENGL_11) - float mat[16]; - glGetFloatv(GL_MODELVIEW_MATRIX, mat); - matrix.m0 = mat[0]; matrix.m1 = mat[1]; matrix.m2 = mat[2]; matrix.m3 = mat[3]; - matrix.m4 = mat[4]; matrix.m5 = mat[5]; matrix.m6 = mat[6]; matrix.m7 = mat[7]; - matrix.m8 = mat[8]; matrix.m9 = mat[9]; matrix.m10 = mat[10]; matrix.m11 = mat[11]; - matrix.m12 = mat[12]; matrix.m13 = mat[13]; matrix.m14 = mat[14]; matrix.m15 = mat[15]; -#else - matrix = RLGL.State.modelview; -#endif - return matrix; -} - -// Return internal projection matrix -Matrix rlGetMatrixProjection(void) -{ -#if defined(GRAPHICS_API_OPENGL_11) - float mat[16]; - glGetFloatv(GL_PROJECTION_MATRIX,mat); - Matrix m; - m.m0 = mat[0]; m.m1 = mat[1]; m.m2 = mat[2]; m.m3 = mat[3]; - m.m4 = mat[4]; m.m5 = mat[5]; m.m6 = mat[6]; m.m7 = mat[7]; - m.m8 = mat[8]; m.m9 = mat[9]; m.m10 = mat[10]; m.m11 = mat[11]; - m.m12 = mat[12]; m.m13 = mat[13]; m.m14 = mat[14]; m.m15 = mat[15]; - return m; -#else - return RLGL.State.projection; -#endif -} - -// Get internal accumulated transform matrix -Matrix rlGetMatrixTransform(void) -{ - Matrix mat = MatrixIdentity(); -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // TODO: Consider possible transform matrices in the RLGL.State.stack - // Is this the right order? or should we start with the first stored matrix instead of the last one? - //Matrix matStackTransform = MatrixIdentity(); - //for (int i = RLGL.State.stackCounter; i > 0; i--) matStackTransform = MatrixMultiply(RLGL.State.stack[i], matStackTransform); - mat = RLGL.State.transform; -#endif - return mat; -} - -// Get internal projection matrix for stereo render (selected eye) -RLAPI Matrix rlGetMatrixProjectionStereo(int eye) -{ - Matrix mat = MatrixIdentity(); -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - mat = RLGL.State.projectionStereo[eye]; -#endif - return mat; -} - -// Get internal view offset matrix for stereo render (selected eye) -RLAPI Matrix rlGetMatrixViewOffsetStereo(int eye) -{ - Matrix mat = MatrixIdentity(); -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - mat = RLGL.State.viewOffsetStereo[eye]; -#endif - return mat; -} - -// Set a custom modelview matrix (replaces internal modelview matrix) -void rlSetMatrixModelview(Matrix view) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.modelview = view; -#endif -} - -// Set a custom projection matrix (replaces internal projection matrix) -void rlSetMatrixProjection(Matrix projection) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.projection = projection; -#endif -} - -// Set eyes projection matrices for stereo rendering -void rlSetMatrixProjectionStereo(Matrix right, Matrix left) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.projectionStereo[0] = right; - RLGL.State.projectionStereo[1] = left; -#endif -} - -// Set eyes view offsets matrices for stereo rendering -void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - RLGL.State.viewOffsetStereo[0] = right; - RLGL.State.viewOffsetStereo[1] = left; -#endif -} - -// Load and draw a 1x1 XY quad in NDC -void rlLoadDrawQuad(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - unsigned int quadVAO = 0; - unsigned int quadVBO = 0; - - float vertices[] = { - // Positions Texcoords - -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, - -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, - 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, - 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, - }; - - // Gen VAO to contain VBO - glGenVertexArrays(1, &quadVAO); - glBindVertexArray(quadVAO); - - // Gen and fill vertex buffer (VBO) - glGenBuffers(1, &quadVBO); - glBindBuffer(GL_ARRAY_BUFFER, quadVBO); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), &vertices, GL_STATIC_DRAW); - - // Bind vertex attributes (position, texcoords) - glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 5*sizeof(float), (void *)0); // Positions - glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 5*sizeof(float), (void *)(3*sizeof(float))); // Texcoords - - // Draw quad - glBindVertexArray(quadVAO); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - glBindVertexArray(0); - - // Delete buffers (VBO and VAO) - glDeleteBuffers(1, &quadVBO); - glDeleteVertexArrays(1, &quadVAO); -#endif -} - -// Load and draw a 1x1 3D cube in NDC -void rlLoadDrawCube(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - unsigned int cubeVAO = 0; - unsigned int cubeVBO = 0; - - float vertices[] = { - // Positions Normals Texcoords - -1.0f, -1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, - 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, - 1.0f, -1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, - 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, - -1.0f, -1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, - -1.0f, 1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, - -1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, - -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, - -1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, - -1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, - -1.0f, 1.0f, -1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, - -1.0f, -1.0f, -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, - -1.0f, -1.0f, -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, - -1.0f, -1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, - -1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, - 1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, - 1.0f, -1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, - 1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, - -1.0f, -1.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, - 1.0f, -1.0f, -1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f, - 1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, - 1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, - -1.0f, -1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, - -1.0f, -1.0f, -1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, - -1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, - 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, - -1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, - -1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f - }; - - // Gen VAO to contain VBO - glGenVertexArrays(1, &cubeVAO); - glBindVertexArray(cubeVAO); - - // Gen and fill vertex buffer (VBO) - glGenBuffers(1, &cubeVBO); - glBindBuffer(GL_ARRAY_BUFFER, cubeVBO); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - // Bind vertex attributes (position, normals, texcoords) - glBindVertexArray(cubeVAO); - glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8*sizeof(float), (void *)0); // Positions - glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8*sizeof(float), (void *)(3*sizeof(float))); // Normals - glEnableVertexAttribArray(2); - glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8*sizeof(float), (void *)(6*sizeof(float))); // Texcoords - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindVertexArray(0); - - // Draw cube - glBindVertexArray(cubeVAO); - glDrawArrays(GL_TRIANGLES, 0, 36); - glBindVertexArray(0); - - // Delete VBO and VAO - glDeleteBuffers(1, &cubeVBO); - glDeleteVertexArrays(1, &cubeVAO); -#endif -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -// Load default shader (just vertex positioning and texture coloring) -// NOTE: This shader program is used for internal buffers -// NOTE: It uses global variable: RLGL.State.defaultShader -static void rlLoadShaderDefault(void) -{ - RLGL.State.defaultShader.locs = (int *)RL_CALLOC(MAX_SHADER_LOCATIONS, sizeof(int)); - - // NOTE: All locations must be reseted to -1 (no location) - for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) RLGL.State.defaultShader.locs[i] = -1; - - // Vertex shader directly defined, no external file required - const char *vShaderDefault = -#if defined(GRAPHICS_API_OPENGL_21) - "#version 120 \n" - "attribute vec3 vertexPosition; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec4 vertexColor; \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) - "#version 330 \n" - "in vec3 vertexPosition; \n" - "in vec2 vertexTexCoord; \n" - "in vec4 vertexColor; \n" - "out vec2 fragTexCoord; \n" - "out vec4 fragColor; \n" -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - "#version 100 \n" - "attribute vec3 vertexPosition; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec4 vertexColor; \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#endif - "uniform mat4 mvp; \n" - "void main() \n" - "{ \n" - " fragTexCoord = vertexTexCoord; \n" - " fragColor = vertexColor; \n" - " gl_Position = mvp*vec4(vertexPosition, 1.0); \n" - "} \n"; - - // Fragment shader directly defined, no external file required - const char *fShaderDefault = -#if defined(GRAPHICS_API_OPENGL_21) - "#version 120 \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" - "uniform sampler2D texture0; \n" - "uniform vec4 colDiffuse; \n" - "void main() \n" - "{ \n" - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" - " gl_FragColor = texelColor*colDiffuse*fragColor; \n" - "} \n"; -#elif defined(GRAPHICS_API_OPENGL_33) - "#version 330 \n" - "in vec2 fragTexCoord; \n" - "in vec4 fragColor; \n" - "out vec4 finalColor; \n" - "uniform sampler2D texture0; \n" - "uniform vec4 colDiffuse; \n" - "void main() \n" - "{ \n" - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " finalColor = texelColor*colDiffuse*fragColor; \n" - "} \n"; -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) - "#version 100 \n" - "precision mediump float; \n" // Precision required for OpenGL ES2 (WebGL) - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" - "uniform sampler2D texture0; \n" - "uniform vec4 colDiffuse; \n" - "void main() \n" - "{ \n" - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" - " gl_FragColor = texelColor*colDiffuse*fragColor; \n" - "} \n"; -#endif - - // NOTE: Compiled vertex/fragment shaders are kept for re-use - RLGL.State.defaultVShaderId = rlCompileShader(vShaderDefault, GL_VERTEX_SHADER); // Compile default vertex shader - RLGL.State.defaultFShaderId = rlCompileShader(fShaderDefault, GL_FRAGMENT_SHADER); // Compile default fragment shader - - RLGL.State.defaultShader.id = rlLoadShaderProgram(RLGL.State.defaultVShaderId, RLGL.State.defaultFShaderId); - - if (RLGL.State.defaultShader.id > 0) - { - TRACELOG(LOG_INFO, "SHADER: [ID %i] Default shader loaded successfully", RLGL.State.defaultShader.id); - - // Set default shader locations: attributes locations - RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_POSITION] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexPosition"); - RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_TEXCOORD01] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexTexCoord"); - RLGL.State.defaultShader.locs[SHADER_LOC_VERTEX_COLOR] = glGetAttribLocation(RLGL.State.defaultShader.id, "vertexColor"); - - // Set default shader locations: uniform locations - RLGL.State.defaultShader.locs[SHADER_LOC_MATRIX_MVP] = glGetUniformLocation(RLGL.State.defaultShader.id, "mvp"); - RLGL.State.defaultShader.locs[SHADER_LOC_COLOR_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShader.id, "colDiffuse"); - RLGL.State.defaultShader.locs[SHADER_LOC_MAP_DIFFUSE] = glGetUniformLocation(RLGL.State.defaultShader.id, "texture0"); - } - else TRACELOG(LOG_WARNING, "SHADER: [ID %i] Failed to load default shader", RLGL.State.defaultShader.id); -} - -// Unload default shader -// NOTE: It uses global variable: RLGL.State.defaultShader -static void rlUnloadShaderDefault(void) -{ - glUseProgram(0); - - glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultVShaderId); - glDetachShader(RLGL.State.defaultShader.id, RLGL.State.defaultFShaderId); - glDeleteShader(RLGL.State.defaultVShaderId); - glDeleteShader(RLGL.State.defaultFShaderId); - - glDeleteProgram(RLGL.State.defaultShader.id); - - RL_FREE(RLGL.State.defaultShader.locs); - - TRACELOG(LOG_INFO, "SHADER: [ID %i] Default shader unloaded successfully", RLGL.State.defaultShader.id); -} - -#if defined(SUPPORT_GL_DETAILS_INFO) -// Get compressed format official GL identifier name -static char *rlGetCompressedFormatName(int format) -{ - static char compName[64] = { 0 }; - memset(compName, 0, 64); - - switch (format) - { - // GL_EXT_texture_compression_s3tc - case 0x83F0: strcpy(compName, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"); break; - case 0x83F1: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"); break; - case 0x83F2: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"); break; - case 0x83F3: strcpy(compName, "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"); break; - // GL_3DFX_texture_compression_FXT1 - case 0x86B0: strcpy(compName, "GL_COMPRESSED_RGB_FXT1_3DFX"); break; - case 0x86B1: strcpy(compName, "GL_COMPRESSED_RGBA_FXT1_3DFX"); break; - // GL_IMG_texture_compression_pvrtc - case 0x8C00: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG"); break; - case 0x8C01: strcpy(compName, "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG"); break; - case 0x8C02: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"); break; - case 0x8C03: strcpy(compName, "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"); break; - // GL_OES_compressed_ETC1_RGB8_texture - case 0x8D64: strcpy(compName, "GL_ETC1_RGB8_OES"); break; - // GL_ARB_texture_compression_rgtc - case 0x8DBB: strcpy(compName, "GL_COMPRESSED_RED_RGTC1"); break; - case 0x8DBC: strcpy(compName, "GL_COMPRESSED_SIGNED_RED_RGTC1"); break; - case 0x8DBD: strcpy(compName, "GL_COMPRESSED_RG_RGTC2"); break; - case 0x8DBE: strcpy(compName, "GL_COMPRESSED_SIGNED_RG_RGTC2"); break; - // GL_ARB_texture_compression_bptc - case 0x8E8C: strcpy(compName, "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB"); break; - case 0x8E8D: strcpy(compName, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB"); break; - case 0x8E8E: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB"); break; - case 0x8E8F: strcpy(compName, "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB"); break; - // GL_ARB_ES3_compatibility - case 0x9274: strcpy(compName, "GL_COMPRESSED_RGB8_ETC2"); break; - case 0x9275: strcpy(compName, "GL_COMPRESSED_SRGB8_ETC2"); break; - case 0x9276: strcpy(compName, "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break; - case 0x9277: strcpy(compName, "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"); break; - case 0x9278: strcpy(compName, "GL_COMPRESSED_RGBA8_ETC2_EAC"); break; - case 0x9279: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"); break; - case 0x9270: strcpy(compName, "GL_COMPRESSED_R11_EAC"); break; - case 0x9271: strcpy(compName, "GL_COMPRESSED_SIGNED_R11_EAC"); break; - case 0x9272: strcpy(compName, "GL_COMPRESSED_RG11_EAC"); break; - case 0x9273: strcpy(compName, "GL_COMPRESSED_SIGNED_RG11_EAC"); break; - // GL_KHR_texture_compression_astc_hdr - case 0x93B0: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_4x4_KHR"); break; - case 0x93B1: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x4_KHR"); break; - case 0x93B2: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_5x5_KHR"); break; - case 0x93B3: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x5_KHR"); break; - case 0x93B4: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_6x6_KHR"); break; - case 0x93B5: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x5_KHR"); break; - case 0x93B6: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x6_KHR"); break; - case 0x93B7: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_8x8_KHR"); break; - case 0x93B8: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x5_KHR"); break; - case 0x93B9: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x6_KHR"); break; - case 0x93BA: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x8_KHR"); break; - case 0x93BB: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_10x10_KHR"); break; - case 0x93BC: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x10_KHR"); break; - case 0x93BD: strcpy(compName, "GL_COMPRESSED_RGBA_ASTC_12x12_KHR"); break; - case 0x93D0: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"); break; - case 0x93D1: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"); break; - case 0x93D2: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"); break; - case 0x93D3: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"); break; - case 0x93D4: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"); break; - case 0x93D5: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"); break; - case 0x93D6: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"); break; - case 0x93D7: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"); break; - case 0x93D8: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"); break; - case 0x93D9: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"); break; - case 0x93DA: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"); break; - case 0x93DB: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"); break; - case 0x93DC: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"); break; - case 0x93DD: strcpy(compName, "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"); break; - default: strcpy(compName, "GL_COMPRESSED_UNKNOWN"); break; - } - - return compName; -} -#endif // SUPPORT_GL_DETAILS_INFO - -#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 - -#if defined(GRAPHICS_API_OPENGL_11) -// Mipmaps data is generated after image data -// NOTE: Only works with RGBA (4 bytes) data! -static int rlGenerateMipmapsData(unsigned char *data, int baseWidth, int baseHeight) -{ - int mipmapCount = 1; // Required mipmap levels count (including base level) - int width = baseWidth; - int height = baseHeight; - int size = baseWidth*baseHeight*4; // Size in bytes (will include mipmaps...), RGBA only - - // Count mipmap levels required - while ((width != 1) && (height != 1)) - { - width /= 2; - height /= 2; - - TRACELOGD("TEXTURE: Next mipmap size: %i x %i", width, height); - - mipmapCount++; - - size += (width*height*4); // Add mipmap size (in bytes) - } - - TRACELOGD("TEXTURE: Total mipmaps required: %i", mipmapCount); - TRACELOGD("TEXTURE: Total size of data required: %i", size); - - unsigned char *temp = RL_REALLOC(data, size); - - if (temp != NULL) data = temp; - else TRACELOG(LOG_WARNING, "TEXTURE: Failed to re-allocate required mipmaps memory"); - - width = baseWidth; - height = baseHeight; - size = (width*height*4); - - // Generate mipmaps - // NOTE: Every mipmap data is stored after data - Color *image = (Color *)RL_MALLOC(width*height*sizeof(Color)); - Color *mipmap = NULL; - int offset = 0; - int j = 0; - - for (int i = 0; i < size; i += 4) - { - image[j].r = data[i]; - image[j].g = data[i + 1]; - image[j].b = data[i + 2]; - image[j].a = data[i + 3]; - j++; - } - - TRACELOGD("TEXTURE: Mipmap base size (%ix%i)", width, height); - - for (int mip = 1; mip < mipmapCount; mip++) - { - mipmap = rlGenNextMipmapData(image, width, height); - - offset += (width*height*4); // Size of last mipmap - j = 0; - - width /= 2; - height /= 2; - size = (width*height*4); // Mipmap size to store after offset - - // Add mipmap to data - for (int i = 0; i < size; i += 4) - { - data[offset + i] = mipmap[j].r; - data[offset + i + 1] = mipmap[j].g; - data[offset + i + 2] = mipmap[j].b; - data[offset + i + 3] = mipmap[j].a; - j++; - } - - RL_FREE(image); - - image = mipmap; - mipmap = NULL; - } - - RL_FREE(mipmap); // free mipmap data - - return mipmapCount; -} - -// Manual mipmap generation (basic scaling algorithm) -static Color *rlGenNextMipmapData(Color *srcData, int srcWidth, int srcHeight) -{ - int x2, y2; - Color prow, pcol; - - int width = srcWidth/2; - int height = srcHeight/2; - - Color *mipmap = (Color *)RL_MALLOC(width*height*sizeof(Color)); - - // Scaling algorithm works perfectly (box-filter) - for (int y = 0; y < height; y++) - { - y2 = 2*y; - - for (int x = 0; x < width; x++) - { - x2 = 2*x; - - prow.r = (srcData[y2*srcWidth + x2].r + srcData[y2*srcWidth + x2 + 1].r)/2; - prow.g = (srcData[y2*srcWidth + x2].g + srcData[y2*srcWidth + x2 + 1].g)/2; - prow.b = (srcData[y2*srcWidth + x2].b + srcData[y2*srcWidth + x2 + 1].b)/2; - prow.a = (srcData[y2*srcWidth + x2].a + srcData[y2*srcWidth + x2 + 1].a)/2; - - pcol.r = (srcData[(y2+1)*srcWidth + x2].r + srcData[(y2+1)*srcWidth + x2 + 1].r)/2; - pcol.g = (srcData[(y2+1)*srcWidth + x2].g + srcData[(y2+1)*srcWidth + x2 + 1].g)/2; - pcol.b = (srcData[(y2+1)*srcWidth + x2].b + srcData[(y2+1)*srcWidth + x2 + 1].b)/2; - pcol.a = (srcData[(y2+1)*srcWidth + x2].a + srcData[(y2+1)*srcWidth + x2 + 1].a)/2; - - mipmap[y*width + x].r = (prow.r + pcol.r)/2; - mipmap[y*width + x].g = (prow.g + pcol.g)/2; - mipmap[y*width + x].b = (prow.b + pcol.b)/2; - mipmap[y*width + x].a = (prow.a + pcol.a)/2; - } - } - - TRACELOGD("TEXTURE: Mipmap generated successfully (%ix%i)", width, height); - - return mipmap; -} -#endif // GRAPHICS_API_OPENGL_11 - -// Get pixel data size in bytes (image or texture) -// NOTE: Size depends on pixel format -static int rlGetPixelDataSize(int width, int height, int format) -{ - int dataSize = 0; // Size in bytes - int bpp = 0; // Bits per pixel - - switch (format) - { - case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break; - case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: - case PIXELFORMAT_UNCOMPRESSED_R5G6B5: - case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: - case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break; - case PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break; - case PIXELFORMAT_UNCOMPRESSED_R32: bpp = 32; break; - case PIXELFORMAT_UNCOMPRESSED_R32G32B32: bpp = 32*3; break; - case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break; - case PIXELFORMAT_COMPRESSED_DXT1_RGB: - case PIXELFORMAT_COMPRESSED_DXT1_RGBA: - case PIXELFORMAT_COMPRESSED_ETC1_RGB: - case PIXELFORMAT_COMPRESSED_ETC2_RGB: - case PIXELFORMAT_COMPRESSED_PVRT_RGB: - case PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break; - case PIXELFORMAT_COMPRESSED_DXT3_RGBA: - case PIXELFORMAT_COMPRESSED_DXT5_RGBA: - case PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: - case PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break; - case PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break; - default: break; - } - - dataSize = width*height*bpp/8; // Total data size in bytes - - // Most compressed formats works on 4x4 blocks, - // if texture is smaller, minimum dataSize is 8 or 16 - if ((width < 4) && (height < 4)) - { - if ((format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < PIXELFORMAT_COMPRESSED_DXT3_RGBA)) dataSize = 8; - else if ((format >= PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; - } - - return dataSize; -} -#endif // RLGL_IMPLEMENTATION diff --git a/raylib-test/Cargo.toml b/raylib-test/Cargo.toml index b4ab37d7..362c1704 100644 --- a/raylib-test/Cargo.toml +++ b/raylib-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-test" -version = "3.7.0" +version = "4.0.0" authors = ["David Ayeke"] edition = "2018" license = "Zlib" @@ -9,5 +9,5 @@ repository = "https://github.com/deltaphc/raylib-rs" [dependencies] -raylib = { version = "3.7", path = "../raylib" } +raylib = { version = "4.0", path = "../raylib" } lazy_static = "1.2.0" diff --git a/raylib-test/src/misc.rs b/raylib-test/src/misc.rs index 3e43e883..a4279621 100644 --- a/raylib-test/src/misc.rs +++ b/raylib-test/src/misc.rs @@ -15,6 +15,6 @@ mod core_test { let mut handle = TEST_HANDLE.write().unwrap(); let rl = handle.as_mut().unwrap(); // make sure it doesn't seg fault - let _ = rl.get_screen_data(t); + let _ = rl.load_image_from_screen(t); } } diff --git a/raylib-test/src/texture.rs b/raylib-test/src/texture.rs index cbdeed14..8cf39cd8 100644 --- a/raylib-test/src/texture.rs +++ b/raylib-test/src/texture.rs @@ -44,7 +44,7 @@ mod texture_test { .load_texture_from_image(thread, &i) .expect("could not load texture from image"); let _ = t - .get_texture_data() + .load_image() .expect("can't get an image from a texture created from an image..."); i.export_image("test_out/billboard_texture.png"); } diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 3fa36daa..25c36659 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib" -version = "3.7.0" +version = "4.0.0" authors = ["DeltaPHC "] license = "Zlib" readme = "../README.md" @@ -12,7 +12,7 @@ categories = ["api-bindings", "game-engines", "graphics"] edition = "2018" [dependencies] -raylib-sys = { version = "= 3.7.0", path = "../raylib-sys" } +raylib-sys = { version = "= 4.0.0", path = "../raylib-sys" } libc = "0.2.45" lazy_static = "1.2.0" cfg-if = "1.0.0" diff --git a/raylib/src/consts.rs b/raylib/src/consts.rs index 557a933c..6c60a83f 100644 --- a/raylib/src/consts.rs +++ b/raylib/src/consts.rs @@ -8,7 +8,7 @@ pub use ffi::ConfigFlags; pub use ffi::CubemapLayout; pub use ffi::GamepadAxis; pub use ffi::GamepadButton; -pub use ffi::Gestures; +pub use ffi::Gesture; pub use ffi::KeyboardKey; pub use ffi::MaterialMapIndex; pub use ffi::MouseButton; diff --git a/raylib/src/core/audio.rs b/raylib/src/core/audio.rs index 29a8780e..f897b80e 100644 --- a/raylib/src/core/audio.rs +++ b/raylib/src/core/audio.rs @@ -8,7 +8,7 @@ use std::mem::ManuallyDrop; make_thin_wrapper!(Wave, ffi::Wave, ffi::UnloadWave); make_thin_wrapper!(Sound, ffi::Sound, ffi::UnloadSound); make_thin_wrapper!(Music, ffi::Music, ffi::UnloadMusicStream); -make_thin_wrapper!(AudioStream, ffi::AudioStream, ffi::CloseAudioStream); +make_thin_wrapper!(AudioStream, ffi::AudioStream, ffi::UnloadAudioStream); make_rslice!(WaveSamples, f32, ffi::UnloadWaveSamples); @@ -164,8 +164,8 @@ impl RaylibAudio { /// Checks if music is playing. #[inline] - pub fn is_music_playing(&self, music: &Music) -> bool { - unsafe { ffi::IsMusicPlaying(music.0) } + pub fn is_music_stream_playing(&self, music: &Music) -> bool { + unsafe { ffi::IsMusicStreamPlaying(music.0) } } /// Sets volume for music (`1.0` is max level). @@ -267,8 +267,8 @@ impl Drop for RaylibAudio { } impl Wave { - pub fn sample_count(&self) -> u32 { - self.0.sampleCount + pub fn frame_count(&self) -> u32 { + self.0.frameCount } pub fn smaple_rate(&self) -> u32 { self.0.sampleRate @@ -340,7 +340,7 @@ impl Wave { let data = ffi::LoadWaveSamples(self.0); Box::from_raw(std::slice::from_raw_parts_mut( data, - self.sample_count() as usize, + self.frame_count() as usize, )) }; WaveSamples(ManuallyDrop::new(as_slice)) @@ -360,8 +360,8 @@ impl AsMut for Sound { } impl Sound { - pub fn sample_count(&self) -> u32 { - self.0.sampleCount + pub fn frame_count(&self) -> u32 { + self.0.frameCount } pub unsafe fn inner(self) -> ffi::Sound { let inner = self.0; @@ -432,13 +432,13 @@ impl AudioStream { } /// Initializes audio stream (to stream raw PCM data). #[inline] - pub fn init_audio_stream( + pub fn load_audio_stream( _: &RaylibThread, sample_rate: u32, sample_size: u32, channels: u32, ) -> AudioStream { - unsafe { AudioStream(ffi::InitAudioStream(sample_rate, sample_size, channels)) } + unsafe { AudioStream(ffi::LoadAudioStream(sample_rate, sample_size, channels)) } } /// Updates audio stream buffers with data. diff --git a/raylib/src/core/collision.rs b/raylib/src/core/collision.rs index ce47bbdf..cf5ffb9e 100644 --- a/raylib/src/core/collision.rs +++ b/raylib/src/core/collision.rs @@ -1,7 +1,8 @@ //! Common collision handling code -use crate::core::math::{BoundingBox, Ray, RayHitInfo, Rectangle, Vector2, Vector3}; +use crate::core::math::{BoundingBox, Ray, Rectangle, Vector2}; use crate::core::models::Model; use crate::ffi; +use crate::math::RayCollision; impl Rectangle { /// Check collision between two rectangles @@ -130,67 +131,46 @@ impl BoundingBox { /// Detects collision between ray and box. #[inline] - pub fn check_collision_ray_box(&self, ray: Ray) -> bool { - unsafe { ffi::CheckCollisionRayBox(ray.into(), self.into()) } + pub fn get_ray_collision_box(&self, ray: Ray) -> RayCollision { + unsafe { ffi::GetRayCollisionBox(ray.into(), self.into()).into() } } } /// Detects collision between ray and sphere. #[inline] -pub fn check_collision_ray_sphere( +pub fn get_ray_collision_sphere( ray: Ray, sphere_position: impl Into, sphere_radius: f32, -) -> bool { - unsafe { ffi::CheckCollisionRaySphere(ray.into(), sphere_position.into(), sphere_radius) } -} - -/// Detects collision between ray and sphere, and returns the collision point. -#[inline] -pub fn check_collision_ray_sphere_ex( - ray: Ray, - sphere_position: impl Into, - sphere_radius: f32, -) -> Option { - unsafe { - let mut col_point = ffi::Vector3 { - x: 0.0, - y: 0.0, - z: 0.0, - }; - let collision = ffi::CheckCollisionRaySphereEx( - ray.into(), - sphere_position.into(), - sphere_radius, - &mut col_point, - ); - if collision { - Some(col_point.into()) - } else { - None - } - } +) -> RayCollision { + unsafe { ffi::GetRayCollisionSphere(ray.into(), sphere_position.into(), sphere_radius).into() } } /// Gets collision info between ray and model. #[inline] -pub fn get_collision_ray_model(ray: Ray, model: &Model) -> RayHitInfo { - unsafe { ffi::GetCollisionRayModel(ray.into(), model.0).into() } +pub fn get_ray_collision_model(ray: Ray, model: &Model) -> RayCollision { + unsafe { ffi::GetRayCollisionModel(ray.into(), model.0).into() } } /// Gets collision info between ray and triangle. #[inline] -pub fn get_collision_ray_triangle( +pub fn get_ray_collision_triangle( ray: Ray, p1: impl Into, p2: impl Into, p3: impl Into, -) -> RayHitInfo { - unsafe { ffi::GetCollisionRayTriangle(ray.into(), p1.into(), p2.into(), p3.into()).into() } +) -> RayCollision { + unsafe { ffi::GetRayCollisionTriangle(ray.into(), p1.into(), p2.into(), p3.into()).into() } } -/// Gets collision info between ray and ground plane (Y-normal plane). +/// Gets collision info between ray and model. #[inline] -pub fn get_collision_ray_ground(ray: Ray, ground_height: f32) -> RayHitInfo { - unsafe { ffi::GetCollisionRayGround(ray.into(), ground_height).into() } +pub fn get_ray_collision_quad( + ray: Ray, + p1: impl Into, + p2: impl Into, + p3: impl Into, + p4: impl Into, +) -> RayCollision { + unsafe { ffi::GetRayCollisionQuad(ray.into(), p1.into(), p2.into(), p3.into(), p4.into()).into() } } diff --git a/raylib/src/core/color.rs b/raylib/src/core/color.rs index 2f8b69b8..0cdff725 100644 --- a/raylib/src/core/color.rs +++ b/raylib/src/core/color.rs @@ -127,7 +127,7 @@ impl Color { /// Returns a Color struct from hexadecimal value #[inline] - pub fn get_color(hex_value: i32) -> Color { + pub fn get_color(hex_value: u32) -> Color { unsafe { ffi::GetColor(hex_value).into() } } @@ -192,6 +192,7 @@ impl Color { pub const DARKORCHID: Color = Color::new(153, 50, 204, 255); pub const DARKMAGENTA: Color = Color::new(139, 0, 139, 255); pub const PURPLE: Color = Color::new(128, 0, 128, 255); + pub const DARKPURPLE: Color = Color::new(112, 31, 126, 255); pub const INDIGO: Color = Color::new(75, 0, 130, 255); pub const SLATEBLUE: Color = Color::new(106, 90, 205, 255); pub const DARKSLATEBLUE: Color = Color::new(72, 61, 139, 255); @@ -259,6 +260,7 @@ impl Color { pub const SADDLEBROWN: Color = Color::new(139, 69, 19, 255); pub const SIENNA: Color = Color::new(160, 82, 45, 255); pub const BROWN: Color = Color::new(165, 42, 42, 255); + pub const DARKBROWN: Color = Color::new(76, 63, 47, 255); pub const MAROON: Color = Color::new(128, 0, 0, 255); pub const WHITE: Color = Color::new(255, 255, 255, 255); pub const SNOW: Color = Color::new(255, 250, 250, 255); diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index f05fd6eb..63af5df6 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -718,7 +718,7 @@ pub trait RaylibDraw { fn draw_rectangle_lines_ex( &mut self, rec: impl Into, - line_thick: i32, + line_thick: f32, color: impl Into, ) { unsafe { @@ -746,7 +746,7 @@ pub trait RaylibDraw { rec: impl Into, roundness: f32, segments: i32, - line_thickness: i32, + line_thickness: f32, color: impl Into, ) { unsafe { @@ -1072,66 +1072,6 @@ pub trait RaylibDraw { } } - /// Draws text using `font` and additional parameters. - #[inline] - fn draw_text_rec( - &mut self, - font: impl AsRef, - text: &str, - rec: impl Into, - font_size: f32, - spacing: f32, - word_wrap: bool, - tint: impl Into, - ) { - let c_text = CString::new(text).unwrap(); - unsafe { - ffi::DrawTextRec( - *font.as_ref(), - c_text.as_ptr(), - rec.into(), - font_size, - spacing, - word_wrap, - tint.into(), - ); - } - } - - /// Draws text using `font` and additional parameters. - #[inline] - fn draw_text_rec_ex( - &mut self, - font: impl AsRef, - text: &str, - rec: impl Into, - font_size: f32, - spacing: f32, - word_wrap: bool, - tint: impl Into, - select_start: i32, - select_length: i32, - select_text: impl Into, - select_back: impl Into, - ) { - let c_text = CString::new(text).unwrap(); - unsafe { - ffi::DrawTextRecEx( - *font.as_ref(), - c_text.as_ptr(), - rec.into(), - font_size, - spacing, - word_wrap, - tint.into(), - select_start, - select_length, - select_text.into(), - select_back.into(), - ); - } - } - /// Draw one character (codepoint) #[inline] fn draw_text_codepoint( @@ -1517,7 +1457,7 @@ pub trait RaylibDraw3D { texture: &Texture2D, source_rec: impl Into, center: impl Into, - size: f32, + size: impl Into, tint: impl Into, ) { unsafe { @@ -1526,7 +1466,7 @@ pub trait RaylibDraw3D { texture.0, source_rec.into(), center.into(), - size, + size.into(), tint.into(), ); } diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index eb99f4a4..ec2a50c1 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -1,10 +1,10 @@ //! Keyboard, Controller, and Mouse related functions -use crate::consts::Gestures; +use crate::consts::Gesture; use crate::core::math::Vector2; use crate::core::RaylibHandle; use crate::ffi; -use std::ffi::{CStr, CString}; +use std::ffi::{CStr}; impl RaylibHandle { /// Detect if a key has been pressed once. @@ -68,13 +68,6 @@ impl RaylibHandle { unsafe { ffi::IsGamepadAvailable(gamepad) } } - /// Checks gamepad name (if available). - #[inline] - pub fn is_gamepad_name(&self, gamepad: i32, name: &str) -> bool { - let c_name = CString::new(name).unwrap(); - unsafe { ffi::IsGamepadName(gamepad, c_name.as_ptr()) } - } - /// Returns gamepad internal name id. #[inline] pub fn get_gamepad_name(&self, gamepad: i32) -> Option { @@ -247,20 +240,20 @@ impl RaylibHandle { /// Checks if a gesture have been detected. #[inline] - pub fn is_gesture_detected(&self, gesture: Gestures) -> bool { + pub fn is_gesture_detected(&self, gesture: Gesture) -> bool { unsafe { ffi::IsGestureDetected(gesture as i32) } } /// Gets latest detected gesture. #[inline] - pub fn get_gesture_detected(&self) -> Gestures { + pub fn get_gesture_detected(&self) -> Gesture { unsafe { std::mem::transmute(ffi::GetGestureDetected()) } } /// Gets touch points count. #[inline] - pub fn get_touch_points_count(&self) -> u32 { - unsafe { ffi::GetTouchPointsCount() as u32 } + pub fn get_touch_point_count(&self) -> u32 { + unsafe { ffi::GetTouchPointCount() as u32 } } /// Gets gesture hold time in milliseconds. diff --git a/raylib/src/core/math.rs b/raylib/src/core/math.rs index 58394e3e..3b9a467f 100644 --- a/raylib/src/core/math.rs +++ b/raylib/src/core/math.rs @@ -176,7 +176,7 @@ impl Vector2 { /// Calculates the vector length square (**2); pub fn length_sqr(&self) -> f32 { - ((self.x * self.x) + (self.y * self.y)) + (self.x * self.x) + (self.y * self.y) } /// Calculates the dot product with vector `v`. @@ -2023,33 +2023,33 @@ impl Into for &BoundingBox { } optional_serde_struct! { - pub struct RayHitInfo { + pub struct RayCollision { pub hit: bool, pub distance: f32, - pub position: Vector3, + pub point: Vector3, pub normal: Vector3, } } -impl From for RayHitInfo { - fn from(r: ffi::RayHitInfo) -> RayHitInfo { +impl From for RayCollision { + fn from(r: ffi::RayCollision) -> RayCollision { unsafe { std::mem::transmute(r) } } } -impl Into for RayHitInfo { - fn into(self) -> ffi::RayHitInfo { +impl Into for RayCollision { + fn into(self) -> ffi::RayCollision { unsafe { std::mem::transmute(self) } } } -impl Into for &RayHitInfo { - fn into(self) -> ffi::RayHitInfo { - ffi::RayHitInfo { - hit: self.hit, - distance: self.distance, - position: self.position.into(), - normal: self.normal.into(), +impl Into for &RayCollision { + fn into(self) -> ffi::RayCollision { + ffi::RayCollision { + hit: self.hit.into(), + distance: self.distance.into(), + point: self.point.into(), + normal: self.normal.into() } } } diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index efc6c3b4..74efcf6e 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -29,8 +29,8 @@ pub fn open_url(url: &str) { } impl RaylibHandle { - pub fn get_screen_data(&mut self, _: &RaylibThread) -> Image { - unsafe { Image(ffi::GetScreenData()) } + pub fn load_image_from_screen(&mut self, _: &RaylibThread) -> Image { + unsafe { Image(ffi::LoadImageFromScreen()) } } /// Takes a screenshot of current screen (saved a .png) diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index 40189c20..7b393fc9 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -2,7 +2,7 @@ use crate::core::math::{BoundingBox, Vector3}; use crate::core::texture::Image; use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; +use crate::{consts, ffi}; use std::ffi::CString; fn no_drop(_thing: T) {} @@ -374,24 +374,24 @@ pub trait RaylibMesh: AsRef + AsMut { /// Computes mesh bounding box limits. #[inline] - fn mesh_bounding_box(&self) -> BoundingBox { - unsafe { ffi::MeshBoundingBox(*self.as_ref()).into() } + fn get_mesh_bounding_box(&self) -> BoundingBox { + unsafe { ffi::GetMeshBoundingBox(*self.as_ref()).into() } } /// Computes mesh tangents. // NOTE: New VBO for tangents is generated at default location and also binded to mesh VAO #[inline] - fn mesh_tangents(&mut self, _: &RaylibThread) { + fn gen_mesh_tangents(&mut self, _: &RaylibThread) { unsafe { - ffi::MeshTangents(self.as_mut()); + ffi::GenMeshTangents(self.as_mut()); } } /// Computes mesh binormals. #[inline] - fn mesh_binormals(&mut self) { + fn gen_mesh_binormals(&mut self) { unsafe { - ffi::MeshBinormals(self.as_mut()); + ffi::GenMeshBinormals(self.as_mut()); } } @@ -448,7 +448,7 @@ pub trait RaylibMaterial: AsRef + AsMut { unsafe { std::slice::from_raw_parts( self.as_ref().maps as *const MaterialMap, - ffi::MAX_MATERIAL_MAPS as usize, + consts::MAX_MATERIAL_MAPS as usize, ) } } @@ -457,7 +457,7 @@ pub trait RaylibMaterial: AsRef + AsMut { unsafe { std::slice::from_raw_parts_mut( self.as_mut().maps as *mut MaterialMap, - ffi::MAX_MATERIAL_MAPS as usize, + consts::MAX_MATERIAL_MAPS as usize, ) } } diff --git a/raylib/src/core/shaders.rs b/raylib/src/core/shaders.rs index 54dfbea1..cf6e5c2e 100644 --- a/raylib/src/core/shaders.rs +++ b/raylib/src/core/shaders.rs @@ -79,7 +79,12 @@ impl RaylibHandle { /// Get default shader. Modifying it modifies everthing that uses that shader #[cfg(target_os = "windows")] pub fn get_shader_default() -> WeakShader { - unsafe { WeakShader(ffi::rlGetShaderDefault()) } + unsafe { + WeakShader(ffi::Shader { + id: ffi::rlGetShaderIdDefault(), + locs: ffi::rlGetShaderLocsDefault() + }) + } } } diff --git a/raylib/src/core/text.rs b/raylib/src/core/text.rs index dda759ec..f6915682 100644 --- a/raylib/src/core/text.rs +++ b/raylib/src/core/text.rs @@ -11,13 +11,13 @@ use std::ffi::CString; fn no_drop(_thing: T) {} make_thin_wrapper!(Font, ffi::Font, ffi::UnloadFont); make_thin_wrapper!(WeakFont, ffi::Font, no_drop); -make_thin_wrapper!(CharInfo, ffi::CharInfo, no_drop); +make_thin_wrapper!(GlyphInfo, ffi::GlyphInfo, no_drop); #[repr(transparent)] #[derive(Debug)] -pub struct RSliceCharInfo(pub(crate) std::mem::ManuallyDrop>); +pub struct RSliceGlyphInfo(pub(crate) std::mem::ManuallyDrop>); -impl Drop for RSliceCharInfo { +impl Drop for RSliceGlyphInfo { #[allow(unused_unsafe)] fn drop(&mut self) { unsafe { @@ -31,27 +31,27 @@ impl Drop for RSliceCharInfo { } } -impl std::convert::AsRef> for RSliceCharInfo { - fn as_ref(&self) -> &Box<[CharInfo]> { +impl std::convert::AsRef> for RSliceGlyphInfo { + fn as_ref(&self) -> &Box<[GlyphInfo]> { &self.0 } } -impl std::convert::AsMut> for RSliceCharInfo { - fn as_mut(&mut self) -> &mut Box<[CharInfo]> { +impl std::convert::AsMut> for RSliceGlyphInfo { + fn as_mut(&mut self) -> &mut Box<[GlyphInfo]> { &mut self.0 } } -impl std::ops::Deref for RSliceCharInfo { - type Target = Box<[CharInfo]>; +impl std::ops::Deref for RSliceGlyphInfo { + type Target = Box<[GlyphInfo]>; #[inline] fn deref(&self) -> &Self::Target { &self.0 } } -impl std::ops::DerefMut for RSliceCharInfo { +impl std::ops::DerefMut for RSliceGlyphInfo { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 @@ -96,7 +96,7 @@ impl RaylibHandle { pub fn load_font(&mut self, _: &RaylibThread, filename: &str) -> Result { let c_filename = CString::new(filename).unwrap(); let f = unsafe { ffi::LoadFont(c_filename.as_ptr()) }; - if f.chars.is_null() || f.texture.id == 0 { + if f.glyphs.is_null() || f.texture.id == 0 { return Err(format!( "Error loading font {}. Does it exist? Is it the right type?", filename @@ -128,7 +128,7 @@ impl RaylibHandle { } } }; - if f.chars.is_null() || f.texture.id == 0 { + if f.glyphs.is_null() || f.texture.id == 0 { return Err(format!( "Error loading font {}. Does it exist? Is it the right type?", filename @@ -147,7 +147,7 @@ impl RaylibHandle { first_char: i32, ) -> Result { let f = unsafe { ffi::LoadFontFromImage(image.0, key.into(), first_char) }; - if f.chars.is_null() { + if f.glyphs.is_null() { return Err(format!("Error loading font from image.")); } Ok(Font(f)) @@ -162,7 +162,7 @@ impl RaylibHandle { font_size: i32, chars: Option<&[i32]>, sdf: i32, - ) -> Option { + ) -> Option { unsafe { let ci_arr_ptr = match chars { Some(c) => ffi::LoadFontData( @@ -186,7 +186,7 @@ impl RaylibHandle { if ci_arr_ptr.is_null() { None } else { - Some(RSliceCharInfo(std::mem::ManuallyDrop::new(Box::from_raw( + Some(RSliceGlyphInfo(std::mem::ManuallyDrop::new(Box::from_raw( std::slice::from_raw_parts_mut(ci_arr_ptr as *mut _, ci_size), )))) } @@ -204,19 +204,19 @@ pub trait RaylibFont: AsRef + AsMut { fn texture(&self) -> &Texture2D { unsafe { std::mem::transmute(&self.as_ref().texture) } } - fn chars(&self) -> &[CharInfo] { + fn chars(&self) -> &[GlyphInfo] { unsafe { std::slice::from_raw_parts( - self.as_ref().chars as *const CharInfo, - self.as_ref().charsCount as usize, + self.as_ref().glyphs as *const GlyphInfo, + self.as_ref().glyphCount as usize, ) } } - fn chars_mut(&mut self) -> &mut [CharInfo] { + fn chars_mut(&mut self) -> &mut [GlyphInfo] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().chars as *mut CharInfo, - self.as_ref().charsCount as usize, + self.as_mut().glyphs as *mut GlyphInfo, + self.as_ref().glyphCount as usize, ) } } @@ -228,9 +228,9 @@ impl Font { std::mem::forget(self); return w; } - /// Returns a new `Font` using provided `CharInfo` data and parameters. + /// Returns a new `Font` using provided `GlyphInfo` data and parameters. fn from_data( - chars: &[ffi::CharInfo], + chars: &[ffi::GlyphInfo], base_size: i32, padding: i32, pack_method: i32, @@ -241,10 +241,10 @@ impl Font { f.set_chars(chars); let atlas = ffi::GenImageFontAtlas( - f.chars, + f.glyphs, &mut f.0.recs, f.baseSize, - f.charsCount, + f.glyphCount, padding, pack_method, ); @@ -252,24 +252,24 @@ impl Font { ffi::UnloadImage(atlas); f }; - if f.0.chars.is_null() || f.0.texture.id == 0 { + if f.0.glyphs.is_null() || f.0.texture.id == 0 { return Err(format!("Error loading font from image.")); } Ok(f) } /// Sets the character data on the current Font. - fn set_chars(&mut self, chars: &[ffi::CharInfo]) { + fn set_chars(&mut self, chars: &[ffi::GlyphInfo]) { unsafe { - self.charsCount = chars.len() as i32; - let data_size = self.charsCount as usize * std::mem::size_of::(); + self.glyphCount = chars.len() as i32; + let data_size = self.glyphCount as usize * std::mem::size_of::(); let ci_arr_ptr = libc::malloc(data_size); // raylib frees this data in UnloadFont std::ptr::copy( chars.as_ptr(), - ci_arr_ptr as *mut ffi::CharInfo, + ci_arr_ptr as *mut ffi::GlyphInfo, chars.len(), ); - self.chars = ci_arr_ptr as *mut ffi::CharInfo; + self.glyphs = ci_arr_ptr as *mut ffi::GlyphInfo; } } @@ -286,7 +286,7 @@ impl Font { #[inline] pub fn gen_image_font_atlas( _: &RaylibThread, - chars: &mut [ffi::CharInfo], + chars: &mut [ffi::GlyphInfo], font_size: i32, padding: i32, pack_method: i32, diff --git a/raylib/src/core/texture.rs b/raylib/src/core/texture.rs index 2400005b..a8f316cd 100644 --- a/raylib/src/core/texture.rs +++ b/raylib/src/core/texture.rs @@ -1,6 +1,6 @@ //! Image and texture related functions use crate::core::color::Color; -use crate::core::math::{Rectangle, Vector4}; +use crate::core::math::Rectangle; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; use std::ffi::CString; @@ -659,22 +659,6 @@ impl Image { unsafe { Image(ffi::GenImageWhiteNoise(width, height, factor)) } } - /// Generates an Image containing perlin noise. - #[inline] - pub fn gen_image_perlin_noise( - width: i32, - height: i32, - offset_x: i32, - offset_y: i32, - scale: f32, - ) -> Image { - unsafe { - Image(ffi::GenImagePerlinNoise( - width, height, offset_x, offset_y, scale, - )) - } - } - /// Generates an Image using a cellular algorithm. Bigger `tile_size` means bigger cells. #[inline] pub fn gen_image_cellular(width: i32, height: i32, tile_size: i32) -> Image { @@ -812,8 +796,8 @@ pub trait RaylibTexture2D: AsRef + AsMut { /// Gets pixel data from GPU texture and returns an `Image`. /// Fairly sure this would never fail. If it does wrap in result. #[inline] - fn get_texture_data(&self) -> Result { - let i = unsafe { ffi::GetTextureData(*self.as_ref()) }; + fn load_image(&self) -> Result { + let i = unsafe { ffi::LoadImageFromTexture(*self.as_ref()) }; if i.data.is_null() { return Err(format!("Texture cannot be rendered to an image")); } diff --git a/raylib/src/core/vr.rs b/raylib/src/core/vr.rs index 3c2a6d6d..b363fd52 100644 --- a/raylib/src/core/vr.rs +++ b/raylib/src/core/vr.rs @@ -1,8 +1,6 @@ //! Vr related functions -use crate::core::camera::Camera3D; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; -use std::sync::atomic::{AtomicBool, Ordering}; make_thin_wrapper!( VrStereoConfig, diff --git a/raylib/src/rgui/safe.rs b/raylib/src/rgui/safe.rs index 26d766eb..6a627d01 100644 --- a/raylib/src/rgui/safe.rs +++ b/raylib/src/rgui/safe.rs @@ -228,40 +228,6 @@ pub trait RaylibDrawGui { ) } } - /// Image button control, returns true when clicked - #[inline] - fn gui_image_button( - &mut self, - bounds: impl Into, - text: Option<&CStr>, - texture: impl AsRef, - ) -> bool { - unsafe { - ffi::GuiImageButton( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - *texture.as_ref(), - ) - } - } - /// Image button extended control, returns true when clicked - #[inline] - fn gui_image_button_ex( - &mut self, - bounds: impl Into, - text: Option<&CStr>, - texture: impl AsRef, - tex_source: impl Into, - ) -> bool { - unsafe { - ffi::GuiImageButtonEx( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - *texture.as_ref(), - tex_source.into(), - ) - } - } /// Toggle Button control, returns true when active #[inline] fn gui_toggle( diff --git a/samples/Cargo.toml b/samples/Cargo.toml index 9ef44b42..49b5a4f6 100644 --- a/samples/Cargo.toml +++ b/samples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-examples" -version = "3.7.0" +version = "4.0.0" authors = ["David Ayeke"] edition = "2018" license = "Zlib" @@ -9,7 +9,7 @@ repository = "https://github.com/deltaphc/raylib-rs" [dependencies] -raylib = { version = "3.7", path = "../raylib" } +raylib = { version = "4.0", path = "../raylib" } structopt = "0.2" specs-derive = "0.4.1" rand = "0.7" diff --git a/showcase/Cargo.toml b/showcase/Cargo.toml index c863cc60..65f3ee5d 100644 --- a/showcase/Cargo.toml +++ b/showcase/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-showcase" -version = "3.7.0" +version = "4.0.0" authors = ["David Ayeke"] edition = "2018" license = "Zlib" @@ -10,4 +10,4 @@ repository = "https://github.com/deltaphc/raylib-rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -raylib = { version = "3.7", path = "../raylib" } \ No newline at end of file +raylib = { version = "4.0", path = "../raylib" } \ No newline at end of file diff --git a/showcase/src/example/audio/audio_raw_stream.rs b/showcase/src/example/audio/audio_raw_stream.rs index 3466960c..39b2bf8b 100644 --- a/showcase/src/example/audio/audio_raw_stream.rs +++ b/showcase/src/example/audio/audio_raw_stream.rs @@ -28,7 +28,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let mut audio = RaylibAudio::init_audio_device(); // Initialize audio device // Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono) - let mut stream = AudioStream::init_audio_stream(thread, 22050, 16, 1); + let mut stream = AudioStream::load_audio_stream(thread, 22050, 16, 1); // Buffer for the single cycle waveform we are synthesizing let mut data = [0i16; MAX_SAMPLES / std::mem::size_of::()]; @@ -68,7 +68,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // Sample mouse input. mousePosition = rl.get_mouse_position(); - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { let fp = mousePosition.y; frequency = 40.0 + fp; diff --git a/showcase/src/example/controls_test_suite/controls_test_suite.rs b/showcase/src/example/controls_test_suite/controls_test_suite.rs index cf070e57..77e54b0f 100644 --- a/showcase/src/example/controls_test_suite/controls_test_suite.rs +++ b/showcase/src/example/controls_test_suite/controls_test_suite.rs @@ -127,7 +127,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //---------------------------------------------------------------------------------- let mut d = rl.begin_drawing(&thread); let hex = d.gui_get_style(DEFAULT, BACKGROUND_COLOR as i32); - d.clear_background(Color::get_color(hex)); + d.clear_background(Color::get_color(hex as u32)); // raygui: controls drawing //---------------------------------------------------------------------------------- @@ -172,7 +172,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { d.gui_set_style(BUTTON, TEXT_ALIGNMENT as i32, GUI_TEXT_ALIGN_CENTER as i32); - let itext = d.gui_icon_text(RICON_FILE_SAVE, Some(rstr!("Save File"))); + let itext = d.gui_icon_text(RAYGUI_ICON_FILE_SAVE, Some(rstr!("Save File"))); let itext = CString::new(itext).unwrap(); if d.gui_button(rrect(25, 255, 125, 30), Some(&itext)) { showTextInputBox = true; @@ -308,7 +308,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { d.get_screen_height(), Color::RAYWHITE.fade(0.8), ); - let itext = d.gui_icon_text(RICON_EXIT, Some(rstr!("Close Window"))); + let itext = d.gui_icon_text(RAYGUI_ICON_EXIT, Some(rstr!("Close Window"))); let itext = CString::new(itext).unwrap(); let result = d.gui_message_box( rrect( @@ -337,7 +337,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { d.get_screen_height(), Color::RAYWHITE.fade(0.8), ); - let itext = unsafe { d.gui_icon_text(RICON_FILE_SAVE, Some(rstr!("Save file as..."))) }; + let itext = unsafe { d.gui_icon_text(RAYGUI_ICON_FILE_SAVE, Some(rstr!("Save file as..."))) }; let itext = CString::new(itext).unwrap(); let result = d.gui_text_input_box( rrect( diff --git a/showcase/src/example/core/core_3d_picking.rs b/showcase/src/example/core/core_3d_picking.rs index 50bc8fb9..c97e9565 100644 --- a/showcase/src/example/core/core_3d_picking.rs +++ b/showcase/src/example/core/core_3d_picking.rs @@ -49,7 +49,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //---------------------------------------------------------------------------------- rl.update_camera(&mut camera); // Update camera - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { if !collision { @@ -57,7 +57,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // Check collision between ray and box collision = BoundingBox::new(rvec3(cube_position.x - cube_size.x / 2.0, cube_position.y - cube_size.y / 2.0, cube_position.z - cube_size.z / 2.0), - rvec3(cube_position.x + cube_size.x / 2.0, cube_position.y + cube_size.y / 2.0, cube_position.z + cube_size.z / 2.0)).check_collision_ray_box(ray); + rvec3(cube_position.x + cube_size.x / 2.0, cube_position.y + cube_size.y / 2.0, cube_position.z + cube_size.z / 2.0)).get_ray_collision_box(ray).hit; } else { collision = false; diff --git a/showcase/src/example/core/core_input_gamepad.rs b/showcase/src/example/core/core_input_gamepad.rs index 3653d8ef..f7b331a8 100644 --- a/showcase/src/example/core/core_input_gamepad.rs +++ b/showcase/src/example/core/core_input_gamepad.rs @@ -64,7 +64,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { { d.draw_text(&format!("GP1: {}", d.get_gamepad_name(0).unwrap()), 10, 10, 10, Color::BLACK); - if d.is_gamepad_name(0, XBOX360_NAME_ID) + if d.get_gamepad_name(0).unwrap() == XBOX360_NAME_ID { d.draw_texture(&tex_xbox_pad, 0, 0, Color::DARKGRAY); @@ -164,7 +164,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //d.draw_text(format!("Xbox axis LT: %02.02f", d.get_gamepad_axis_movement(0, raylib::consts::GamepadAxis::GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, Color::BLACK); //d.draw_text(format!("Xbox axis RT: %02.02f", d.get_gamepad_axis_movement(0, raylib::consts::GamepadAxis::GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, Color::BLACK); } - else if d.is_gamepad_name(0, PS3_NAME_ID) + else if d.get_gamepad_name(0).unwrap() == PS3_NAME_ID { d.draw_texture(&tex_ps3_pad, 0, 0, Color::DARKGRAY); diff --git a/showcase/src/example/core/core_input_gestures.rs b/showcase/src/example/core/core_input_gestures.rs index 046944d9..8a1aa5b1 100644 --- a/showcase/src/example/core/core_input_gestures.rs +++ b/showcase/src/example/core/core_input_gestures.rs @@ -14,7 +14,7 @@ use raylib::prelude::*; const MAX_GESTURE_STRINGS: usize = 20; pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { - use raylib::consts::Gestures::*; + use raylib::consts::Gesture::*; // Initialization //-------------------------------------------------------------------------------------- let screen_width = 800; @@ -27,7 +27,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let touch_area = rrect(220, 10, screen_width - 230, screen_height - 20); let mut gestures_count = 0; - let mut gesture_strings = [raylib::consts::Gestures::GESTURE_NONE; MAX_GESTURE_STRINGS]; + let mut gesture_strings = [raylib::consts::Gesture::GESTURE_NONE; MAX_GESTURE_STRINGS]; let mut current_gesture = GESTURE_NONE; let mut last_gesture = GESTURE_NONE; diff --git a/showcase/src/example/core/core_input_mouse.rs b/showcase/src/example/core/core_input_mouse.rs index 861e8507..dc066036 100644 --- a/showcase/src/example/core/core_input_mouse.rs +++ b/showcase/src/example/core/core_input_mouse.rs @@ -34,17 +34,17 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //---------------------------------------------------------------------------------- ballPosition = rl.get_mouse_position(); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { ballColor = Color::MAROON; } - else if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_MIDDLE_BUTTON) + else if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_MIDDLE) { ballColor = Color::LIME; } - else if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) + else if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { ballColor = Color::DARKBLUE; diff --git a/showcase/src/example/core/core_input_multitouch.rs b/showcase/src/example/core/core_input_multitouch.rs index 337e892a..67c34063 100644 --- a/showcase/src/example/core/core_input_multitouch.rs +++ b/showcase/src/example/core/core_input_multitouch.rs @@ -43,33 +43,33 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { ball_color = Color::BEIGE; - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { ball_color = Color::MAROON; } - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_MIDDLE_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_MIDDLE) { ball_color = Color::LIME; } - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { ball_color = Color::DARKBLUE; } - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { touch_counter = 10; } - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_MIDDLE_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_MIDDLE) { touch_counter = 10; } - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { touch_counter = 10; diff --git a/showcase/src/example/core/core_scissor_test.rs b/showcase/src/example/core/core_scissor_test.rs index cc2acacb..102f4d3e 100644 --- a/showcase/src/example/core/core_scissor_test.rs +++ b/showcase/src/example/core/core_scissor_test.rs @@ -88,7 +88,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { ); } - d.draw_rectangle_lines_ex(scissor_area, 1, Color::BLACK); + d.draw_rectangle_lines_ex(scissor_area, 1.0, Color::BLACK); d.draw_text("Press S to toggle scissor test", 10, 10, 20, Color::BLACK); //---------------------------------------------------------------------------------- diff --git a/showcase/src/example/image_exporter/image_exporter.rs b/showcase/src/example/image_exporter/image_exporter.rs index 0a5dca45..cac0c6e5 100644 --- a/showcase/src/example/image_exporter/image_exporter.rs +++ b/showcase/src/example/image_exporter/image_exporter.rs @@ -179,8 +179,8 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { { d.draw_texture_ex(&texture, rvec2(screen_width / 2 - (texture.width() as f32 * imageScale / 2.0) as i32, screen_height / 2 - (texture.height() as f32 * imageScale / 2.0) as i32), 0.0, imageScale, Color::WHITE); - d.draw_rectangle_lines_ex(imageRec, 1, if imageRec.check_collision_point_rec(d.get_mouse_position()) {Color::RED } else { Color::DARKGRAY}); - d.draw_text(&format!("SCALE: {:.2}", imageScale * 100.0), 20, screen_height - 40, 20, Color::get_color(d.gui_get_style(raylib::consts::GuiControl::DEFAULT, raylib::consts::GuiDefaultProperty::LINE_COLOR as i32))); + d.draw_rectangle_lines_ex(imageRec, 1.0, if imageRec.check_collision_point_rec(d.get_mouse_position()) {Color::RED } else { Color::DARKGRAY}); + d.draw_text(&format!("SCALE: {:.2}", imageScale * 100.0), 20, screen_height - 40, 20, Color::get_color(d.gui_get_style(raylib::consts::GuiControl::DEFAULT, raylib::consts::GuiDefaultProperty::LINE_COLOR as i32) as u32)); } else { @@ -199,7 +199,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //----------------------------------------------------------------------------- if windowBoxActive { - d.draw_rectangle(0, 0, screen_width, screen_height, Color::get_color(d.gui_get_style(raylib::consts::GuiControl::DEFAULT, raylib::consts::GuiDefaultProperty::BACKGROUND_COLOR as i32)).fade( 0.7)); + d.draw_rectangle(0, 0, screen_width, screen_height, Color::get_color(d.gui_get_style(raylib::consts::GuiControl::DEFAULT, raylib::consts::GuiDefaultProperty::BACKGROUND_COLOR as i32) as u32).fade( 0.7)); windowBoxActive = !d.gui_window_box(rrect(windowBoxRec.x, windowBoxRec.y, 220, 190), Some(rstr!("Image Export Options"))); d.gui_label(rrect(windowBoxRec.x + 10.0, windowBoxRec.y + 35.0, 60, 25), Some(rstr!("File format:"))); diff --git a/showcase/src/example/models/models_loading.rs b/showcase/src/example/models/models_loading.rs index d78f5819..3b9e3006 100644 --- a/showcase/src/example/models/models_loading.rs +++ b/showcase/src/example/models/models_loading.rs @@ -45,7 +45,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut let position = rvec3( 0.0, 0.0, 0.0 ); // Set model position - let mut bounds = model.meshes()[0].mesh_bounding_box(); // Set model bounds + let mut bounds = model.meshes()[0].get_mesh_bounding_box(); // Set model bounds // NOTE: bounds are calculated from the original size of the model, // if model is scaled on drawing, bounds must be also scaled @@ -81,7 +81,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut model = rl.load_model(thread, &droppedFiles[0]).unwrap(); // Load new model model.materials_mut()[0].maps_mut()[raylib::consts::MaterialMapIndex::MATERIAL_MAP_ALBEDO as usize].texture = *texture.as_ref(); // Set current map diffuse texture - bounds = model.meshes()[0].mesh_bounding_box(); + bounds = model.meshes()[0].get_mesh_bounding_box(); // TODO: Move camera position from target enough distance to visualize model properly } @@ -97,10 +97,10 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut } // Select model on mouse click - if (rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON)) + if (rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT)) { // Check collision between ray and box - if bounds.check_collision_ray_box(rl.get_mouse_ray(rl.get_mouse_position(), &camera)){ selected = !selected;} + if bounds.get_ray_collision_box(rl.get_mouse_ray(rl.get_mouse_position(), &camera)).hit { selected = !selected;} else {selected = false;} } //---------------------------------------------------------------------------------- diff --git a/showcase/src/example/models/models_mesh_generation.rs b/showcase/src/example/models/models_mesh_generation.rs index 5aa63425..be805b45 100644 --- a/showcase/src/example/models/models_mesh_generation.rs +++ b/showcase/src/example/models/models_mesh_generation.rs @@ -67,7 +67,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut //---------------------------------------------------------------------------------- rl.update_camera(&mut camera); // Update internal camera and our camera - if (rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON)) + if (rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT)) { currentModel = (currentModel + 1)%NUM_MODELS; // Cycle between the textures } diff --git a/showcase/src/example/models/models_mesh_picking.rs b/showcase/src/example/models/models_mesh_picking.rs index bcb487e6..dc48e57d 100644 --- a/showcase/src/example/models/models_mesh_picking.rs +++ b/showcase/src/example/models/models_mesh_picking.rs @@ -38,10 +38,16 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut tower.materials_mut()[0].maps_mut()[raylib::consts::MaterialMapIndex::MATERIAL_MAP_ALBEDO as usize].texture = *texture.as_ref(); // Set model diffuse texture let towerPos = rvec3( 0.0, 0.0, 0.0 ); // Set model position - let towerBBox = tower.meshes_mut()[0].mesh_bounding_box(); // Get mesh bounding box + let towerBBox = tower.meshes_mut()[0].get_mesh_bounding_box(); // Get mesh bounding box let mut hitMeshBBox = false; let mut hitTriangle = false; + // Ground quad + let g0 = rvec3( -50.0, 0.0, -50.0 ); + let g1 = rvec3( -50.0, 0.0, 50.0 ); + let g2 = rvec3( 50.0, 0.0, 50.0 ); + let g3 = rvec3( 50.0, 0.0, -50.0 ); + // Test triangle let ta = rvec3( -25.0, 0.5,0.0 ); let tb = rvec3( -4.0, 2.5,1.0 ); @@ -62,7 +68,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut rl.update_camera(&mut camera); // Update camera // Display information about closest hit - let mut nearestHit = RayHitInfo::default(); + let mut nearestHit = RayCollision::default(); let mut hitObjectName = "None"; nearestHit.distance = std::f32::MAX; nearestHit.hit = false; @@ -72,7 +78,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut ray = rl.get_mouse_ray(rl.get_mouse_position(), camera); // Check ray collision aginst ground plane - let groundHitInfo = get_collision_ray_ground(ray, 0.0); + let groundHitInfo = get_ray_collision_quad(ray, g0, g1, g2, g3); if ((groundHitInfo.hit) && (groundHitInfo.distance < nearestHit.distance)) { @@ -82,7 +88,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut } // Check ray collision against test triangle - let triHitInfo = get_collision_ray_triangle(ray, ta, tb, tc); + let triHitInfo = get_ray_collision_triangle(ray, ta, tb, tc); if ((triHitInfo.hit) && (triHitInfo.distance < nearestHit.distance)) { @@ -90,21 +96,21 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut cursorColor = Color::PURPLE; hitObjectName = "Triangle"; - bary = nearestHit.position.barycenter( ta, tb, tc); + bary = nearestHit.point.barycenter( ta, tb, tc); hitTriangle = true; } else {hitTriangle = false;} - let mut meshHitInfo = RayHitInfo::default(); + let mut meshHitInfo = RayCollision::default(); // Check ray collision against bounding box first, before trying the full ray-mesh test - if (towerBBox.check_collision_ray_box(ray)) + if (towerBBox.get_ray_collision_box(ray).hit) { hitMeshBBox = true; // Check ray collision against model // NOTE: It considers model.transform matrix! - meshHitInfo = get_collision_ray_model(ray, &tower); + meshHitInfo = get_ray_collision_model(ray, &tower); if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance)) { @@ -143,15 +149,15 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut // If we hit something, draw the cursor at the hit point if (nearestHit.hit) { - d.draw_cube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor); - d.draw_cube_wires(nearestHit.position, 0.3, 0.3, 0.3, Color::RED); + d.draw_cube(nearestHit.point, 0.3, 0.3, 0.3, cursorColor); + d.draw_cube_wires(nearestHit.point, 0.3, 0.3, 0.3, Color::RED); let mut normalEnd = Vector3::default(); - normalEnd.x = nearestHit.position.x + nearestHit.normal.x; - normalEnd.y = nearestHit.position.y + nearestHit.normal.y; - normalEnd.z = nearestHit.position.z + nearestHit.normal.z; + normalEnd.x = nearestHit.point.x + nearestHit.normal.x; + normalEnd.y = nearestHit.point.y + nearestHit.normal.y; + normalEnd.z = nearestHit.point.z + nearestHit.normal.z; - d.draw_line_3D(nearestHit.position, normalEnd, Color::RED); + d.draw_line_3D(nearestHit.point, normalEnd, Color::RED); } d.draw_ray(ray, Color::MAROON); @@ -169,10 +175,10 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut d.draw_text(&format!("Distance: {:3.2}", nearestHit.distance), 10, ypos, 10, Color::BLACK); - d.draw_text(&format!("Hit Pos: {:3.2} {:3.2} {:3.2}", - nearestHit.position.x, - nearestHit.position.y, - nearestHit.position.z), 10, ypos + 15, 10, Color::BLACK); + d.draw_text(&format!("Hit Point: {:3.2} {:3.2} {:3.2}", + nearestHit.point.x, + nearestHit.point.y, + nearestHit.point.z), 10, ypos + 15, 10, Color::BLACK); d.draw_text(&format!("Hit Norm: {:3.2} {:3.2} {:3.2}", nearestHit.normal.x, diff --git a/showcase/src/example/models/models_rlgl_solar_system.rs b/showcase/src/example/models/models_rlgl_solar_system.rs index f2cb3bbc..396355c9 100644 --- a/showcase/src/example/models/models_rlgl_solar_system.rs +++ b/showcase/src/example/models/models_rlgl_solar_system.rs @@ -75,34 +75,34 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let mut d = d.begin_mode3D(&camera); - + unsafe { ffi::rlPushMatrix(); ffi::rlScalef(sunRadius, sunRadius, sunRadius); // Scale Sun DrawSphereBasic(Color::GOLD); // Draw the Sun ffi::rlPopMatrix(); - + ffi::rlPushMatrix(); ffi::rlRotatef(earthOrbitRotation, 0.0, 1.0, 0.0); // Rotation for Earth orbit around Sun ffi::rlTranslatef(earthOrbitRadius, 0.0, 0.0); // Translation for Earth orbit ffi::rlRotatef(-earthOrbitRotation, 0.0, 1.0, 0.0); // Rotation for Earth orbit around Sun inverted - + ffi::rlPushMatrix(); ffi::rlRotatef(earthRotation, 0.25, 1.0, 0.0); // Rotation for Earth itself ffi::rlScalef(earthRadius, earthRadius, earthRadius);// Scale Earth - + DrawSphereBasic(Color::BLUE); // Draw the Earth ffi::rlPopMatrix(); - + ffi::rlRotatef(moonOrbitRotation, 0.0, 1.0, 0.0); // Rotation for Moon orbit around Earth ffi::rlTranslatef(moonOrbitRadius, 0.0, 0.0); // Translation for Moon orbit ffi::rlRotatef(-moonOrbitRotation, 0.0, 1.0, 0.0); // Rotation for Moon orbit around Earth inverted ffi::rlRotatef(moonRotation, 0.0, 1.0, 0.0); // Rotation for Moon itself ffi::rlScalef(moonRadius, moonRadius, moonRadius); // Scale Moon - + DrawSphereBasic(Color::LIGHTGRAY); // Draw the Moon ffi::rlPopMatrix(); - + } // Some reference elements (not affected by previous matrix transformations) @@ -129,33 +129,36 @@ fn DrawSphereBasic(color: Color) let slices = 16; unsafe { + ffi::rlCheckRenderBatchLimit((rings + 2) * slices * 6); + ffi::rlBegin(ffi::RL_TRIANGLES as i32); ffi::rlColor4ub(color.r, color.g, color.b, color.a); - + for i in 0..(rings + 2) { for j in 0..slices { - let deg2rad: f32 = 0.017453292519943295; + let deg2rad: f32 = consts::DEG2RAD as f32; + ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); + (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); - + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); + ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).cos()); + (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i)) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); + (deg2rad*(270+(180/(rings + 1))*(i)) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*(i)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); } } ffi::rlEnd(); diff --git a/showcase/src/example/portable_window/portable_window.rs b/showcase/src/example/portable_window/portable_window.rs index 3ef5cf9c..348c6c54 100644 --- a/showcase/src/example/portable_window/portable_window.rs +++ b/showcase/src/example/portable_window/portable_window.rs @@ -51,7 +51,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { //---------------------------------------------------------------------------------- mousePosition = rl.get_mouse_position(); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { if rrect(0, 0, screen_width, 20).check_collision_point_rec(mousePosition ) { @@ -65,7 +65,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { windowPosition.x += (mousePosition.x - panOffset.x); windowPosition.y += (mousePosition.y - panOffset.y); - if rl.is_mouse_button_released(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_released(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { dragWindow = false; } diff --git a/showcase/src/example/shaders/shaders_julia_set.rs b/showcase/src/example/shaders/shaders_julia_set.rs index 8406b9c5..4b56e8d0 100644 --- a/showcase/src/example/shaders/shaders_julia_set.rs +++ b/showcase/src/example/shaders/shaders_julia_set.rs @@ -136,11 +136,11 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // TODO: The idea is to zoom and move around with mouse // Probably offset movement should be proportional to zoom level - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) || rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) || rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { zoom += zoom * 0.003;} - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { zoom -= zoom * 0.003;} let mousePos = rl.get_mouse_position(); diff --git a/showcase/src/example/textures/textures_bunnymark.rs b/showcase/src/example/textures/textures_bunnymark.rs index 45a09e35..e2ab1a40 100644 --- a/showcase/src/example/textures/textures_bunnymark.rs +++ b/showcase/src/example/textures/textures_bunnymark.rs @@ -50,7 +50,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // Update //---------------------------------------------------------------------------------- - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) { + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { // Create more bunnies for _ in 0..100 { if bunnies_count < MAX_BUNNIES { diff --git a/showcase/src/example/textures/textures_mouse_painting.rs b/showcase/src/example/textures/textures_mouse_painting.rs index 020684c4..27c737f5 100644 --- a/showcase/src/example/textures/textures_mouse_painting.rs +++ b/showcase/src/example/textures/textures_mouse_painting.rs @@ -89,7 +89,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut // Main game loop return Box::new( move |mut rl: &mut RaylibHandle, thread: &RaylibThread| -> () { - use raylib::consts::Gestures::*; + use raylib::consts::Gesture::*; // Update //---------------------------------------------------------------------------------- let mouse_pos = rl.get_mouse_position(); @@ -115,7 +115,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut } if color_mouse_hover.is_some() - && rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + && rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { color_selected = color_mouse_hover.unwrap(); color_selected_prev = color_selected; @@ -136,7 +136,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut d.clear_background(colors[0]); } - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) || rl.get_gesture_detected() == GESTURE_DRAG { // Paint circle into render texture @@ -154,7 +154,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut } } - if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) { + if rl.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { color_selected = 0; // Erase circle from render texture @@ -182,10 +182,10 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut // Image saving logic // NOTE: Saving painted texture to a default named image if btn_save_mouse_hover - && rl.is_mouse_button_released(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + && rl.is_mouse_button_released(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) || rl.is_key_pressed(raylib::consts::KeyboardKey::KEY_S) { - let mut image = target.get_texture_data().unwrap(); + let mut image = target.load_image().unwrap(); image.flip_vertical(); image.export_image("my_amazing_texture_painting.png"); @@ -218,7 +218,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut // Draw drawing circle for reference if mouse_pos.y > 50.0 { - if d.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) { + if d.is_mouse_button_down(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { d.draw_circle_lines( mouse_pos.x as i32, mouse_pos.y as i32, @@ -259,14 +259,14 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut colors_recs[color_selected].width + 4.0, colors_recs[color_selected].height + 4.0, ), - 2, + 2.0, Color::BLACK, ); // Draw save image button d.draw_rectangle_lines_ex( btn_save_rec, - 2, + 2.0, if btn_save_mouse_hover { Color::RED } else { From 864c0c0593a53a9064b75a2b99bdea3ec117c7e9 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Wed, 26 Jan 2022 09:50:16 +0000 Subject: [PATCH 02/30] Fix non-async build for samples, allows audio to work --- raylib/src/core/window.rs | 1 + showcase/.cargo/config.toml | 6 +- .../controls_test_suite.rs | 5 +- showcase/src/main.rs | 12 +-- testshell.html | 89 +++++++++++++++++++ 5 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 testshell.html diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 54122473..210a8344 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -474,6 +474,7 @@ impl RaylibHandle { // Window handling functions impl RaylibHandle { /// Checks if `KEY_ESCAPE` or Close icon was pressed. + /// Do not call on web unless you are compiling with asyncify. #[inline] pub fn window_should_close(&self) -> bool { unsafe { ffi::WindowShouldClose() } diff --git a/showcase/.cargo/config.toml b/showcase/.cargo/config.toml index bb7eeedb..b3664ef4 100644 --- a/showcase/.cargo/config.toml +++ b/showcase/.cargo/config.toml @@ -1,4 +1,4 @@ [target.wasm32-unknown-emscripten] -#rustflags = ["-C", "link-args=-s USE_GLFW=3 -s ASSERTIONS=1 -s ASYNCIFY=1 --profiling"] -# rustflags = ["-C", "link-args=-s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 -s ASYNCIFY --preload-file /root/raylib-rs/showcase/original@original"] -rustflags = ["-C", "link-args=-s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 -s ASYNCIFY --preload-file showcase/original@original"] \ No newline at end of file +#rustflags = ["-C", "link-args=-s USE_GLFW=3 -s ASSERTIONS=1 --profiling"] +# rustflags = ["-C", "link-args=-s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file /root/raylib-rs/showcase/original@original"] +rustflags = ["-C", "link-args=-s USE_GLFW=3 -s FORCE_FILESYSTEM=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file showcase/original@original"] \ No newline at end of file diff --git a/showcase/src/example/controls_test_suite/controls_test_suite.rs b/showcase/src/example/controls_test_suite/controls_test_suite.rs index 77e54b0f..2a266482 100644 --- a/showcase/src/example/controls_test_suite/controls_test_suite.rs +++ b/showcase/src/example/controls_test_suite/controls_test_suite.rs @@ -101,7 +101,10 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // Update //---------------------------------------------------------------------------------- - _exit_window = rl.window_should_close(); + #[cfg(not(target_arch = "wasm32"))] + { + _exit_window = rl.window_should_close(); + } if rl.is_key_pressed(crate::EXIT_KEY) { showMessageBox = !showMessageBox; diff --git a/showcase/src/main.rs b/showcase/src/main.rs index 6b21a159..756a447f 100644 --- a/showcase/src/main.rs +++ b/showcase/src/main.rs @@ -14,13 +14,6 @@ thread_local! (static APP: RefCell bool>>> = RefCell:: pub const EXIT_KEY: raylib::consts::KeyboardKey = raylib::consts::KeyboardKey::KEY_ESCAPE; fn main() { - // Set the emscripten main loop before setting up raylib so that raylib has something - // to configure - // #[cfg(target_arch = "wasm32")] - // unsafe { - // wasm::emscripten_set_main_loop(wasm::_nothing_wasm, 0, 1); - // } - let title = "Showcase"; let screen_width = 800; let screen_height = 640; @@ -313,7 +306,10 @@ fn main() { } } }; + #[cfg(not(target_arch = "wasm32"))] return rl.window_should_close(); + #[cfg(target_arch = "wasm32")] + return false; }); APP.with(|app| { @@ -363,6 +359,4 @@ mod wasm { pub extern "C" fn _update_wasm() { super::update(); } - - pub extern "C" fn _nothing_wasm() {} } diff --git a/testshell.html b/testshell.html new file mode 100644 index 00000000..c537aca1 --- /dev/null +++ b/testshell.html @@ -0,0 +1,89 @@ + + + + + + + raylib web game + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + \ No newline at end of file From 0765bdaf255f2587e20516d84fb7976b12efeb86 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:02:22 +0000 Subject: [PATCH 03/30] Read desc - Added get_mouse_delta - Added get_touch_point_id - Made get_random_value stateful and added set_random_seed - Works no matter if the game uses -s ASYNCIFY on web or not - Fixed broken examples - Fixed build on all samples TODO: Look at compressions and now encoding --- raylib-sys/build.rs | 4 +-- raylib/src/core/input.rs | 12 +++++++ raylib/src/core/misc.rs | 31 ++++++++++++------- raylib/src/lib.rs | 2 +- samples/asteroids.rs | 16 +++++----- samples/camera2D.rs | 10 +++--- samples/roguelike.rs | 9 +++--- samples/specs.rs | 4 +-- .../src/example/audio/audio_module_playing.rs | 20 ++++++------ showcase/src/example/core/core_2d_camera.rs | 10 +++--- .../core/core_3d_camera_first_person.rs | 10 +++--- .../src/example/core/core_random_values.rs | 4 +-- .../src/example/core/core_window_letterbox.rs | 4 +-- showcase/src/example/models/mod.rs | 1 - .../models/models_rlgl_solar_system.rs | 4 +-- showcase/src/example/others/mod.rs | 1 - .../src/example/others/rlgl_standalone.rs | 2 +- .../example/textures/textures_bunnymark.rs | 10 +++--- showcase/src/main.rs | 4 +-- 19 files changed, 87 insertions(+), 71 deletions(-) diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index 3ad37764..cbaaf74e 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -18,7 +18,7 @@ Permission is granted to anyone to use this software for any purpose, including extern crate bindgen; use std::path::{Path, PathBuf}; -use std::{env, fs}; +use std::env; /// latest version on github's release page as of time or writing const LATEST_RAYLIB_VERSION: &str = "3.7.0"; @@ -67,7 +67,7 @@ fn build_with_cmake(src_path: &str) { match platform { Platform::Desktop => conf.define("PLATFORM", "Desktop"), - Platform::Web => conf.define("PLATFORM", "Web"), + Platform::Web => conf.define("PLATFORM", "Web").define("CMAKE_C_FLAGS", "-s ASYNCIFY"), Platform::RPI => conf.define("PLATFORM", "Raspberry Pi"), }; diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index ec2a50c1..14494a03 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -180,6 +180,12 @@ impl RaylibHandle { unsafe { ffi::GetMousePosition().into() } } + /// Returns mouse delta between frames. + #[inline] + pub fn get_mouse_delta(&self) -> Vector2 { + unsafe { ffi::GetMouseDelta().into() } + } + /// Sets mouse position. #[inline] pub fn set_mouse_position(&mut self, position: impl Into) { @@ -250,6 +256,12 @@ impl RaylibHandle { unsafe { std::mem::transmute(ffi::GetGestureDetected()) } } + /// Get touch point identifier for given index + #[inline] + pub fn get_touch_point_id(&self, index: u32) -> i32 { + unsafe { ffi::GetTouchPointId(index as i32) } + } + /// Gets touch points count. #[inline] pub fn get_touch_point_count(&self) -> u32 { diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index 74efcf6e..f148393d 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -4,17 +4,6 @@ use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; use std::ffi::CString; -/// Returns a random value between min and max (both included) -/// ```rust -/// use raylib::*; -/// fn main() { -/// let r = get_random_value(0, 10); -/// println!("random value: {}", r); -/// } -pub fn get_random_value>(min: i32, max: i32) -> T { - unsafe { (ffi::GetRandomValue(min, max) as i32).into() } -} - /// Open URL with default system browser (if available) /// ```ignore /// use raylib::*; @@ -29,7 +18,8 @@ pub fn open_url(url: &str) { } impl RaylibHandle { - pub fn load_image_from_screen(&mut self, _: &RaylibThread) -> Image { + /// Load pixels from the screen into a CPU image + pub fn load_image_from_screen(&self, _: &RaylibThread) -> Image { unsafe { Image(ffi::LoadImageFromScreen()) } } @@ -40,6 +30,23 @@ impl RaylibHandle { ffi::TakeScreenshot(c_filename.as_ptr()); } } + + /// Returns a random value between min and max (both included) + /// ```rust + /// use raylib::*; + /// fn main() { + /// let (mut rl, thread) = ...; + /// let r = rl.get_random_value(0, 10); + /// println!("random value: {}", r); + /// } + pub fn get_random_value>(&self, min: i32, max: i32) -> T { + unsafe { (ffi::GetRandomValue(min, max) as i32).into() } + } + + /// Set the seed for random number generation + pub fn set_random_seed(&mut self, seed: u32) { + unsafe { ffi::SetRandomSeed(seed); } + } } // lossy conversion to an f32 diff --git a/raylib/src/lib.rs b/raylib/src/lib.rs index ab03aa58..3f0687bc 100644 --- a/raylib/src/lib.rs +++ b/raylib/src/lib.rs @@ -70,7 +70,7 @@ pub mod ffi { pub use crate::core::collision::*; pub use crate::core::file::*; pub use crate::core::logging::*; -pub use crate::core::misc::{get_random_value, open_url}; +pub use crate::core::misc::{open_url}; pub use crate::core::*; // Re-exports diff --git a/samples/asteroids.rs b/samples/asteroids.rs index b23861c2..12890f57 100644 --- a/samples/asteroids.rs +++ b/samples/asteroids.rs @@ -147,11 +147,11 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { let mut correct_range = false; for meteor in &mut game.big_meteors { - let mut x: i32 = get_random_value(0, width as i32); + let mut x: i32 = rl.get_random_value(0, width as i32); while !correct_range { if x > half_width as i32 - 150 && x < half_width as i32 + 150 { - x = get_random_value(0, width as i32); + x = rl.get_random_value(0, width as i32); } else { correct_range = true; @@ -160,11 +160,11 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { correct_range = false; - let mut y: i32 = get_random_value(0, height as i32); + let mut y: i32 = rl.get_random_value(0, height as i32); while !correct_range { if y > half_height as i32 - 150 && y < half_height as i32 + 150 { - y = get_random_value(0, height as i32); + y = rl.get_random_value(0, height as i32); } else { correct_range = true; @@ -173,13 +173,13 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { correct_range = false; - let mut vel_x: i32 = get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - let mut vel_y: i32 = get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); + let mut vel_x: i32 = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); + let mut vel_y: i32 = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); while !correct_range { if vel_x == 0 && vel_y == 0 { - vel_x = get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - vel_y = get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); + vel_x = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); + vel_y = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); } else { correct_range = true; diff --git a/samples/camera2D.rs b/samples/camera2D.rs index 1eb69587..d4a6a606 100644 --- a/samples/camera2D.rs +++ b/samples/camera2D.rs @@ -18,19 +18,19 @@ fn main() { let mut spacing = 0.0; for i in 0..MAX_BUILDINGS { - let bh: i32 = get_random_value(100, 800); + let bh: i32 = rl.get_random_value(100, 800); buildings.push(Rectangle::new( -6000.0 + spacing, (h - 130 - bh) as f32, - get_random_value::(50, 200) as f32, + rl.get_random_value::(50, 200) as f32, bh as f32, )); spacing += buildings[i].width; build_colors.push(Color::new( - get_random_value::(200, 240) as u8, - get_random_value::(200, 240) as u8, - get_random_value::(200, 240) as u8, + rl.get_random_value::(200, 240) as u8, + rl.get_random_value::(200, 240) as u8, + rl.get_random_value::(200, 240) as u8, 255, )); } diff --git a/samples/roguelike.rs b/samples/roguelike.rs index 43fda09a..91f3fd46 100644 --- a/samples/roguelike.rs +++ b/samples/roguelike.rs @@ -14,6 +14,7 @@ use std::fs::File; use std::io::{Read, Write}; use structopt::StructOpt; use tcod::map::{FovAlgorithm, Map as FovMap}; +use crate::KeyboardKey::KEY_A; mod options; @@ -933,7 +934,7 @@ fn play_game( // handle game logic level_up(rl, thread, game, objects); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) { + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { tcod.mouse = rl.get_mouse_position(); } @@ -1802,14 +1803,14 @@ fn target_tile( let (x, y) = (pos.x as i32 / TILE_WIDTH, pos.y as i32 / TILE_HEIGHT); let in_fov = (x < MAP_WIDTH) && (y < MAP_HEIGHT) && tcod.fov.is_in_fov(x, y); let in_range = max_range.map_or(true, |range| objects[PLAYER].distance(x, y) <= range); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_LEFT_BUTTON) + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) && in_fov && in_range { return Some((x, y)); } - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_RIGHT_BUTTON) { + if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { return None; } // ... @@ -1893,7 +1894,7 @@ fn menu>( if let Some(pressed_key) = pressed_key { dbg!(pressed_key); use std::num::Wrapping; - let index = Wrapping(pressed_key) - Wrapping('a' as u32); + let index = Wrapping(pressed_key) - Wrapping(KEY_A as u32); let index: u32 = index.0; if (index as usize) < options.len() { Some(index as usize) diff --git a/samples/specs.rs b/samples/specs.rs index a7e056e2..f661e2fd 100644 --- a/samples/specs.rs +++ b/samples/specs.rs @@ -199,10 +199,10 @@ fn init_world(rl: &RaylibHandle, world: &mut World) -> EntityMap { for x in 0..TILE_COUNT { for y in 0..TILE_COUNT { let mut eb = world.create_entity().with(Tile).with(Pos(x, y)); - if !placed_player && get_random_value::(0, 100) < 10 { + if !placed_player && rl.get_random_value::(0, 100) < 10 { placed_player = true; eb = eb.with(Player); - } else if get_random_value::(0, 100) < 10 { + } else if rl.get_random_value::(0, 100) < 10 { eb = eb.with(Fire); } diff --git a/showcase/src/example/audio/audio_module_playing.rs b/showcase/src/example/audio/audio_module_playing.rs index 51c8344d..95041d75 100644 --- a/showcase/src/example/audio/audio_module_playing.rs +++ b/showcase/src/example/audio/audio_module_playing.rs @@ -49,11 +49,11 @@ pub fn run(rl for i in 0..MAX_CIRCLES { circles[i].alpha = 0.0; - circles[i].radius = raylib::get_random_value::(10, 40) as f32 ; - circles[i].position.x = raylib::get_random_value::(circles[i].radius as i32, screen_width - circles[i].radius as i32) as f32 ; - circles[i].position.y = raylib::get_random_value::(circles[i].radius as i32, screen_height - circles[i].radius as i32) as f32 ; - circles[i].speed = raylib::get_random_value::(1, 100) as f32 / 2000.0; - circles[i].color = colors[raylib::get_random_value::(0, 13) as usize]; + circles[i].radius = rl.get_random_value::(10, 40) as f32 ; + circles[i].position.x = rl.get_random_value::(circles[i].radius as i32, screen_width - circles[i].radius as i32) as f32 ; + circles[i].position.y = rl.get_random_value::(circles[i].radius as i32, screen_height - circles[i].radius as i32) as f32 ; + circles[i].speed = rl.get_random_value::(1, 100) as f32 / 2000.0; + circles[i].color = colors[rl.get_random_value::(0, 13) as usize]; } let mut music = Music::load_music_stream(thread, "original/audio/resources/mini1111.xm").unwrap(); @@ -115,11 +115,11 @@ pub fn run(rl if circles[i].alpha <= 0.0 { circles[i].alpha = 0.0; - circles[i].radius = raylib::get_random_value::(10, 40) as f32; - circles[i].position.x = raylib::get_random_value::(circles[i].radius as i32, screen_width - circles[i].radius as i32) as f32; - circles[i].position.y = raylib::get_random_value::(circles[i].radius as i32, screen_height - circles[i].radius as i32) as f32; - circles[i].color = colors[raylib::get_random_value::(0, 13) as usize]; - circles[i].speed = raylib::get_random_value::(1, 100) as f32 / 2000.0; + circles[i].radius = rl.get_random_value::(10, 40) as f32; + circles[i].position.x = rl.get_random_value::(circles[i].radius as i32, screen_width - circles[i].radius as i32) as f32; + circles[i].position.y = rl.get_random_value::(circles[i].radius as i32, screen_height - circles[i].radius as i32) as f32; + circles[i].color = colors[rl.get_random_value::(0, 13) as usize]; + circles[i].speed = rl.get_random_value::(1, 100) as f32 / 2000.0; } } //---------------------------------------------------------------------------------- diff --git a/showcase/src/example/core/core_2d_camera.rs b/showcase/src/example/core/core_2d_camera.rs index b0f52f49..39c703d5 100644 --- a/showcase/src/example/core/core_2d_camera.rs +++ b/showcase/src/example/core/core_2d_camera.rs @@ -28,17 +28,17 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let mut spacing = 0f32; for i in 0..MAX_BUILDINGS as usize { - buildings[i].width = get_random_value::(50, 200) as f32; - buildings[i].height = get_random_value::(100, 800) as f32; + buildings[i].width = rl.get_random_value::(50, 200) as f32; + buildings[i].height = rl.get_random_value::(100, 800) as f32; buildings[i].y = screen_height as f32 - 130.0 - buildings[i].height; buildings[i].x = -6000.0 + spacing; spacing += buildings[i].width; build_colors[i] = Color::new( - get_random_value::(200, 240) as u8, - get_random_value::(200, 240) as u8, - get_random_value::(200, 250) as u8, + rl.get_random_value::(200, 240) as u8, + rl.get_random_value::(200, 240) as u8, + rl.get_random_value::(200, 250) as u8, 255, ); } diff --git a/showcase/src/example/core/core_3d_camera_first_person.rs b/showcase/src/example/core/core_3d_camera_first_person.rs index 7c19ef60..b0b74e5c 100644 --- a/showcase/src/example/core/core_3d_camera_first_person.rs +++ b/showcase/src/example/core/core_3d_camera_first_person.rs @@ -31,15 +31,15 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let mut colors = [Color::default(); MAX_COLUMNS]; for i in 0..MAX_COLUMNS { - heights[i] = raylib::get_random_value::(1, 12) as f32; + heights[i] = rl.get_random_value::(1, 12) as f32; positions[i] = rvec3( - raylib::get_random_value::(-15, 15), + rl.get_random_value::(-15, 15), heights[i] / 2.0, - raylib::get_random_value::(-15, 15), + rl.get_random_value::(-15, 15), ); colors[i] = Color::new( - raylib::get_random_value::(20, 255) as u8, - raylib::get_random_value::(10, 55) as u8, + rl.get_random_value::(20, 255) as u8, + rl.get_random_value::(10, 55) as u8, 30, 255, ); diff --git a/showcase/src/example/core/core_random_values.rs b/showcase/src/example/core/core_random_values.rs index 45eddfdf..07ee191d 100644 --- a/showcase/src/example/core/core_random_values.rs +++ b/showcase/src/example/core/core_random_values.rs @@ -22,7 +22,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { let mut framesCounter = 0; // Variable used to count frames - let mut randValue: i32 = raylib::get_random_value::(-8, 5); // Get a random integer number between -8 and 5 (both included) + let mut randValue: i32 = rl.get_random_value::(-8, 5); // Get a random integer number between -8 and 5 (both included) rl.set_target_fps(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- @@ -38,7 +38,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { // Every two seconds (120 frames) a new random value is generated if ((framesCounter / 120) % 2) == 1 { - randValue = raylib::get_random_value::(-8, 5); + randValue = rl.get_random_value::(-8, 5); framesCounter = 0; } //---------------------------------------------------------------------------------- diff --git a/showcase/src/example/core/core_window_letterbox.rs b/showcase/src/example/core/core_window_letterbox.rs index 02a990e5..8c0fe88f 100644 --- a/showcase/src/example/core/core_window_letterbox.rs +++ b/showcase/src/example/core/core_window_letterbox.rs @@ -48,7 +48,7 @@ pub fn run(rl let mut colors = [Color::default(); 10]; for i in 0..10 { - colors[i] = Color::new(raylib::get_random_value::(100, 250) as u8, raylib::get_random_value::(50, 150) as u8, raylib::get_random_value::(10, 100) as u8, 255); + colors[i] = Color::new(rl.get_random_value::(100, 250) as u8, rl.get_random_value::(50, 150) as u8, rl.get_random_value::(10, 100) as u8, 255); } @@ -69,7 +69,7 @@ pub fn run(rl for i in 0..10 { - colors[i] = Color::new(raylib::get_random_value::(100, 250) as u8, raylib::get_random_value::(50, 150) as u8, raylib::get_random_value::(10, 100) as u8, 255); + colors[i] = Color::new(rl.get_random_value::(100, 250) as u8, rl.get_random_value::(50, 150) as u8, rl.get_random_value::(10, 100) as u8, 255); } } diff --git a/showcase/src/example/models/mod.rs b/showcase/src/example/models/mod.rs index 099dd230..cf0d45f4 100644 --- a/showcase/src/example/models/mod.rs +++ b/showcase/src/example/models/mod.rs @@ -10,7 +10,6 @@ pub mod models_loading; pub mod models_mesh_generation; pub mod models_mesh_picking; pub mod models_orthographic_projection; -#[cfg(target_os = "windows")] pub mod models_rlgl_solar_system; // pub mod models_skybox; pub mod models_waving_cubes; diff --git a/showcase/src/example/models/models_rlgl_solar_system.rs b/showcase/src/example/models/models_rlgl_solar_system.rs index 396355c9..93acbdd5 100644 --- a/showcase/src/example/models/models_rlgl_solar_system.rs +++ b/showcase/src/example/models/models_rlgl_solar_system.rs @@ -142,13 +142,13 @@ fn DrawSphereBasic(color: Color) ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); + (deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).sin(), (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j+1)*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).sin(), - (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*((j*360/slices) as f32).cos())); + (deg2rad*(270+(180/(rings + 1))*(i+1)) as f32).cos()*(deg2rad*(j*360/slices) as f32).cos()); ffi::rlVertex3f((deg2rad*(270+(180/(rings + 1))*i) as f32).cos()*(deg2rad*(j*360/slices) as f32).sin(), (deg2rad*(270+(180/(rings + 1))*i) as f32).sin(), diff --git a/showcase/src/example/others/mod.rs b/showcase/src/example/others/mod.rs index 71624a36..f8037c90 100644 --- a/showcase/src/example/others/mod.rs +++ b/showcase/src/example/others/mod.rs @@ -1,2 +1 @@ -#[cfg(target_os = "windows")] pub mod rlgl_standalone; diff --git a/showcase/src/example/others/rlgl_standalone.rs b/showcase/src/example/others/rlgl_standalone.rs index de1f43a9..640d2fdc 100644 --- a/showcase/src/example/others/rlgl_standalone.rs +++ b/showcase/src/example/others/rlgl_standalone.rs @@ -106,7 +106,7 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { ); let mat_view = Matrix::look_at(camera.position, camera.target, camera.up); - ffi::rlSetMatrixProjection(mat_view.into()); // Set internal modelview matrix (default shader) + ffi::rlSetMatrixModelview(mat_view.into()); // Set internal modelview matrix (default shader) ffi::rlSetMatrixProjection(mat_proj.into()); // Set internal projection matrix (default shader) draw_cube(cube_position, 2.0, 2.0, 2.0, Color::RED); diff --git a/showcase/src/example/textures/textures_bunnymark.rs b/showcase/src/example/textures/textures_bunnymark.rs index e2ab1a40..a3cbafb4 100644 --- a/showcase/src/example/textures/textures_bunnymark.rs +++ b/showcase/src/example/textures/textures_bunnymark.rs @@ -56,13 +56,13 @@ pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut { if bunnies_count < MAX_BUNNIES { bunnies[bunnies_count].position = rl.get_mouse_position(); bunnies[bunnies_count].speed.x = - get_random_value::(-250, 250) as f32 / 60.0; + rl.get_random_value::(-250, 250) as f32 / 60.0; bunnies[bunnies_count].speed.y = - get_random_value::(-250, 250) as f32 / 60.0; + rl.get_random_value::(-250, 250) as f32 / 60.0; bunnies[bunnies_count].color = Color::new( - get_random_value::(50, 240) as u8, - get_random_value::(80, 240) as u8, - get_random_value::(100, 240) as u8, + rl.get_random_value::(50, 240) as u8, + rl.get_random_value::(80, 240) as u8, + rl.get_random_value::(100, 240) as u8, 255, ); bunnies_count += 1; diff --git a/showcase/src/main.rs b/showcase/src/main.rs index 756a447f..fea01012 100644 --- a/showcase/src/main.rs +++ b/showcase/src/main.rs @@ -198,7 +198,6 @@ fn main() { rstr!("raylib [models] example - orthographic projection"), example::models::models_orthographic_projection::run, ), - #[cfg(target_os = "windows")] ( rstr!( "raylib [models] example - rlgl module usage with push/pop matrix transformations" @@ -253,7 +252,6 @@ fn main() { rstr!("raylib [textures] example - mouse painting"), example::textures::textures_mouse_painting::run, ), - #[cfg(target_os = "windows")] ( rstr!("rlgl standalone"), example::others::rlgl_standalone::run, @@ -278,7 +276,7 @@ fn main() { let list: Vec<_> = samples.iter().map(|(s, _)| *s).collect(); list_view_active = d.gui_list_view_ex( - rrect(100.0, y_margin, 600, box_length), + rrect(100.0, y_margin as f32, 600 as f32, box_length as f32), list.as_slice(), &mut list_view_focus, &mut list_view_scroll_index, From d6455cd5096010b9f76e5cfcb55e399092e0ff89 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Sat, 29 Jan 2022 00:22:05 +0000 Subject: [PATCH 04/30] Fixed a couple of things --- raylib-test/src/drawing.rs | 4 +- raylib-test/src/texture.rs | 212 +++++++++++++++++++------------------ raylib/src/core/color.rs | 3 + raylib/src/core/window.rs | 3 + 4 files changed, 115 insertions(+), 107 deletions(-) diff --git a/raylib-test/src/drawing.rs b/raylib-test/src/drawing.rs index 87a8d82f..f1ce4fb0 100644 --- a/raylib-test/src/drawing.rs +++ b/raylib-test/src/drawing.rs @@ -85,7 +85,7 @@ mod draw_test { Color::WHITE, ); d.draw_rectangle_lines(90, 10, 10, 10, Color::RED); - d.draw_rectangle_lines_ex(Rectangle::new(100.0, 10.0, 10.0, 10.0), 3, Color::GREEN); + d.draw_rectangle_lines_ex(Rectangle::new(100.0, 10.0, 10.0, 10.0), 3.0, Color::GREEN); d.draw_rectangle_rounded( Rectangle::new(110.0, 30.0, 100.0, 100.0), 0.1, @@ -96,7 +96,7 @@ mod draw_test { Rectangle::new(220.0, 30.0, 100.0, 100.0), 0.10, 5, - 3, + 3.0, Color::ORANGE, ); } diff --git a/raylib-test/src/texture.rs b/raylib-test/src/texture.rs index 8cf39cd8..dd90cab4 100644 --- a/raylib-test/src/texture.rs +++ b/raylib-test/src/texture.rs @@ -10,26 +10,27 @@ mod texture_test { i.export_image_as_code("test_out/billboard_code.h"); } - #[test] - fn test_image_load_ex() { - let mut col = Vec::new(); - for _ in 0..32 { - for _ in 0..32 { - col.push(Color::RED); - } - } - let i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); - assert_eq!( - i.get_image_data().len(), - 32 * 32, - "failed to read pixels of image" - ); - assert_eq!( - i.get_image_data_normalized().len(), - 32 * 32, - "failed to read pixels of image normalized" - ); - } + // TODO: Disabled, load_image_ex doesn't seem to exist + // #[test] + // fn test_image_load_ex() { + // let mut col = Vec::new(); + // for _ in 0..32 { + // for _ in 0..32 { + // col.push(Color::RED); + // } + // } + // let i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); + // assert_eq!( + // i.get_image_data().len(), + // 32 * 32, + // "failed to read pixels of image" + // ); + // assert_eq!( + // i.get_image_data_normalized().len(), + // 32 * 32, + // "failed to read pixels of image normalized" + // ); + // } ray_test!(test_texture_load); fn test_texture_load(thread: &RaylibThread) { @@ -57,89 +58,90 @@ mod texture_test { .expect("render texture created"); } - #[test] - fn test_image_manipulations() { - // Just checking that nothing segfaults. Not ensuring they work as expected. - let mut col = Vec::new(); - let mut alpha = Vec::new(); - let mut blank = Vec::new(); - for i in 0..32 { - for j in 0..32 { - col.push(Color::RED); - blank.push(Color::new(0, 0, 0, 0)); - if (i / 8) % 2 == (j / 8) % 2 { - alpha.push(Color::new(255, 255, 255, 255)) - } else { - alpha.push(Color::new(0, 0, 0, 0)) - } - } - } - - let mut i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); - let mut canvas = Image::load_image_ex(&blank, 32, 32).expect("failed to load canvas image"); - let mask = Image::load_image_ex(&alpha, 32, 32).expect("failed to load alpha image"); - - let mut c = i.clone(); - - c.alpha_mask(&mask); - c.alpha_clear(Color::BLUE, 0.5); - // shouldn't do anything - c.alpha_crop(0.5); - // shouldn't do anything - c.alpha_premultiply(); - let mut blurry = c.clone(); - blurry.resize(256, 256); - blurry.export_image("test_out/chessboard_blurry.png"); - c.resize_nn(256, 256); - i.resize_canvas(256, 256, 10, 10, Color::BLUE); - i.export_image("test_out/resized.png"); - c.export_image("test_out/chessboard.png"); - c.mipmaps(); - blurry.dither(128, 128, 128, 128); - let colors = c.extract_palette(100); - assert_eq!(colors.len(), 2, "color palette extraction failed"); - canvas.draw( - &i, - Rectangle::new(0.0, 0.0, 20.0, 20.0), - Rectangle::new(0.0, 0.0, 20.0, 20.0), - Color::WHITE, - ); - canvas.draw_rectangle_lines(Rectangle::new(20.0, 0.0, 20.0, 20.0), 4, Color::GREEN); - let rec = Rectangle::new(40.0, 0.0, 20.0, 20.0); - canvas.draw_rectangle( - rec.x as i32, - rec.y as i32, - rec.width as i32, - rec.height as i32, - Color::ORANGE, - ); - canvas.flip_vertical(); - canvas.flip_horizontal(); - canvas.rotate_cw(); - canvas.rotate_ccw(); - canvas.color_tint(Color::PINK); - canvas.color_invert(); - canvas.color_contrast(0.5); - canvas.color_brightness(128); - canvas.color_replace(Color::GREEN, Color::RED); - canvas.export_image("test_out/canvas.png"); - - // Test generation functions - let g = Image::gen_image_color(64, 64, Color::BLUE); - g.export_image("test_out/generated_color.png"); - let g = Image::gen_image_gradient_v(64, 64, Color::RED, Color::BLUE); - g.export_image("test_out/generated_gradient_v.png"); - let g = Image::gen_image_gradient_h(64, 64, Color::RED, Color::BLUE); - g.export_image("test_out/generated_gradient_h.png"); - let g = Image::gen_image_gradient_radial(64, 64, 0.5, Color::RED, Color::BLUE); - g.export_image("test_out/generated_gradient_radial.png"); - let g = Image::gen_image_checked(64, 64, 8, 8, Color::RED, Color::BLUE); - g.export_image("test_out/generated_checked.png"); - let g = Image::gen_image_white_noise(64, 64, 0.7); - g.export_image("test_out/generated_white.png"); - let g = Image::gen_image_perlin_noise(64, 64, 0, 0, 0.7); - g.export_image("test_out/generated_perlin.png"); - let g = Image::gen_image_cellular(64, 64, 4); - g.export_image("test_out/generated_cellular.png"); - } + // TODO: Disabled, load_image_ex doesn't seem to exist + // #[test] + // fn test_image_manipulations() { + // // Just checking that nothing segfaults. Not ensuring they work as expected. + // let mut col = Vec::new(); + // let mut alpha = Vec::new(); + // let mut blank = Vec::new(); + // for i in 0..32 { + // for j in 0..32 { + // col.push(Color::RED); + // blank.push(Color::new(0, 0, 0, 0)); + // if (i / 8) % 2 == (j / 8) % 2 { + // alpha.push(Color::new(255, 255, 255, 255)) + // } else { + // alpha.push(Color::new(0, 0, 0, 0)) + // } + // } + // } + // + // let mut i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); + // let mut canvas = Image::load_image_ex(&blank, 32, 32).expect("failed to load canvas image"); + // let mask = Image::load_image_ex(&alpha, 32, 32).expect("failed to load alpha image"); + // + // let mut c = i.clone(); + // + // c.alpha_mask(&mask); + // c.alpha_clear(Color::BLUE, 0.5); + // // shouldn't do anything + // c.alpha_crop(0.5); + // // shouldn't do anything + // c.alpha_premultiply(); + // let mut blurry = c.clone(); + // blurry.resize(256, 256); + // blurry.export_image("test_out/chessboard_blurry.png"); + // c.resize_nn(256, 256); + // i.resize_canvas(256, 256, 10, 10, Color::BLUE); + // i.export_image("test_out/resized.png"); + // c.export_image("test_out/chessboard.png"); + // c.mipmaps(); + // blurry.dither(128, 128, 128, 128); + // let colors = c.extract_palette(100); + // assert_eq!(colors.len(), 2, "color palette extraction failed"); + // canvas.draw( + // &i, + // Rectangle::new(0.0, 0.0, 20.0, 20.0), + // Rectangle::new(0.0, 0.0, 20.0, 20.0), + // Color::WHITE, + // ); + // canvas.draw_rectangle_lines(Rectangle::new(20.0, 0.0, 20.0, 20.0), 4, Color::GREEN); + // let rec = Rectangle::new(40.0, 0.0, 20.0, 20.0); + // canvas.draw_rectangle( + // rec.x as i32, + // rec.y as i32, + // rec.width as i32, + // rec.height as i32, + // Color::ORANGE, + // ); + // canvas.flip_vertical(); + // canvas.flip_horizontal(); + // canvas.rotate_cw(); + // canvas.rotate_ccw(); + // canvas.color_tint(Color::PINK); + // canvas.color_invert(); + // canvas.color_contrast(0.5); + // canvas.color_brightness(128); + // canvas.color_replace(Color::GREEN, Color::RED); + // canvas.export_image("test_out/canvas.png"); + // + // // Test generation functions + // let g = Image::gen_image_color(64, 64, Color::BLUE); + // g.export_image("test_out/generated_color.png"); + // let g = Image::gen_image_gradient_v(64, 64, Color::RED, Color::BLUE); + // g.export_image("test_out/generated_gradient_v.png"); + // let g = Image::gen_image_gradient_h(64, 64, Color::RED, Color::BLUE); + // g.export_image("test_out/generated_gradient_h.png"); + // let g = Image::gen_image_gradient_radial(64, 64, 0.5, Color::RED, Color::BLUE); + // g.export_image("test_out/generated_gradient_radial.png"); + // let g = Image::gen_image_checked(64, 64, 8, 8, Color::RED, Color::BLUE); + // g.export_image("test_out/generated_checked.png"); + // let g = Image::gen_image_white_noise(64, 64, 0.7); + // g.export_image("test_out/generated_white.png"); + // let g = Image::gen_image_perlin_noise(64, 64, 0, 0, 0.7); + // g.export_image("test_out/generated_perlin.png"); + // let g = Image::gen_image_cellular(64, 64, 4); + // g.export_image("test_out/generated_cellular.png"); + // } } diff --git a/raylib/src/core/color.rs b/raylib/src/core/color.rs index 0cdff725..beb187c4 100644 --- a/raylib/src/core/color.rs +++ b/raylib/src/core/color.rs @@ -2,6 +2,9 @@ use crate::core::math::{Vector3, Vector4}; use crate::ffi; +#[cfg(feature = "with_serde")] +use serde::{Deserialize, Serialize}; + #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 210a8344..168ffaec 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -5,6 +5,9 @@ use crate::ffi; use std::ffi::{CStr, CString, IntoStringError, NulError}; use std::os::raw::c_char; +#[cfg(feature = "with_serde")] +use serde::{Deserialize, Serialize}; + // MonitorInfo grabs the sizes (virtual and physical) of your monitor #[derive(Clone, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] From e73346e7d95ff374300f9d8a3d60ecf79df390d7 Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 12 Nov 2022 19:48:09 -0800 Subject: [PATCH 05/30] Merge --- README.md | 9 + raylib-sys/Cargo.toml | 11 +- raylib-sys/build.rs | 60 +++++- raylib-sys/raylib | 2 +- raylib-test/src/texture.rs | 194 ++++++++---------- raylib-test/src/window.rs | 25 ++- raylib/Cargo.toml | 1 + raylib/src/core/color.rs | 2 + raylib/src/core/data.rs | 11 +- raylib/src/core/input.rs | 10 + raylib/src/core/math.rs | 12 +- raylib/src/core/misc.rs | 15 +- raylib/src/core/window.rs | 4 +- raylib/src/lib.rs | 2 +- samples/3d_camera_first_person.rs | 8 +- .../textures/textures_mouse_painting.rs | 8 +- 16 files changed, 234 insertions(+), 140 deletions(-) diff --git a/README.md b/README.md index cf3a14b7..5bda069b 100644 --- a/README.md +++ b/README.md @@ -73,12 +73,21 @@ fn main() { - In C, `LoadFontData` returns a pointer to a heap-allocated array of `CharInfo` structs. In this Rust binding, said array is copied into an owned `Vec`, the original data is freed, and the owned Vec is returned. - In C, `GetDroppedFiles` returns a pointer to an array of strings owned by raylib. Again, for safety and also ease of use, this binding copies said array into a `Vec` which is returned to the caller. - I've tried to make linking automatic, though I've only tested on Windows 10, Ubuntu, and MacOS 15. Other platforms may have other considerations. +- OpenGL 3.3, 2.1, and ES 2.0 may be forced via adding `["opengl_33"]`, `["opengl_21"]` or `["opengl_es_20]` to the `features` array in your Cargo.toml dependency definition. ## Building from source 1. Clone repository: `git clone --recurse-submodules` 2. `cargo build` +### If building for Wayland on Linux + +3. Install these packages: +`libglfw3-dev wayland-devel libxkbcommon-devel wayland-protocols wayland-protocols-devel libecm-dev` +###### Note that this may not be a comprehensive list, please add details for your distribution or expand on these packages if you believe this to be incomplete. + +4. Enable wayland by adding `features=["wayland"]` to your dependency definition + ## Cross-compiling using `cross` The [@rust-embedded](https://github.com/rust-embedded) project provides a handy tool called [`cross`](https://github.com/rust-embedded/cross) that uses docker to cross-compile any cargo project to one of their many [supported platforms](https://github.com/rust-embedded/cross#supported-targets). This tool makes it easy to cross-compile `raylib-rs` for binary distribution (in cases where you are producing a pre-compiled game for example). diff --git a/raylib-sys/Cargo.toml b/raylib-sys/Cargo.toml index 2fe4c247..3bbd60e1 100644 --- a/raylib-sys/Cargo.toml +++ b/raylib-sys/Cargo.toml @@ -24,4 +24,13 @@ bindgen = "0.53.1" [features] default = [] # Build Raylib headless for docs. Up to you to link -nobuild = [] \ No newline at end of file +nobuild = [] + +# Build for wayland on linux. Should fix #119 +wayland = [] + +# OpenGL stuff, intended for fixing #122 +opengl_33 = [] +opengl_21 = [] +# opengl_11 = [] I couldn't get this one working, the others were fine in my limited testing (unsure about wayland compatibility) +opengl_es_20 = [] \ No newline at end of file diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index cbaaf74e..fea1e89c 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -65,6 +65,42 @@ fn build_with_cmake(src_path: &str) { // turn off until this is fixed .define("SUPPORT_BUSY_WAIT_LOOP", "OFF"); + // Enable wayland cmake flag if feature is specified + #[cfg(feature = "wayland")] + { + builder.define("USE_WAYLAND", "ON"); + builder.define("USE_EXTERNAL_GLFW", "ON"); // Necessary for wayland support in my testing + } + + // This seems redundant, but I felt it was needed incase raylib changes it's default + #[cfg(not(feature = "wayland"))] + builder.define("USE_WAYLAND", "OFF"); + + // Scope implementing flags for forcing OpenGL version + // See all possible flags at https://github.com/raysan5/raylib/wiki/CMake-Build-Options + { + #[cfg(feature = "opengl_33")] + builder.define("OPENGL_VERSION", "3.3"); + + #[cfg(feature = "opengl_21")] + builder.define("OPENGL_VERSION", "2.1"); + + // #[cfg(feature = "opengl_11")] + // builder.define("OPENGL_VERSION", "1.1"); + + #[cfg(feature = "opengl_es_20")] + builder.define("OPENGL_VERSION", "ES 2.0"); + + // Once again felt this was necessary incase a default was changed :) + #[cfg(not(any( + feature = "opengl_33", + feature = "opengl_21", + // feature = "opengl_11", + feature = "opengl_es_20" + )))] + builder.define("OPENGL_VERSION", "OFF"); + } + match platform { Platform::Desktop => conf.define("PLATFORM", "Desktop"), Platform::Web => conf.define("PLATFORM", "Web").define("CMAKE_C_FLAGS", "-s ASYNCIFY"), @@ -179,8 +215,20 @@ fn link(platform: Platform, platform_os: PlatformOS) { println!("cargo:rustc-link-lib=dylib=shell32"); } PlatformOS::Linux => { - println!("cargo:rustc-link-search=/usr/local/lib"); - println!("cargo:rustc-link-lib=X11"); + // X11 linking + #[cfg(not(feature = "wayland"))] + { + println!("cargo:rustc-link-search=/usr/local/lib"); + println!("cargo:rustc-link-lib=X11"); + } + + // Wayland linking + #[cfg(feature = "wayland")] + { + println!("cargo:rustc-link-search=/usr/local/lib"); + println!("cargo:rustc-link-lib=wayland-client"); + println!("cargo:rustc-link-lib=glfw"); // Link against locally installed glfw + } } PlatformOS::OSX => { println!("cargo:rustc-link-search=native=/usr/local/lib"); @@ -194,7 +242,13 @@ fn link(platform: Platform, platform_os: PlatformOS) { } if platform == Platform::Web { println!("cargo:rustc-link-lib=glfw"); - } + } else if platform == Platform::RPI { + println!("cargo:rustc-link-search=/opt/vc/lib"); + println!("cargo:rustc-link-lib=bcm_host"); + println!("cargo:rustc-link-lib=brcmEGL"); + println!("cargo:rustc-link-lib=brcmGLESv2"); + println!("cargo:rustc-link-lib=vcos"); + } println!("cargo:rustc-link-lib=static=raylib"); } diff --git a/raylib-sys/raylib b/raylib-sys/raylib index 08519603..b6c8d343 160000 --- a/raylib-sys/raylib +++ b/raylib-sys/raylib @@ -1 +1 @@ -Subproject commit 0851960397f02a477d80eda2239f90fae14dec64 +Subproject commit b6c8d343dca2ef19c23c50975328a028124cf3cb diff --git a/raylib-test/src/texture.rs b/raylib-test/src/texture.rs index dd90cab4..720b6ae7 100644 --- a/raylib-test/src/texture.rs +++ b/raylib-test/src/texture.rs @@ -10,28 +10,6 @@ mod texture_test { i.export_image_as_code("test_out/billboard_code.h"); } - // TODO: Disabled, load_image_ex doesn't seem to exist - // #[test] - // fn test_image_load_ex() { - // let mut col = Vec::new(); - // for _ in 0..32 { - // for _ in 0..32 { - // col.push(Color::RED); - // } - // } - // let i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); - // assert_eq!( - // i.get_image_data().len(), - // 32 * 32, - // "failed to read pixels of image" - // ); - // assert_eq!( - // i.get_image_data_normalized().len(), - // 32 * 32, - // "failed to read pixels of image normalized" - // ); - // } - ray_test!(test_texture_load); fn test_texture_load(thread: &RaylibThread) { let i = @@ -58,90 +36,90 @@ mod texture_test { .expect("render texture created"); } - // TODO: Disabled, load_image_ex doesn't seem to exist - // #[test] - // fn test_image_manipulations() { - // // Just checking that nothing segfaults. Not ensuring they work as expected. - // let mut col = Vec::new(); - // let mut alpha = Vec::new(); - // let mut blank = Vec::new(); - // for i in 0..32 { - // for j in 0..32 { - // col.push(Color::RED); - // blank.push(Color::new(0, 0, 0, 0)); - // if (i / 8) % 2 == (j / 8) % 2 { - // alpha.push(Color::new(255, 255, 255, 255)) - // } else { - // alpha.push(Color::new(0, 0, 0, 0)) - // } - // } - // } - // - // let mut i = Image::load_image_ex(&col, 32, 32).expect("failed to load binary image"); - // let mut canvas = Image::load_image_ex(&blank, 32, 32).expect("failed to load canvas image"); - // let mask = Image::load_image_ex(&alpha, 32, 32).expect("failed to load alpha image"); - // - // let mut c = i.clone(); - // - // c.alpha_mask(&mask); - // c.alpha_clear(Color::BLUE, 0.5); - // // shouldn't do anything - // c.alpha_crop(0.5); - // // shouldn't do anything - // c.alpha_premultiply(); - // let mut blurry = c.clone(); - // blurry.resize(256, 256); - // blurry.export_image("test_out/chessboard_blurry.png"); - // c.resize_nn(256, 256); - // i.resize_canvas(256, 256, 10, 10, Color::BLUE); - // i.export_image("test_out/resized.png"); - // c.export_image("test_out/chessboard.png"); - // c.mipmaps(); - // blurry.dither(128, 128, 128, 128); - // let colors = c.extract_palette(100); - // assert_eq!(colors.len(), 2, "color palette extraction failed"); - // canvas.draw( - // &i, - // Rectangle::new(0.0, 0.0, 20.0, 20.0), - // Rectangle::new(0.0, 0.0, 20.0, 20.0), - // Color::WHITE, - // ); - // canvas.draw_rectangle_lines(Rectangle::new(20.0, 0.0, 20.0, 20.0), 4, Color::GREEN); - // let rec = Rectangle::new(40.0, 0.0, 20.0, 20.0); - // canvas.draw_rectangle( - // rec.x as i32, - // rec.y as i32, - // rec.width as i32, - // rec.height as i32, - // Color::ORANGE, - // ); - // canvas.flip_vertical(); - // canvas.flip_horizontal(); - // canvas.rotate_cw(); - // canvas.rotate_ccw(); - // canvas.color_tint(Color::PINK); - // canvas.color_invert(); - // canvas.color_contrast(0.5); - // canvas.color_brightness(128); - // canvas.color_replace(Color::GREEN, Color::RED); - // canvas.export_image("test_out/canvas.png"); - // - // // Test generation functions - // let g = Image::gen_image_color(64, 64, Color::BLUE); - // g.export_image("test_out/generated_color.png"); - // let g = Image::gen_image_gradient_v(64, 64, Color::RED, Color::BLUE); - // g.export_image("test_out/generated_gradient_v.png"); - // let g = Image::gen_image_gradient_h(64, 64, Color::RED, Color::BLUE); - // g.export_image("test_out/generated_gradient_h.png"); - // let g = Image::gen_image_gradient_radial(64, 64, 0.5, Color::RED, Color::BLUE); - // g.export_image("test_out/generated_gradient_radial.png"); - // let g = Image::gen_image_checked(64, 64, 8, 8, Color::RED, Color::BLUE); - // g.export_image("test_out/generated_checked.png"); - // let g = Image::gen_image_white_noise(64, 64, 0.7); - // g.export_image("test_out/generated_white.png"); - // let g = Image::gen_image_perlin_noise(64, 64, 0, 0, 0.7); - // g.export_image("test_out/generated_perlin.png"); - // let g = Image::gen_image_cellular(64, 64, 4); - // g.export_image("test_out/generated_cellular.png"); - // } + #[test] + fn test_image_manipulations() { + // Just checking that nothing segfaults. Not ensuring they work as expected. + let mut col = Vec::new(); + let mut alpha = Vec::new(); + let mut blank = Vec::new(); + for i in 0..32 { + for j in 0..32 { + col.push(Color::RED); + blank.push(Color::new(0, 0, 0, 0)); + if (i / 8) % 2 == (j / 8) % 2 { + alpha.push(Color::new(255, 255, 255, 255)) + } else { + alpha.push(Color::new(0, 0, 0, 0)) + } + } + } + + let mut i = Image::gen_image_color(32, 32, Color::RED); + let mut canvas = Image::gen_image_color(32, 32, Color::BLANK); + // let mask = Image::load_image_ex(&alpha, 32, 32).expect("failed to load alpha image"); + let mask = Image::gen_image_checked(32, 32, 8, 8, Color::WHITE, Color::BLANK); + + let mut c = i.clone(); + + c.alpha_mask(&mask); + c.alpha_clear(Color::BLUE, 0.5); + // shouldn't do anything + c.alpha_crop(0.5); + // shouldn't do anything + c.alpha_premultiply(); + let mut blurry = c.clone(); + blurry.resize(256, 256); + blurry.export_image("test_out/chessboard_blurry.png"); + c.resize_nn(256, 256); + i.resize_canvas(256, 256, 10, 10, Color::BLUE); + i.export_image("test_out/resized.png"); + c.export_image("test_out/chessboard.png"); + c.mipmaps(); + blurry.dither(128, 128, 128, 128); + let colors = c.extract_palette(100); + assert_eq!(colors.len(), 2, "color palette extraction failed"); + canvas.draw( + &i, + Rectangle::new(0.0, 0.0, 20.0, 20.0), + Rectangle::new(0.0, 0.0, 20.0, 20.0), + Color::WHITE, + ); + canvas.draw_rectangle_lines(Rectangle::new(20.0, 0.0, 20.0, 20.0), 4, Color::GREEN); + let rec = Rectangle::new(40.0, 0.0, 20.0, 20.0); + canvas.draw_rectangle( + rec.x as i32, + rec.y as i32, + rec.width as i32, + rec.height as i32, + Color::ORANGE, + ); + canvas.flip_vertical(); + canvas.flip_horizontal(); + canvas.rotate_cw(); + canvas.rotate_ccw(); + canvas.color_tint(Color::PINK); + canvas.color_invert(); + canvas.color_contrast(0.5); + canvas.color_brightness(128); + canvas.color_replace(Color::GREEN, Color::RED); + canvas.export_image("test_out/canvas.png"); + + // Test generation functions + let g = Image::gen_image_color(64, 64, Color::BLUE); + g.export_image("test_out/generated_color.png"); + let g = Image::gen_image_gradient_v(64, 64, Color::RED, Color::BLUE); + g.export_image("test_out/generated_gradient_v.png"); + let g = Image::gen_image_gradient_h(64, 64, Color::RED, Color::BLUE); + g.export_image("test_out/generated_gradient_h.png"); + let g = Image::gen_image_gradient_radial(64, 64, 0.5, Color::RED, Color::BLUE); + g.export_image("test_out/generated_gradient_radial.png"); + let g = Image::gen_image_checked(64, 64, 8, 8, Color::RED, Color::BLUE); + g.export_image("test_out/generated_checked.png"); + let g = Image::gen_image_white_noise(64, 64, 0.7); + g.export_image("test_out/generated_white.png"); + let g = Image::gen_image_perlin_noise(64, 64, 0, 0, 0.7); + g.export_image("test_out/generated_perlin.png"); + let g = Image::gen_image_cellular(64, 64, 4); + g.export_image("test_out/generated_cellular.png"); + } } diff --git a/raylib-test/src/window.rs b/raylib-test/src/window.rs index a1517219..106626bf 100644 --- a/raylib-test/src/window.rs +++ b/raylib-test/src/window.rs @@ -1,6 +1,6 @@ #[cfg(test)] mod core_test { - + use crate::tests::*; use raylib::camera::*; use raylib::math::*; @@ -40,22 +40,31 @@ mod core_test { rl.get_time(); } + fn set_window_hidden(rl: &mut raylib::RaylibHandle, hidden: bool) { + let state = rl.get_window_state().set_window_hidden(hidden); + rl.set_window_state(state); + } + #[test] #[cfg(not(target_os = "windows"))] + // does not work (too fast?) + #[ignore] fn test_window_ops() { // Call twice to make sure multiple calls won't panic let mut handle = TEST_HANDLE.write().unwrap(); let rl = handle.as_mut().unwrap(); + // check initial state + assert!(!rl.is_window_hidden(), "window is hidden!"); + // double hide double show - rl.hide_window(); - rl.hide_window(); - // TODO uncomment this when we can draw a frame - // assert!(rl.is_window_hidden(), "window is not hidden!"); + set_window_hidden(rl, true); + set_window_hidden(rl, true); + assert!(rl.is_window_hidden(), "window is not hidden!"); - rl.unhide_window(); - rl.unhide_window(); - // assert!(!rl.is_window_hidden(), "window is hidden!"); + set_window_hidden(rl, false); + set_window_hidden(rl, false); + assert!(!rl.is_window_hidden(), "window is hidden!"); } ray_test!(test_set_window_name); diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 25c36659..63d49ef8 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -25,6 +25,7 @@ nightly = [] nobuild = ["raylib-sys/nobuild"] with_serde = ["serde", "serde_json"] nalgebra_interop = ["nalgebra"] +wayland = ["raylib-sys/wayland"] [package.metadata.docs.rs] features = ["nobuild"] diff --git a/raylib/src/core/color.rs b/raylib/src/core/color.rs index beb187c4..bfbadc21 100644 --- a/raylib/src/core/color.rs +++ b/raylib/src/core/color.rs @@ -1,6 +1,8 @@ //! [`Color`] manipulation helpers use crate::core::math::{Vector3, Vector4}; use crate::ffi; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; #[cfg(feature = "with_serde")] use serde::{Deserialize, Serialize}; diff --git a/raylib/src/core/data.rs b/raylib/src/core/data.rs index 768548cd..8f65e643 100644 --- a/raylib/src/core/data.rs +++ b/raylib/src/core/data.rs @@ -2,11 +2,11 @@ use crate::ffi; /// Compress data (DEFLATE algorythm) -/// Currently broken. /// ```rust /// use raylib::prelude::*; /// let data = compress_data(b"1111111111"); -/// assert!(data.is_err()); +/// let expected: &[u8] = &[61, 193, 33, 1, 0, 0, 0, 128, 160, 77, 254, 63, 103, 3, 98]; +/// assert_eq!(data, Ok(expected)); /// ``` pub fn compress_data(data: &[u8]) -> Result<&'static [u8], String> { let mut out_length: i32 = 0; @@ -22,11 +22,12 @@ pub fn compress_data(data: &[u8]) -> Result<&'static [u8], String> { } /// Decompress data (DEFLATE algorythm) -/// Currently broken. /// ```rust /// use raylib::prelude::*; -/// let data = compress_data(b"1111111111"); -/// assert!(data.is_err()); +/// let input: &[u8] = &[61, 193, 33, 1, 0, 0, 0, 128, 160, 77, 254, 63, 103, 3, 98]; +/// let expected: &[u8] = b"1111111111"; +/// let data = decompress_data(input); +/// assert_eq!(data, Ok(expected)); /// ``` pub fn decompress_data(data: &[u8]) -> Result<&'static [u8], String> { let mut out_length: i32 = 0; diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index 14494a03..79762960 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -51,6 +51,16 @@ impl RaylibHandle { None } + /// Gets latest char (unicode) pressed + #[inline] + pub fn get_char_pressed(&mut self) -> Option { + let char_code = unsafe { ffi::GetCharPressed() }; + if char_code > 0 { + return char::from_u32(char_code as u32); + } + None + } + /// Sets a custom key to exit program (default is ESC). // #[inline] pub fn set_exit_key(&mut self, key: Option) { diff --git a/raylib/src/core/math.rs b/raylib/src/core/math.rs index 3b9a467f..a9af1cfe 100644 --- a/raylib/src/core/math.rs +++ b/raylib/src/core/math.rs @@ -154,18 +154,26 @@ pub fn rrect( } impl Vector2 { + /// Constant `Vector2` with both components set to zero. + const ZERO: Vector2 = Vector2 { x: 0.0, y: 0.0 }; + + /// Constant `Vector2` with both components set to one. + const ONE: Vector2 = Vector2 { x: 1.0, y: 1.0 }; + /// Returns a new `Vector2` with specified components. pub const fn new(x: f32, y: f32) -> Vector2 { Vector2 { x, y } } /// Returns a new `Vector2` with both components set to zero. - pub fn zero() -> Vector2 { + #[inline] + pub const fn zero() -> Vector2 { Vector2 { x: 0.0, y: 0.0 } } /// Returns a new `Vector2` with both components set to one. - pub fn one() -> Vector2 { + #[inline] + pub const fn one() -> Vector2 { Vector2 { x: 1.0, y: 1.0 } } diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index f148393d..f73edbc2 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -4,6 +4,17 @@ use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; use std::ffi::CString; +/// Returns a random value between min and max (both included) +/// ```rust +/// use raylib::*; +/// fn main() { +/// let r = get_random_value::(0, 10); +/// println!("random value: {}", r); +/// } +pub fn get_random_value>(min: i32, max: i32) -> T { + unsafe { (ffi::GetRandomValue(min, max) as i32).into() } +} + /// Open URL with default system browser (if available) /// ```ignore /// use raylib::*; @@ -45,7 +56,9 @@ impl RaylibHandle { /// Set the seed for random number generation pub fn set_random_seed(&mut self, seed: u32) { - unsafe { ffi::SetRandomSeed(seed); } + unsafe { + ffi::SetRandomSeed(seed); + } } } diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 168ffaec..28c2ad20 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -2,6 +2,8 @@ use crate::core::math::{Matrix, Ray, Vector2}; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use std::ffi::{CStr, CString, IntoStringError, NulError}; use std::os::raw::c_char; @@ -504,7 +506,7 @@ impl RaylibHandle { /// Checks if window has been hidden. #[inline] pub fn is_window_hidden(&self) -> bool { - unsafe { ffi::IsWindowResized() } + unsafe { ffi::IsWindowHidden() } } /// Returns whether or not window is in fullscreen mode diff --git a/raylib/src/lib.rs b/raylib/src/lib.rs index 3f0687bc..60803c53 100644 --- a/raylib/src/lib.rs +++ b/raylib/src/lib.rs @@ -37,7 +37,7 @@ Permission is granted to anyone to use this software for any purpose, including //! //! The classic "Hello, world": //! -//! ``` +//! ```no_run //! use raylib::prelude::*; //! //! fn main() { diff --git a/samples/3d_camera_first_person.rs b/samples/3d_camera_first_person.rs index 999fc9e7..60a11f06 100644 --- a/samples/3d_camera_first_person.rs +++ b/samples/3d_camera_first_person.rs @@ -14,13 +14,13 @@ struct Column { impl Column { fn create_random() -> Column { let mut rng = rand::thread_rng(); - let height: f32 = rng.gen_range(1.0, 12.0); + let height: f32 = rng.gen_range(1.0..12.0); let position = Vector3::new( - rng.gen_range(-15.0, 15.0), + rng.gen_range(-15.0..15.0), height / 2.0, - rng.gen_range(-15.0, 15.0), + rng.gen_range(-15.0..15.0), ); - let color = Color::new(rng.gen_range(20, 255), rng.gen_range(10, 55), 30, 255); + let color = Color::new(rng.gen_range(20..255), rng.gen_range(10..55), 30, 255); Column { height, diff --git a/showcase/src/example/textures/textures_mouse_painting.rs b/showcase/src/example/textures/textures_mouse_painting.rs index 27c737f5..fc18f1c0 100644 --- a/showcase/src/example/textures/textures_mouse_painting.rs +++ b/showcase/src/example/textures/textures_mouse_painting.rs @@ -41,10 +41,8 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut Color::DARKBLUE, Color::PURPLE, Color::VIOLET, - Color::DARKPURPLE, Color::BEIGE, Color::BROWN, - Color::DARKBROWN, Color::LIGHTGRAY, Color::GRAY, Color::DARKGRAY, @@ -66,7 +64,7 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut let mut color_mouse_hover = None; let mut brush_size = 20; - let btn_save_rec = rrect(750, 10, 40, 30); + let btn_save_rec = rrect::(750, 10, 40, 30); let mut btn_save_mouse_hover = false; let mut show_save_message = false; let mut save_message_counter = 0; @@ -211,8 +209,8 @@ pub fn run(mut rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) d.draw_texture_rec( &target, - rrect(0, 0, target.texture.width, -target.texture.height), - rvec2(0, 0), + rrect::(0, 0, target.texture.width, -target.texture.height), + rvec2::(0, 0), Color::WHITE, ); From b20d463134ec2c07ef7e7259fefb0ae8d9a40988 Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 12 Nov 2022 21:16:01 -0800 Subject: [PATCH 06/30] building raylib-sys --- .gitmodules | 1 + raylib-sys/Cargo.toml | 8 +- raylib-sys/binding/binding.h | 517 ++--- raylib-sys/binding/config.h | 228 +- raylib-sys/binding/raygui.h | 4216 ++++++++++++++++++---------------- raylib-sys/build.rs | 26 +- raylib-sys/raylib | 2 +- raylib/Cargo.toml | 4 +- 8 files changed, 2733 insertions(+), 2269 deletions(-) diff --git a/.gitmodules b/.gitmodules index a25d66a8..c13092d8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "raylib-sys/raylib"] path = raylib-sys/raylib url = https://github.com/raysan5/raylib + branch = "4.0.0" diff --git a/raylib-sys/Cargo.toml b/raylib-sys/Cargo.toml index 3bbd60e1..82e5f0ab 100644 --- a/raylib-sys/Cargo.toml +++ b/raylib-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-sys" -version = "4.0.0" +version = "4.2.0" authors = ["DeltaPHC "] license = "Zlib" description = "Raw FFI bindings for Raylib" @@ -16,10 +16,10 @@ exclude = [ ] [build-dependencies] -fs_extra = "1.1" -cmake = "0.1.35" +fs_extra = "1.2" +cmake = "0.1.49" cc = "1.0" -bindgen = "0.53.1" +bindgen = "0.61.0" [features] default = [] diff --git a/raylib-sys/binding/binding.h b/raylib-sys/binding/binding.h index a4625060..00f36084 100644 --- a/raylib-sys/binding/binding.h +++ b/raylib-sys/binding/binding.h @@ -1,261 +1,262 @@ #include "raygui.h" #include "../raylib/src/rlgl.h" -typedef enum { - RAYGUI_ICON_NONE = 0, - RAYGUI_ICON_FOLDER_FILE_OPEN = 1, - RAYGUI_ICON_FILE_SAVE_CLASSIC = 2, - RAYGUI_ICON_FOLDER_OPEN = 3, - RAYGUI_ICON_FOLDER_SAVE = 4, - RAYGUI_ICON_FILE_OPEN = 5, - RAYGUI_ICON_FILE_SAVE = 6, - RAYGUI_ICON_FILE_EXPORT = 7, - RAYGUI_ICON_FILE_NEW = 8, - RAYGUI_ICON_FILE_DELETE = 9, - RAYGUI_ICON_FILETYPE_TEXT = 10, - RAYGUI_ICON_FILETYPE_AUDIO = 11, - RAYGUI_ICON_FILETYPE_IMAGE = 12, - RAYGUI_ICON_FILETYPE_PLAY = 13, - RAYGUI_ICON_FILETYPE_VIDEO = 14, - RAYGUI_ICON_FILETYPE_INFO = 15, - RAYGUI_ICON_FILE_COPY = 16, - RAYGUI_ICON_FILE_CUT = 17, - RAYGUI_ICON_FILE_PASTE = 18, - RAYGUI_ICON_CURSOR_HAND = 19, - RAYGUI_ICON_CURSOR_POINTER = 20, - RAYGUI_ICON_CURSOR_CLASSIC = 21, - RAYGUI_ICON_PENCIL = 22, - RAYGUI_ICON_PENCIL_BIG = 23, - RAYGUI_ICON_BRUSH_CLASSIC = 24, - RAYGUI_ICON_BRUSH_PAINTER = 25, - RAYGUI_ICON_WATER_DROP = 26, - RAYGUI_ICON_COLOR_PICKER = 27, - RAYGUI_ICON_RUBBER = 28, - RAYGUI_ICON_COLOR_BUCKET = 29, - RAYGUI_ICON_TEXT_T = 30, - RAYGUI_ICON_TEXT_A = 31, - RAYGUI_ICON_SCALE = 32, - RAYGUI_ICON_RESIZE = 33, - RAYGUI_ICON_FILTER_POINT = 34, - RAYGUI_ICON_FILTER_BILINEAR = 35, - RAYGUI_ICON_CROP = 36, - RAYGUI_ICON_CROP_ALPHA = 37, - RAYGUI_ICON_SQUARE_TOGGLE = 38, - RAYGUI_ICON_SYMMETRY = 39, - RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40, - RAYGUI_ICON_SYMMETRY_VERTICAL = 41, - RAYGUI_ICON_LENS = 42, - RAYGUI_ICON_LENS_BIG = 43, - RAYGUI_ICON_EYE_ON = 44, - RAYGUI_ICON_EYE_OFF = 45, - RAYGUI_ICON_FILTER_TOP = 46, - RAYGUI_ICON_FILTER = 47, - RAYGUI_ICON_TARGET_POINT = 48, - RAYGUI_ICON_TARGET_SMALL = 49, - RAYGUI_ICON_TARGET_BIG = 50, - RAYGUI_ICON_TARGET_MOVE = 51, - RAYGUI_ICON_CURSOR_MOVE = 52, - RAYGUI_ICON_CURSOR_SCALE = 53, - RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54, - RAYGUI_ICON_CURSOR_SCALE_LEFT = 55, - RAYGUI_ICON_UNDO = 56, - RAYGUI_ICON_REDO = 57, - RAYGUI_ICON_REREDO = 58, - RAYGUI_ICON_MUTATE = 59, - RAYGUI_ICON_ROTATE = 60, - RAYGUI_ICON_REPEAT = 61, - RAYGUI_ICON_SHUFFLE = 62, - RAYGUI_ICON_EMPTYBOX = 63, - RAYGUI_ICON_TARGET = 64, - RAYGUI_ICON_TARGET_SMALL_FILL = 65, - RAYGUI_ICON_TARGET_BIG_FILL = 66, - RAYGUI_ICON_TARGET_MOVE_FILL = 67, - RAYGUI_ICON_CURSOR_MOVE_FILL = 68, - RAYGUI_ICON_CURSOR_SCALE_FILL = 69, - RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70, - RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71, - RAYGUI_ICON_UNDO_FILL = 72, - RAYGUI_ICON_REDO_FILL = 73, - RAYGUI_ICON_REREDO_FILL = 74, - RAYGUI_ICON_MUTATE_FILL = 75, - RAYGUI_ICON_ROTATE_FILL = 76, - RAYGUI_ICON_REPEAT_FILL = 77, - RAYGUI_ICON_SHUFFLE_FILL = 78, - RAYGUI_ICON_EMPTYBOX_SMALL = 79, - RAYGUI_ICON_BOX = 80, - RAYGUI_ICON_BOX_TOP = 81, - RAYGUI_ICON_BOX_TOP_RIGHT = 82, - RAYGUI_ICON_BOX_RIGHT = 83, - RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84, - RAYGUI_ICON_BOX_BOTTOM = 85, - RAYGUI_ICON_BOX_BOTTOM_LEFT = 86, - RAYGUI_ICON_BOX_LEFT = 87, - RAYGUI_ICON_BOX_TOP_LEFT = 88, - RAYGUI_ICON_BOX_CENTER = 89, - RAYGUI_ICON_BOX_CIRCLE_MASK = 90, - RAYGUI_ICON_POT = 91, - RAYGUI_ICON_ALPHA_MULTIPLY = 92, - RAYGUI_ICON_ALPHA_CLEAR = 93, - RAYGUI_ICON_DITHERING = 94, - RAYGUI_ICON_MIPMAPS = 95, - RAYGUI_ICON_BOX_GRID = 96, - RAYGUI_ICON_GRID = 97, - RAYGUI_ICON_BOX_CORNERS_SMALL = 98, - RAYGUI_ICON_BOX_CORNERS_BIG = 99, - RAYGUI_ICON_FOUR_BOXES = 100, - RAYGUI_ICON_GRID_FILL = 101, - RAYGUI_ICON_BOX_MULTISIZE = 102, - RAYGUI_ICON_ZOOM_SMALL = 103, - RAYGUI_ICON_ZOOM_MEDIUM = 104, - RAYGUI_ICON_ZOOM_BIG = 105, - RAYGUI_ICON_ZOOM_ALL = 106, - RAYGUI_ICON_ZOOM_CENTER = 107, - RAYGUI_ICON_BOX_DOTS_SMALL = 108, - RAYGUI_ICON_BOX_DOTS_BIG = 109, - RAYGUI_ICON_BOX_CONCENTRIC = 110, - RAYGUI_ICON_BOX_GRID_BIG = 111, - RAYGUI_ICON_OK_TICK = 112, - RAYGUI_ICON_CROSS = 113, - RAYGUI_ICON_ARROW_LEFT = 114, - RAYGUI_ICON_ARROW_RIGHT = 115, - RAYGUI_ICON_ARROW_DOWN = 116, - RAYGUI_ICON_ARROW_UP = 117, - RAYGUI_ICON_ARROW_LEFT_FILL = 118, - RAYGUI_ICON_ARROW_RIGHT_FILL = 119, - RAYGUI_ICON_ARROW_DOWN_FILL = 120, - RAYGUI_ICON_ARROW_UP_FILL = 121, - RAYGUI_ICON_AUDIO = 122, - RAYGUI_ICON_FX = 123, - RAYGUI_ICON_WAVE = 124, - RAYGUI_ICON_WAVE_SINUS = 125, - RAYGUI_ICON_WAVE_SQUARE = 126, - RAYGUI_ICON_WAVE_TRIANGULAR = 127, - RAYGUI_ICON_CROSS_SMALL = 128, - RAYGUI_ICON_PLAYER_PREVIOUS = 129, - RAYGUI_ICON_PLAYER_PLAY_BACK = 130, - RAYGUI_ICON_PLAYER_PLAY = 131, - RAYGUI_ICON_PLAYER_PAUSE = 132, - RAYGUI_ICON_PLAYER_STOP = 133, - RAYGUI_ICON_PLAYER_NEXT = 134, - RAYGUI_ICON_PLAYER_RECORD = 135, - RAYGUI_ICON_MAGNET = 136, - RAYGUI_ICON_LOCK_CLOSE = 137, - RAYGUI_ICON_LOCK_OPEN = 138, - RAYGUI_ICON_CLOCK = 139, - RAYGUI_ICON_TOOLS = 140, - RAYGUI_ICON_GEAR = 141, - RAYGUI_ICON_GEAR_BIG = 142, - RAYGUI_ICON_BIN = 143, - RAYGUI_ICON_HAND_POINTER = 144, - RAYGUI_ICON_LASER = 145, - RAYGUI_ICON_COIN = 146, - RAYGUI_ICON_EXPLOSION = 147, - RAYGUI_ICON_1UP = 148, - RAYGUI_ICON_PLAYER = 149, - RAYGUI_ICON_PLAYER_JUMP = 150, - RAYGUI_ICON_KEY = 151, - RAYGUI_ICON_DEMON = 152, - RAYGUI_ICON_TEXT_POPUP = 153, - RAYGUI_ICON_GEAR_EX = 154, - RAYGUI_ICON_CRACK = 155, - RAYGUI_ICON_CRACK_POINTS = 156, - RAYGUI_ICON_STAR = 157, - RAYGUI_ICON_DOOR = 158, - RAYGUI_ICON_EXIT = 159, - RAYGUI_ICON_MODE_2D = 160, - RAYGUI_ICON_MODE_3D = 161, - RAYGUI_ICON_CUBE = 162, - RAYGUI_ICON_CUBE_FACE_TOP = 163, - RAYGUI_ICON_CUBE_FACE_LEFT = 164, - RAYGUI_ICON_CUBE_FACE_FRONT = 165, - RAYGUI_ICON_CUBE_FACE_BOTTOM = 166, - RAYGUI_ICON_CUBE_FACE_RIGHT = 167, - RAYGUI_ICON_CUBE_FACE_BACK = 168, - RAYGUI_ICON_CAMERA = 169, - RAYGUI_ICON_SPECIAL = 170, - RAYGUI_ICON_LINK_NET = 171, - RAYGUI_ICON_LINK_BOXES = 172, - RAYGUI_ICON_LINK_MULTI = 173, - RAYGUI_ICON_LINK = 174, - RAYGUI_ICON_LINK_BROKE = 175, - RAYGUI_ICON_TEXT_NOTES = 176, - RAYGUI_ICON_NOTEBOOK = 177, - RAYGUI_ICON_SUITCASE = 178, - RAYGUI_ICON_SUITCASE_ZIP = 179, - RAYGUI_ICON_MAILBOX = 180, - RAYGUI_ICON_MONITOR = 181, - RAYGUI_ICON_PRINTER = 182, - RAYGUI_ICON_PHOTO_CAMERA = 183, - RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184, - RAYGUI_ICON_HOUSE = 185, - RAYGUI_ICON_HEART = 186, - RAYGUI_ICON_CORNER = 187, - RAYGUI_ICON_VERTICAL_BARS = 188, - RAYGUI_ICON_VERTICAL_BARS_FILL = 189, - RAYGUI_ICON_LIFE_BARS = 190, - RAYGUI_ICON_INFO = 191, - RAYGUI_ICON_CROSSLINE = 192, - RAYGUI_ICON_HELP = 193, - RAYGUI_ICON_FILETYPE_ALPHA = 194, - RAYGUI_ICON_FILETYPE_HOME = 195, - RAYGUI_ICON_LAYERS_VISIBLE = 196, - RAYGUI_ICON_LAYERS = 197, - RAYGUI_ICON_WINDOW = 198, - RAYGUI_ICON_HIDPI = 199, - RAYGUI_ICON_200 = 200, - RAYGUI_ICON_201 = 201, - RAYGUI_ICON_202 = 202, - RAYGUI_ICON_203 = 203, - RAYGUI_ICON_204 = 204, - RAYGUI_ICON_205 = 205, - RAYGUI_ICON_206 = 206, - RAYGUI_ICON_207 = 207, - RAYGUI_ICON_208 = 208, - RAYGUI_ICON_209 = 209, - RAYGUI_ICON_210 = 210, - RAYGUI_ICON_211 = 211, - RAYGUI_ICON_212 = 212, - RAYGUI_ICON_213 = 213, - RAYGUI_ICON_214 = 214, - RAYGUI_ICON_215 = 215, - RAYGUI_ICON_216 = 216, - RAYGUI_ICON_217 = 217, - RAYGUI_ICON_218 = 218, - RAYGUI_ICON_219 = 219, - RAYGUI_ICON_220 = 220, - RAYGUI_ICON_221 = 221, - RAYGUI_ICON_222 = 222, - RAYGUI_ICON_223 = 223, - RAYGUI_ICON_224 = 224, - RAYGUI_ICON_225 = 225, - RAYGUI_ICON_226 = 226, - RAYGUI_ICON_227 = 227, - RAYGUI_ICON_228 = 228, - RAYGUI_ICON_229 = 229, - RAYGUI_ICON_230 = 230, - RAYGUI_ICON_231 = 231, - RAYGUI_ICON_232 = 232, - RAYGUI_ICON_233 = 233, - RAYGUI_ICON_234 = 234, - RAYGUI_ICON_235 = 235, - RAYGUI_ICON_236 = 236, - RAYGUI_ICON_237 = 237, - RAYGUI_ICON_238 = 238, - RAYGUI_ICON_239 = 239, - RAYGUI_ICON_240 = 240, - RAYGUI_ICON_241 = 241, - RAYGUI_ICON_242 = 242, - RAYGUI_ICON_243 = 243, - RAYGUI_ICON_244 = 244, - RAYGUI_ICON_245 = 245, - RAYGUI_ICON_246 = 246, - RAYGUI_ICON_247 = 247, - RAYGUI_ICON_248 = 248, - RAYGUI_ICON_249 = 249, - RAYGUI_ICON_250 = 250, - RAYGUI_ICON_251 = 251, - RAYGUI_ICON_252 = 252, - RAYGUI_ICON_253 = 253, - RAYGUI_ICON_254 = 254, - RAYGUI_ICON_255 = 255, -} guiIconName; \ No newline at end of file +typedef enum +{ + RAYGUI_ICON_NONE = 0, + RAYGUI_ICON_FOLDER_FILE_OPEN = 1, + RAYGUI_ICON_FILE_SAVE_CLASSIC = 2, + RAYGUI_ICON_FOLDER_OPEN = 3, + RAYGUI_ICON_FOLDER_SAVE = 4, + RAYGUI_ICON_FILE_OPEN = 5, + RAYGUI_ICON_FILE_SAVE = 6, + RAYGUI_ICON_FILE_EXPORT = 7, + RAYGUI_ICON_FILE_ADD = 8, + RAYGUI_ICON_FILE_DELETE = 9, + RAYGUI_ICON_FILETYPE_TEXT = 10, + RAYGUI_ICON_FILETYPE_AUDIO = 11, + RAYGUI_ICON_FILETYPE_IMAGE = 12, + RAYGUI_ICON_FILETYPE_PLAY = 13, + RAYGUI_ICON_FILETYPE_VIDEO = 14, + RAYGUI_ICON_FILETYPE_INFO = 15, + RAYGUI_ICON_FILE_COPY = 16, + RAYGUI_ICON_FILE_CUT = 17, + RAYGUI_ICON_FILE_PASTE = 18, + RAYGUI_ICON_CURSOR_HAND = 19, + RAYGUI_ICON_CURSOR_POINTER = 20, + RAYGUI_ICON_CURSOR_CLASSIC = 21, + RAYGUI_ICON_PENCIL = 22, + RAYGUI_ICON_PENCIL_BIG = 23, + RAYGUI_ICON_BRUSH_CLASSIC = 24, + RAYGUI_ICON_BRUSH_PAINTER = 25, + RAYGUI_ICON_WATER_DROP = 26, + RAYGUI_ICON_COLOR_PICKER = 27, + RAYGUI_ICON_RUBBER = 28, + RAYGUI_ICON_COLOR_BUCKET = 29, + RAYGUI_ICON_TEXT_T = 30, + RAYGUI_ICON_TEXT_A = 31, + RAYGUI_ICON_SCALE = 32, + RAYGUI_ICON_RESIZE = 33, + RAYGUI_ICON_FILTER_POINT = 34, + RAYGUI_ICON_FILTER_BILINEAR = 35, + RAYGUI_ICON_CROP = 36, + RAYGUI_ICON_CROP_ALPHA = 37, + RAYGUI_ICON_SQUARE_TOGGLE = 38, + RAYGUI_ICON_SYMMETRY = 39, + RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40, + RAYGUI_ICON_SYMMETRY_VERTICAL = 41, + RAYGUI_ICON_LENS = 42, + RAYGUI_ICON_LENS_BIG = 43, + RAYGUI_ICON_EYE_ON = 44, + RAYGUI_ICON_EYE_OFF = 45, + RAYGUI_ICON_FILTER_TOP = 46, + RAYGUI_ICON_FILTER = 47, + RAYGUI_ICON_TARGET_POINT = 48, + RAYGUI_ICON_TARGET_SMALL = 49, + RAYGUI_ICON_TARGET_BIG = 50, + RAYGUI_ICON_TARGET_MOVE = 51, + RAYGUI_ICON_CURSOR_MOVE = 52, + RAYGUI_ICON_CURSOR_SCALE = 53, + RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54, + RAYGUI_ICON_CURSOR_SCALE_LEFT = 55, + RAYGUI_ICON_UNDO = 56, + RAYGUI_ICON_REDO = 57, + RAYGUI_ICON_REREDO = 58, + RAYGUI_ICON_MUTATE = 59, + RAYGUI_ICON_ROTATE = 60, + RAYGUI_ICON_REPEAT = 61, + RAYGUI_ICON_SHUFFLE = 62, + RAYGUI_ICON_EMPTYBOX = 63, + RAYGUI_ICON_TARGET = 64, + RAYGUI_ICON_TARGET_SMALL_FILL = 65, + RAYGUI_ICON_TARGET_BIG_FILL = 66, + RAYGUI_ICON_TARGET_MOVE_FILL = 67, + RAYGUI_ICON_CURSOR_MOVE_FILL = 68, + RAYGUI_ICON_CURSOR_SCALE_FILL = 69, + RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70, + RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71, + RAYGUI_ICON_UNDO_FILL = 72, + RAYGUI_ICON_REDO_FILL = 73, + RAYGUI_ICON_REREDO_FILL = 74, + RAYGUI_ICON_MUTATE_FILL = 75, + RAYGUI_ICON_ROTATE_FILL = 76, + RAYGUI_ICON_REPEAT_FILL = 77, + RAYGUI_ICON_SHUFFLE_FILL = 78, + RAYGUI_ICON_EMPTYBOX_SMALL = 79, + RAYGUI_ICON_BOX = 80, + RAYGUI_ICON_BOX_TOP = 81, + RAYGUI_ICON_BOX_TOP_RIGHT = 82, + RAYGUI_ICON_BOX_RIGHT = 83, + RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84, + RAYGUI_ICON_BOX_BOTTOM = 85, + RAYGUI_ICON_BOX_BOTTOM_LEFT = 86, + RAYGUI_ICON_BOX_LEFT = 87, + RAYGUI_ICON_BOX_TOP_LEFT = 88, + RAYGUI_ICON_BOX_CENTER = 89, + RAYGUI_ICON_BOX_CIRCLE_MASK = 90, + RAYGUI_ICON_POT = 91, + RAYGUI_ICON_ALPHA_MULTIPLY = 92, + RAYGUI_ICON_ALPHA_CLEAR = 93, + RAYGUI_ICON_DITHERING = 94, + RAYGUI_ICON_MIPMAPS = 95, + RAYGUI_ICON_BOX_GRID = 96, + RAYGUI_ICON_GRID = 97, + RAYGUI_ICON_BOX_CORNERS_SMALL = 98, + RAYGUI_ICON_BOX_CORNERS_BIG = 99, + RAYGUI_ICON_FOUR_BOXES = 100, + RAYGUI_ICON_GRID_FILL = 101, + RAYGUI_ICON_BOX_MULTISIZE = 102, + RAYGUI_ICON_ZOOM_SMALL = 103, + RAYGUI_ICON_ZOOM_MEDIUM = 104, + RAYGUI_ICON_ZOOM_BIG = 105, + RAYGUI_ICON_ZOOM_ALL = 106, + RAYGUI_ICON_ZOOM_CENTER = 107, + RAYGUI_ICON_BOX_DOTS_SMALL = 108, + RAYGUI_ICON_BOX_DOTS_BIG = 109, + RAYGUI_ICON_BOX_CONCENTRIC = 110, + RAYGUI_ICON_BOX_GRID_BIG = 111, + RAYGUI_ICON_OK_TICK = 112, + RAYGUI_ICON_CROSS = 113, + RAYGUI_ICON_ARROW_LEFT = 114, + RAYGUI_ICON_ARROW_RIGHT = 115, + RAYGUI_ICON_ARROW_DOWN = 116, + RAYGUI_ICON_ARROW_UP = 117, + RAYGUI_ICON_ARROW_LEFT_FILL = 118, + RAYGUI_ICON_ARROW_RIGHT_FILL = 119, + RAYGUI_ICON_ARROW_DOWN_FILL = 120, + RAYGUI_ICON_ARROW_UP_FILL = 121, + RAYGUI_ICON_AUDIO = 122, + RAYGUI_ICON_FX = 123, + RAYGUI_ICON_WAVE = 124, + RAYGUI_ICON_WAVE_SINUS = 125, + RAYGUI_ICON_WAVE_SQUARE = 126, + RAYGUI_ICON_WAVE_TRIANGULAR = 127, + RAYGUI_ICON_CROSS_SMALL = 128, + RAYGUI_ICON_PLAYER_PREVIOUS = 129, + RAYGUI_ICON_PLAYER_PLAY_BACK = 130, + RAYGUI_ICON_PLAYER_PLAY = 131, + RAYGUI_ICON_PLAYER_PAUSE = 132, + RAYGUI_ICON_PLAYER_STOP = 133, + RAYGUI_ICON_PLAYER_NEXT = 134, + RAYGUI_ICON_PLAYER_RECORD = 135, + RAYGUI_ICON_MAGNET = 136, + RAYGUI_ICON_LOCK_CLOSE = 137, + RAYGUI_ICON_LOCK_OPEN = 138, + RAYGUI_ICON_CLOCK = 139, + RAYGUI_ICON_TOOLS = 140, + RAYGUI_ICON_GEAR = 141, + RAYGUI_ICON_GEAR_BIG = 142, + RAYGUI_ICON_BIN = 143, + RAYGUI_ICON_HAND_POINTER = 144, + RAYGUI_ICON_LASER = 145, + RAYGUI_ICON_COIN = 146, + RAYGUI_ICON_EXPLOSION = 147, + RAYGUI_ICON_1UP = 148, + RAYGUI_ICON_PLAYER = 149, + RAYGUI_ICON_PLAYER_JUMP = 150, + RAYGUI_ICON_KEY = 151, + RAYGUI_ICON_DEMON = 152, + RAYGUI_ICON_TEXT_POPUP = 153, + RAYGUI_ICON_GEAR_EX = 154, + RAYGUI_ICON_CRACK = 155, + RAYGUI_ICON_CRACK_POINTS = 156, + RAYGUI_ICON_STAR = 157, + RAYGUI_ICON_DOOR = 158, + RAYGUI_ICON_EXIT = 159, + RAYGUI_ICON_MODE_2D = 160, + RAYGUI_ICON_MODE_3D = 161, + RAYGUI_ICON_CUBE = 162, + RAYGUI_ICON_CUBE_FACE_TOP = 163, + RAYGUI_ICON_CUBE_FACE_LEFT = 164, + RAYGUI_ICON_CUBE_FACE_FRONT = 165, + RAYGUI_ICON_CUBE_FACE_BOTTOM = 166, + RAYGUI_ICON_CUBE_FACE_RIGHT = 167, + RAYGUI_ICON_CUBE_FACE_BACK = 168, + RAYGUI_ICON_CAMERA = 169, + RAYGUI_ICON_SPECIAL = 170, + RAYGUI_ICON_LINK_NET = 171, + RAYGUI_ICON_LINK_BOXES = 172, + RAYGUI_ICON_LINK_MULTI = 173, + RAYGUI_ICON_LINK = 174, + RAYGUI_ICON_LINK_BROKE = 175, + RAYGUI_ICON_TEXT_NOTES = 176, + RAYGUI_ICON_NOTEBOOK = 177, + RAYGUI_ICON_SUITCASE = 178, + RAYGUI_ICON_SUITCASE_ZIP = 179, + RAYGUI_ICON_MAILBOX = 180, + RAYGUI_ICON_MONITOR = 181, + RAYGUI_ICON_PRINTER = 182, + RAYGUI_ICON_PHOTO_CAMERA = 183, + RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184, + RAYGUI_ICON_HOUSE = 185, + RAYGUI_ICON_HEART = 186, + RAYGUI_ICON_CORNER = 187, + RAYGUI_ICON_VERTICAL_BARS = 188, + RAYGUI_ICON_VERTICAL_BARS_FILL = 189, + RAYGUI_ICON_LIFE_BARS = 190, + RAYGUI_ICON_INFO = 191, + RAYGUI_ICON_CROSSLINE = 192, + RAYGUI_ICON_HELP = 193, + RAYGUI_ICON_FILETYPE_ALPHA = 194, + RAYGUI_ICON_FILETYPE_HOME = 195, + RAYGUI_ICON_LAYERS_VISIBLE = 196, + RAYGUI_ICON_LAYERS = 197, + RAYGUI_ICON_WINDOW = 198, + RAYGUI_ICON_HIDPI = 199, + RAYGUI_ICON_FILETYPE_BINARY = 200, + RAYGUI_ICON_HEX = 201, + RAYGUI_ICON_SHIELD = 202, + RAYGUI_ICON_FILE_NEW = 203, + RAYGUI_ICON_FOLDER_ADD = 204, + RAYGUI_ICON_ALARM = 205, + RAYGUI_ICON_CPU = 206, + RAYGUI_ICON_ROM = 207, + RAYGUI_ICON_STEP_OVER = 208, + RAYGUI_ICON_STEP_INTO = 209, + RAYGUI_ICON_STEP_OUT = 210, + RAYGUI_ICON_RESTART = 211, + RAYGUI_ICON_BREAKPOINT_ON = 212, + RAYGUI_ICON_BREAKPOINT_OFF = 213, + RAYGUI_ICON_BURGER_MENU = 214, + RAYGUI_ICON_CASE_SENSITIVE = 215, + RAYGUI_ICON_REG_EXP = 216, + RAYGUI_ICON_FOLDER = 217, + RAYGUI_ICON_FILE = 218, + RAYGUI_ICON_219 = 219, + RAYGUI_ICON_220 = 220, + RAYGUI_ICON_221 = 221, + RAYGUI_ICON_222 = 222, + RAYGUI_ICON_223 = 223, + RAYGUI_ICON_224 = 224, + RAYGUI_ICON_225 = 225, + RAYGUI_ICON_226 = 226, + RAYGUI_ICON_227 = 227, + RAYGUI_ICON_228 = 228, + RAYGUI_ICON_229 = 229, + RAYGUI_ICON_230 = 230, + RAYGUI_ICON_231 = 231, + RAYGUI_ICON_232 = 232, + RAYGUI_ICON_233 = 233, + RAYGUI_ICON_234 = 234, + RAYGUI_ICON_235 = 235, + RAYGUI_ICON_236 = 236, + RAYGUI_ICON_237 = 237, + RAYGUI_ICON_238 = 238, + RAYGUI_ICON_239 = 239, + RAYGUI_ICON_240 = 240, + RAYGUI_ICON_241 = 241, + RAYGUI_ICON_242 = 242, + RAYGUI_ICON_243 = 243, + RAYGUI_ICON_244 = 244, + RAYGUI_ICON_245 = 245, + RAYGUI_ICON_246 = 246, + RAYGUI_ICON_247 = 247, + RAYGUI_ICON_248 = 248, + RAYGUI_ICON_249 = 249, + RAYGUI_ICON_250 = 250, + RAYGUI_ICON_251 = 251, + RAYGUI_ICON_252 = 252, + RAYGUI_ICON_253 = 253, + RAYGUI_ICON_254 = 254, + RAYGUI_ICON_255 = 255, +} guiRAYGUI_ICONName; \ No newline at end of file diff --git a/raylib-sys/binding/config.h b/raylib-sys/binding/config.h index ab2f2892..2c61b466 100644 --- a/raylib-sys/binding/config.h +++ b/raylib-sys/binding/config.h @@ -1,111 +1,165 @@ /********************************************************************************************** -* -* raylib configuration flags -* -* This file defines all the configuration flags for the different raylib modules -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2018-2020 Ahmad Fatoum & Ramon Santamaria (@raysan5) -* -* 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 RAYLIB_VERSION "3.0" - -// Edit to control what features Makefile'd raylib is compiled with -#if defined(RAYLIB_CMAKE) -// Edit CMakeOptions.txt for CMake instead -#include "cmake/config.h" -#else - -//------------------------------------------------------------------------------------ -// Module: core - Configuration Flags -//------------------------------------------------------------------------------------ -// Camera module is included (camera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital + * + * raylib configuration flags + * + * This file defines all the configuration flags for the different raylib modules + * + * LICENSE: zlib/libpng + * + * Copyright (c) 2018-2022 Ahmad Fatoum & Ramon Santamaria (@raysan5) + * + * 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. + * + **********************************************************************************************/ + +//------------------------------------------------------------------------------------ +// Module selection - Some modules could be avoided +// Mandatory modules: rcore, rlgl, utils +//------------------------------------------------------------------------------------ +#define SUPPORT_MODULE_RSHAPES 1 +#define SUPPORT_MODULE_RTEXTURES 1 +#define SUPPORT_MODULE_RTEXT 1 // WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures +#define SUPPORT_MODULE_RMODELS 1 +#define SUPPORT_MODULE_RAUDIO 1 + +//------------------------------------------------------------------------------------ +// Module: rcore - Configuration Flags +//------------------------------------------------------------------------------------ +// Camera module is included (rcamera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital #define SUPPORT_CAMERA_SYSTEM 1 -// Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag +// Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag #define SUPPORT_GESTURES_SYSTEM 1 // Mouse gestures are directly mapped like touches and processed by gestures system #define SUPPORT_MOUSE_GESTURES 1 // Reconfigure standard input to receive key inputs, works with SSH connection. #define SUPPORT_SSH_KEYBOARD_RPI 1 -// Draw a mouse reference on screen (square cursor box) -#define SUPPORT_MOUSE_CURSOR_RPI 1 +// Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. +// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. +#define SUPPORT_WINMM_HIGHRES_TIMER 1 // Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used //#define SUPPORT_BUSY_WAIT_LOOP 1 -// Use a half-busy wait loop, in this case frame sleeps for some time and runs a busy-wait-loop at the end -#define SUPPORT_HALFBUSY_WAIT_LOOP +// Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy +#define SUPPORT_PARTIALBUSY_WAIT_LOOP // Wait for events passively (sleeping while no events) instead of polling them actively every frame //#define SUPPORT_EVENTS_WAITING 1 // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() #define SUPPORT_SCREEN_CAPTURE 1 // Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() -//#define SUPPORT_GIF_RECORDING 1 -// Allow scale all the drawn content to match the high-DPI equivalent size (only PLATFORM_DESKTOP) -//#define SUPPORT_HIGH_DPI 1 +#define SUPPORT_GIF_RECORDING 1 // Support CompressData() and DecompressData() functions #define SUPPORT_COMPRESSION_API 1 -// Support saving binary data automatically to a generated storage.data file. This file is managed internally. -#define SUPPORT_DATA_STORAGE 1 +// Support automatic generated events, loading and recording of those events when required +//#define SUPPORT_EVENTS_AUTOMATION 1 +// Support custom frame control, only for advance users +// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() +// Enabling this flag allows manual control of the frame processes, use at your own risk +//#define SUPPORT_CUSTOM_FRAME_CONTROL 1 +// rcore: Configuration values //------------------------------------------------------------------------------------ -// Module: rlgl - Configuration Flags +#define MAX_FILEPATH_CAPACITY 8192 // Maximum file paths capacity +#define MAX_FILEPATH_LENGTH 4096 // Maximum length for filepaths (Linux PATH_MAX default value) + +#define MAX_KEYBOARD_KEYS 512 // Maximum number of keyboard keys supported +#define MAX_MOUSE_BUTTONS 8 // Maximum number of mouse buttons supported +#define MAX_GAMEPADS 4 // Maximum number of gamepads supported +#define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad) +#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad) +#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported +#define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue +#define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue + +#define MAX_DECOMPRESSION_SIZE 64 // Max size allocated for decompression in MB + //------------------------------------------------------------------------------------ -// Support VR simulation functionality (stereo rendering) -#define SUPPORT_VR_SIMULATOR 1 +// Module: rlgl - Configuration values +//------------------------------------------------------------------------------------ + +// Enable OpenGL Debug Context (only available on OpenGL 4.3) +//#define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT 1 + +// Show OpenGL extensions and capabilities detailed logs on init +//#define RLGL_SHOW_GL_DETAILS_INFO 1 + +//#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096 // Default internal render batch elements limits +#define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering) +#define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) +#define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) + +#define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack + +#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported + +#define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance +#define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance + +// Default shader vertex attribute names to set location points +// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience +#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Binded by default to shader location: 0 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Binded by default to shader location: 1 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Binded by default to shader location: 2 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Binded by default to shader location: 3 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Binded by default to shader location: 4 +#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Binded by default to shader location: 5 + +#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix +#define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)) +#define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) +#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) //------------------------------------------------------------------------------------ -// Module: shapes - Configuration Flags +// Module: rshapes - Configuration Flags //------------------------------------------------------------------------------------ -// Draw rectangle shapes using font texture white character instead of default white texture -// Allows drawing rectangles and text with a single draw call, very useful for GUI systems! -#define SUPPORT_FONT_TEXTURE 1 // Use QUADS instead of TRIANGLES for drawing when possible // Some lines-based shapes could still use lines #define SUPPORT_QUADS_DRAW_MODE 1 //------------------------------------------------------------------------------------ -// Module: textures - Configuration Flags +// Module: rtextures - Configuration Flags //------------------------------------------------------------------------------------ // Selecte desired fileformats to be supported for image data loading #define SUPPORT_FILEFORMAT_PNG 1 -#define SUPPORT_FILEFORMAT_BMP 1 -#define SUPPORT_FILEFORMAT_TGA 1 -#define SUPPORT_FILEFORMAT_JPG 1 +//#define SUPPORT_FILEFORMAT_BMP 1 +//#define SUPPORT_FILEFORMAT_TGA 1 +//#define SUPPORT_FILEFORMAT_JPG 1 #define SUPPORT_FILEFORMAT_GIF 1 -//#define SUPPORT_FILEFORMAT_PSD 1 +#define SUPPORT_FILEFORMAT_QOI 1 +//#define SUPPORT_FILEFORMAT_PSD 1 #define SUPPORT_FILEFORMAT_DDS 1 #define SUPPORT_FILEFORMAT_HDR 1 -#define SUPPORT_FILEFORMAT_KTX 1 -#define SUPPORT_FILEFORMAT_ASTC 1 -//#define SUPPORT_FILEFORMAT_PKM 1 -//#define SUPPORT_FILEFORMAT_PVR 1 +//#define SUPPORT_FILEFORMAT_KTX 1 +//#define SUPPORT_FILEFORMAT_ASTC 1 +//#define SUPPORT_FILEFORMAT_PKM 1 +//#define SUPPORT_FILEFORMAT_PVR 1 -// Support image export functionality (.png, .bmp, .tga, .jpg) +// Support image export functionality (.png, .bmp, .tga, .jpg, .qoi) #define SUPPORT_IMAGE_EXPORT 1 -// Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... -// If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT() -#define SUPPORT_IMAGE_MANIPULATION 1 // Support procedural image generation functionality (gradient, spot, perlin-noise, cellular) #define SUPPORT_IMAGE_GENERATION 1 +// Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... +// If not defined, still some functions are supported: ImageFormat(), ImageCrop(), ImageToPOT() +#define SUPPORT_IMAGE_MANIPULATION 1 //------------------------------------------------------------------------------------ -// Module: text - Configuration Flags +// Module: rtext - Configuration Flags //------------------------------------------------------------------------------------ // Default font is loaded on window initialization to be available for the user to render simple text // NOTE: If enabled, uses external module functions to load default raylib font @@ -114,35 +168,63 @@ #define SUPPORT_FILEFORMAT_FNT 1 #define SUPPORT_FILEFORMAT_TTF 1 +// Support text management functions +// If not defined, still some functions are supported: TextLength(), TextFormat() +#define SUPPORT_TEXT_MANIPULATION 1 + +// rtext: Configuration values +//------------------------------------------------------------------------------------ +#define MAX_TEXT_BUFFER_LENGTH 1024 // Size of internal static buffers used on some functions: + // TextFormat(), TextSubtext(), TextToUpper(), TextToLower(), TextToPascal(), TextSplit() +#define MAX_TEXTSPLIT_COUNT 128 // Maximum number of substrings to split: TextSplit() + //------------------------------------------------------------------------------------ -// Module: models - Configuration Flags +// Module: rmodels - Configuration Flags //------------------------------------------------------------------------------------ // Selected desired model fileformats to be supported for loading #define SUPPORT_FILEFORMAT_OBJ 1 #define SUPPORT_FILEFORMAT_MTL 1 #define SUPPORT_FILEFORMAT_IQM 1 #define SUPPORT_FILEFORMAT_GLTF 1 +#define SUPPORT_FILEFORMAT_VOX 1 // Support procedural mesh generation functions, uses external par_shapes.h library // NOTE: Some generated meshes DO NOT include generated texture coordinates #define SUPPORT_MESH_GENERATION 1 +// rmodels: Configuration values //------------------------------------------------------------------------------------ -// Module: audio - Configuration Flags +#define MAX_MATERIAL_MAPS 12 // Maximum number of shader maps supported +#define MAX_MESH_VERTEX_BUFFERS 7 // Maximum vertex buffers (VBO) per mesh + +//------------------------------------------------------------------------------------ +// Module: raudio - Configuration Flags //------------------------------------------------------------------------------------ // Desired audio fileformats to be supported for loading #define SUPPORT_FILEFORMAT_WAV 1 #define SUPPORT_FILEFORMAT_OGG 1 #define SUPPORT_FILEFORMAT_XM 1 #define SUPPORT_FILEFORMAT_MOD 1 -//#define SUPPORT_FILEFORMAT_FLAC 1 #define SUPPORT_FILEFORMAT_MP3 1 +//#define SUPPORT_FILEFORMAT_FLAC 1 + +// raudio: Configuration values +//------------------------------------------------------------------------------------ +#define AUDIO_DEVICE_FORMAT ma_format_f32 // Device output format (miniaudio: float-32bit) +#define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo +#define AUDIO_DEVICE_SAMPLE_RATE 0 // Device sample rate (device default) + +#define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Maximum number of audio pool channels //------------------------------------------------------------------------------------ // Module: utils - Configuration Flags //------------------------------------------------------------------------------------ +// Standard file io library (stdio.h) included +#define SUPPORT_STANDARD_FILEIO // Show TRACELOG() output messages // NOTE: By default LOG_DEBUG traces not shown #define SUPPORT_TRACELOG 1 //#define SUPPORT_TRACELOG_DEBUG 1 -#endif //defined(RAYLIB_CMAKE) +// utils: Configuration values +//------------------------------------------------------------------------------------ +#define MAX_TRACELOG_MSG_LENGTH 128 // Max length of one trace-log message diff --git a/raylib-sys/binding/raygui.h b/raylib-sys/binding/raygui.h index e5e79388..0ea37e90 100644 --- a/raylib-sys/binding/raygui.h +++ b/raylib-sys/binding/raygui.h @@ -1,196 +1,203 @@ /******************************************************************************************* -* -* raygui v3.1 - A simple and easy-to-use immediate-mode gui library -* -* DESCRIPTION: -* -* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also -* available as a standalone library, as long as input and drawing functions are provided. -* -* Controls provided: -* -* # Container/separators Controls -* - WindowBox -* - GroupBox -* - Line -* - Panel -* - ScrollPanel -* -* # Basic Controls -* - Label -* - Button -* - LabelButton --> Label -* - Toggle -* - ToggleGroup --> Toggle -* - CheckBox -* - ComboBox -* - DropdownBox -* - TextBox -* - TextBoxMulti -* - ValueBox --> TextBox -* - Spinner --> Button, ValueBox -* - Slider -* - SliderBar --> Slider -* - ProgressBar -* - StatusBar -* - ScrollBar // TODO: Really? Do we need it? We have GuiScrollPanel() -* - DummyRec -* - Grid -* -* # Advance Controls -* - ListView -* - ColorPicker --> ColorPanel, ColorBarHue -* - MessageBox --> Window, Label, Button -* - TextInputBox --> Window, Label, TextBox, Button -* -* It also provides a set of functions for styling the controls based on its properties (size, color). -* -* -* RAYGUI STYLE (guiStyle): -* -* raygui uses a global data array for all gui style properties (allocated on data segment by default), -* when a new style is loaded, it is loaded over the global style... but a default gui style could always be -* recovered with GuiLoadStyleDefault() function, that overwrites the current style to the default one -* -* The global style array size is fixed and depends on the number of controls and properties: -* -* static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)]; -* -* guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB -* -* Note that the first set of BASE properties (by default guiStyle[0..15]) belong to the generic style -* used for all controls, when any of those base values is set, it is automatically populated to all -* controls, so, specific control values overwriting generic style should be set after base values. -* -* After the first BASE set we have the EXTENDED properties (by default guiStyle[16..23]), those -* properties are actually common to all controls and can not be overwritten individually (like BASE ones) -* Some of those properties are: TEXT_SIZE, TEXT_SPACING, LINE_COLOR, BACKGROUND_COLOR -* -* Custom control properties can be defined using the EXTENDED properties for each independent control. -* -* TOOL: rGuiStyler is a visual tool to customize raygui style. -* -* -* RAYGUI ICONS (guiIcons): -* -* raygui could use a global array containing icons data (allocated on data segment by default), -* a custom icons set could be loaded over this array using GuiLoadIcons(), but loaded icons set -* must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS will be loaded -* -* Every icon is codified in binary form, using 1 bit per pixel, so, every 16x16 icon -* requires 8 integers (16*16/32) to be stored in memory. -* -* When the icon is draw, actually one quad per pixel is drawn if the bit for that pixel is set. -* -* The global icons array size is fixed and depends on the number of icons and size: -* -* static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS]; -* -* guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB -* -* TOOL: rGuiIcons is a visual tool to customize raygui icons. -* -* -* CONFIGURATION: -* -* #define RAYGUI_IMPLEMENTATION -* Generates the implementation of the library into the included file. -* If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. -* -* #define RAYGUI_STANDALONE -* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined -* internally in the library and input management and drawing functions must be provided by -* the user (check library implementation for further details). -* -* #define RAYGUI_NO_ICONS -* Avoid including embedded ricons data (256 icons, 16x16 pixels, 1-bit per pixel, 2KB) -* -* #define RAYGUI_CUSTOM_ICONS -* Includes custom ricons.h header defining a set of custom icons, -* this file can be generated using rGuiIcons tool -* -* -* VERSIONS HISTORY: -* 3.1 (12-Jan-2021) REVIEWED: Default style for consistency (aligned with rGuiLayout v2.5 tool) -* REVIEWED: GuiLoadStyle() to support compressed font atlas image data and unload previous textures -* REVIEWED: External icons usage logic -* REVIEWED: GuiLine() for centered alignment when including text -* RENAMED: Multiple controls properties definitions to prepend RAYGUI_ -* RENAMED: RICON_ references to RAYGUI_ICON_ for library consistency -* Projects updated and multiple tweaks -* 3.0 (04-Nov-2021) Integrated ricons data to avoid external file -* REDESIGNED: GuiTextBoxMulti() -* REMOVED: GuiImageButton*() -* Multiple minor tweaks and bugs corrected -* 2.9 (17-Mar-2021) REMOVED: Tooltip API -* 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() -* 2.7 (20-Feb-2020) ADDED: Possible tooltips API -* 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() -* REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() -* REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() -* Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties -* ADDED: 8 new custom styles ready to use -* Multiple minor tweaks and bugs corrected -* 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() -* 2.3 (29-Apr-2019) ADDED: rIcons auxiliar library and support for it, multiple controls reviewed -* Refactor all controls drawing mechanism to use control state -* 2.2 (05-Feb-2019) ADDED: GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls -* 2.1 (26-Dec-2018) REDESIGNED: GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string -* REDESIGNED: Style system (breaking change) -* 2.0 (08-Nov-2018) ADDED: Support controls guiLock and custom fonts -* REVIEWED: GuiComboBox(), GuiListView()... -* 1.9 (09-Oct-2018) REVIEWED: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... -* 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout -* 1.5 (21-Jun-2017) Working in an improved styles system -* 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) -* 1.3 (12-Jun-2017) Complete redesign of style system -* 1.1 (01-Jun-2017) Complete review of the library -* 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. -* 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. -* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. -* -* -* CONTRIBUTORS: -* -* Ramon Santamaria: Supervision, review, redesign, update and maintenance -* Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) -* Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) -* Adria Arranz: Testing and Implementation of additional controls (2018) -* Jordi Jorba: Testing and Implementation of additional controls (2018) -* Albert Martos: Review and testing of the library (2015) -* Ian Eito: Review and testing of the library (2015) -* Kevin Gato: Initial implementation of basic components (2014) -* Daniel Nicolas: Initial implementation of basic components (2014) -* -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2014-2022 Ramon Santamaria (@raysan5) -* -* 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. -* -**********************************************************************************************/ + * + * raygui v3.2 - A simple and easy-to-use immediate-mode gui library + * + * DESCRIPTION: + * + * raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also + * available as a standalone library, as long as input and drawing functions are provided. + * + * Controls provided: + * + * # Container/separators Controls + * - WindowBox --> StatusBar, Panel + * - GroupBox --> Line + * - Line + * - Panel --> StatusBar + * - ScrollPanel --> StatusBar + * + * # Basic Controls + * - Label + * - Button + * - LabelButton --> Label + * - Toggle + * - ToggleGroup --> Toggle + * - CheckBox + * - ComboBox + * - DropdownBox + * - TextBox + * - TextBoxMulti + * - ValueBox --> TextBox + * - Spinner --> Button, ValueBox + * - Slider + * - SliderBar --> Slider + * - ProgressBar + * - StatusBar + * - DummyRec + * - Grid + * + * # Advance Controls + * - ListView + * - ColorPicker --> ColorPanel, ColorBarHue + * - MessageBox --> Window, Label, Button + * - TextInputBox --> Window, Label, TextBox, Button + * + * It also provides a set of functions for styling the controls based on its properties (size, color). + * + * + * RAYGUI STYLE (guiStyle): + * + * raygui uses a global data array for all gui style properties (allocated on data segment by default), + * when a new style is loaded, it is loaded over the global style... but a default gui style could always be + * recovered with GuiLoadStyleDefault() function, that overwrites the current style to the default one + * + * The global style array size is fixed and depends on the number of controls and properties: + * + * static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)]; + * + * guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB + * + * Note that the first set of BASE properties (by default guiStyle[0..15]) belong to the generic style + * used for all controls, when any of those base values is set, it is automatically populated to all + * controls, so, specific control values overwriting generic style should be set after base values. + * + * After the first BASE set we have the EXTENDED properties (by default guiStyle[16..23]), those + * properties are actually common to all controls and can not be overwritten individually (like BASE ones) + * Some of those properties are: TEXT_SIZE, TEXT_SPACING, LINE_COLOR, BACKGROUND_COLOR + * + * Custom control properties can be defined using the EXTENDED properties for each independent control. + * + * TOOL: rGuiStyler is a visual tool to customize raygui style. + * + * + * RAYGUI ICONS (guiIcons): + * + * raygui could use a global array containing icons data (allocated on data segment by default), + * a custom icons set could be loaded over this array using GuiLoadIcons(), but loaded icons set + * must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS will be loaded + * + * Every icon is codified in binary form, using 1 bit per pixel, so, every 16x16 icon + * requires 8 integers (16*16/32) to be stored in memory. + * + * When the icon is draw, actually one quad per pixel is drawn if the bit for that pixel is set. + * + * The global icons array size is fixed and depends on the number of icons and size: + * + * static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS]; + * + * guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB + * + * TOOL: rGuiIcons is a visual tool to customize raygui icons. + * + * + * CONFIGURATION: + * + * #define RAYGUI_IMPLEMENTATION + * Generates the implementation of the library into the included file. + * If not defined, the library is in header only mode and can be included in other headers + * or source files without problems. But only ONE file should hold the implementation. + * + * #define RAYGUI_STANDALONE + * Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined + * internally in the library and input management and drawing functions must be provided by + * the user (check library implementation for further details). + * + * #define RAYGUI_NO_ICONS + * Avoid including embedded ricons data (256 icons, 16x16 pixels, 1-bit per pixel, 2KB) + * + * #define RAYGUI_CUSTOM_ICONS + * Includes custom ricons.h header defining a set of custom icons, + * this file can be generated using rGuiIcons tool + * + * + * VERSIONS HISTORY: + * 3.2 (22-May-2022) RENAMED: Some enum values, for unification, avoiding prefixes + * REMOVED: GuiScrollBar(), only internal + * REDESIGNED: GuiPanel() to support text parameter + * REDESIGNED: GuiScrollPanel() to support text parameter + * REDESIGNED: GuiColorPicker() to support text parameter + * REDESIGNED: GuiColorPanel() to support text parameter + * REDESIGNED: GuiColorBarAlpha() to support text parameter + * REDESIGNED: GuiColorBarHue() to support text parameter + * REDESIGNED: GuiTextInputBox() to support password + * 3.1 (12-Jan-2022) REVIEWED: Default style for consistency (aligned with rGuiLayout v2.5 tool) + * REVIEWED: GuiLoadStyle() to support compressed font atlas image data and unload previous textures + * REVIEWED: External icons usage logic + * REVIEWED: GuiLine() for centered alignment when including text + * RENAMED: Multiple controls properties definitions to prepend RAYGUI_ + * RENAMED: RICON_ references to RAYGUI_ICON_ for library consistency + * Projects updated and multiple tweaks + * 3.0 (04-Nov-2021) Integrated ricons data to avoid external file + * REDESIGNED: GuiTextBoxMulti() + * REMOVED: GuiImageButton*() + * Multiple minor tweaks and bugs corrected + * 2.9 (17-Mar-2021) REMOVED: Tooltip API + * 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() + * 2.7 (20-Feb-2020) ADDED: Possible tooltips API + * 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() + * REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() + * REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() + * Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties + * ADDED: 8 new custom styles ready to use + * Multiple minor tweaks and bugs corrected + * 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() + * 2.3 (29-Apr-2019) ADDED: rIcons auxiliar library and support for it, multiple controls reviewed + * Refactor all controls drawing mechanism to use control state + * 2.2 (05-Feb-2019) ADDED: GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls + * 2.1 (26-Dec-2018) REDESIGNED: GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string + * REDESIGNED: Style system (breaking change) + * 2.0 (08-Nov-2018) ADDED: Support controls guiLock and custom fonts + * REVIEWED: GuiComboBox(), GuiListView()... + * 1.9 (09-Oct-2018) REVIEWED: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... + * 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout + * 1.5 (21-Jun-2017) Working in an improved styles system + * 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) + * 1.3 (12-Jun-2017) Complete redesign of style system + * 1.1 (01-Jun-2017) Complete review of the library + * 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. + * 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. + * 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. + * + * + * CONTRIBUTORS: + * + * Ramon Santamaria: Supervision, review, redesign, update and maintenance + * Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) + * Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) + * Adria Arranz: Testing and Implementation of additional controls (2018) + * Jordi Jorba: Testing and Implementation of additional controls (2018) + * Albert Martos: Review and testing of the library (2015) + * Ian Eito: Review and testing of the library (2015) + * Kevin Gato: Initial implementation of basic components (2014) + * Daniel Nicolas: Initial implementation of basic components (2014) + * + * + * LICENSE: zlib/libpng + * + * Copyright (c) 2014-2022 Ramon Santamaria (@raysan5) + * + * 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. + * + **********************************************************************************************/ #ifndef RAYGUI_H #define RAYGUI_H -#define RAYGUI_VERSION "3.1" +#define RAYGUI_VERSION "3.2" -/// NOTE: This is where we load in from the subdir #if !defined(RAYGUI_STANDALONE) #include "../raylib/src/raylib.h" #endif @@ -199,15 +206,15 @@ // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll #if defined(_WIN32) #if defined(BUILD_LIBTYPE_SHARED) - #define RAYGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) - #elif defined(USE_LIBTYPE_SHARED) - #define RAYGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) - #endif +#define RAYGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) +#elif defined(USE_LIBTYPE_SHARED) +#define RAYGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) +#endif #endif // Function specifiers definition #ifndef RAYGUIAPI -#define RAYGUIAPI // Functions defined as 'extern' by default (implicit specifiers) +#define RAYGUIAPI // Functions defined as 'extern' by default (implicit specifiers) #endif //---------------------------------------------------------------------------------- @@ -215,13 +222,13 @@ //---------------------------------------------------------------------------------- // Allow custom memory allocators #ifndef RAYGUI_MALLOC -#define RAYGUI_MALLOC(sz) malloc(sz) +#define RAYGUI_MALLOC(sz) malloc(sz) #endif #ifndef RAYGUI_CALLOC -#define RAYGUI_CALLOC(n,sz) calloc(n,sz) +#define RAYGUI_CALLOC(n, sz) calloc(n, sz) #endif #ifndef RAYGUI_FREE -#define RAYGUI_FREE(p) free(p) +#define RAYGUI_FREE(p) free(p) #endif // Simple log system to avoid printf() calls if required @@ -239,107 +246,124 @@ //---------------------------------------------------------------------------------- #if defined(RAYGUI_STANDALONE) #ifndef __cplusplus - // Boolean type - #ifndef true - typedef enum { false, true } bool; - #endif - #endif - - // Vector2 type - typedef struct Vector2 { - float x; - float y; - } Vector2; - - // Vector3 type // -- ConvertHSVtoRGB(), ConvertRGBtoHSV() - typedef struct Vector3 { - float x; - float y; - float z; - } Vector3; - - // Color type, RGBA (32bit) - typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; - } Color; - - // Rectangle type - typedef struct Rectangle { - float x; - float y; - float width; - float height; - } Rectangle; - - // TODO: Texture2D type is very coupled to raylib, required by Font type - // It should be redesigned to be provided by user - typedef struct Texture2D { - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) - } Texture2D; - - // GlyphInfo, font characters glyphs info - typedef struct GlyphInfo { - int value; // Character value (Unicode) - int offsetX; // Character offset X when drawing - int offsetY; // Character offset Y when drawing - int advanceX; // Character advance position X - Image image; // Character image data - } GlyphInfo; - - // TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() - // It should be redesigned to be provided by user - typedef struct Font { - int baseSize; // Base size (default chars height) - int glyphCount; // Number of characters - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - GlyphInfo *chars; // Characters info data - } Font; +// Boolean type +#ifndef true +typedef enum +{ + false, + true +} bool; +#endif +#endif + +// Vector2 type +typedef struct Vector2 +{ + float x; + float y; +} Vector2; + +// Vector3 type // -- ConvertHSVtoRGB(), ConvertRGBtoHSV() +typedef struct Vector3 +{ + float x; + float y; + float z; +} Vector3; + +// Color type, RGBA (32bit) +typedef struct Color +{ + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; +} Color; + +// Rectangle type +typedef struct Rectangle +{ + float x; + float y; + float width; + float height; +} Rectangle; + +// TODO: Texture2D type is very coupled to raylib, required by Font type +// It should be redesigned to be provided by user +typedef struct Texture2D +{ + unsigned int id; // OpenGL texture id + int width; // Texture base width + int height; // Texture base height + int mipmaps; // Mipmap levels, 1 by default + int format; // Data format (PixelFormat type) +} Texture2D; + +// GlyphInfo, font characters glyphs info +typedef struct GlyphInfo +{ + int value; // Character value (Unicode) + int offsetX; // Character offset X when drawing + int offsetY; // Character offset Y when drawing + int advanceX; // Character advance position X + Image image; // Character image data +} GlyphInfo; + +// TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() +// It should be redesigned to be provided by user +typedef struct Font +{ + int baseSize; // Base size (default chars height) + int glyphCount; // Number of characters + Texture2D texture; // Characters texture atlas + Rectangle *recs; // Characters rectangles in texture + GlyphInfo *chars; // Characters info data +} Font; #endif // Style property -typedef struct GuiStyleProp { +typedef struct GuiStyleProp +{ unsigned short controlId; unsigned short propertyId; - int propertyValue; + unsigned int propertyValue; } GuiStyleProp; // Gui control state -typedef enum { - GUI_STATE_NORMAL = 0, - GUI_STATE_FOCUSED, - GUI_STATE_PRESSED, - GUI_STATE_DISABLED, -} GuiControlState; +typedef enum +{ + STATE_NORMAL = 0, + STATE_FOCUSED, + STATE_PRESSED, + STATE_DISABLED, +} GuiState; // Gui control text alignment -typedef enum { - GUI_TEXT_ALIGN_LEFT = 0, - GUI_TEXT_ALIGN_CENTER, - GUI_TEXT_ALIGN_RIGHT, +typedef enum +{ + TEXT_ALIGN_LEFT = 0, + TEXT_ALIGN_CENTER, + TEXT_ALIGN_RIGHT, } GuiTextAlignment; // Gui controls -typedef enum { - DEFAULT = 0, // Generic control -> populates to all controls when set - LABEL, // Used also for: LABELBUTTON +typedef enum +{ + // Default -> populates to all controls when set + DEFAULT = 0, + // Basic controls + LABEL, // Used also for: LABELBUTTON BUTTON, - TOGGLE, // Used also for: TOGGLEGROUP - SLIDER, // Used also for: SLIDERBAR + TOGGLE, // Used also for: TOGGLEGROUP + SLIDER, // Used also for: SLIDERBAR PROGRESSBAR, CHECKBOX, COMBOBOX, DROPDOWNBOX, - TEXTBOX, // Used also for: TEXTBOXMULTI + TEXTBOX, // Used also for: TEXTBOXMULTI VALUEBOX, - SPINNER, + SPINNER, // Uses: BUTTON, VALUEBOX LISTVIEW, COLORPICKER, SCROLLBAR, @@ -348,7 +372,8 @@ typedef enum { // Gui base properties for every control // NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties) -typedef enum { +typedef enum +{ BORDER_COLOR_NORMAL = 0, BASE_COLOR_NORMAL, TEXT_COLOR_NORMAL, @@ -369,102 +394,110 @@ typedef enum { // Gui extended properties depend on control // NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default 8 properties) +//---------------------------------------------------------------------------------- // DEFAULT extended properties -// NOTE: Those properties are actually common to all controls -typedef enum { - TEXT_SIZE = 16, - TEXT_SPACING, - LINE_COLOR, - BACKGROUND_COLOR, +// NOTE: Those properties are common to all controls or global +typedef enum +{ + TEXT_SIZE = 16, // Text size (glyphs max height) + TEXT_SPACING, // Text spacing between glyphs + LINE_COLOR, // Line control color + BACKGROUND_COLOR, // Background color } GuiDefaultProperty; // Label -//typedef enum { } GuiLabelProperty; +// typedef enum { } GuiLabelProperty; -// Button -//typedef enum { } GuiButtonProperty; +// Button/Spinner +// typedef enum { } GuiButtonProperty; // Toggle/ToggleGroup -typedef enum { - GROUP_PADDING = 16, +typedef enum +{ + GROUP_PADDING = 16, // ToggleGroup separation between toggles } GuiToggleProperty; // Slider/SliderBar -typedef enum { - SLIDER_WIDTH = 16, - SLIDER_PADDING +typedef enum +{ + SLIDER_WIDTH = 16, // Slider size of internal bar + SLIDER_PADDING // Slider/SliderBar internal bar padding } GuiSliderProperty; // ProgressBar -typedef enum { - PROGRESS_PADDING = 16, +typedef enum +{ + PROGRESS_PADDING = 16, // ProgressBar internal padding } GuiProgressBarProperty; +// ScrollBar +typedef enum +{ + ARROWS_SIZE = 16, + ARROWS_VISIBLE, + SCROLL_SLIDER_PADDING, // (SLIDERBAR, SLIDER_PADDING) + SCROLL_SLIDER_SIZE, + SCROLL_PADDING, + SCROLL_SPEED, +} GuiScrollBarProperty; + // CheckBox -typedef enum { - CHECK_PADDING = 16 +typedef enum +{ + CHECK_PADDING = 16 // CheckBox internal check padding } GuiCheckBoxProperty; // ComboBox -typedef enum { - COMBO_BUTTON_WIDTH = 16, - COMBO_BUTTON_PADDING +typedef enum +{ + COMBO_BUTTON_WIDTH = 16, // ComboBox right button width + COMBO_BUTTON_SPACING // ComboBox button separation } GuiComboBoxProperty; // DropdownBox -typedef enum { - ARROW_PADDING = 16, - DROPDOWN_ITEMS_PADDING +typedef enum +{ + ARROW_PADDING = 16, // DropdownBox arrow separation from border and items + DROPDOWN_ITEMS_SPACING // DropdownBox items separation } GuiDropdownBoxProperty; // TextBox/TextBoxMulti/ValueBox/Spinner -typedef enum { - TEXT_INNER_PADDING = 16, - TEXT_LINES_PADDING, - COLOR_SELECTED_FG, - COLOR_SELECTED_BG +typedef enum +{ + TEXT_INNER_PADDING = 16, // TextBox/TextBoxMulti/ValueBox/Spinner inner text padding + TEXT_LINES_SPACING, // TextBoxMulti lines separation } GuiTextBoxProperty; // Spinner -typedef enum { - SPIN_BUTTON_WIDTH = 16, - SPIN_BUTTON_PADDING, +typedef enum +{ + SPIN_BUTTON_WIDTH = 16, // Spinner left/right buttons width + SPIN_BUTTON_SPACING, // Spinner buttons separation } GuiSpinnerProperty; -// ScrollBar -typedef enum { - ARROWS_SIZE = 16, - ARROWS_VISIBLE, - SCROLL_SLIDER_PADDING, - SCROLL_SLIDER_SIZE, - SCROLL_PADDING, - SCROLL_SPEED, -} GuiScrollBarProperty; - -// ScrollBar side -typedef enum { - SCROLLBAR_LEFT_SIDE = 0, - SCROLLBAR_RIGHT_SIDE -} GuiScrollBarSide; - // ListView -typedef enum { - LIST_ITEMS_HEIGHT = 16, - LIST_ITEMS_PADDING, - SCROLLBAR_WIDTH, - SCROLLBAR_SIDE, +typedef enum +{ + LIST_ITEMS_HEIGHT = 16, // ListView items height + LIST_ITEMS_SPACING, // ListView items separation + SCROLLBAR_WIDTH, // ListView scrollbar size (usually width) + SCROLLBAR_SIDE, // ListView scrollbar side (0-left, 1-right) } GuiListViewProperty; // ColorPicker -typedef enum { +typedef enum +{ COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH, // Right hue bar width - HUEBAR_PADDING, // Right hue bar separation from panel - HUEBAR_SELECTOR_HEIGHT, // Right hue bar selector height - HUEBAR_SELECTOR_OVERFLOW // Right hue bar selector overflow + HUEBAR_WIDTH, // ColorPicker right hue bar width + HUEBAR_PADDING, // ColorPicker right hue bar separation from panel + HUEBAR_SELECTOR_HEIGHT, // ColorPicker right hue bar selector height + HUEBAR_SELECTOR_OVERFLOW // ColorPicker right hue bar selector overflow } GuiColorPickerProperty; +#define SCROLLBAR_LEFT_SIDE 0 +#define SCROLLBAR_RIGHT_SIDE 1 + //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -475,385 +508,390 @@ typedef enum { //---------------------------------------------------------------------------------- #if defined(__cplusplus) -extern "C" { // Prevents name mangling of functions +extern "C" +{ // Prevents name mangling of functions #endif -// Global gui state control functions -RAYGUIAPI void GuiEnable(void); // Enable gui controls (global state) -RAYGUIAPI void GuiDisable(void); // Disable gui controls (global state) -RAYGUIAPI void GuiLock(void); // Lock gui controls (global state) -RAYGUIAPI void GuiUnlock(void); // Unlock gui controls (global state) -RAYGUIAPI bool GuiIsLocked(void); // Check if gui is locked (global state) -RAYGUIAPI void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f -RAYGUIAPI void GuiSetState(int state); // Set gui state (global state) -RAYGUIAPI int GuiGetState(void); // Get gui state (global state) - -// Font set/get functions -RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state) -RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state) - -// Style set/get functions -RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property -RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property - -// Container/separator controls, useful for controls organization -RAYGUIAPI bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed -RAYGUIAPI void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name -RAYGUIAPI void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text -RAYGUIAPI void GuiPanel(Rectangle bounds); // Panel control, useful to group controls -RAYGUIAPI Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll); // Scroll Panel control - -// Basic controls set -RAYGUIAPI void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text -RAYGUIAPI bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked -RAYGUIAPI bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked -RAYGUIAPI bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active -RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index -RAYGUIAPI bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active -RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index -RAYGUIAPI bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item -RAYGUIAPI bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value -RAYGUIAPI bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers -RAYGUIAPI bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text -RAYGUIAPI bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines -RAYGUIAPI float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value -RAYGUIAPI float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value -RAYGUIAPI float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value -RAYGUIAPI void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text -RAYGUIAPI void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders -RAYGUIAPI int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control -RAYGUIAPI Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs); // Grid control - - -// Advance controls set -RAYGUIAPI int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index -RAYGUIAPI int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters -RAYGUIAPI int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message -RAYGUIAPI int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text); // Text Input Box control, ask for text -RAYGUIAPI Color GuiColorPicker(Rectangle bounds, Color color); // Color Picker control (multiple color controls) -RAYGUIAPI Color GuiColorPanel(Rectangle bounds, Color color); // Color Panel control -RAYGUIAPI float GuiColorBarAlpha(Rectangle bounds, float alpha); // Color Bar Alpha control -RAYGUIAPI float GuiColorBarHue(Rectangle bounds, float value); // Color Bar Hue control - -// Styles loading functions -RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) -RAYGUIAPI void GuiLoadStyleDefault(void); // Load style default over global style + // Global gui state control functions + RAYGUIAPI void GuiEnable(void); // Enable gui controls (global state) + RAYGUIAPI void GuiDisable(void); // Disable gui controls (global state) + RAYGUIAPI void GuiLock(void); // Lock gui controls (global state) + RAYGUIAPI void GuiUnlock(void); // Unlock gui controls (global state) + RAYGUIAPI bool GuiIsLocked(void); // Check if gui is locked (global state) + RAYGUIAPI void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f + RAYGUIAPI void GuiSetState(int state); // Set gui state (global state) + RAYGUIAPI int GuiGetState(void); // Get gui state (global state) + + // Font set/get functions + RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state) + RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state) + + // Style set/get functions + RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property + RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property + + // Container/separator controls, useful for controls organization + RAYGUIAPI bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed + RAYGUIAPI void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name + RAYGUIAPI void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text + RAYGUIAPI void GuiPanel(Rectangle bounds, const char *text); // Panel control, useful to group controls + RAYGUIAPI Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll); // Scroll Panel control + + // Basic controls set + RAYGUIAPI void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text + RAYGUIAPI bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked + RAYGUIAPI bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked + RAYGUIAPI bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active + RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index + RAYGUIAPI bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active + RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index + RAYGUIAPI bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item + RAYGUIAPI bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value + RAYGUIAPI bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers + RAYGUIAPI bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text + RAYGUIAPI bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines + RAYGUIAPI float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value + RAYGUIAPI float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value + RAYGUIAPI float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value + RAYGUIAPI void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text + RAYGUIAPI void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders + RAYGUIAPI Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs); // Grid control, returns mouse cell position + + // Advance controls set + RAYGUIAPI int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index + RAYGUIAPI int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters + RAYGUIAPI int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message + RAYGUIAPI int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive); // Text Input Box control, ask for text, supports secret + RAYGUIAPI Color GuiColorPicker(Rectangle bounds, const char *text, Color color); // Color Picker control (multiple color controls) + RAYGUIAPI Color GuiColorPanel(Rectangle bounds, const char *text, Color color); // Color Panel control + RAYGUIAPI float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha); // Color Bar Alpha control + RAYGUIAPI float GuiColorBarHue(Rectangle bounds, const char *text, float value); // Color Bar Hue control + + // Styles loading functions + RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) + RAYGUIAPI void GuiLoadStyleDefault(void); // Load style default over global style + + // Icons functionality + RAYGUIAPI const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) -// Icons functionality -RAYGUIAPI const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) #if !defined(RAYGUI_NO_ICONS) -RAYGUIAPI void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); - -RAYGUIAPI unsigned int *GuiGetIcons(void); // Get full icons data pointer -RAYGUIAPI unsigned int *GuiGetIconData(int iconId); // Get icon bit data -RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data + RAYGUIAPI void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); + + RAYGUIAPI unsigned int *GuiGetIcons(void); // Get full icons data pointer + RAYGUIAPI unsigned int *GuiGetIconData(int iconId); // Get icon bit data + RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data + RAYGUIAPI void GuiSetIconScale(unsigned int scale); // Set icon scale (1 by default) + + RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value + RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value + RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value + +#if !defined(RAYGUI_CUSTOM_ICONS) + //---------------------------------------------------------------------------------- + // Icons enumeration + //---------------------------------------------------------------------------------- + typedef enum + { + ICON_NONE = 0, + ICON_FOLDER_FILE_OPEN = 1, + ICON_FILE_SAVE_CLASSIC = 2, + ICON_FOLDER_OPEN = 3, + ICON_FOLDER_SAVE = 4, + ICON_FILE_OPEN = 5, + ICON_FILE_SAVE = 6, + ICON_FILE_EXPORT = 7, + ICON_FILE_ADD = 8, + ICON_FILE_DELETE = 9, + ICON_FILETYPE_TEXT = 10, + ICON_FILETYPE_AUDIO = 11, + ICON_FILETYPE_IMAGE = 12, + ICON_FILETYPE_PLAY = 13, + ICON_FILETYPE_VIDEO = 14, + ICON_FILETYPE_INFO = 15, + ICON_FILE_COPY = 16, + ICON_FILE_CUT = 17, + ICON_FILE_PASTE = 18, + ICON_CURSOR_HAND = 19, + ICON_CURSOR_POINTER = 20, + ICON_CURSOR_CLASSIC = 21, + ICON_PENCIL = 22, + ICON_PENCIL_BIG = 23, + ICON_BRUSH_CLASSIC = 24, + ICON_BRUSH_PAINTER = 25, + ICON_WATER_DROP = 26, + ICON_COLOR_PICKER = 27, + ICON_RUBBER = 28, + ICON_COLOR_BUCKET = 29, + ICON_TEXT_T = 30, + ICON_TEXT_A = 31, + ICON_SCALE = 32, + ICON_RESIZE = 33, + ICON_FILTER_POINT = 34, + ICON_FILTER_BILINEAR = 35, + ICON_CROP = 36, + ICON_CROP_ALPHA = 37, + ICON_SQUARE_TOGGLE = 38, + ICON_SYMMETRY = 39, + ICON_SYMMETRY_HORIZONTAL = 40, + ICON_SYMMETRY_VERTICAL = 41, + ICON_LENS = 42, + ICON_LENS_BIG = 43, + ICON_EYE_ON = 44, + ICON_EYE_OFF = 45, + ICON_FILTER_TOP = 46, + ICON_FILTER = 47, + ICON_TARGET_POINT = 48, + ICON_TARGET_SMALL = 49, + ICON_TARGET_BIG = 50, + ICON_TARGET_MOVE = 51, + ICON_CURSOR_MOVE = 52, + ICON_CURSOR_SCALE = 53, + ICON_CURSOR_SCALE_RIGHT = 54, + ICON_CURSOR_SCALE_LEFT = 55, + ICON_UNDO = 56, + ICON_REDO = 57, + ICON_REREDO = 58, + ICON_MUTATE = 59, + ICON_ROTATE = 60, + ICON_REPEAT = 61, + ICON_SHUFFLE = 62, + ICON_EMPTYBOX = 63, + ICON_TARGET = 64, + ICON_TARGET_SMALL_FILL = 65, + ICON_TARGET_BIG_FILL = 66, + ICON_TARGET_MOVE_FILL = 67, + ICON_CURSOR_MOVE_FILL = 68, + ICON_CURSOR_SCALE_FILL = 69, + ICON_CURSOR_SCALE_RIGHT_FILL = 70, + ICON_CURSOR_SCALE_LEFT_FILL = 71, + ICON_UNDO_FILL = 72, + ICON_REDO_FILL = 73, + ICON_REREDO_FILL = 74, + ICON_MUTATE_FILL = 75, + ICON_ROTATE_FILL = 76, + ICON_REPEAT_FILL = 77, + ICON_SHUFFLE_FILL = 78, + ICON_EMPTYBOX_SMALL = 79, + ICON_BOX = 80, + ICON_BOX_TOP = 81, + ICON_BOX_TOP_RIGHT = 82, + ICON_BOX_RIGHT = 83, + ICON_BOX_BOTTOM_RIGHT = 84, + ICON_BOX_BOTTOM = 85, + ICON_BOX_BOTTOM_LEFT = 86, + ICON_BOX_LEFT = 87, + ICON_BOX_TOP_LEFT = 88, + ICON_BOX_CENTER = 89, + ICON_BOX_CIRCLE_MASK = 90, + ICON_POT = 91, + ICON_ALPHA_MULTIPLY = 92, + ICON_ALPHA_CLEAR = 93, + ICON_DITHERING = 94, + ICON_MIPMAPS = 95, + ICON_BOX_GRID = 96, + ICON_GRID = 97, + ICON_BOX_CORNERS_SMALL = 98, + ICON_BOX_CORNERS_BIG = 99, + ICON_FOUR_BOXES = 100, + ICON_GRID_FILL = 101, + ICON_BOX_MULTISIZE = 102, + ICON_ZOOM_SMALL = 103, + ICON_ZOOM_MEDIUM = 104, + ICON_ZOOM_BIG = 105, + ICON_ZOOM_ALL = 106, + ICON_ZOOM_CENTER = 107, + ICON_BOX_DOTS_SMALL = 108, + ICON_BOX_DOTS_BIG = 109, + ICON_BOX_CONCENTRIC = 110, + ICON_BOX_GRID_BIG = 111, + ICON_OK_TICK = 112, + ICON_CROSS = 113, + ICON_ARROW_LEFT = 114, + ICON_ARROW_RIGHT = 115, + ICON_ARROW_DOWN = 116, + ICON_ARROW_UP = 117, + ICON_ARROW_LEFT_FILL = 118, + ICON_ARROW_RIGHT_FILL = 119, + ICON_ARROW_DOWN_FILL = 120, + ICON_ARROW_UP_FILL = 121, + ICON_AUDIO = 122, + ICON_FX = 123, + ICON_WAVE = 124, + ICON_WAVE_SINUS = 125, + ICON_WAVE_SQUARE = 126, + ICON_WAVE_TRIANGULAR = 127, + ICON_CROSS_SMALL = 128, + ICON_PLAYER_PREVIOUS = 129, + ICON_PLAYER_PLAY_BACK = 130, + ICON_PLAYER_PLAY = 131, + ICON_PLAYER_PAUSE = 132, + ICON_PLAYER_STOP = 133, + ICON_PLAYER_NEXT = 134, + ICON_PLAYER_RECORD = 135, + ICON_MAGNET = 136, + ICON_LOCK_CLOSE = 137, + ICON_LOCK_OPEN = 138, + ICON_CLOCK = 139, + ICON_TOOLS = 140, + ICON_GEAR = 141, + ICON_GEAR_BIG = 142, + ICON_BIN = 143, + ICON_HAND_POINTER = 144, + ICON_LASER = 145, + ICON_COIN = 146, + ICON_EXPLOSION = 147, + ICON_1UP = 148, + ICON_PLAYER = 149, + ICON_PLAYER_JUMP = 150, + ICON_KEY = 151, + ICON_DEMON = 152, + ICON_TEXT_POPUP = 153, + ICON_GEAR_EX = 154, + ICON_CRACK = 155, + ICON_CRACK_POINTS = 156, + ICON_STAR = 157, + ICON_DOOR = 158, + ICON_EXIT = 159, + ICON_MODE_2D = 160, + ICON_MODE_3D = 161, + ICON_CUBE = 162, + ICON_CUBE_FACE_TOP = 163, + ICON_CUBE_FACE_LEFT = 164, + ICON_CUBE_FACE_FRONT = 165, + ICON_CUBE_FACE_BOTTOM = 166, + ICON_CUBE_FACE_RIGHT = 167, + ICON_CUBE_FACE_BACK = 168, + ICON_CAMERA = 169, + ICON_SPECIAL = 170, + ICON_LINK_NET = 171, + ICON_LINK_BOXES = 172, + ICON_LINK_MULTI = 173, + ICON_LINK = 174, + ICON_LINK_BROKE = 175, + ICON_TEXT_NOTES = 176, + ICON_NOTEBOOK = 177, + ICON_SUITCASE = 178, + ICON_SUITCASE_ZIP = 179, + ICON_MAILBOX = 180, + ICON_MONITOR = 181, + ICON_PRINTER = 182, + ICON_PHOTO_CAMERA = 183, + ICON_PHOTO_CAMERA_FLASH = 184, + ICON_HOUSE = 185, + ICON_HEART = 186, + ICON_CORNER = 187, + ICON_VERTICAL_BARS = 188, + ICON_VERTICAL_BARS_FILL = 189, + ICON_LIFE_BARS = 190, + ICON_INFO = 191, + ICON_CROSSLINE = 192, + ICON_HELP = 193, + ICON_FILETYPE_ALPHA = 194, + ICON_FILETYPE_HOME = 195, + ICON_LAYERS_VISIBLE = 196, + ICON_LAYERS = 197, + ICON_WINDOW = 198, + ICON_HIDPI = 199, + ICON_FILETYPE_BINARY = 200, + ICON_HEX = 201, + ICON_SHIELD = 202, + ICON_FILE_NEW = 203, + ICON_FOLDER_ADD = 204, + ICON_ALARM = 205, + ICON_206 = 206, + ICON_207 = 207, + ICON_208 = 208, + ICON_209 = 209, + ICON_210 = 210, + ICON_211 = 211, + ICON_212 = 212, + ICON_213 = 213, + ICON_214 = 214, + ICON_215 = 215, + ICON_216 = 216, + ICON_217 = 217, + ICON_218 = 218, + ICON_219 = 219, + ICON_220 = 220, + ICON_221 = 221, + ICON_222 = 222, + ICON_223 = 223, + ICON_224 = 224, + ICON_225 = 225, + ICON_226 = 226, + ICON_227 = 227, + ICON_228 = 228, + ICON_229 = 229, + ICON_230 = 230, + ICON_231 = 231, + ICON_232 = 232, + ICON_233 = 233, + ICON_234 = 234, + ICON_235 = 235, + ICON_236 = 236, + ICON_237 = 237, + ICON_238 = 238, + ICON_239 = 239, + ICON_240 = 240, + ICON_241 = 241, + ICON_242 = 242, + ICON_243 = 243, + ICON_244 = 244, + ICON_245 = 245, + ICON_246 = 246, + ICON_247 = 247, + ICON_248 = 248, + ICON_249 = 249, + ICON_250 = 250, + ICON_251 = 251, + ICON_252 = 252, + ICON_253 = 253, + ICON_254 = 254, + ICON_255 = 255, + } GuiIconName; +#endif -RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value -RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value -RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value #endif #if defined(__cplusplus) -} // Prevents name mangling of functions +} // Prevents name mangling of functions #endif #endif // RAYGUI_H /*********************************************************************************** -* -* RAYGUI IMPLEMENTATION -* -************************************************************************************/ + * + * RAYGUI IMPLEMENTATION + * + ************************************************************************************/ #if defined(RAYGUI_IMPLEMENTATION) -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] -#include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] -#include // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy() -#include // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()] -#include // Required for: roundf() [GuiColorPicker()] +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy() +#include // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()] +#include // Required for: roundf() [GuiColorPicker()] #ifdef __cplusplus - #define RAYGUI_CLITERAL(name) name +#define RAYGUI_CLITERAL(name) name #else - #define RAYGUI_CLITERAL(name) (name) +#define RAYGUI_CLITERAL(name) (name) #endif #if !defined(RAYGUI_NO_ICONS) && !defined(RAYGUI_CUSTOM_ICONS) -// Embedded raygui icons, no external file provided -#define RAYGUI_ICON_SIZE 16 // Size of icons (squared) -#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons -#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id +// Embedded icons, no external file provided +#define RAYGUI_ICON_SIZE 16 // Size of icons in pixels (squared) +#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons +#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id // Icons data is defined by bit array (every bit represents one pixel) -// Those arrays are stored as unsigned int data arrays, so every array -// element defines 32 pixels (bits) of information -// Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels) -#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32) - -//---------------------------------------------------------------------------------- -// Icons enumeration -//---------------------------------------------------------------------------------- - -typedef enum { - RAYGUI_ICON_NONE = 0, - RAYGUI_ICON_FOLDER_FILE_OPEN = 1, - RAYGUI_ICON_FILE_SAVE_CLASSIC = 2, - RAYGUI_ICON_FOLDER_OPEN = 3, - RAYGUI_ICON_FOLDER_SAVE = 4, - RAYGUI_ICON_FILE_OPEN = 5, - RAYGUI_ICON_FILE_SAVE = 6, - RAYGUI_ICON_FILE_EXPORT = 7, - RAYGUI_ICON_FILE_NEW = 8, - RAYGUI_ICON_FILE_DELETE = 9, - RAYGUI_ICON_FILETYPE_TEXT = 10, - RAYGUI_ICON_FILETYPE_AUDIO = 11, - RAYGUI_ICON_FILETYPE_IMAGE = 12, - RAYGUI_ICON_FILETYPE_PLAY = 13, - RAYGUI_ICON_FILETYPE_VIDEO = 14, - RAYGUI_ICON_FILETYPE_INFO = 15, - RAYGUI_ICON_FILE_COPY = 16, - RAYGUI_ICON_FILE_CUT = 17, - RAYGUI_ICON_FILE_PASTE = 18, - RAYGUI_ICON_CURSOR_HAND = 19, - RAYGUI_ICON_CURSOR_POINTER = 20, - RAYGUI_ICON_CURSOR_CLASSIC = 21, - RAYGUI_ICON_PENCIL = 22, - RAYGUI_ICON_PENCIL_BIG = 23, - RAYGUI_ICON_BRUSH_CLASSIC = 24, - RAYGUI_ICON_BRUSH_PAINTER = 25, - RAYGUI_ICON_WATER_DROP = 26, - RAYGUI_ICON_COLOR_PICKER = 27, - RAYGUI_ICON_RUBBER = 28, - RAYGUI_ICON_COLOR_BUCKET = 29, - RAYGUI_ICON_TEXT_T = 30, - RAYGUI_ICON_TEXT_A = 31, - RAYGUI_ICON_SCALE = 32, - RAYGUI_ICON_RESIZE = 33, - RAYGUI_ICON_FILTER_POINT = 34, - RAYGUI_ICON_FILTER_BILINEAR = 35, - RAYGUI_ICON_CROP = 36, - RAYGUI_ICON_CROP_ALPHA = 37, - RAYGUI_ICON_SQUARE_TOGGLE = 38, - RAYGUI_ICON_SYMMETRY = 39, - RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40, - RAYGUI_ICON_SYMMETRY_VERTICAL = 41, - RAYGUI_ICON_LENS = 42, - RAYGUI_ICON_LENS_BIG = 43, - RAYGUI_ICON_EYE_ON = 44, - RAYGUI_ICON_EYE_OFF = 45, - RAYGUI_ICON_FILTER_TOP = 46, - RAYGUI_ICON_FILTER = 47, - RAYGUI_ICON_TARGET_POINT = 48, - RAYGUI_ICON_TARGET_SMALL = 49, - RAYGUI_ICON_TARGET_BIG = 50, - RAYGUI_ICON_TARGET_MOVE = 51, - RAYGUI_ICON_CURSOR_MOVE = 52, - RAYGUI_ICON_CURSOR_SCALE = 53, - RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54, - RAYGUI_ICON_CURSOR_SCALE_LEFT = 55, - RAYGUI_ICON_UNDO = 56, - RAYGUI_ICON_REDO = 57, - RAYGUI_ICON_REREDO = 58, - RAYGUI_ICON_MUTATE = 59, - RAYGUI_ICON_ROTATE = 60, - RAYGUI_ICON_REPEAT = 61, - RAYGUI_ICON_SHUFFLE = 62, - RAYGUI_ICON_EMPTYBOX = 63, - RAYGUI_ICON_TARGET = 64, - RAYGUI_ICON_TARGET_SMALL_FILL = 65, - RAYGUI_ICON_TARGET_BIG_FILL = 66, - RAYGUI_ICON_TARGET_MOVE_FILL = 67, - RAYGUI_ICON_CURSOR_MOVE_FILL = 68, - RAYGUI_ICON_CURSOR_SCALE_FILL = 69, - RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70, - RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71, - RAYGUI_ICON_UNDO_FILL = 72, - RAYGUI_ICON_REDO_FILL = 73, - RAYGUI_ICON_REREDO_FILL = 74, - RAYGUI_ICON_MUTATE_FILL = 75, - RAYGUI_ICON_ROTATE_FILL = 76, - RAYGUI_ICON_REPEAT_FILL = 77, - RAYGUI_ICON_SHUFFLE_FILL = 78, - RAYGUI_ICON_EMPTYBOX_SMALL = 79, - RAYGUI_ICON_BOX = 80, - RAYGUI_ICON_BOX_TOP = 81, - RAYGUI_ICON_BOX_TOP_RIGHT = 82, - RAYGUI_ICON_BOX_RIGHT = 83, - RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84, - RAYGUI_ICON_BOX_BOTTOM = 85, - RAYGUI_ICON_BOX_BOTTOM_LEFT = 86, - RAYGUI_ICON_BOX_LEFT = 87, - RAYGUI_ICON_BOX_TOP_LEFT = 88, - RAYGUI_ICON_BOX_CENTER = 89, - RAYGUI_ICON_BOX_CIRCLE_MASK = 90, - RAYGUI_ICON_POT = 91, - RAYGUI_ICON_ALPHA_MULTIPLY = 92, - RAYGUI_ICON_ALPHA_CLEAR = 93, - RAYGUI_ICON_DITHERING = 94, - RAYGUI_ICON_MIPMAPS = 95, - RAYGUI_ICON_BOX_GRID = 96, - RAYGUI_ICON_GRID = 97, - RAYGUI_ICON_BOX_CORNERS_SMALL = 98, - RAYGUI_ICON_BOX_CORNERS_BIG = 99, - RAYGUI_ICON_FOUR_BOXES = 100, - RAYGUI_ICON_GRID_FILL = 101, - RAYGUI_ICON_BOX_MULTISIZE = 102, - RAYGUI_ICON_ZOOM_SMALL = 103, - RAYGUI_ICON_ZOOM_MEDIUM = 104, - RAYGUI_ICON_ZOOM_BIG = 105, - RAYGUI_ICON_ZOOM_ALL = 106, - RAYGUI_ICON_ZOOM_CENTER = 107, - RAYGUI_ICON_BOX_DOTS_SMALL = 108, - RAYGUI_ICON_BOX_DOTS_BIG = 109, - RAYGUI_ICON_BOX_CONCENTRIC = 110, - RAYGUI_ICON_BOX_GRID_BIG = 111, - RAYGUI_ICON_OK_TICK = 112, - RAYGUI_ICON_CROSS = 113, - RAYGUI_ICON_ARROW_LEFT = 114, - RAYGUI_ICON_ARROW_RIGHT = 115, - RAYGUI_ICON_ARROW_DOWN = 116, - RAYGUI_ICON_ARROW_UP = 117, - RAYGUI_ICON_ARROW_LEFT_FILL = 118, - RAYGUI_ICON_ARROW_RIGHT_FILL = 119, - RAYGUI_ICON_ARROW_DOWN_FILL = 120, - RAYGUI_ICON_ARROW_UP_FILL = 121, - RAYGUI_ICON_AUDIO = 122, - RAYGUI_ICON_FX = 123, - RAYGUI_ICON_WAVE = 124, - RAYGUI_ICON_WAVE_SINUS = 125, - RAYGUI_ICON_WAVE_SQUARE = 126, - RAYGUI_ICON_WAVE_TRIANGULAR = 127, - RAYGUI_ICON_CROSS_SMALL = 128, - RAYGUI_ICON_PLAYER_PREVIOUS = 129, - RAYGUI_ICON_PLAYER_PLAY_BACK = 130, - RAYGUI_ICON_PLAYER_PLAY = 131, - RAYGUI_ICON_PLAYER_PAUSE = 132, - RAYGUI_ICON_PLAYER_STOP = 133, - RAYGUI_ICON_PLAYER_NEXT = 134, - RAYGUI_ICON_PLAYER_RECORD = 135, - RAYGUI_ICON_MAGNET = 136, - RAYGUI_ICON_LOCK_CLOSE = 137, - RAYGUI_ICON_LOCK_OPEN = 138, - RAYGUI_ICON_CLOCK = 139, - RAYGUI_ICON_TOOLS = 140, - RAYGUI_ICON_GEAR = 141, - RAYGUI_ICON_GEAR_BIG = 142, - RAYGUI_ICON_BIN = 143, - RAYGUI_ICON_HAND_POINTER = 144, - RAYGUI_ICON_LASER = 145, - RAYGUI_ICON_COIN = 146, - RAYGUI_ICON_EXPLOSION = 147, - RAYGUI_ICON_1UP = 148, - RAYGUI_ICON_PLAYER = 149, - RAYGUI_ICON_PLAYER_JUMP = 150, - RAYGUI_ICON_KEY = 151, - RAYGUI_ICON_DEMON = 152, - RAYGUI_ICON_TEXT_POPUP = 153, - RAYGUI_ICON_GEAR_EX = 154, - RAYGUI_ICON_CRACK = 155, - RAYGUI_ICON_CRACK_POINTS = 156, - RAYGUI_ICON_STAR = 157, - RAYGUI_ICON_DOOR = 158, - RAYGUI_ICON_EXIT = 159, - RAYGUI_ICON_MODE_2D = 160, - RAYGUI_ICON_MODE_3D = 161, - RAYGUI_ICON_CUBE = 162, - RAYGUI_ICON_CUBE_FACE_TOP = 163, - RAYGUI_ICON_CUBE_FACE_LEFT = 164, - RAYGUI_ICON_CUBE_FACE_FRONT = 165, - RAYGUI_ICON_CUBE_FACE_BOTTOM = 166, - RAYGUI_ICON_CUBE_FACE_RIGHT = 167, - RAYGUI_ICON_CUBE_FACE_BACK = 168, - RAYGUI_ICON_CAMERA = 169, - RAYGUI_ICON_SPECIAL = 170, - RAYGUI_ICON_LINK_NET = 171, - RAYGUI_ICON_LINK_BOXES = 172, - RAYGUI_ICON_LINK_MULTI = 173, - RAYGUI_ICON_LINK = 174, - RAYGUI_ICON_LINK_BROKE = 175, - RAYGUI_ICON_TEXT_NOTES = 176, - RAYGUI_ICON_NOTEBOOK = 177, - RAYGUI_ICON_SUITCASE = 178, - RAYGUI_ICON_SUITCASE_ZIP = 179, - RAYGUI_ICON_MAILBOX = 180, - RAYGUI_ICON_MONITOR = 181, - RAYGUI_ICON_PRINTER = 182, - RAYGUI_ICON_PHOTO_CAMERA = 183, - RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184, - RAYGUI_ICON_HOUSE = 185, - RAYGUI_ICON_HEART = 186, - RAYGUI_ICON_CORNER = 187, - RAYGUI_ICON_VERTICAL_BARS = 188, - RAYGUI_ICON_VERTICAL_BARS_FILL = 189, - RAYGUI_ICON_LIFE_BARS = 190, - RAYGUI_ICON_INFO = 191, - RAYGUI_ICON_CROSSLINE = 192, - RAYGUI_ICON_HELP = 193, - RAYGUI_ICON_FILETYPE_ALPHA = 194, - RAYGUI_ICON_FILETYPE_HOME = 195, - RAYGUI_ICON_LAYERS_VISIBLE = 196, - RAYGUI_ICON_LAYERS = 197, - RAYGUI_ICON_WINDOW = 198, - RAYGUI_ICON_HIDPI = 199, - RAYGUI_ICON_200 = 200, - RAYGUI_ICON_201 = 201, - RAYGUI_ICON_202 = 202, - RAYGUI_ICON_203 = 203, - RAYGUI_ICON_204 = 204, - RAYGUI_ICON_205 = 205, - RAYGUI_ICON_206 = 206, - RAYGUI_ICON_207 = 207, - RAYGUI_ICON_208 = 208, - RAYGUI_ICON_209 = 209, - RAYGUI_ICON_210 = 210, - RAYGUI_ICON_211 = 211, - RAYGUI_ICON_212 = 212, - RAYGUI_ICON_213 = 213, - RAYGUI_ICON_214 = 214, - RAYGUI_ICON_215 = 215, - RAYGUI_ICON_216 = 216, - RAYGUI_ICON_217 = 217, - RAYGUI_ICON_218 = 218, - RAYGUI_ICON_219 = 219, - RAYGUI_ICON_220 = 220, - RAYGUI_ICON_221 = 221, - RAYGUI_ICON_222 = 222, - RAYGUI_ICON_223 = 223, - RAYGUI_ICON_224 = 224, - RAYGUI_ICON_225 = 225, - RAYGUI_ICON_226 = 226, - RAYGUI_ICON_227 = 227, - RAYGUI_ICON_228 = 228, - RAYGUI_ICON_229 = 229, - RAYGUI_ICON_230 = 230, - RAYGUI_ICON_231 = 231, - RAYGUI_ICON_232 = 232, - RAYGUI_ICON_233 = 233, - RAYGUI_ICON_234 = 234, - RAYGUI_ICON_235 = 235, - RAYGUI_ICON_236 = 236, - RAYGUI_ICON_237 = 237, - RAYGUI_ICON_238 = 238, - RAYGUI_ICON_239 = 239, - RAYGUI_ICON_240 = 240, - RAYGUI_ICON_241 = 241, - RAYGUI_ICON_242 = 242, - RAYGUI_ICON_243 = 243, - RAYGUI_ICON_244 = 244, - RAYGUI_ICON_245 = 245, - RAYGUI_ICON_246 = 246, - RAYGUI_ICON_247 = 247, - RAYGUI_ICON_248 = 248, - RAYGUI_ICON_249 = 249, - RAYGUI_ICON_250 = 250, - RAYGUI_ICON_251 = 251, - RAYGUI_ICON_252 = 252, - RAYGUI_ICON_253 = 253, - RAYGUI_ICON_254 = 254, - RAYGUI_ICON_255 = 255, -} guiIconName; +// Those arrays are stored as unsigned int data arrays, so, +// every array element defines 32 pixels (bits) of information +// One icon is defined by 8 int, (8 int * 32 bit = 256 bit = 16*16 pixels) +// NOTE: Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels) +#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE * RAYGUI_ICON_SIZE / 32) //---------------------------------------------------------------------------------- // Icons data for all gui possible icons (allocated on data segment by default) @@ -866,289 +904,297 @@ typedef enum { // // guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB //---------------------------------------------------------------------------------- -static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_NONE - 0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // RAYGUI_ICON_FOLDER_FILE_OPEN - 0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // RAYGUI_ICON_FILE_SAVE_CLASSIC - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024002, 0x44424282, 0x793e4102, 0x00000100, // RAYGUI_ICON_FOLDER_OPEN - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024102, 0x44424102, 0x793e4282, 0x00000000, // RAYGUI_ICON_FOLDER_SAVE - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x24442284, 0x21042104, 0x20042104, 0x00003ffc, // RAYGUI_ICON_FILE_OPEN - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x21042104, 0x22842444, 0x20042104, 0x00003ffc, // RAYGUI_ICON_FILE_SAVE - 0x3ff00000, 0x201c2010, 0x00042004, 0x20041004, 0x20844784, 0x00841384, 0x20042784, 0x00003ffc, // RAYGUI_ICON_FILE_EXPORT - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x22042204, 0x22042f84, 0x20042204, 0x00003ffc, // RAYGUI_ICON_FILE_NEW - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x25042884, 0x25042204, 0x20042884, 0x00003ffc, // RAYGUI_ICON_FILE_DELETE - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_TEXT - 0x3ff00000, 0x201c2010, 0x27042004, 0x244424c4, 0x26442444, 0x20642664, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_AUDIO - 0x3ff00000, 0x201c2010, 0x26042604, 0x20042004, 0x35442884, 0x2414222c, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_IMAGE - 0x3ff00000, 0x201c2010, 0x20c42004, 0x22442144, 0x22442444, 0x20c42144, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_PLAY - 0x3ff00000, 0x3ffc2ff0, 0x3f3c2ff4, 0x3dbc2eb4, 0x3dbc2bb4, 0x3f3c2eb4, 0x3ffc2ff4, 0x00002ff4, // RAYGUI_ICON_FILETYPE_VIDEO - 0x3ff00000, 0x201c2010, 0x21842184, 0x21842004, 0x21842184, 0x21842184, 0x20042184, 0x00003ffc, // RAYGUI_ICON_FILETYPE_INFO - 0x0ff00000, 0x381c0810, 0x28042804, 0x28042804, 0x28042804, 0x28042804, 0x20102ffc, 0x00003ff0, // RAYGUI_ICON_FILE_COPY - 0x00000000, 0x701c0000, 0x079c1e14, 0x55a000f0, 0x079c00f0, 0x701c1e14, 0x00000000, 0x00000000, // RAYGUI_ICON_FILE_CUT - 0x01c00000, 0x13e41bec, 0x3f841004, 0x204420c4, 0x20442044, 0x20442044, 0x207c2044, 0x00003fc0, // RAYGUI_ICON_FILE_PASTE - 0x00000000, 0x3aa00fe0, 0x2abc2aa0, 0x2aa42aa4, 0x20042aa4, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_CURSOR_HAND - 0x00000000, 0x003c000c, 0x030800c8, 0x30100c10, 0x10202020, 0x04400840, 0x01800280, 0x00000000, // RAYGUI_ICON_CURSOR_POINTER - 0x00000000, 0x00180000, 0x01f00078, 0x03e007f0, 0x07c003e0, 0x04000e40, 0x00000000, 0x00000000, // RAYGUI_ICON_CURSOR_CLASSIC - 0x00000000, 0x04000000, 0x11000a00, 0x04400a80, 0x01100220, 0x00580088, 0x00000038, 0x00000000, // RAYGUI_ICON_PENCIL - 0x04000000, 0x15000a00, 0x50402880, 0x14102820, 0x05040a08, 0x015c028c, 0x007c00bc, 0x00000000, // RAYGUI_ICON_PENCIL_BIG - 0x01c00000, 0x01400140, 0x01400140, 0x0ff80140, 0x0ff80808, 0x0aa80808, 0x0aa80aa8, 0x00000ff8, // RAYGUI_ICON_BRUSH_CLASSIC - 0x1ffc0000, 0x5ffc7ffe, 0x40004000, 0x00807f80, 0x01c001c0, 0x01c001c0, 0x01c001c0, 0x00000080, // RAYGUI_ICON_BRUSH_PAINTER - 0x00000000, 0x00800000, 0x01c00080, 0x03e001c0, 0x07f003e0, 0x036006f0, 0x000001c0, 0x00000000, // RAYGUI_ICON_WATER_DROP - 0x00000000, 0x3e003800, 0x1f803f80, 0x0c201e40, 0x02080c10, 0x00840104, 0x00380044, 0x00000000, // RAYGUI_ICON_COLOR_PICKER - 0x00000000, 0x07800300, 0x1fe00fc0, 0x3f883fd0, 0x0e021f04, 0x02040402, 0x00f00108, 0x00000000, // RAYGUI_ICON_RUBBER - 0x00c00000, 0x02800140, 0x08200440, 0x20081010, 0x2ffe3004, 0x03f807fc, 0x00e001f0, 0x00000040, // RAYGUI_ICON_COLOR_BUCKET - 0x00000000, 0x21843ffc, 0x01800180, 0x01800180, 0x01800180, 0x01800180, 0x03c00180, 0x00000000, // RAYGUI_ICON_TEXT_T - 0x00800000, 0x01400180, 0x06200340, 0x0c100620, 0x1ff80c10, 0x380c1808, 0x70067004, 0x0000f80f, // RAYGUI_ICON_TEXT_A - 0x78000000, 0x50004000, 0x00004800, 0x03c003c0, 0x03c003c0, 0x00100000, 0x0002000a, 0x0000000e, // RAYGUI_ICON_SCALE - 0x75560000, 0x5e004002, 0x54001002, 0x41001202, 0x408200fe, 0x40820082, 0x40820082, 0x00006afe, // RAYGUI_ICON_RESIZE - 0x00000000, 0x3f003f00, 0x3f003f00, 0x3f003f00, 0x00400080, 0x001c0020, 0x001c001c, 0x00000000, // RAYGUI_ICON_FILTER_POINT - 0x6d800000, 0x00004080, 0x40804080, 0x40800000, 0x00406d80, 0x001c0020, 0x001c001c, 0x00000000, // RAYGUI_ICON_FILTER_BILINEAR - 0x40080000, 0x1ffe2008, 0x14081008, 0x11081208, 0x10481088, 0x10081028, 0x10047ff8, 0x00001002, // RAYGUI_ICON_CROP - 0x00100000, 0x3ffc0010, 0x2ab03550, 0x22b02550, 0x20b02150, 0x20302050, 0x2000fff0, 0x00002000, // RAYGUI_ICON_CROP_ALPHA - 0x40000000, 0x1ff82000, 0x04082808, 0x01082208, 0x00482088, 0x00182028, 0x35542008, 0x00000002, // RAYGUI_ICON_SQUARE_TOGGLE - 0x00000000, 0x02800280, 0x06c006c0, 0x0ea00ee0, 0x1e901eb0, 0x3e883e98, 0x7efc7e8c, 0x00000000, // RAYGUI_ICON_SIMMETRY - 0x01000000, 0x05600100, 0x1d480d50, 0x7d423d44, 0x3d447d42, 0x0d501d48, 0x01000560, 0x00000100, // RAYGUI_ICON_SIMMETRY_HORIZONTAL - 0x01800000, 0x04200240, 0x10080810, 0x00001ff8, 0x00007ffe, 0x0ff01ff8, 0x03c007e0, 0x00000180, // RAYGUI_ICON_SIMMETRY_VERTICAL - 0x00000000, 0x010800f0, 0x02040204, 0x02040204, 0x07f00308, 0x1c000e00, 0x30003800, 0x00000000, // RAYGUI_ICON_LENS - 0x00000000, 0x061803f0, 0x08240c0c, 0x08040814, 0x0c0c0804, 0x23f01618, 0x18002400, 0x00000000, // RAYGUI_ICON_LENS_BIG - 0x00000000, 0x00000000, 0x1c7007c0, 0x638e3398, 0x1c703398, 0x000007c0, 0x00000000, 0x00000000, // RAYGUI_ICON_EYE_ON - 0x00000000, 0x10002000, 0x04700fc0, 0x610e3218, 0x1c703098, 0x001007a0, 0x00000008, 0x00000000, // RAYGUI_ICON_EYE_OFF - 0x00000000, 0x00007ffc, 0x40047ffc, 0x10102008, 0x04400820, 0x02800280, 0x02800280, 0x00000100, // RAYGUI_ICON_FILTER_TOP - 0x00000000, 0x40027ffe, 0x10082004, 0x04200810, 0x02400240, 0x02400240, 0x01400240, 0x000000c0, // RAYGUI_ICON_FILTER - 0x00800000, 0x00800080, 0x00000080, 0x3c9e0000, 0x00000000, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_POINT - 0x00800000, 0x00800080, 0x00800080, 0x3f7e01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_SMALL - 0x00800000, 0x00800080, 0x03e00080, 0x3e3e0220, 0x03e00220, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_BIG - 0x01000000, 0x04400280, 0x01000100, 0x43842008, 0x43849ab2, 0x01002008, 0x04400100, 0x01000280, // RAYGUI_ICON_TARGET_MOVE - 0x01000000, 0x04400280, 0x01000100, 0x41042108, 0x41049ff2, 0x01002108, 0x04400100, 0x01000280, // RAYGUI_ICON_CURSOR_MOVE - 0x781e0000, 0x500a4002, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x4002500a, 0x0000781e, // RAYGUI_ICON_CURSOR_SCALE - 0x00000000, 0x20003c00, 0x24002800, 0x01000200, 0x00400080, 0x00140024, 0x003c0004, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_RIGHT - 0x00000000, 0x0004003c, 0x00240014, 0x00800040, 0x02000100, 0x28002400, 0x3c002000, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_LEFT - 0x00000000, 0x00100020, 0x10101fc8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RAYGUI_ICON_UNDO - 0x00000000, 0x08000400, 0x080813f8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RAYGUI_ICON_REDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3f902020, 0x00400020, 0x00000000, // RAYGUI_ICON_REREDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3fc82010, 0x00200010, 0x00000000, // RAYGUI_ICON_MUTATE - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18101020, 0x00100fc8, 0x00000020, // RAYGUI_ICON_ROTATE - 0x00000000, 0x04000200, 0x240429fc, 0x20042204, 0x20442004, 0x3f942024, 0x00400020, 0x00000000, // RAYGUI_ICON_REPEAT - 0x00000000, 0x20001000, 0x22104c0e, 0x00801120, 0x11200040, 0x4c0e2210, 0x10002000, 0x00000000, // RAYGUI_ICON_SHUFFLE - 0x7ffe0000, 0x50024002, 0x44024802, 0x41024202, 0x40424082, 0x40124022, 0x4002400a, 0x00007ffe, // RAYGUI_ICON_EMPTYBOX - 0x00800000, 0x03e00080, 0x08080490, 0x3c9e0808, 0x08080808, 0x03e00490, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET - 0x00800000, 0x00800080, 0x00800080, 0x3ffe01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_SMALL_FILL - 0x00800000, 0x00800080, 0x03e00080, 0x3ffe03e0, 0x03e003e0, 0x00800080, 0x00800080, 0x00000000, // RAYGUI_ICON_TARGET_BIG_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x638c2008, 0x638cfbbe, 0x01002008, 0x07c00100, 0x01000380, // RAYGUI_ICON_TARGET_MOVE_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x610c2108, 0x610cfffe, 0x01002108, 0x07c00100, 0x01000380, // RAYGUI_ICON_CURSOR_MOVE_FILL - 0x781e0000, 0x6006700e, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x700e6006, 0x0000781e, // RAYGUI_ICON_CURSOR_SCALE_FILL - 0x00000000, 0x38003c00, 0x24003000, 0x01000200, 0x00400080, 0x000c0024, 0x003c001c, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_RIGHT - 0x00000000, 0x001c003c, 0x0024000c, 0x00800040, 0x02000100, 0x30002400, 0x3c003800, 0x00000000, // RAYGUI_ICON_CURSOR_SCALE_LEFT - 0x00000000, 0x00300020, 0x10301ff8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // RAYGUI_ICON_UNDO_FILL - 0x00000000, 0x0c000400, 0x0c081ff8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // RAYGUI_ICON_REDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3ff02060, 0x00400060, 0x00000000, // RAYGUI_ICON_REREDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3ff82030, 0x00200030, 0x00000000, // RAYGUI_ICON_MUTATE_FILL - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18301020, 0x00300ff8, 0x00000020, // RAYGUI_ICON_ROTATE_FILL - 0x00000000, 0x06000200, 0x26042ffc, 0x20042204, 0x20442004, 0x3ff42064, 0x00400060, 0x00000000, // RAYGUI_ICON_REPEAT_FILL - 0x00000000, 0x30001000, 0x32107c0e, 0x00801120, 0x11200040, 0x7c0e3210, 0x10003000, 0x00000000, // RAYGUI_ICON_SHUFFLE_FILL - 0x00000000, 0x30043ffc, 0x24042804, 0x21042204, 0x20442084, 0x20142024, 0x3ffc200c, 0x00000000, // RAYGUI_ICON_EMPTYBOX_SMALL - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX - 0x00000000, 0x23c43ffc, 0x23c423c4, 0x200423c4, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP - 0x00000000, 0x3e043ffc, 0x3e043e04, 0x20043e04, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x3e043e04, 0x3e043e04, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x3e042004, 0x3e043e04, 0x3ffc3e04, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x23c42004, 0x23c423c4, 0x3ffc23c4, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x207c2004, 0x207c207c, 0x3ffc207c, 0x00000000, // RAYGUI_ICON_BOX_BOTTOM_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x207c207c, 0x207c207c, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_LEFT - 0x00000000, 0x207c3ffc, 0x207c207c, 0x2004207c, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_TOP_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x23c423c4, 0x23c423c4, 0x20042004, 0x3ffc2004, 0x00000000, // RAYGUI_ICON_BOX_CIRCLE_MASK - 0x7ffe0000, 0x40024002, 0x47e24182, 0x4ff247e2, 0x47e24ff2, 0x418247e2, 0x40024002, 0x00007ffe, // RAYGUI_ICON_BOX_CENTER - 0x7fff0000, 0x40014001, 0x40014001, 0x49555ddd, 0x4945495d, 0x400149c5, 0x40014001, 0x00007fff, // RAYGUI_ICON_POT - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x404e40ce, 0x48125432, 0x4006540e, 0x00007ffe, // RAYGUI_ICON_ALPHA_MULTIPLY - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x5c4e40ce, 0x44124432, 0x40065c0e, 0x00007ffe, // RAYGUI_ICON_ALPHA_CLEAR - 0x7ffe0000, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x00007ffe, // RAYGUI_ICON_DITHERING - 0x07fe0000, 0x1ffa0002, 0x7fea000a, 0x402a402a, 0x5b2a512a, 0x5128552a, 0x40205128, 0x00007fe0, // RAYGUI_ICON_MIPMAPS - 0x00000000, 0x1ff80000, 0x12481248, 0x12481ff8, 0x1ff81248, 0x12481248, 0x00001ff8, 0x00000000, // RAYGUI_ICON_BOX_GRID - 0x12480000, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x00001248, // RAYGUI_ICON_GRID - 0x00000000, 0x1c380000, 0x1c3817e8, 0x08100810, 0x08100810, 0x17e81c38, 0x00001c38, 0x00000000, // RAYGUI_ICON_BOX_CORNERS_SMALL - 0x700e0000, 0x700e5ffa, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x5ffa700e, 0x0000700e, // RAYGUI_ICON_BOX_CORNERS_BIG - 0x3f7e0000, 0x21422142, 0x21422142, 0x00003f7e, 0x21423f7e, 0x21422142, 0x3f7e2142, 0x00000000, // RAYGUI_ICON_FOUR_BOXES - 0x00000000, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x00000000, // RAYGUI_ICON_GRID_FILL - 0x7ffe0000, 0x7ffe7ffe, 0x77fe7000, 0x77fe77fe, 0x777e7700, 0x777e777e, 0x777e777e, 0x0000777e, // RAYGUI_ICON_BOX_MULTISIZE - 0x781e0000, 0x40024002, 0x00004002, 0x01800000, 0x00000180, 0x40020000, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_SMALL - 0x781e0000, 0x40024002, 0x00004002, 0x03c003c0, 0x03c003c0, 0x40020000, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_MEDIUM - 0x781e0000, 0x40024002, 0x07e04002, 0x07e007e0, 0x07e007e0, 0x400207e0, 0x40024002, 0x0000781e, // RAYGUI_ICON_ZOOM_BIG - 0x781e0000, 0x5ffa4002, 0x1ff85ffa, 0x1ff81ff8, 0x1ff81ff8, 0x5ffa1ff8, 0x40025ffa, 0x0000781e, // RAYGUI_ICON_ZOOM_ALL - 0x00000000, 0x2004381c, 0x00002004, 0x00000000, 0x00000000, 0x20040000, 0x381c2004, 0x00000000, // RAYGUI_ICON_ZOOM_CENTER - 0x00000000, 0x1db80000, 0x10081008, 0x10080000, 0x00001008, 0x10081008, 0x00001db8, 0x00000000, // RAYGUI_ICON_BOX_DOTS_SMALL - 0x35560000, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x35562002, 0x00000000, // RAYGUI_ICON_BOX_DOTS_BIG - 0x7ffe0000, 0x40024002, 0x48124ff2, 0x49924812, 0x48124992, 0x4ff24812, 0x40024002, 0x00007ffe, // RAYGUI_ICON_BOX_CONCENTRIC - 0x00000000, 0x10841ffc, 0x10841084, 0x1ffc1084, 0x10841084, 0x10841084, 0x00001ffc, 0x00000000, // RAYGUI_ICON_BOX_GRID_BIG - 0x00000000, 0x00000000, 0x10000000, 0x04000800, 0x01040200, 0x00500088, 0x00000020, 0x00000000, // RAYGUI_ICON_OK_TICK - 0x00000000, 0x10080000, 0x04200810, 0x01800240, 0x02400180, 0x08100420, 0x00001008, 0x00000000, // RAYGUI_ICON_CROSS - 0x00000000, 0x02000000, 0x00800100, 0x00200040, 0x00200010, 0x00800040, 0x02000100, 0x00000000, // RAYGUI_ICON_ARROW_LEFT - 0x00000000, 0x00400000, 0x01000080, 0x04000200, 0x04000800, 0x01000200, 0x00400080, 0x00000000, // RAYGUI_ICON_ARROW_RIGHT - 0x00000000, 0x00000000, 0x00000000, 0x08081004, 0x02200410, 0x00800140, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_DOWN - 0x00000000, 0x00000000, 0x01400080, 0x04100220, 0x10040808, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_UP - 0x00000000, 0x02000000, 0x03800300, 0x03e003c0, 0x03e003f0, 0x038003c0, 0x02000300, 0x00000000, // RAYGUI_ICON_ARROW_LEFT_FILL - 0x00000000, 0x00400000, 0x01c000c0, 0x07c003c0, 0x07c00fc0, 0x01c003c0, 0x004000c0, 0x00000000, // RAYGUI_ICON_ARROW_RIGHT_FILL - 0x00000000, 0x00000000, 0x00000000, 0x0ff81ffc, 0x03e007f0, 0x008001c0, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_DOWN_FILL - 0x00000000, 0x00000000, 0x01c00080, 0x07f003e0, 0x1ffc0ff8, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_ARROW_UP_FILL - 0x00000000, 0x18a008c0, 0x32881290, 0x24822686, 0x26862482, 0x12903288, 0x08c018a0, 0x00000000, // RAYGUI_ICON_AUDIO - 0x00000000, 0x04800780, 0x004000c0, 0x662000f0, 0x08103c30, 0x130a0e18, 0x0000318e, 0x00000000, // RAYGUI_ICON_FX - 0x00000000, 0x00800000, 0x08880888, 0x2aaa0a8a, 0x0a8a2aaa, 0x08880888, 0x00000080, 0x00000000, // RAYGUI_ICON_WAVE - 0x00000000, 0x00600000, 0x01080090, 0x02040108, 0x42044204, 0x24022402, 0x00001800, 0x00000000, // RAYGUI_ICON_WAVE_SINUS - 0x00000000, 0x07f80000, 0x04080408, 0x04080408, 0x04080408, 0x7c0e0408, 0x00000000, 0x00000000, // RAYGUI_ICON_WAVE_SQUARE - 0x00000000, 0x00000000, 0x00a00040, 0x22084110, 0x08021404, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_WAVE_TRIANGULAR - 0x00000000, 0x00000000, 0x04200000, 0x01800240, 0x02400180, 0x00000420, 0x00000000, 0x00000000, // RAYGUI_ICON_CROSS_SMALL - 0x00000000, 0x18380000, 0x12281428, 0x10a81128, 0x112810a8, 0x14281228, 0x00001838, 0x00000000, // RAYGUI_ICON_PLAYER_PREVIOUS - 0x00000000, 0x18000000, 0x11801600, 0x10181060, 0x10601018, 0x16001180, 0x00001800, 0x00000000, // RAYGUI_ICON_PLAYER_PLAY_BACK - 0x00000000, 0x00180000, 0x01880068, 0x18080608, 0x06081808, 0x00680188, 0x00000018, 0x00000000, // RAYGUI_ICON_PLAYER_PLAY - 0x00000000, 0x1e780000, 0x12481248, 0x12481248, 0x12481248, 0x12481248, 0x00001e78, 0x00000000, // RAYGUI_ICON_PLAYER_PAUSE - 0x00000000, 0x1ff80000, 0x10081008, 0x10081008, 0x10081008, 0x10081008, 0x00001ff8, 0x00000000, // RAYGUI_ICON_PLAYER_STOP - 0x00000000, 0x1c180000, 0x14481428, 0x15081488, 0x14881508, 0x14281448, 0x00001c18, 0x00000000, // RAYGUI_ICON_PLAYER_NEXT - 0x00000000, 0x03c00000, 0x08100420, 0x10081008, 0x10081008, 0x04200810, 0x000003c0, 0x00000000, // RAYGUI_ICON_PLAYER_RECORD - 0x00000000, 0x0c3007e0, 0x13c81818, 0x14281668, 0x14281428, 0x1c381c38, 0x08102244, 0x00000000, // RAYGUI_ICON_MAGNET - 0x07c00000, 0x08200820, 0x3ff80820, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RAYGUI_ICON_LOCK_CLOSE - 0x07c00000, 0x08000800, 0x3ff80800, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // RAYGUI_ICON_LOCK_OPEN - 0x01c00000, 0x0c180770, 0x3086188c, 0x60832082, 0x60034781, 0x30062002, 0x0c18180c, 0x01c00770, // RAYGUI_ICON_CLOCK - 0x0a200000, 0x1b201b20, 0x04200e20, 0x04200420, 0x04700420, 0x0e700e70, 0x0e700e70, 0x04200e70, // RAYGUI_ICON_TOOLS - 0x01800000, 0x3bdc318c, 0x0ff01ff8, 0x7c3e1e78, 0x1e787c3e, 0x1ff80ff0, 0x318c3bdc, 0x00000180, // RAYGUI_ICON_GEAR - 0x01800000, 0x3ffc318c, 0x1c381ff8, 0x781e1818, 0x1818781e, 0x1ff81c38, 0x318c3ffc, 0x00000180, // RAYGUI_ICON_GEAR_BIG - 0x00000000, 0x08080ff8, 0x08081ffc, 0x0aa80aa8, 0x0aa80aa8, 0x0aa80aa8, 0x08080aa8, 0x00000ff8, // RAYGUI_ICON_BIN - 0x00000000, 0x00000000, 0x20043ffc, 0x08043f84, 0x04040f84, 0x04040784, 0x000007fc, 0x00000000, // RAYGUI_ICON_HAND_POINTER - 0x00000000, 0x24400400, 0x00001480, 0x6efe0e00, 0x00000e00, 0x24401480, 0x00000400, 0x00000000, // RAYGUI_ICON_LASER - 0x00000000, 0x03c00000, 0x08300460, 0x11181118, 0x11181118, 0x04600830, 0x000003c0, 0x00000000, // RAYGUI_ICON_COIN - 0x00000000, 0x10880080, 0x06c00810, 0x366c07e0, 0x07e00240, 0x00001768, 0x04200240, 0x00000000, // RAYGUI_ICON_EXPLOSION - 0x00000000, 0x3d280000, 0x2528252c, 0x3d282528, 0x05280528, 0x05e80528, 0x00000000, 0x00000000, // RAYGUI_ICON_1UP - 0x01800000, 0x03c003c0, 0x018003c0, 0x0ff007e0, 0x0bd00bd0, 0x0a500bd0, 0x02400240, 0x02400240, // RAYGUI_ICON_PLAYER - 0x01800000, 0x03c003c0, 0x118013c0, 0x03c81ff8, 0x07c003c8, 0x04400440, 0x0c080478, 0x00000000, // RAYGUI_ICON_PLAYER_JUMP - 0x3ff80000, 0x30183ff8, 0x30183018, 0x3ff83ff8, 0x03000300, 0x03c003c0, 0x03e00300, 0x000003e0, // RAYGUI_ICON_KEY - 0x3ff80000, 0x3ff83ff8, 0x33983ff8, 0x3ff83398, 0x3ff83ff8, 0x00000540, 0x0fe00aa0, 0x00000fe0, // RAYGUI_ICON_DEMON - 0x00000000, 0x0ff00000, 0x20041008, 0x25442004, 0x10082004, 0x06000bf0, 0x00000300, 0x00000000, // RAYGUI_ICON_TEXT_POPUP - 0x00000000, 0x11440000, 0x07f00be8, 0x1c1c0e38, 0x1c1c0c18, 0x07f00e38, 0x11440be8, 0x00000000, // RAYGUI_ICON_GEAR_EX - 0x00000000, 0x20080000, 0x0c601010, 0x07c00fe0, 0x07c007c0, 0x0c600fe0, 0x20081010, 0x00000000, // RAYGUI_ICON_CRACK - 0x00000000, 0x20080000, 0x0c601010, 0x04400fe0, 0x04405554, 0x0c600fe0, 0x20081010, 0x00000000, // RAYGUI_ICON_CRACK_POINTS - 0x00000000, 0x00800080, 0x01c001c0, 0x1ffc3ffe, 0x03e007f0, 0x07f003e0, 0x0c180770, 0x00000808, // RAYGUI_ICON_STAR - 0x0ff00000, 0x08180810, 0x08100818, 0x0a100810, 0x08180810, 0x08100818, 0x08100810, 0x00001ff8, // RAYGUI_ICON_DOOR - 0x0ff00000, 0x08100810, 0x08100810, 0x10100010, 0x4f902010, 0x10102010, 0x08100010, 0x00000ff0, // RAYGUI_ICON_EXIT - 0x00040000, 0x001f000e, 0x0ef40004, 0x12f41284, 0x0ef41214, 0x10040004, 0x7ffc3004, 0x10003000, // RAYGUI_ICON_MODE_2D - 0x78040000, 0x501f600e, 0x0ef44004, 0x12f41284, 0x0ef41284, 0x10140004, 0x7ffc300c, 0x10003000, // RAYGUI_ICON_MODE_3D - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE - 0x7fe00000, 0x5ff87ff0, 0x47fe4ffc, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_TOP - 0x7fe00000, 0x50386030, 0x47fe483c, 0x443e443e, 0x443e443e, 0x241e75fe, 0x0c06140e, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_LEFT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x47fe47fe, 0x47fe47fe, 0x27fe77fe, 0x0ffe17fe, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_FRONT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x3ff27fe2, 0x0ffe1ffa, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_BOTTOM - 0x7fe00000, 0x70286030, 0x7ffe7804, 0x7c227c02, 0x7c227c22, 0x3c127de2, 0x0c061c0a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_RIGHT - 0x7fe00000, 0x7fe87ff0, 0x7ffe7fe4, 0x7fe27fe2, 0x7fe27fe2, 0x24127fe2, 0x0c06140a, 0x000007fe, // RAYGUI_ICON_CUBE_FACE_BACK - 0x00000000, 0x2a0233fe, 0x22022602, 0x22022202, 0x2a022602, 0x00a033fe, 0x02080110, 0x00000000, // RAYGUI_ICON_CAMERA - 0x00000000, 0x200c3ffc, 0x000c000c, 0x3ffc000c, 0x30003000, 0x30003000, 0x3ffc3004, 0x00000000, // RAYGUI_ICON_SPECIAL - 0x00000000, 0x0022003e, 0x012201e2, 0x0100013e, 0x01000100, 0x79000100, 0x4f004900, 0x00007800, // RAYGUI_ICON_LINK_NET - 0x00000000, 0x44007c00, 0x45004600, 0x00627cbe, 0x00620022, 0x45007cbe, 0x44004600, 0x00007c00, // RAYGUI_ICON_LINK_BOXES - 0x00000000, 0x0044007c, 0x0010007c, 0x3f100010, 0x3f1021f0, 0x3f100010, 0x3f0021f0, 0x00000000, // RAYGUI_ICON_LINK_MULTI - 0x00000000, 0x0044007c, 0x00440044, 0x0010007c, 0x00100010, 0x44107c10, 0x440047f0, 0x00007c00, // RAYGUI_ICON_LINK - 0x00000000, 0x0044007c, 0x00440044, 0x0000007c, 0x00000010, 0x44007c10, 0x44004550, 0x00007c00, // RAYGUI_ICON_LINK_BROKE - 0x02a00000, 0x22a43ffc, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // RAYGUI_ICON_TEXT_NOTES - 0x3ffc0000, 0x20042004, 0x245e27c4, 0x27c42444, 0x2004201e, 0x201e2004, 0x20042004, 0x00003ffc, // RAYGUI_ICON_NOTEBOOK - 0x00000000, 0x07e00000, 0x04200420, 0x24243ffc, 0x24242424, 0x24242424, 0x3ffc2424, 0x00000000, // RAYGUI_ICON_SUITCASE - 0x00000000, 0x0fe00000, 0x08200820, 0x40047ffc, 0x7ffc5554, 0x40045554, 0x7ffc4004, 0x00000000, // RAYGUI_ICON_SUITCASE_ZIP - 0x00000000, 0x20043ffc, 0x3ffc2004, 0x13c81008, 0x100813c8, 0x10081008, 0x1ff81008, 0x00000000, // RAYGUI_ICON_MAILBOX - 0x00000000, 0x40027ffe, 0x5ffa5ffa, 0x5ffa5ffa, 0x40025ffa, 0x03c07ffe, 0x1ff81ff8, 0x00000000, // RAYGUI_ICON_MONITOR - 0x0ff00000, 0x6bfe7ffe, 0x7ffe7ffe, 0x68167ffe, 0x08106816, 0x08100810, 0x0ff00810, 0x00000000, // RAYGUI_ICON_PRINTER - 0x3ff80000, 0xfffe2008, 0x870a8002, 0x904a888a, 0x904a904a, 0x870a888a, 0xfffe8002, 0x00000000, // RAYGUI_ICON_PHOTO_CAMERA - 0x0fc00000, 0xfcfe0cd8, 0x8002fffe, 0x84428382, 0x84428442, 0x80028382, 0xfffe8002, 0x00000000, // RAYGUI_ICON_PHOTO_CAMERA_FLASH - 0x00000000, 0x02400180, 0x08100420, 0x20041008, 0x23c42004, 0x22442244, 0x3ffc2244, 0x00000000, // RAYGUI_ICON_HOUSE - 0x00000000, 0x1c700000, 0x3ff83ef8, 0x3ff83ff8, 0x0fe01ff0, 0x038007c0, 0x00000100, 0x00000000, // RAYGUI_ICON_HEART - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0xe000c000, // RAYGUI_ICON_CORNER - 0x00000000, 0x14001c00, 0x15c01400, 0x15401540, 0x155c1540, 0x15541554, 0x1ddc1554, 0x00000000, // RAYGUI_ICON_VERTICAL_BARS - 0x00000000, 0x03000300, 0x1b001b00, 0x1b601b60, 0x1b6c1b60, 0x1b6c1b6c, 0x1b6c1b6c, 0x00000000, // RAYGUI_ICON_VERTICAL_BARS_FILL - 0x00000000, 0x00000000, 0x403e7ffe, 0x7ffe403e, 0x7ffe0000, 0x43fe43fe, 0x00007ffe, 0x00000000, // RAYGUI_ICON_LIFE_BARS - 0x7ffc0000, 0x43844004, 0x43844284, 0x43844004, 0x42844284, 0x42844284, 0x40044384, 0x00007ffc, // RAYGUI_ICON_INFO - 0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // RAYGUI_ICON_CROSSLINE - 0x00000000, 0x1ff01ff0, 0x18301830, 0x1f001830, 0x03001f00, 0x00000300, 0x03000300, 0x00000000, // RAYGUI_ICON_HELP - 0x3ff00000, 0x2abc3550, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x00003ffc, // RAYGUI_ICON_FILETYPE_ALPHA - 0x3ff00000, 0x201c2010, 0x22442184, 0x28142424, 0x29942814, 0x2ff42994, 0x20042004, 0x00003ffc, // RAYGUI_ICON_FILETYPE_HOME - 0x07fe0000, 0x04020402, 0x7fe20402, 0x44224422, 0x44224422, 0x402047fe, 0x40204020, 0x00007fe0, // RAYGUI_ICON_LAYERS_VISIBLE - 0x07fe0000, 0x04020402, 0x7c020402, 0x44024402, 0x44024402, 0x402047fe, 0x40204020, 0x00007fe0, // RAYGUI_ICON_LAYERS - 0x00000000, 0x40027ffe, 0x7ffe4002, 0x40024002, 0x40024002, 0x40024002, 0x7ffe4002, 0x00000000, // RAYGUI_ICON_WINDOW - 0x09100000, 0x09f00910, 0x09100910, 0x00000910, 0x24a2779e, 0x27a224a2, 0x709e20a2, 0x00000000, // RAYGUI_ICON_HIDPI - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_200 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_201 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_202 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_203 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_204 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_205 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_206 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_207 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_208 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_209 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_210 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_211 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_212 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_213 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_214 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_215 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_216 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_217 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_218 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_219 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_220 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_221 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_222 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_223 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_224 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_225 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_226 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_227 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_228 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_229 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_230 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_231 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_232 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_233 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_234 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_235 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_236 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_237 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_238 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_239 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_240 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_241 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_242 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_243 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_244 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_245 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_246 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_247 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_248 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_249 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_250 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_251 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_252 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_253 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_254 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RAYGUI_ICON_255 +static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS * RAYGUI_ICON_DATA_ELEMENTS] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_NONE + 0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // ICON_FOLDER_FILE_OPEN + 0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // ICON_FILE_SAVE_CLASSIC + 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024002, 0x44424282, 0x793e4102, 0x00000100, // ICON_FOLDER_OPEN + 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024102, 0x44424102, 0x793e4282, 0x00000000, // ICON_FOLDER_SAVE + 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x24442284, 0x21042104, 0x20042104, 0x00003ffc, // ICON_FILE_OPEN + 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x21042104, 0x22842444, 0x20042104, 0x00003ffc, // ICON_FILE_SAVE + 0x3ff00000, 0x201c2010, 0x00042004, 0x20041004, 0x20844784, 0x00841384, 0x20042784, 0x00003ffc, // ICON_FILE_EXPORT + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x22042204, 0x22042f84, 0x20042204, 0x00003ffc, // ICON_FILE_ADD + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x25042884, 0x25042204, 0x20042884, 0x00003ffc, // ICON_FILE_DELETE + 0x3ff00000, 0x201c2010, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // ICON_FILETYPE_TEXT + 0x3ff00000, 0x201c2010, 0x27042004, 0x244424c4, 0x26442444, 0x20642664, 0x20042004, 0x00003ffc, // ICON_FILETYPE_AUDIO + 0x3ff00000, 0x201c2010, 0x26042604, 0x20042004, 0x35442884, 0x2414222c, 0x20042004, 0x00003ffc, // ICON_FILETYPE_IMAGE + 0x3ff00000, 0x201c2010, 0x20c42004, 0x22442144, 0x22442444, 0x20c42144, 0x20042004, 0x00003ffc, // ICON_FILETYPE_PLAY + 0x3ff00000, 0x3ffc2ff0, 0x3f3c2ff4, 0x3dbc2eb4, 0x3dbc2bb4, 0x3f3c2eb4, 0x3ffc2ff4, 0x00002ff4, // ICON_FILETYPE_VIDEO + 0x3ff00000, 0x201c2010, 0x21842184, 0x21842004, 0x21842184, 0x21842184, 0x20042184, 0x00003ffc, // ICON_FILETYPE_INFO + 0x0ff00000, 0x381c0810, 0x28042804, 0x28042804, 0x28042804, 0x28042804, 0x20102ffc, 0x00003ff0, // ICON_FILE_COPY + 0x00000000, 0x701c0000, 0x079c1e14, 0x55a000f0, 0x079c00f0, 0x701c1e14, 0x00000000, 0x00000000, // ICON_FILE_CUT + 0x01c00000, 0x13e41bec, 0x3f841004, 0x204420c4, 0x20442044, 0x20442044, 0x207c2044, 0x00003fc0, // ICON_FILE_PASTE + 0x00000000, 0x3aa00fe0, 0x2abc2aa0, 0x2aa42aa4, 0x20042aa4, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_CURSOR_HAND + 0x00000000, 0x003c000c, 0x030800c8, 0x30100c10, 0x10202020, 0x04400840, 0x01800280, 0x00000000, // ICON_CURSOR_POINTER + 0x00000000, 0x00180000, 0x01f00078, 0x03e007f0, 0x07c003e0, 0x04000e40, 0x00000000, 0x00000000, // ICON_CURSOR_CLASSIC + 0x00000000, 0x04000000, 0x11000a00, 0x04400a80, 0x01100220, 0x00580088, 0x00000038, 0x00000000, // ICON_PENCIL + 0x04000000, 0x15000a00, 0x50402880, 0x14102820, 0x05040a08, 0x015c028c, 0x007c00bc, 0x00000000, // ICON_PENCIL_BIG + 0x01c00000, 0x01400140, 0x01400140, 0x0ff80140, 0x0ff80808, 0x0aa80808, 0x0aa80aa8, 0x00000ff8, // ICON_BRUSH_CLASSIC + 0x1ffc0000, 0x5ffc7ffe, 0x40004000, 0x00807f80, 0x01c001c0, 0x01c001c0, 0x01c001c0, 0x00000080, // ICON_BRUSH_PAINTER + 0x00000000, 0x00800000, 0x01c00080, 0x03e001c0, 0x07f003e0, 0x036006f0, 0x000001c0, 0x00000000, // ICON_WATER_DROP + 0x00000000, 0x3e003800, 0x1f803f80, 0x0c201e40, 0x02080c10, 0x00840104, 0x00380044, 0x00000000, // ICON_COLOR_PICKER + 0x00000000, 0x07800300, 0x1fe00fc0, 0x3f883fd0, 0x0e021f04, 0x02040402, 0x00f00108, 0x00000000, // ICON_RUBBER + 0x00c00000, 0x02800140, 0x08200440, 0x20081010, 0x2ffe3004, 0x03f807fc, 0x00e001f0, 0x00000040, // ICON_COLOR_BUCKET + 0x00000000, 0x21843ffc, 0x01800180, 0x01800180, 0x01800180, 0x01800180, 0x03c00180, 0x00000000, // ICON_TEXT_T + 0x00800000, 0x01400180, 0x06200340, 0x0c100620, 0x1ff80c10, 0x380c1808, 0x70067004, 0x0000f80f, // ICON_TEXT_A + 0x78000000, 0x50004000, 0x00004800, 0x03c003c0, 0x03c003c0, 0x00100000, 0x0002000a, 0x0000000e, // ICON_SCALE + 0x75560000, 0x5e004002, 0x54001002, 0x41001202, 0x408200fe, 0x40820082, 0x40820082, 0x00006afe, // ICON_RESIZE + 0x00000000, 0x3f003f00, 0x3f003f00, 0x3f003f00, 0x00400080, 0x001c0020, 0x001c001c, 0x00000000, // ICON_FILTER_POINT + 0x6d800000, 0x00004080, 0x40804080, 0x40800000, 0x00406d80, 0x001c0020, 0x001c001c, 0x00000000, // ICON_FILTER_BILINEAR + 0x40080000, 0x1ffe2008, 0x14081008, 0x11081208, 0x10481088, 0x10081028, 0x10047ff8, 0x00001002, // ICON_CROP + 0x00100000, 0x3ffc0010, 0x2ab03550, 0x22b02550, 0x20b02150, 0x20302050, 0x2000fff0, 0x00002000, // ICON_CROP_ALPHA + 0x40000000, 0x1ff82000, 0x04082808, 0x01082208, 0x00482088, 0x00182028, 0x35542008, 0x00000002, // ICON_SQUARE_TOGGLE + 0x00000000, 0x02800280, 0x06c006c0, 0x0ea00ee0, 0x1e901eb0, 0x3e883e98, 0x7efc7e8c, 0x00000000, // ICON_SYMMETRY + 0x01000000, 0x05600100, 0x1d480d50, 0x7d423d44, 0x3d447d42, 0x0d501d48, 0x01000560, 0x00000100, // ICON_SYMMETRY_HORIZONTAL + 0x01800000, 0x04200240, 0x10080810, 0x00001ff8, 0x00007ffe, 0x0ff01ff8, 0x03c007e0, 0x00000180, // ICON_SYMMETRY_VERTICAL + 0x00000000, 0x010800f0, 0x02040204, 0x02040204, 0x07f00308, 0x1c000e00, 0x30003800, 0x00000000, // ICON_LENS + 0x00000000, 0x061803f0, 0x08240c0c, 0x08040814, 0x0c0c0804, 0x23f01618, 0x18002400, 0x00000000, // ICON_LENS_BIG + 0x00000000, 0x00000000, 0x1c7007c0, 0x638e3398, 0x1c703398, 0x000007c0, 0x00000000, 0x00000000, // ICON_EYE_ON + 0x00000000, 0x10002000, 0x04700fc0, 0x610e3218, 0x1c703098, 0x001007a0, 0x00000008, 0x00000000, // ICON_EYE_OFF + 0x00000000, 0x00007ffc, 0x40047ffc, 0x10102008, 0x04400820, 0x02800280, 0x02800280, 0x00000100, // ICON_FILTER_TOP + 0x00000000, 0x40027ffe, 0x10082004, 0x04200810, 0x02400240, 0x02400240, 0x01400240, 0x000000c0, // ICON_FILTER + 0x00800000, 0x00800080, 0x00000080, 0x3c9e0000, 0x00000000, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_POINT + 0x00800000, 0x00800080, 0x00800080, 0x3f7e01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_SMALL + 0x00800000, 0x00800080, 0x03e00080, 0x3e3e0220, 0x03e00220, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_BIG + 0x01000000, 0x04400280, 0x01000100, 0x43842008, 0x43849ab2, 0x01002008, 0x04400100, 0x01000280, // ICON_TARGET_MOVE + 0x01000000, 0x04400280, 0x01000100, 0x41042108, 0x41049ff2, 0x01002108, 0x04400100, 0x01000280, // ICON_CURSOR_MOVE + 0x781e0000, 0x500a4002, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x4002500a, 0x0000781e, // ICON_CURSOR_SCALE + 0x00000000, 0x20003c00, 0x24002800, 0x01000200, 0x00400080, 0x00140024, 0x003c0004, 0x00000000, // ICON_CURSOR_SCALE_RIGHT + 0x00000000, 0x0004003c, 0x00240014, 0x00800040, 0x02000100, 0x28002400, 0x3c002000, 0x00000000, // ICON_CURSOR_SCALE_LEFT + 0x00000000, 0x00100020, 0x10101fc8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // ICON_UNDO + 0x00000000, 0x08000400, 0x080813f8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // ICON_REDO + 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3f902020, 0x00400020, 0x00000000, // ICON_REREDO + 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3fc82010, 0x00200010, 0x00000000, // ICON_MUTATE + 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18101020, 0x00100fc8, 0x00000020, // ICON_ROTATE + 0x00000000, 0x04000200, 0x240429fc, 0x20042204, 0x20442004, 0x3f942024, 0x00400020, 0x00000000, // ICON_REPEAT + 0x00000000, 0x20001000, 0x22104c0e, 0x00801120, 0x11200040, 0x4c0e2210, 0x10002000, 0x00000000, // ICON_SHUFFLE + 0x7ffe0000, 0x50024002, 0x44024802, 0x41024202, 0x40424082, 0x40124022, 0x4002400a, 0x00007ffe, // ICON_EMPTYBOX + 0x00800000, 0x03e00080, 0x08080490, 0x3c9e0808, 0x08080808, 0x03e00490, 0x00800080, 0x00000000, // ICON_TARGET + 0x00800000, 0x00800080, 0x00800080, 0x3ffe01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_SMALL_FILL + 0x00800000, 0x00800080, 0x03e00080, 0x3ffe03e0, 0x03e003e0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_BIG_FILL + 0x01000000, 0x07c00380, 0x01000100, 0x638c2008, 0x638cfbbe, 0x01002008, 0x07c00100, 0x01000380, // ICON_TARGET_MOVE_FILL + 0x01000000, 0x07c00380, 0x01000100, 0x610c2108, 0x610cfffe, 0x01002108, 0x07c00100, 0x01000380, // ICON_CURSOR_MOVE_FILL + 0x781e0000, 0x6006700e, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x700e6006, 0x0000781e, // ICON_CURSOR_SCALE_FILL + 0x00000000, 0x38003c00, 0x24003000, 0x01000200, 0x00400080, 0x000c0024, 0x003c001c, 0x00000000, // ICON_CURSOR_SCALE_RIGHT_FILL + 0x00000000, 0x001c003c, 0x0024000c, 0x00800040, 0x02000100, 0x30002400, 0x3c003800, 0x00000000, // ICON_CURSOR_SCALE_LEFT_FILL + 0x00000000, 0x00300020, 0x10301ff8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // ICON_UNDO_FILL + 0x00000000, 0x0c000400, 0x0c081ff8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // ICON_REDO_FILL + 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3ff02060, 0x00400060, 0x00000000, // ICON_REREDO_FILL + 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3ff82030, 0x00200030, 0x00000000, // ICON_MUTATE_FILL + 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18301020, 0x00300ff8, 0x00000020, // ICON_ROTATE_FILL + 0x00000000, 0x06000200, 0x26042ffc, 0x20042204, 0x20442004, 0x3ff42064, 0x00400060, 0x00000000, // ICON_REPEAT_FILL + 0x00000000, 0x30001000, 0x32107c0e, 0x00801120, 0x11200040, 0x7c0e3210, 0x10003000, 0x00000000, // ICON_SHUFFLE_FILL + 0x00000000, 0x30043ffc, 0x24042804, 0x21042204, 0x20442084, 0x20142024, 0x3ffc200c, 0x00000000, // ICON_EMPTYBOX_SMALL + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX + 0x00000000, 0x23c43ffc, 0x23c423c4, 0x200423c4, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP + 0x00000000, 0x3e043ffc, 0x3e043e04, 0x20043e04, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x3e043e04, 0x3e043e04, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x3e042004, 0x3e043e04, 0x3ffc3e04, 0x00000000, // ICON_BOX_BOTTOM_RIGHT + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x23c42004, 0x23c423c4, 0x3ffc23c4, 0x00000000, // ICON_BOX_BOTTOM + 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x207c2004, 0x207c207c, 0x3ffc207c, 0x00000000, // ICON_BOX_BOTTOM_LEFT + 0x00000000, 0x20043ffc, 0x20042004, 0x207c207c, 0x207c207c, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_LEFT + 0x00000000, 0x207c3ffc, 0x207c207c, 0x2004207c, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP_LEFT + 0x00000000, 0x20043ffc, 0x20042004, 0x23c423c4, 0x23c423c4, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_CENTER + 0x7ffe0000, 0x40024002, 0x47e24182, 0x4ff247e2, 0x47e24ff2, 0x418247e2, 0x40024002, 0x00007ffe, // ICON_BOX_CIRCLE_MASK + 0x7fff0000, 0x40014001, 0x40014001, 0x49555ddd, 0x4945495d, 0x400149c5, 0x40014001, 0x00007fff, // ICON_POT + 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x404e40ce, 0x48125432, 0x4006540e, 0x00007ffe, // ICON_ALPHA_MULTIPLY + 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x5c4e40ce, 0x44124432, 0x40065c0e, 0x00007ffe, // ICON_ALPHA_CLEAR + 0x7ffe0000, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x00007ffe, // ICON_DITHERING + 0x07fe0000, 0x1ffa0002, 0x7fea000a, 0x402a402a, 0x5b2a512a, 0x5128552a, 0x40205128, 0x00007fe0, // ICON_MIPMAPS + 0x00000000, 0x1ff80000, 0x12481248, 0x12481ff8, 0x1ff81248, 0x12481248, 0x00001ff8, 0x00000000, // ICON_BOX_GRID + 0x12480000, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x00001248, // ICON_GRID + 0x00000000, 0x1c380000, 0x1c3817e8, 0x08100810, 0x08100810, 0x17e81c38, 0x00001c38, 0x00000000, // ICON_BOX_CORNERS_SMALL + 0x700e0000, 0x700e5ffa, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x5ffa700e, 0x0000700e, // ICON_BOX_CORNERS_BIG + 0x3f7e0000, 0x21422142, 0x21422142, 0x00003f7e, 0x21423f7e, 0x21422142, 0x3f7e2142, 0x00000000, // ICON_FOUR_BOXES + 0x00000000, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x00000000, // ICON_GRID_FILL + 0x7ffe0000, 0x7ffe7ffe, 0x77fe7000, 0x77fe77fe, 0x777e7700, 0x777e777e, 0x777e777e, 0x0000777e, // ICON_BOX_MULTISIZE + 0x781e0000, 0x40024002, 0x00004002, 0x01800000, 0x00000180, 0x40020000, 0x40024002, 0x0000781e, // ICON_ZOOM_SMALL + 0x781e0000, 0x40024002, 0x00004002, 0x03c003c0, 0x03c003c0, 0x40020000, 0x40024002, 0x0000781e, // ICON_ZOOM_MEDIUM + 0x781e0000, 0x40024002, 0x07e04002, 0x07e007e0, 0x07e007e0, 0x400207e0, 0x40024002, 0x0000781e, // ICON_ZOOM_BIG + 0x781e0000, 0x5ffa4002, 0x1ff85ffa, 0x1ff81ff8, 0x1ff81ff8, 0x5ffa1ff8, 0x40025ffa, 0x0000781e, // ICON_ZOOM_ALL + 0x00000000, 0x2004381c, 0x00002004, 0x00000000, 0x00000000, 0x20040000, 0x381c2004, 0x00000000, // ICON_ZOOM_CENTER + 0x00000000, 0x1db80000, 0x10081008, 0x10080000, 0x00001008, 0x10081008, 0x00001db8, 0x00000000, // ICON_BOX_DOTS_SMALL + 0x35560000, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x35562002, 0x00000000, // ICON_BOX_DOTS_BIG + 0x7ffe0000, 0x40024002, 0x48124ff2, 0x49924812, 0x48124992, 0x4ff24812, 0x40024002, 0x00007ffe, // ICON_BOX_CONCENTRIC + 0x00000000, 0x10841ffc, 0x10841084, 0x1ffc1084, 0x10841084, 0x10841084, 0x00001ffc, 0x00000000, // ICON_BOX_GRID_BIG + 0x00000000, 0x00000000, 0x10000000, 0x04000800, 0x01040200, 0x00500088, 0x00000020, 0x00000000, // ICON_OK_TICK + 0x00000000, 0x10080000, 0x04200810, 0x01800240, 0x02400180, 0x08100420, 0x00001008, 0x00000000, // ICON_CROSS + 0x00000000, 0x02000000, 0x00800100, 0x00200040, 0x00200010, 0x00800040, 0x02000100, 0x00000000, // ICON_ARROW_LEFT + 0x00000000, 0x00400000, 0x01000080, 0x04000200, 0x04000800, 0x01000200, 0x00400080, 0x00000000, // ICON_ARROW_RIGHT + 0x00000000, 0x00000000, 0x00000000, 0x08081004, 0x02200410, 0x00800140, 0x00000000, 0x00000000, // ICON_ARROW_DOWN + 0x00000000, 0x00000000, 0x01400080, 0x04100220, 0x10040808, 0x00000000, 0x00000000, 0x00000000, // ICON_ARROW_UP + 0x00000000, 0x02000000, 0x03800300, 0x03e003c0, 0x03e003f0, 0x038003c0, 0x02000300, 0x00000000, // ICON_ARROW_LEFT_FILL + 0x00000000, 0x00400000, 0x01c000c0, 0x07c003c0, 0x07c00fc0, 0x01c003c0, 0x004000c0, 0x00000000, // ICON_ARROW_RIGHT_FILL + 0x00000000, 0x00000000, 0x00000000, 0x0ff81ffc, 0x03e007f0, 0x008001c0, 0x00000000, 0x00000000, // ICON_ARROW_DOWN_FILL + 0x00000000, 0x00000000, 0x01c00080, 0x07f003e0, 0x1ffc0ff8, 0x00000000, 0x00000000, 0x00000000, // ICON_ARROW_UP_FILL + 0x00000000, 0x18a008c0, 0x32881290, 0x24822686, 0x26862482, 0x12903288, 0x08c018a0, 0x00000000, // ICON_AUDIO + 0x00000000, 0x04800780, 0x004000c0, 0x662000f0, 0x08103c30, 0x130a0e18, 0x0000318e, 0x00000000, // ICON_FX + 0x00000000, 0x00800000, 0x08880888, 0x2aaa0a8a, 0x0a8a2aaa, 0x08880888, 0x00000080, 0x00000000, // ICON_WAVE + 0x00000000, 0x00600000, 0x01080090, 0x02040108, 0x42044204, 0x24022402, 0x00001800, 0x00000000, // ICON_WAVE_SINUS + 0x00000000, 0x07f80000, 0x04080408, 0x04080408, 0x04080408, 0x7c0e0408, 0x00000000, 0x00000000, // ICON_WAVE_SQUARE + 0x00000000, 0x00000000, 0x00a00040, 0x22084110, 0x08021404, 0x00000000, 0x00000000, 0x00000000, // ICON_WAVE_TRIANGULAR + 0x00000000, 0x00000000, 0x04200000, 0x01800240, 0x02400180, 0x00000420, 0x00000000, 0x00000000, // ICON_CROSS_SMALL + 0x00000000, 0x18380000, 0x12281428, 0x10a81128, 0x112810a8, 0x14281228, 0x00001838, 0x00000000, // ICON_PLAYER_PREVIOUS + 0x00000000, 0x18000000, 0x11801600, 0x10181060, 0x10601018, 0x16001180, 0x00001800, 0x00000000, // ICON_PLAYER_PLAY_BACK + 0x00000000, 0x00180000, 0x01880068, 0x18080608, 0x06081808, 0x00680188, 0x00000018, 0x00000000, // ICON_PLAYER_PLAY + 0x00000000, 0x1e780000, 0x12481248, 0x12481248, 0x12481248, 0x12481248, 0x00001e78, 0x00000000, // ICON_PLAYER_PAUSE + 0x00000000, 0x1ff80000, 0x10081008, 0x10081008, 0x10081008, 0x10081008, 0x00001ff8, 0x00000000, // ICON_PLAYER_STOP + 0x00000000, 0x1c180000, 0x14481428, 0x15081488, 0x14881508, 0x14281448, 0x00001c18, 0x00000000, // ICON_PLAYER_NEXT + 0x00000000, 0x03c00000, 0x08100420, 0x10081008, 0x10081008, 0x04200810, 0x000003c0, 0x00000000, // ICON_PLAYER_RECORD + 0x00000000, 0x0c3007e0, 0x13c81818, 0x14281668, 0x14281428, 0x1c381c38, 0x08102244, 0x00000000, // ICON_MAGNET + 0x07c00000, 0x08200820, 0x3ff80820, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // ICON_LOCK_CLOSE + 0x07c00000, 0x08000800, 0x3ff80800, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // ICON_LOCK_OPEN + 0x01c00000, 0x0c180770, 0x3086188c, 0x60832082, 0x60034781, 0x30062002, 0x0c18180c, 0x01c00770, // ICON_CLOCK + 0x0a200000, 0x1b201b20, 0x04200e20, 0x04200420, 0x04700420, 0x0e700e70, 0x0e700e70, 0x04200e70, // ICON_TOOLS + 0x01800000, 0x3bdc318c, 0x0ff01ff8, 0x7c3e1e78, 0x1e787c3e, 0x1ff80ff0, 0x318c3bdc, 0x00000180, // ICON_GEAR + 0x01800000, 0x3ffc318c, 0x1c381ff8, 0x781e1818, 0x1818781e, 0x1ff81c38, 0x318c3ffc, 0x00000180, // ICON_GEAR_BIG + 0x00000000, 0x08080ff8, 0x08081ffc, 0x0aa80aa8, 0x0aa80aa8, 0x0aa80aa8, 0x08080aa8, 0x00000ff8, // ICON_BIN + 0x00000000, 0x00000000, 0x20043ffc, 0x08043f84, 0x04040f84, 0x04040784, 0x000007fc, 0x00000000, // ICON_HAND_POINTER + 0x00000000, 0x24400400, 0x00001480, 0x6efe0e00, 0x00000e00, 0x24401480, 0x00000400, 0x00000000, // ICON_LASER + 0x00000000, 0x03c00000, 0x08300460, 0x11181118, 0x11181118, 0x04600830, 0x000003c0, 0x00000000, // ICON_COIN + 0x00000000, 0x10880080, 0x06c00810, 0x366c07e0, 0x07e00240, 0x00001768, 0x04200240, 0x00000000, // ICON_EXPLOSION + 0x00000000, 0x3d280000, 0x2528252c, 0x3d282528, 0x05280528, 0x05e80528, 0x00000000, 0x00000000, // ICON_1UP + 0x01800000, 0x03c003c0, 0x018003c0, 0x0ff007e0, 0x0bd00bd0, 0x0a500bd0, 0x02400240, 0x02400240, // ICON_PLAYER + 0x01800000, 0x03c003c0, 0x118013c0, 0x03c81ff8, 0x07c003c8, 0x04400440, 0x0c080478, 0x00000000, // ICON_PLAYER_JUMP + 0x3ff80000, 0x30183ff8, 0x30183018, 0x3ff83ff8, 0x03000300, 0x03c003c0, 0x03e00300, 0x000003e0, // ICON_KEY + 0x3ff80000, 0x3ff83ff8, 0x33983ff8, 0x3ff83398, 0x3ff83ff8, 0x00000540, 0x0fe00aa0, 0x00000fe0, // ICON_DEMON + 0x00000000, 0x0ff00000, 0x20041008, 0x25442004, 0x10082004, 0x06000bf0, 0x00000300, 0x00000000, // ICON_TEXT_POPUP + 0x00000000, 0x11440000, 0x07f00be8, 0x1c1c0e38, 0x1c1c0c18, 0x07f00e38, 0x11440be8, 0x00000000, // ICON_GEAR_EX + 0x00000000, 0x20080000, 0x0c601010, 0x07c00fe0, 0x07c007c0, 0x0c600fe0, 0x20081010, 0x00000000, // ICON_CRACK + 0x00000000, 0x20080000, 0x0c601010, 0x04400fe0, 0x04405554, 0x0c600fe0, 0x20081010, 0x00000000, // ICON_CRACK_POINTS + 0x00000000, 0x00800080, 0x01c001c0, 0x1ffc3ffe, 0x03e007f0, 0x07f003e0, 0x0c180770, 0x00000808, // ICON_STAR + 0x0ff00000, 0x08180810, 0x08100818, 0x0a100810, 0x08180810, 0x08100818, 0x08100810, 0x00001ff8, // ICON_DOOR + 0x0ff00000, 0x08100810, 0x08100810, 0x10100010, 0x4f902010, 0x10102010, 0x08100010, 0x00000ff0, // ICON_EXIT + 0x00040000, 0x001f000e, 0x0ef40004, 0x12f41284, 0x0ef41214, 0x10040004, 0x7ffc3004, 0x10003000, // ICON_MODE_2D + 0x78040000, 0x501f600e, 0x0ef44004, 0x12f41284, 0x0ef41284, 0x10140004, 0x7ffc300c, 0x10003000, // ICON_MODE_3D + 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // ICON_CUBE + 0x7fe00000, 0x5ff87ff0, 0x47fe4ffc, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // ICON_CUBE_FACE_TOP + 0x7fe00000, 0x50386030, 0x47fe483c, 0x443e443e, 0x443e443e, 0x241e75fe, 0x0c06140e, 0x000007fe, // ICON_CUBE_FACE_LEFT + 0x7fe00000, 0x50286030, 0x47fe4804, 0x47fe47fe, 0x47fe47fe, 0x27fe77fe, 0x0ffe17fe, 0x000007fe, // ICON_CUBE_FACE_FRONT + 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x3ff27fe2, 0x0ffe1ffa, 0x000007fe, // ICON_CUBE_FACE_BOTTOM + 0x7fe00000, 0x70286030, 0x7ffe7804, 0x7c227c02, 0x7c227c22, 0x3c127de2, 0x0c061c0a, 0x000007fe, // ICON_CUBE_FACE_RIGHT + 0x7fe00000, 0x7fe87ff0, 0x7ffe7fe4, 0x7fe27fe2, 0x7fe27fe2, 0x24127fe2, 0x0c06140a, 0x000007fe, // ICON_CUBE_FACE_BACK + 0x00000000, 0x2a0233fe, 0x22022602, 0x22022202, 0x2a022602, 0x00a033fe, 0x02080110, 0x00000000, // ICON_CAMERA + 0x00000000, 0x200c3ffc, 0x000c000c, 0x3ffc000c, 0x30003000, 0x30003000, 0x3ffc3004, 0x00000000, // ICON_SPECIAL + 0x00000000, 0x0022003e, 0x012201e2, 0x0100013e, 0x01000100, 0x79000100, 0x4f004900, 0x00007800, // ICON_LINK_NET + 0x00000000, 0x44007c00, 0x45004600, 0x00627cbe, 0x00620022, 0x45007cbe, 0x44004600, 0x00007c00, // ICON_LINK_BOXES + 0x00000000, 0x0044007c, 0x0010007c, 0x3f100010, 0x3f1021f0, 0x3f100010, 0x3f0021f0, 0x00000000, // ICON_LINK_MULTI + 0x00000000, 0x0044007c, 0x00440044, 0x0010007c, 0x00100010, 0x44107c10, 0x440047f0, 0x00007c00, // ICON_LINK + 0x00000000, 0x0044007c, 0x00440044, 0x0000007c, 0x00000010, 0x44007c10, 0x44004550, 0x00007c00, // ICON_LINK_BROKE + 0x02a00000, 0x22a43ffc, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // ICON_TEXT_NOTES + 0x3ffc0000, 0x20042004, 0x245e27c4, 0x27c42444, 0x2004201e, 0x201e2004, 0x20042004, 0x00003ffc, // ICON_NOTEBOOK + 0x00000000, 0x07e00000, 0x04200420, 0x24243ffc, 0x24242424, 0x24242424, 0x3ffc2424, 0x00000000, // ICON_SUITCASE + 0x00000000, 0x0fe00000, 0x08200820, 0x40047ffc, 0x7ffc5554, 0x40045554, 0x7ffc4004, 0x00000000, // ICON_SUITCASE_ZIP + 0x00000000, 0x20043ffc, 0x3ffc2004, 0x13c81008, 0x100813c8, 0x10081008, 0x1ff81008, 0x00000000, // ICON_MAILBOX + 0x00000000, 0x40027ffe, 0x5ffa5ffa, 0x5ffa5ffa, 0x40025ffa, 0x03c07ffe, 0x1ff81ff8, 0x00000000, // ICON_MONITOR + 0x0ff00000, 0x6bfe7ffe, 0x7ffe7ffe, 0x68167ffe, 0x08106816, 0x08100810, 0x0ff00810, 0x00000000, // ICON_PRINTER + 0x3ff80000, 0xfffe2008, 0x870a8002, 0x904a888a, 0x904a904a, 0x870a888a, 0xfffe8002, 0x00000000, // ICON_PHOTO_CAMERA + 0x0fc00000, 0xfcfe0cd8, 0x8002fffe, 0x84428382, 0x84428442, 0x80028382, 0xfffe8002, 0x00000000, // ICON_PHOTO_CAMERA_FLASH + 0x00000000, 0x02400180, 0x08100420, 0x20041008, 0x23c42004, 0x22442244, 0x3ffc2244, 0x00000000, // ICON_HOUSE + 0x00000000, 0x1c700000, 0x3ff83ef8, 0x3ff83ff8, 0x0fe01ff0, 0x038007c0, 0x00000100, 0x00000000, // ICON_HEART + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0xe000c000, // ICON_CORNER + 0x00000000, 0x14001c00, 0x15c01400, 0x15401540, 0x155c1540, 0x15541554, 0x1ddc1554, 0x00000000, // ICON_VERTICAL_BARS + 0x00000000, 0x03000300, 0x1b001b00, 0x1b601b60, 0x1b6c1b60, 0x1b6c1b6c, 0x1b6c1b6c, 0x00000000, // ICON_VERTICAL_BARS_FILL + 0x00000000, 0x00000000, 0x403e7ffe, 0x7ffe403e, 0x7ffe0000, 0x43fe43fe, 0x00007ffe, 0x00000000, // ICON_LIFE_BARS + 0x7ffc0000, 0x43844004, 0x43844284, 0x43844004, 0x42844284, 0x42844284, 0x40044384, 0x00007ffc, // ICON_INFO + 0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // ICON_CROSSLINE + 0x00000000, 0x1ff01ff0, 0x18301830, 0x1f001830, 0x03001f00, 0x00000300, 0x03000300, 0x00000000, // ICON_HELP + 0x3ff00000, 0x2abc3550, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x00003ffc, // ICON_FILETYPE_ALPHA + 0x3ff00000, 0x201c2010, 0x22442184, 0x28142424, 0x29942814, 0x2ff42994, 0x20042004, 0x00003ffc, // ICON_FILETYPE_HOME + 0x07fe0000, 0x04020402, 0x7fe20402, 0x44224422, 0x44224422, 0x402047fe, 0x40204020, 0x00007fe0, // ICON_LAYERS_VISIBLE + 0x07fe0000, 0x04020402, 0x7c020402, 0x44024402, 0x44024402, 0x402047fe, 0x40204020, 0x00007fe0, // ICON_LAYERS + 0x00000000, 0x40027ffe, 0x7ffe4002, 0x40024002, 0x40024002, 0x40024002, 0x7ffe4002, 0x00000000, // ICON_WINDOW + 0x09100000, 0x09f00910, 0x09100910, 0x00000910, 0x24a2779e, 0x27a224a2, 0x709e20a2, 0x00000000, // ICON_HIDPI + 0x3ff00000, 0x201c2010, 0x2a842e84, 0x2e842a84, 0x2ba42004, 0x2aa42aa4, 0x20042ba4, 0x00003ffc, // ICON_FILETYPE_BINARY + 0x00000000, 0x00000000, 0x00120012, 0x4a5e4bd2, 0x485233d2, 0x00004bd2, 0x00000000, 0x00000000, // ICON_HEX + 0x01800000, 0x381c0660, 0x23c42004, 0x23c42044, 0x13c82204, 0x08101008, 0x02400420, 0x00000180, // ICON_SHIELD + 0x007e0000, 0x20023fc2, 0x40227fe2, 0x400a403a, 0x400a400a, 0x400a400a, 0x4008400e, 0x00007ff8, // ICON_FILE_NEW + 0x00000000, 0x0042007e, 0x40027fc2, 0x44024002, 0x5f024402, 0x44024402, 0x7ffe4002, 0x00000000, // ICON_FOLDER_ADD + 0x44220000, 0x12482244, 0xf3cf0000, 0x14280420, 0x48122424, 0x08100810, 0x1ff81008, 0x03c00420, // ICON_ALARM + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_206 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_207 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_208 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_209 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_210 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_211 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_212 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_213 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_214 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_215 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_216 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_217 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_218 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_219 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_220 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_221 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_222 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_223 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_224 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_225 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_226 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_227 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_228 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_229 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_230 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_231 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_232 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_233 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_234 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_235 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_236 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_237 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_238 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_239 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_240 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_241 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_242 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_243 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_244 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_245 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_246 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_247 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_248 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_249 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_250 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_251 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_252 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_253 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_254 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_255 }; -#endif // !RAYGUI_NO_ICONS && !RAYGUI_CUSTOM_ICONS +#endif // !RAYGUI_NO_ICONS && !RAYGUI_CUSTOM_ICONS #ifndef RAYGUI_ICON_SIZE - #define RAYGUI_ICON_SIZE 0 +#define RAYGUI_ICON_SIZE 0 #endif -#define RAYGUI_MAX_CONTROLS 16 // Maximum number of standard controls -#define RAYGUI_MAX_PROPS_BASE 16 // Maximum number of standard properties -#define RAYGUI_MAX_PROPS_EXTENDED 8 // Maximum number of extended properties +#define RAYGUI_MAX_CONTROLS 16 // Maximum number of standard controls +#define RAYGUI_MAX_PROPS_BASE 16 // Maximum number of standard properties +#define RAYGUI_MAX_PROPS_EXTENDED 8 // Maximum number of extended properties //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- // Gui control property style color element -typedef enum { BORDER = 0, BASE, TEXT, OTHER } GuiPropertyElement; +typedef enum +{ + BORDER = 0, + BASE, + TEXT, + OTHER +} GuiPropertyElement; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static GuiControlState guiState = GUI_STATE_NORMAL; +static GuiState guiState = STATE_NORMAL; // Gui global state, if !STATE_NORMAL, forces defined state + +static Font guiFont = {0}; // Gui current font (WARNING: highly coupled to raylib) +static bool guiLocked = false; // Gui lock state (no inputs processed) +static float guiAlpha = 1.0f; // Gui element transpacency on drawing -static Font guiFont = { 0 }; // Gui current font (WARNING: highly coupled to raylib) -static bool guiLocked = false; // Gui lock state (no inputs processed) -static float guiAlpha = 1.0f; // Gui element transpacency on drawing +static unsigned int guiIconScale = 1; // Gui icon default scale (if icons enabled) //---------------------------------------------------------------------------------- // Style data array for all gui style properties (allocated on data segment by default) @@ -1162,9 +1208,9 @@ static float guiAlpha = 1.0f; // Gui element transpacency on drawing // // guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB //---------------------------------------------------------------------------------- -static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)] = { 0 }; +static unsigned int guiStyle[RAYGUI_MAX_CONTROLS * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)] = {0}; -static bool guiStyleLoaded = false; // Style loaded flag for lazy style initialization +static bool guiStyleLoaded = false; // Style loaded flag for lazy style initialization //---------------------------------------------------------------------------------- // Standalone Mode Functions Declaration @@ -1174,14 +1220,14 @@ static bool guiStyleLoaded = false; // Style loaded flag for lazy style init //---------------------------------------------------------------------------------- #if defined(RAYGUI_STANDALONE) -#define KEY_RIGHT 262 -#define KEY_LEFT 263 -#define KEY_DOWN 264 -#define KEY_UP 265 -#define KEY_BACKSPACE 259 -#define KEY_ENTER 257 +#define KEY_RIGHT 262 +#define KEY_LEFT 263 +#define KEY_DOWN 264 +#define KEY_UP 265 +#define KEY_BACKSPACE 259 +#define KEY_ENTER 257 -#define MOUSE_LEFT_BUTTON 0 +#define MOUSE_LEFT_BUTTON 0 // Input required functions //------------------------------------------------------------------------------- @@ -1193,12 +1239,12 @@ static bool IsMouseButtonReleased(int button); static bool IsKeyDown(int key); static bool IsKeyPressed(int key); -static int GetCharPressed(void); // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() +static int GetCharPressed(void); // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() //------------------------------------------------------------------------------- // Drawing required functions //------------------------------------------------------------------------------- -static void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle(), GuiDrawIcon() +static void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle(), GuiDrawIcon() static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // -- GuiColorPicker() //------------------------------------------------------------------------------- @@ -1206,57 +1252,67 @@ static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color // Text required functions //------------------------------------------------------------------------------- static Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // -- GuiLoadStyle() -static Font GetFontDefault(void); // -- GuiLoadStyleDefault() -static Texture2D LoadTextureFromImage(Image image); // -- GuiLoadStyle() -static void SetShapesTexture(Texture2D tex, Rectangle rec); // -- GuiLoadStyle() -static char *LoadFileText(const char *fileName); // -- GuiLoadStyle() -static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() - -static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // -- GetTextWidth(), GuiTextBoxMulti() -static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() +static Font GetFontDefault(void); // -- GuiLoadStyleDefault() +static Texture2D LoadTextureFromImage(Image image); // -- GuiLoadStyle() +static void SetShapesTexture(Texture2D tex, Rectangle rec); // -- GuiLoadStyle() +static char *LoadFileText(const char *fileName); // -- GuiLoadStyle() +static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() + +static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // -- GetTextWidth(), GuiTextBoxMulti() +static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() //------------------------------------------------------------------------------- // raylib functions already implemented in raygui //------------------------------------------------------------------------------- -static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -static int ColorToInt(Color color); // Returns hexadecimal value for a Color -static Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -static const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' -static const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -static int TextToInteger(const char *text); // Get integer value from text -static int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded text -static const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode codepoint into UTF-8 text (char array size returned as parameter) - -static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw rectangle vertical gradient +static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value +static int ColorToInt(Color color); // Returns hexadecimal value for a Color +static Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +static const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' +static const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +static int TextToInteger(const char *text); // Get integer value from text +static int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded text +static const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode codepoint into UTF-8 text (char array size returned as parameter) + +static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw rectangle vertical gradient //------------------------------------------------------------------------------- -#endif // RAYGUI_STANDALONE +#endif // RAYGUI_STANDALONE //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static int GetTextWidth(const char *text); // Gui get text width using default font -static Rectangle GetTextBounds(int control, Rectangle bounds); // Get text bounds considering control bounds -static const char *GetTextIcon(const char *text, int *iconId); // Get text icon if provided and move text cursor +static int GetTextWidth(const char *text); // Gui get text width using default font +static Rectangle GetTextBounds(int control, Rectangle bounds); // Get text bounds considering control bounds +static const char *GetTextIcon(const char *text, int *iconId); // Get text icon if provided and move text cursor -static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint); // Gui draw text using default font -static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color); // Gui draw rectangle using default raygui style +static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint); // Gui draw text using default font +static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color); // Gui draw rectangle using default raygui style -static const char **GuiTextSplit(const char *text, int *count, int *textRow); // Split controls text into multiple strings -static Vector3 ConvertHSVtoRGB(Vector3 hsv); // Convert color data from HSV to RGB -static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color data from RGB to HSV +static const char **GuiTextSplit(const char *text, int *count, int *textRow); // Split controls text into multiple strings +static Vector3 ConvertHSVtoRGB(Vector3 hsv); // Convert color data from HSV to RGB +static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color data from RGB to HSV + +static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll bar control, used by GuiScrollPanel() //---------------------------------------------------------------------------------- // Gui Setup Functions Definition //---------------------------------------------------------------------------------- // Enable gui global state -// NOTE: We check for GUI_STATE_DISABLED to avoid messing custom global state setups -void GuiEnable(void) { if (guiState == GUI_STATE_DISABLED) guiState = GUI_STATE_NORMAL; } +// NOTE: We check for STATE_DISABLED to avoid messing custom global state setups +void GuiEnable(void) +{ + if (guiState == STATE_DISABLED) + guiState = STATE_NORMAL; +} // Disable gui global state -// NOTE: We check for GUI_STATE_NORMAL to avoid messing custom global state setups -void GuiDisable(void) { if (guiState == GUI_STATE_NORMAL) guiState = GUI_STATE_DISABLED; } +// NOTE: We check for STATE_NORMAL to avoid messing custom global state setups +void GuiDisable(void) +{ + if (guiState == STATE_NORMAL) + guiState = STATE_DISABLED; +} // Lock gui global state void GuiLock(void) { guiLocked = true; } @@ -1270,14 +1326,16 @@ bool GuiIsLocked(void) { return guiLocked; } // Set gui controls alpha global state void GuiFade(float alpha) { - if (alpha < 0.0f) alpha = 0.0f; - else if (alpha > 1.0f) alpha = 1.0f; + if (alpha < 0.0f) + alpha = 0.0f; + else if (alpha > 1.0f) + alpha = 1.0f; guiAlpha = alpha; } // Set gui state (global state) -void GuiSetState(int state) { guiState = (GuiControlState)state; } +void GuiSetState(int state) { guiState = (GuiState)state; } // Get gui state (global state) int GuiGetState(void) { return guiState; } @@ -1291,7 +1349,8 @@ void GuiSetFont(Font font) // NOTE: If we try to setup a font but default style has not been // lazily loaded before, it will be overwritten, so we need to force // default style loading first - if (!guiStyleLoaded) GuiLoadStyleDefault(); + if (!guiStyleLoaded) + GuiLoadStyleDefault(); guiFont = font; GuiSetStyle(DEFAULT, TEXT_SIZE, font.baseSize); @@ -1307,21 +1366,24 @@ Font GuiGetFont(void) // Set control style property value void GuiSetStyle(int control, int property, int value) { - if (!guiStyleLoaded) GuiLoadStyleDefault(); - guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; + if (!guiStyleLoaded) + GuiLoadStyleDefault(); + guiStyle[control * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; // Default properties are propagated to all controls if ((control == 0) && (property < RAYGUI_MAX_PROPS_BASE)) { - for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) guiStyle[i*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; + for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) + guiStyle[i * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; } } // Get control style property value int GuiGetStyle(int control, int property) { - if (!guiStyleLoaded) GuiLoadStyleDefault(); - return guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property]; + if (!guiStyleLoaded) + GuiLoadStyleDefault(); + return guiStyle[control * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property]; } //---------------------------------------------------------------------------------- @@ -1331,23 +1393,24 @@ int GuiGetStyle(int control, int property) // Window Box control bool GuiWindowBox(Rectangle bounds, const char *title) { - // Window title bar height (including borders) - // NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() - #if !defined(RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT) - #define RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT 24 - #endif +// Window title bar height (including borders) +// NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() +#if !defined(RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT) +#define RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT 24 +#endif - //GuiControlState state = guiState; + // GuiState state = guiState; bool clicked = false; int statusBarHeight = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT; - Rectangle statusBar = { bounds.x, bounds.y, bounds.width, (float)statusBarHeight }; - if (bounds.height < statusBarHeight*2.0f) bounds.height = statusBarHeight*2.0f; + Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)statusBarHeight}; + if (bounds.height < statusBarHeight * 2.0f) + bounds.height = statusBarHeight * 2.0f; - Rectangle windowPanel = { bounds.x, bounds.y + (float)statusBarHeight - 1, bounds.width, bounds.height - (float)statusBarHeight + 1 }; - Rectangle closeButtonRec = { statusBar.x + statusBar.width - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - 20, - statusBar.y + statusBarHeight/2.0f - 18.0f/2.0f, 18, 18 }; + Rectangle windowPanel = {bounds.x, bounds.y + (float)statusBarHeight - 1, bounds.width, bounds.height - (float)statusBarHeight + 1}; + Rectangle closeButtonRec = {statusBar.x + statusBar.width - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - 20, + statusBar.y + statusBarHeight / 2.0f - 18.0f / 2.0f, 18, 18}; // Update control //-------------------------------------------------------------------- @@ -1357,17 +1420,17 @@ bool GuiWindowBox(Rectangle bounds, const char *title) // Draw control //-------------------------------------------------------------------- GuiStatusBar(statusBar, title); // Draw window header as status bar - GuiPanel(windowPanel); // Draw window base + GuiPanel(windowPanel, NULL); // Draw window base // Draw window close button int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); int tempTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); #if defined(RAYGUI_NO_ICONS) clicked = GuiButton(closeButtonRec, "x"); #else - clicked = GuiButton(closeButtonRec, GuiIconText(RAYGUI_ICON_CROSS_SMALL, NULL)); + clicked = GuiButton(closeButtonRec, GuiIconText(ICON_CROSS_SMALL, NULL)); #endif GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlignment); @@ -1379,147 +1442,194 @@ bool GuiWindowBox(Rectangle bounds, const char *title) // Group Box control with text name void GuiGroupBox(Rectangle bounds, const char *text) { - #if !defined(RAYGUI_GROUPBOX_LINE_THICK) - #define RAYGUI_GROUPBOX_LINE_THICK 1 - #endif - #if !defined(RAYGUI_GROUPBOX_TEXT_PADDING) - #define RAYGUI_GROUPBOX_TEXT_PADDING 10 - #endif +#if !defined(RAYGUI_GROUPBOX_LINE_THICK) +#define RAYGUI_GROUPBOX_LINE_THICK 1 +#endif - GuiControlState state = guiState; + GuiState state = guiState; // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiLine(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, bounds.width, 1 }, text); + GuiLine(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2, bounds.width, (float)GuiGetStyle(DEFAULT, TEXT_SIZE)}, text); //-------------------------------------------------------------------- } // Line control void GuiLine(Rectangle bounds, const char *text) { - #if !defined(RAYGUI_LINE_TEXT_PADDING) - #define RAYGUI_LINE_TEXT_PADDING 8 - #endif +#if !defined(RAYGUI_LINE_ORIGIN_SIZE) +#define RAYGUI_LINE_MARGIN_TEXT 12 +#endif +#if !defined(RAYGUI_LINE_TEXT_PADDING) +#define RAYGUI_LINE_TEXT_PADDING 4 +#endif - GuiControlState state = guiState; + GuiState state = guiState; - Color color = Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha); + Color color = Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha); // Draw control //-------------------------------------------------------------------- - if (text == NULL) GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height/2, bounds.width, 1 }, 0, BLANK, color); + if (text == NULL) + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height / 2, bounds.width, 1}, 0, BLANK, color); else { - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; textBounds.width = (float)GetTextWidth(text); textBounds.height = bounds.height; - textBounds.x = bounds.x + RAYGUI_LINE_TEXT_PADDING; + textBounds.x = bounds.x + RAYGUI_LINE_MARGIN_TEXT; textBounds.y = bounds.y; // Draw line with embedded text label: "--- text --------------" - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height/2, RAYGUI_LINE_TEXT_PADDING - 2, 1 }, 0, BLANK, color); - GuiLabel(textBounds, text); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + RAYGUI_LINE_TEXT_PADDING + textBounds.width + 4, bounds.y + bounds.height/2, bounds.width - textBounds.width - RAYGUI_LINE_TEXT_PADDING - 4, 1 }, 0, BLANK, color); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height / 2, RAYGUI_LINE_MARGIN_TEXT - RAYGUI_LINE_TEXT_PADDING, 1}, 0, BLANK, color); + GuiDrawText(text, textBounds, TEXT_ALIGN_LEFT, color); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + 12 + textBounds.width + 4, bounds.y + bounds.height / 2, bounds.width - textBounds.width - RAYGUI_LINE_MARGIN_TEXT - RAYGUI_LINE_TEXT_PADDING, 1}, 0, BLANK, color); } //-------------------------------------------------------------------- } // Panel control -void GuiPanel(Rectangle bounds) +void GuiPanel(Rectangle bounds, const char *text) { - #if !defined(RAYGUI_PANEL_BORDER_WIDTH) - #define RAYGUI_PANEL_BORDER_WIDTH 1 - #endif +#if !defined(RAYGUI_PANEL_BORDER_WIDTH) +#define RAYGUI_PANEL_BORDER_WIDTH 1 +#endif + + GuiState state = guiState; - GuiControlState state = guiState; + // Text will be drawn as a header bar (if provided) + Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}; + if ((text != NULL) && (bounds.height < RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f)) + bounds.height = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f; + + if (text != NULL) + { + // Move panel bounds after the header bar + bounds.y += (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 1; + bounds.height -= (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + 1; + } // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BORDER_COLOR_DISABLED: LINE_COLOR)), guiAlpha), - Fade(GetColor(GuiGetStyle(DEFAULT, (state == GUI_STATE_DISABLED)? BASE_COLOR_DISABLED : BACKGROUND_COLOR)), guiAlpha)); + if (text != NULL) + GuiStatusBar(statusBar, text); // Draw panel header as status bar + + GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha), + Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BASE_COLOR_DISABLED : BACKGROUND_COLOR)), guiAlpha)); //-------------------------------------------------------------------- } // Scroll Panel control -Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) +Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll) { - GuiControlState state = guiState; + GuiState state = guiState; - Vector2 scrollPos = { 0.0f, 0.0f }; - if (scroll != NULL) scrollPos = *scroll; + Vector2 scrollPos = {0.0f, 0.0f}; + if (scroll != NULL) + scrollPos = *scroll; + + // Text will be drawn as a header bar (if provided) + Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}; + if (bounds.height < RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f) + bounds.height = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f; + + if (text != NULL) + { + // Move panel bounds after the header bar + bounds.y += (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 1; + bounds.height -= (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + 1; + } - bool hasHorizontalScrollBar = (content.width > bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH))? true : false; - bool hasVerticalScrollBar = (content.height > bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH))? true : false; + bool hasHorizontalScrollBar = (content.width > bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; + bool hasVerticalScrollBar = (content.height > bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; // Recheck to account for the other scrollbar being visible - if (!hasHorizontalScrollBar) hasHorizontalScrollBar = (hasVerticalScrollBar && (content.width > (bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH))))? true : false; - if (!hasVerticalScrollBar) hasVerticalScrollBar = (hasHorizontalScrollBar && (content.height > (bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH))))? true : false; + if (!hasHorizontalScrollBar) + hasHorizontalScrollBar = (hasVerticalScrollBar && (content.width > (bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; + if (!hasVerticalScrollBar) + hasVerticalScrollBar = (hasHorizontalScrollBar && (content.height > (bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; - const int horizontalScrollBarWidth = hasHorizontalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - const int verticalScrollBarWidth = hasVerticalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - const Rectangle horizontalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth }; - const Rectangle verticalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) }; + int horizontalScrollBarWidth = hasHorizontalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; + int verticalScrollBarWidth = hasVerticalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; + Rectangle horizontalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth}; + Rectangle verticalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; // Calculate view area (area without the scrollbars) - Rectangle view = (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? - RAYGUI_CLITERAL(Rectangle){ bounds.x + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth } : - RAYGUI_CLITERAL(Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth }; + Rectangle view = (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? RAYGUI_CLITERAL(Rectangle){bounds.x + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth} : RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth}; // Clip view area to the actual content size - if (view.width > content.width) view.width = content.width; - if (view.height > content.height) view.height = content.height; + if (view.width > content.width) + view.width = content.width; + if (view.height > content.height) + view.height = content.height; - const float horizontalMin = hasHorizontalScrollBar? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH); - const float horizontalMax = hasHorizontalScrollBar? content.width - bounds.width + (float)verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)verticalScrollBarWidth : 0) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); - const float verticalMin = hasVerticalScrollBar? (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); - const float verticalMax = hasVerticalScrollBar? content.height - bounds.height + (float)horizontalScrollBarWidth + (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); + float horizontalMin = hasHorizontalScrollBar ? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH); + float horizontalMax = hasHorizontalScrollBar ? content.width - bounds.width + (float)verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)verticalScrollBarWidth : 0) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); + float verticalMin = hasVerticalScrollBar ? 0 : -1; + float verticalMax = hasVerticalScrollBar ? content.height - bounds.height + (float)horizontalScrollBarWidth + (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check button state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; +#if defined(SUPPORT_SCROLLBAR_KEY_INPUT) if (hasHorizontalScrollBar) { - if (IsKeyDown(KEY_RIGHT)) scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_LEFT)) scrollPos.x += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_RIGHT)) + scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_LEFT)) + scrollPos.x += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); } if (hasVerticalScrollBar) { - if (IsKeyDown(KEY_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_DOWN)) + scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + if (IsKeyDown(KEY_UP)) + scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); } - +#endif float wheelMove = GetMouseWheelMove(); // Horizontal scroll (Shift + Mouse wheel) - if (hasHorizontalScrollBar && (IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT))) scrollPos.x += wheelMove*20; - else scrollPos.y += wheelMove*20; // Vertical scroll + if (hasHorizontalScrollBar && (IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_SHIFT))) + scrollPos.x += wheelMove * 20; + else + scrollPos.y += wheelMove * 20; // Vertical scroll } } // Normalize scroll values - if (scrollPos.x > -horizontalMin) scrollPos.x = -horizontalMin; - if (scrollPos.x < -horizontalMax) scrollPos.x = -horizontalMax; - if (scrollPos.y > -verticalMin) scrollPos.y = -verticalMin; - if (scrollPos.y < -verticalMax) scrollPos.y = -verticalMax; + if (scrollPos.x > -horizontalMin) + scrollPos.x = -horizontalMin; + if (scrollPos.x < -horizontalMax) + scrollPos.x = -horizontalMax; + if (scrollPos.y > -verticalMin) + scrollPos.y = -verticalMin; + if (scrollPos.y < -verticalMax) + scrollPos.y = -verticalMax; //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + if (text != NULL) + GuiStatusBar(statusBar, text); // Draw panel header as status bar + + GuiDrawRectangle(bounds, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background // Save size of the scrollbar slider const int slider = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); @@ -1528,33 +1638,38 @@ Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) if (hasHorizontalScrollBar) { // Change scrollbar slider size to show the diff in size between the content width and the widget width - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth)/(int)content.width)*((int)bounds.width - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth))); + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth) / (int)content.width) * ((int)bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth))); scrollPos.x = (float)-GuiScrollBar(horizontalScrollBar, (int)-scrollPos.x, (int)horizontalMin, (int)horizontalMax); } + else + scrollPos.x = 0.0f; // Draw vertical scrollbar if visible if (hasVerticalScrollBar) { // Change scrollbar slider size to show the diff in size between the content height and the widget height - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth)/(int)content.height)*((int)bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth))); + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth) / (int)content.height) * ((int)bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth))); scrollPos.y = (float)-GuiScrollBar(verticalScrollBar, (int)-scrollPos.y, (int)verticalMin, (int)verticalMax); } + else + scrollPos.y = 0.0f; // Draw detail corner rectangle if both scroll bars are visible if (hasHorizontalScrollBar && hasVerticalScrollBar) { - Rectangle corner = { (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) + 2) : (horizontalScrollBar.x + horizontalScrollBar.width + 2), verticalScrollBar.y + verticalScrollBar.height + 2, (float)horizontalScrollBarWidth - 4, (float)verticalScrollBarWidth - 4 }; - GuiDrawRectangle(corner, 0, BLANK, Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT + (state*3))), guiAlpha)); + Rectangle corner = {(GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) + 2) : (horizontalScrollBar.x + horizontalScrollBar.width + 2), verticalScrollBar.y + verticalScrollBar.height + 2, (float)horizontalScrollBarWidth - 4, (float)verticalScrollBarWidth - 4}; + GuiDrawRectangle(corner, 0, BLANK, Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT + (state * 3))), guiAlpha)); } // Draw scrollbar lines depending on current state - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + (state*3))), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + (state * 3))), guiAlpha), BLANK); // Set scrollbar slider size back to the way it was before GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, slider); //-------------------------------------------------------------------- - if (scroll != NULL) *scroll = scrollPos; + if (scroll != NULL) + *scroll = scrollPos; return view; } @@ -1562,7 +1677,7 @@ Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) // Label control void GuiLabel(Rectangle bounds, const char *text) { - GuiControlState state = guiState; + GuiState state = guiState; // Update control //-------------------------------------------------------------------- @@ -1571,37 +1686,40 @@ void GuiLabel(Rectangle bounds, const char *text) // Draw control //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, (state == GUI_STATE_DISABLED)? TEXT_COLOR_DISABLED : TEXT_COLOR_NORMAL)), guiAlpha)); + GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); //-------------------------------------------------------------------- } // Button control, returns true when clicked bool GuiButton(Rectangle bounds, const char *text) { - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check button state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + pressed = true; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state*3))), guiAlpha)); - GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state*3))), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state * 3))), guiAlpha)); + GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state * 3))), guiAlpha)); //------------------------------------------------------------------ return pressed; @@ -1610,33 +1728,37 @@ bool GuiButton(Rectangle bounds, const char *text) // Label button control bool GuiLabelButton(Rectangle bounds, const char *text) { - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; // NOTE: We force bounds.width to be all text float textWidth = MeasureTextEx(guiFont, text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)).x; - if (bounds.width < textWidth) bounds.width = textWidth; + if (bounds.width < textWidth) + bounds.width = textWidth; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check checkbox state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + pressed = true; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); //-------------------------------------------------------------------- return pressed; @@ -1645,39 +1767,41 @@ bool GuiLabelButton(Rectangle bounds, const char *text) // Toggle Button control, returns true when active bool GuiToggle(Rectangle bounds, const char *text, bool active) { - GuiControlState state = guiState; + GuiState state = guiState; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check toggle button state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) { - state = GUI_STATE_NORMAL; + state = STATE_NORMAL; active = !active; } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - if (state == GUI_STATE_NORMAL) + if (state == STATE_NORMAL) { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, (active? BORDER_COLOR_PRESSED : (BORDER + state*3)))), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, (active? BASE_COLOR_PRESSED : (BASE + state*3)))), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, (active? TEXT_COLOR_PRESSED : (TEXT + state*3)))), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BORDER_COLOR_PRESSED : (BORDER + state * 3)))), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BASE_COLOR_PRESSED : (BASE + state * 3)))), guiAlpha)); + GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? TEXT_COLOR_PRESSED : (TEXT + state * 3)))), guiAlpha)); } else { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, BASE + state*3)), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, TEXT + state*3)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, BASE + state * 3)), guiAlpha)); + GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, TEXT + state * 3)), guiAlpha)); } //-------------------------------------------------------------------- @@ -1687,14 +1811,14 @@ bool GuiToggle(Rectangle bounds, const char *text, bool active) // Toggle Group control, returns toggled button index int GuiToggleGroup(Rectangle bounds, const char *text, int active) { - #if !defined(RAYGUI_TOGGLEGROUP_MAX_ELEMENTS) - #define RAYGUI_TOGGLEGROUP_MAX_ELEMENTS 32 - #endif +#if !defined(RAYGUI_TOGGLEGROUP_MAX_ITEMS) +#define RAYGUI_TOGGLEGROUP_MAX_ITEMS 32 +#endif float initBoundsX = bounds.x; // Get substrings items from text (items pointers) - int rows[RAYGUI_TOGGLEGROUP_MAX_ELEMENTS] = { 0 }; + int rows[RAYGUI_TOGGLEGROUP_MAX_ITEMS] = {0}; int itemCount = 0; const char **items = GuiTextSplit(text, &itemCount, rows); @@ -1709,8 +1833,10 @@ int GuiToggleGroup(Rectangle bounds, const char *text, int active) prevRow = rows[i]; } - if (i == active) GuiToggle(bounds, items[i], true); - else if (GuiToggle(bounds, items[i], false) == true) active = i; + if (i == active) + GuiToggle(bounds, items[i], true); + else if (GuiToggle(bounds, items[i], false) == true) + active = i; bounds.x += (bounds.width + GuiGetStyle(TOGGLE, GROUP_PADDING)); } @@ -1721,27 +1847,28 @@ int GuiToggleGroup(Rectangle bounds, const char *text, int active) // Check Box control, returns true when active bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) { - GuiControlState state = guiState; + GuiState state = guiState; - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; if (text != NULL) { textBounds.width = (float)GetTextWidth(text); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x + bounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; - if (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(CHECKBOX, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; + if (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) + textBounds.x = bounds.x - textBounds.width - GuiGetStyle(CHECKBOX, TEXT_PADDING); } // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); Rectangle totalBounds = { - (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT)? textBounds.x : bounds.x, + (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) ? textBounds.x : bounds.x, bounds.y, bounds.width + textBounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING), bounds.height, @@ -1750,28 +1877,31 @@ bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) // Check checkbox state if (CheckCollisionPointRec(mousePoint, totalBounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) checked = !checked; + if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + checked = !checked; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(CHECKBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(CHECKBOX, BORDER + (state*3))), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(CHECKBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(CHECKBOX, BORDER + (state * 3))), guiAlpha), BLANK); if (checked) { - Rectangle check = { bounds.x + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.y + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.width - 2*(GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)), - bounds.height - 2*(GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)) }; - GuiDrawRectangle(check, 0, BLANK, Fade(GetColor(GuiGetStyle(CHECKBOX, TEXT + state*3)), guiAlpha)); + Rectangle check = {bounds.x + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), + bounds.y + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), + bounds.width - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)), + bounds.height - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING))}; + GuiDrawRectangle(check, 0, BLANK, Fade(GetColor(GuiGetStyle(CHECKBOX, TEXT + state * 3)), guiAlpha)); } - GuiDrawText(text, textBounds, (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + GuiDrawText(text, textBounds, (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); //-------------------------------------------------------------------- return checked; @@ -1780,23 +1910,25 @@ bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) // Combo Box control, returns selected item index int GuiComboBox(Rectangle bounds, const char *text, int active) { - GuiControlState state = guiState; + GuiState state = guiState; - bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING)); + bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_SPACING)); - Rectangle selector = { (float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_PADDING), - (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height }; + Rectangle selector = {(float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_SPACING), + (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height}; // Get substrings items from text (items pointers, lengths and count) int itemCount = 0; const char **items = GuiTextSplit(text, &itemCount, NULL); - if (active < 0) active = 0; - else if (active > itemCount - 1) active = itemCount - 1; + if (active < 0) + active = 0; + else if (active > itemCount - 1) + active = itemCount - 1; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked && (itemCount > 1)) + if ((state != STATE_DISABLED) && !guiLocked && (itemCount > 1)) { Vector2 mousePoint = GetMousePosition(); @@ -1806,11 +1938,14 @@ int GuiComboBox(Rectangle bounds, const char *text, int active) if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) { active += 1; - if (active >= itemCount) active = 0; + if (active >= itemCount) + active = 0; } - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; } } //-------------------------------------------------------------------- @@ -1818,15 +1953,15 @@ int GuiComboBox(Rectangle bounds, const char *text, int active) // Draw control //-------------------------------------------------------------------- // Draw combo box main - GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state*3))), guiAlpha)); - GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state*3))), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state * 3))), guiAlpha)); + GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state * 3))), guiAlpha)); // Draw selector using a custom button // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); GuiButton(selector, TextFormat("%i/%i", active + 1, itemCount)); @@ -1841,7 +1976,7 @@ int GuiComboBox(Rectangle bounds, const char *text, int active) // NOTE: Returns mouse click bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode) { - GuiControlState state = guiState; + GuiState state = guiState; int itemSelected = *active; int itemFocused = -1; @@ -1850,36 +1985,38 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo const char **items = GuiTextSplit(text, &itemCount, NULL); Rectangle boundsOpen = bounds; - boundsOpen.height = (itemCount + 1)*(bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + boundsOpen.height = (itemCount + 1) * (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); Rectangle itemBounds = bounds; - bool pressed = false; // Check mouse button pressed + bool pressed = false; // Check mouse button pressed // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && (editMode || !guiLocked) && (itemCount > 1)) + if ((state != STATE_DISABLED) && (editMode || !guiLocked) && (itemCount > 1)) { Vector2 mousePoint = GetMousePosition(); if (editMode) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; // Check if mouse has been pressed or released outside limits if (!CheckCollisionPointRec(mousePoint, boundsOpen)) { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) pressed = true; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + pressed = true; } // Check if already selected item has been pressed again - if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + pressed = true; // Check focused and selected item for (int i = 0; i < itemCount; i++) { // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); if (CheckCollisionPointRec(mousePoint, itemBounds)) { @@ -1887,7 +2024,7 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) { itemSelected = i; - pressed = true; // Item selected, change to editMode = false + pressed = true; // Item selected, change to editMode = false } break; } @@ -1902,9 +2039,10 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) { pressed = true; - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; } } } @@ -1912,10 +2050,11 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo // Draw control //-------------------------------------------------------------------- - if (editMode) GuiPanel(boundsOpen); + if (editMode) + GuiPanel(boundsOpen, NULL); - GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state*3)), guiAlpha)); - GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state*3)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state * 3)), guiAlpha)); + GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state * 3)), guiAlpha)); if (editMode) { @@ -1923,7 +2062,7 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo for (int i = 0; i < itemCount; i++) { // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING)); + itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); if (i == itemSelected) { @@ -1935,17 +2074,18 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_FOCUSED)), guiAlpha)); GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_FOCUSED)), guiAlpha)); } - else GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha)); + else + GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha)); } } // Draw arrows (using icon if available) #if defined(RAYGUI_NO_ICONS) - GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); + GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height / 2 - 2, 10, 10}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); #else - GuiDrawText("#120#", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 6, 10, 10 }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); // RAYGUI_ICON_ARROW_DOWN_FILL + GuiDrawText("#120#", RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height / 2 - 6, 10, 10}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); // ICON_ARROW_DOWN_FILL #endif //-------------------------------------------------------------------- @@ -1957,41 +2097,45 @@ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMo // NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) { - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; + int textWidth = GetTextWidth(text); + Rectangle textBounds = GetTextBounds(TEXTBOX, bounds); + int textAlignment = editMode && textWidth >= textBounds.width ? TEXT_ALIGN_RIGHT : GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT); Rectangle cursor = { bounds.x + GuiGetStyle(TEXTBOX, TEXT_PADDING) + GetTextWidth(text) + 2, - bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE), + bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE), 4, - (float)GuiGetStyle(DEFAULT, TEXT_SIZE)*2 - }; + (float)GuiGetStyle(DEFAULT, TEXT_SIZE) * 2}; - if (cursor.height > bounds.height) cursor.height = bounds.height - GuiGetStyle(TEXTBOX, BORDER_WIDTH)*2; + if (cursor.height >= bounds.height) + cursor.height = bounds.height - GuiGetStyle(TEXTBOX, BORDER_WIDTH) * 2; + if (cursor.y < (bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH))) + cursor.y = bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH); // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); if (editMode) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; - int key = GetCharPressed(); // Returns codepoint as Unicode + int key = GetCharPressed(); // Returns codepoint as Unicode int keyCount = (int)strlen(text); + int byteSize = 0; + const char *textUTF8 = CodepointToUTF8(key, &byteSize); // Only allow keys in range [32..125] - if (keyCount < (textSize - 1)) + if ((keyCount + byteSize) < textSize) { - float maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)*2)); + float maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) * 2)); - if ((GetTextWidth(text) < (maxWidth - GuiGetStyle(DEFAULT, TEXT_SIZE))) && (key >= 32)) + if (key >= 32) { - int byteSize = 0; - const char *textUTF8 = CodepointToUTF8(key, &byteSize); - for (int i = 0; i < byteSize; i++) { text[keyCount] = textUTF8[i]; @@ -2007,25 +2151,28 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) { if (IsKeyPressed(KEY_BACKSPACE)) { - keyCount--; + while ((keyCount > 0) && ((text[--keyCount] & 0xc0) == 0x80)) + ; text[keyCount] = '\0'; - if (keyCount < 0) keyCount = 0; } } - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true; + if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) + pressed = true; // Check text alignment to position cursor properly - int textAlignment = GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT); - if (textAlignment == GUI_TEXT_ALIGN_CENTER) cursor.x = bounds.x + GetTextWidth(text)/2 + bounds.width/2 + 1; - else if (textAlignment == GUI_TEXT_ALIGN_RIGHT) cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING); + if (textAlignment == TEXT_ALIGN_CENTER) + cursor.x = bounds.x + GetTextWidth(text) / 2 + bounds.width / 2 + 1; + else if (textAlignment == TEXT_ALIGN_RIGHT) + cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) - GuiGetStyle(TEXTBOX, BORDER_WIDTH); } else { if (CheckCollisionPointRec(mousePoint, bounds)) { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + state = STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + pressed = true; } } } @@ -2033,20 +2180,30 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) // Draw control //-------------------------------------------------------------------- - if (state == GUI_STATE_PRESSED) + if (state == STATE_PRESSED) { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); } - else if (state == GUI_STATE_DISABLED) + else if (state == STATE_DISABLED) { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); } - else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK); + else + GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - GuiDrawText(text, GetTextBounds(TEXTBOX, bounds), GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state*3))), guiAlpha)); + // in case we edit and text does not fit in the textbox show right aligned and character clipped, slower but working + while (editMode && textWidth >= textBounds.width && *text) + { + int bytes = 0; + GetCodepoint(text, &bytes); + text += bytes; + textWidth = GetTextWidth(text); + } + GuiDrawText(text, textBounds, textAlignment, Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); // Draw cursor - if (editMode) GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); + if (editMode) + GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); //-------------------------------------------------------------------- return pressed; @@ -2055,52 +2212,61 @@ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) // Spinner control, returns selected value bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) { - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; int tempValue = *value; - Rectangle spinner = { bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING), bounds.y, - bounds.width - 2*(GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_PADDING)), bounds.height }; - Rectangle leftButtonBound = { (float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height }; - Rectangle rightButtonBound = { (float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height }; + Rectangle spinner = {bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_SPACING), bounds.y, + bounds.width - 2 * (GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_SPACING)), bounds.height}; + Rectangle leftButtonBound = {(float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; + Rectangle rightButtonBound = {(float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; if (text != NULL) { textBounds.width = (float)GetTextWidth(text); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x + bounds.width + GuiGetStyle(SPINNER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; - if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; + if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) + textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING); } // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check spinner state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; } } #if defined(RAYGUI_NO_ICONS) - if (GuiButton(leftButtonBound, "<")) tempValue--; - if (GuiButton(rightButtonBound, ">")) tempValue++; + if (GuiButton(leftButtonBound, "<")) + tempValue--; + if (GuiButton(rightButtonBound, ">")) + tempValue++; #else - if (GuiButton(leftButtonBound, GuiIconText(RAYGUI_ICON_ARROW_LEFT_FILL, NULL))) tempValue--; - if (GuiButton(rightButtonBound, GuiIconText(RAYGUI_ICON_ARROW_RIGHT_FILL, NULL))) tempValue++; + if (GuiButton(leftButtonBound, GuiIconText(ICON_ARROW_LEFT_FILL, NULL))) + tempValue--; + if (GuiButton(rightButtonBound, GuiIconText(ICON_ARROW_RIGHT_FILL, NULL))) + tempValue++; #endif if (!editMode) { - if (tempValue < minValue) tempValue = minValue; - if (tempValue > maxValue) tempValue = maxValue; + if (tempValue < minValue) + tempValue = minValue; + if (tempValue > maxValue) + tempValue = maxValue; } //-------------------------------------------------------------------- @@ -2114,15 +2280,13 @@ bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, in int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH)); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); - - + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); // Draw text label if provided - GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); //-------------------------------------------------------------------- *value = tempValue; @@ -2133,29 +2297,30 @@ bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, in // NOTE: Requires static variables: frameCounter bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) { - #if !defined(RAYGUI_VALUEBOX_MAX_CHARS) - #define RAYGUI_VALUEBOX_MAX_CHARS 32 - #endif +#if !defined(RAYGUI_VALUEBOX_MAX_CHARS) +#define RAYGUI_VALUEBOX_MAX_CHARS 32 +#endif - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; char textValue[RAYGUI_VALUEBOX_MAX_CHARS + 1] = "\0"; sprintf(textValue, "%i", *value); - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; if (text != NULL) { textBounds.width = (float)GetTextWidth(text); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x + bounds.width + GuiGetStyle(VALUEBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; - if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_LEFT) textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING); + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; + if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) + textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING); } // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); @@ -2163,7 +2328,7 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i if (editMode) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; int keyCount = (int)strlen(textValue); @@ -2189,27 +2354,32 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i { keyCount--; textValue[keyCount] = '\0'; - if (keyCount < 0) keyCount = 0; valueHasChanged = true; } } - if (valueHasChanged) *value = TextToInteger(textValue); + if (valueHasChanged) + *value = TextToInteger(textValue); - if (*value > maxValue) *value = maxValue; - else if (*value < minValue) *value = minValue; + // NOTE: We are not clamp values until user input finishes + // if (*value > maxValue) *value = maxValue; + // else if (*value < minValue) *value = minValue; - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true; + if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) + pressed = true; } else { - if (*value > maxValue) *value = maxValue; - else if (*value < minValue) *value = minValue; + if (*value > maxValue) + *value = maxValue; + else if (*value < minValue) + *value = minValue; if (CheckCollisionPointRec(mousePoint, bounds)) { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + state = STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + pressed = true; } } } @@ -2218,23 +2388,25 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i // Draw control //-------------------------------------------------------------------- Color baseColor = BLANK; - if (state == GUI_STATE_PRESSED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED)); - else if (state == GUI_STATE_DISABLED) baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED)); + if (state == STATE_PRESSED) + baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED)); + else if (state == STATE_DISABLED) + baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED)); // WARNING: BLANK color does not work properly with Fade() - GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state*3))), guiAlpha), baseColor); - GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state*3))), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state * 3))), guiAlpha), baseColor); + GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state * 3))), guiAlpha)); // Draw cursor if (editMode) { // NOTE: ValueBox internal text is always centered - Rectangle cursor = { bounds.x + GetTextWidth(textValue)/2 + bounds.width/2 + 2, bounds.y + 2*GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4*GuiGetStyle(VALUEBOX, BORDER_WIDTH) }; + Rectangle cursor = {bounds.x + GetTextWidth(textValue) / 2 + bounds.width / 2 + 2, bounds.y + 2 * GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4 * GuiGetStyle(VALUEBOX, BORDER_WIDTH)}; GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha)); } // Draw text label if provided - GuiDrawText(text, textBounds, (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT)? GUI_TEXT_ALIGN_LEFT : GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state*3))), guiAlpha)); + GuiDrawText(text, textBounds, (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); //-------------------------------------------------------------------- return pressed; @@ -2243,37 +2415,38 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i // Text Box control with multiple lines bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) { - GuiControlState state = guiState; + GuiState state = guiState; bool pressed = false; Rectangle textAreaBounds = { bounds.x + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.width - 2*(GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)), - bounds.height - 2*(GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)) - }; + bounds.width - 2 * (GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)), + bounds.height - 2 * (GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING))}; // Cursor position, [x, y] values should be updated - Rectangle cursor = { 0, -1, 4, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) + 2 }; + Rectangle cursor = {0, -1, 4, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) + 2}; - float scaleFactor = (float)GuiGetStyle(DEFAULT, TEXT_SIZE)/(float)guiFont.baseSize; // Character rectangle scaling factor + float scaleFactor = (float)GuiGetStyle(DEFAULT, TEXT_SIZE) / (float)guiFont.baseSize; // Character rectangle scaling factor // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); if (editMode) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; // We get an Unicode codepoint int codepoint = GetCharPressed(); - int textLength = (int)strlen(text); // Length in bytes (UTF-8 string) + int textLength = (int)strlen(text); // Length in bytes (UTF-8 string) + int byteSize = 0; + const char *textUTF8 = CodepointToUTF8(codepoint, &byteSize); // Introduce characters - if (textLength < (textSize - 1)) + if ((textLength + byteSize) < textSize) { if (IsKeyPressed(KEY_ENTER)) { @@ -2305,7 +2478,8 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) { // Remove latest UTF-8 unicode character introduced (n bytes) int charUTF8Length = 0; - while (((unsigned char)text[textLength - 1 - charUTF8Length] & 0b01000000) == 0) charUTF8Length++; + while ((charUTF8Length < textLength) && ((unsigned char)text[textLength - 1 - charUTF8Length] & 0b01000000) == 0) + charUTF8Length++; textLength -= (charUTF8Length + 1); text[textLength] = '\0'; @@ -2314,14 +2488,16 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) } // Exit edit mode - if (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + if (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + pressed = true; } else { if (CheckCollisionPointRec(mousePoint, bounds)) { - state = GUI_STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) pressed = true; + state = STATE_FOCUSED; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + pressed = true; } } } @@ -2329,48 +2505,51 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) // Draw control //-------------------------------------------------------------------- - if (state == GUI_STATE_PRESSED) + if (state == STATE_PRESSED) { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); } - else if (state == GUI_STATE_DISABLED) + else if (state == STATE_DISABLED) { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); } - else GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state*3))), guiAlpha), BLANK); + else + GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap - Vector2 cursorPos = { textAreaBounds.x, textAreaBounds.y }; + int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap + Vector2 cursorPos = {textAreaBounds.x, textAreaBounds.y}; - //int lastSpacePos = 0; - //int lastSpaceWidth = 0; - //int lastSpaceCursorPos = 0; + // int lastSpacePos = 0; + // int lastSpaceWidth = 0; + // int lastSpaceCursorPos = 0; for (int i = 0, codepointLength = 0; text[i] != '\0'; i += codepointLength) { int codepoint = GetCodepoint(text + i, &codepointLength); - int index = GetGlyphIndex(guiFont, codepoint); // If requested codepoint is not found, we get '?' (0x3f) + int index = GetGlyphIndex(guiFont, codepoint); // If requested codepoint is not found, we get '?' (0x3f) Rectangle atlasRec = guiFont.recs[index]; - GlyphInfo glyphInfo = guiFont.glyphs[index]; // Glyph measures + GlyphInfo glyphInfo = guiFont.glyphs[index]; // Glyph measures if ((codepointLength == 1) && (codepoint == '\n')) { - cursorPos.y += (guiFont.baseSize*scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_PADDING)); // Line feed - cursorPos.x = textAreaBounds.x; // Carriage return + cursorPos.y += (guiFont.baseSize * scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_SPACING)); // Line feed + cursorPos.x = textAreaBounds.x; // Carriage return } else { if (wrapMode == 1) { int glyphWidth = 0; - if (glyphInfo.advanceX != 0) glyphWidth += glyphInfo.advanceX; - else glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); + if (glyphInfo.advanceX != 0) + glyphWidth += glyphInfo.advanceX; + else + glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); // Jump line if the end of the text box area has been reached - if ((cursorPos.x + (glyphWidth*scaleFactor)) > (textAreaBounds.x + textAreaBounds.width)) + if ((cursorPos.x + (glyphWidth * scaleFactor)) > (textAreaBounds.x + textAreaBounds.width)) { - cursorPos.y += (guiFont.baseSize*scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_PADDING)); // Line feed - cursorPos.x = textAreaBounds.x; // Carriage return + cursorPos.y += (guiFont.baseSize * scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_SPACING)); // Line feed + cursorPos.x = textAreaBounds.x; // Carriage return } } else if (wrapMode == 2) @@ -2393,14 +2572,16 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) } // Draw current character glyph - DrawTextCodepoint(guiFont, codepoint, cursorPos, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state*3))), guiAlpha)); + DrawTextCodepoint(guiFont, codepoint, cursorPos, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); int glyphWidth = 0; - if (glyphInfo.advanceX != 0) glyphWidth += glyphInfo.advanceX; - else glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); + if (glyphInfo.advanceX != 0) + glyphWidth += glyphInfo.advanceX; + else + glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); - cursorPos.x += (glyphWidth*scaleFactor + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); - //if (i > lastSpacePos) lastSpaceWidth += (atlasRec.width + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + cursorPos.x += (glyphWidth * scaleFactor + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + // if (i > lastSpacePos) lastSpaceWidth += (atlasRec.width + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); } } @@ -2408,7 +2589,8 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) cursor.y = cursorPos.y; // Draw cursor position considering text glyphs - if (editMode) GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); + if (editMode) + GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); //-------------------------------------------------------------------- return pressed; @@ -2418,19 +2600,19 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) // NOTE: Other GuiSlider*() controls use this one float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue, int sliderWidth) { - GuiControlState state = guiState; + GuiState state = guiState; - int sliderValue = (int)(((value - minValue)/(maxValue - minValue))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))); + int sliderValue = (int)(((value - minValue) / (maxValue - minValue)) * (bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH))); - Rectangle slider = { bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING), - 0, bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING) }; + Rectangle slider = {bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING), + 0, bounds.height - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH) - 2 * GuiGetStyle(SLIDER, SLIDER_PADDING)}; - if (sliderWidth > 0) // Slider + if (sliderWidth > 0) // Slider { - slider.x += (sliderValue - sliderWidth/2); + slider.x += (sliderValue - sliderWidth / 2); slider.width = (float)sliderWidth; } - else if (sliderWidth == 0) // SliderBar + else if (sliderWidth == 0) // SliderBar { slider.x += GuiGetStyle(SLIDER, BORDER_WIDTH); slider.width = (float)sliderValue; @@ -2438,7 +2620,7 @@ float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); @@ -2446,62 +2628,72 @@ float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight { if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; // Get equivalent value and slider position from mousePoint.x - value = ((maxValue - minValue)*(mousePoint.x - (float)(bounds.x + sliderWidth/2)))/(float)(bounds.width - sliderWidth) + minValue; + value = ((maxValue - minValue) * (mousePoint.x - (float)(bounds.x + sliderWidth / 2))) / (float)(bounds.width - sliderWidth) + minValue; - if (sliderWidth > 0) slider.x = mousePoint.x - slider.width/2; // Slider - else if (sliderWidth == 0) slider.width = (float)sliderValue; // SliderBar + if (sliderWidth > 0) + slider.x = mousePoint.x - slider.width / 2; // Slider + else if (sliderWidth == 0) + slider.width = (float)sliderValue; // SliderBar } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; } - if (value > maxValue) value = maxValue; - else if (value < minValue) value = minValue; + if (value > maxValue) + value = maxValue; + else if (value < minValue) + value = minValue; } // Bar limits check - if (sliderWidth > 0) // Slider + if (sliderWidth > 0) // Slider { - if (slider.x <= (bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH))) slider.x = bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH); - else if ((slider.x + slider.width) >= (bounds.x + bounds.width)) slider.x = bounds.x + bounds.width - slider.width - GuiGetStyle(SLIDER, BORDER_WIDTH); + if (slider.x <= (bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH))) + slider.x = bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH); + else if ((slider.x + slider.width) >= (bounds.x + bounds.width)) + slider.x = bounds.x + bounds.width - slider.width - GuiGetStyle(SLIDER, BORDER_WIDTH); } - else if (sliderWidth == 0) // SliderBar + else if (sliderWidth == 0) // SliderBar { - if (slider.width > bounds.width) slider.width = bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH); + if (slider.width > bounds.width) + slider.width = bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH); } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); // Draw slider internal bar (depends on state) - if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == GUI_STATE_FOCUSED) GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha)); + if ((state == STATE_NORMAL) || (state == STATE_PRESSED)) + GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha)); + else if (state == STATE_FOCUSED) + GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha)); // Draw left/right text if provided if (textLeft != NULL) { - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; textBounds.width = (float)GetTextWidth(textLeft); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha)); + GuiDrawText(textLeft, textBounds, TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); } if (textRight != NULL) { - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; textBounds.width = (float)GetTextWidth(textRight); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x + bounds.width + GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha)); + GuiDrawText(textRight, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); } //-------------------------------------------------------------------- @@ -2523,46 +2715,52 @@ float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight // Progress Bar control extended, shows current progress value float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) { - GuiControlState state = guiState; + GuiState state = guiState; - Rectangle progress = { bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), - bounds.y + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) + GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING), 0, - bounds.height - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) - 2*GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING) }; + Rectangle progress = {bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), + bounds.y + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) + GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING), 0, + bounds.height - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) - 2 * GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING)}; // Update control //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) progress.width = ((float)(value/(maxValue - minValue))*(float)(bounds.width - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); + if (value > maxValue) + value = maxValue; + + if (state != STATE_DISABLED) + progress.width = ((float)(value / (maxValue - minValue)) * (float)(bounds.width - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(PROGRESSBAR, BORDER + (state*3))), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(PROGRESSBAR, BORDER + (state * 3))), guiAlpha), BLANK); // Draw slider internal progress bar (depends on state) - if ((state == GUI_STATE_NORMAL) || (state == GUI_STATE_PRESSED)) GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == GUI_STATE_FOCUSED) GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT_COLOR_FOCUSED)), guiAlpha)); + if ((state == STATE_NORMAL) || (state == STATE_PRESSED)) + GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)), guiAlpha)); + else if (state == STATE_FOCUSED) + GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT_COLOR_FOCUSED)), guiAlpha)); // Draw left/right text if provided if (textLeft != NULL) { - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; textBounds.width = (float)GetTextWidth(textLeft); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x - textBounds.width - GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - GuiDrawText(textLeft, textBounds, GUI_TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state*3))), guiAlpha)); + GuiDrawText(textLeft, textBounds, TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); } if (textRight != NULL) { - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; textBounds.width = (float)GetTextWidth(textRight); textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); textBounds.x = bounds.x + bounds.width + GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2; + textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - GuiDrawText(textRight, textBounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state*3))), guiAlpha)); + GuiDrawText(textRight, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); } //-------------------------------------------------------------------- @@ -2572,165 +2770,53 @@ float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRig // Status Bar control void GuiStatusBar(Rectangle bounds, const char *text) { - GuiControlState state = guiState; + GuiState state = guiState; // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(STATUSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? BORDER_COLOR_NORMAL : BORDER_COLOR_DISABLED)), guiAlpha), - Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(STATUSBAR, bounds), GuiGetStyle(STATUSBAR, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != GUI_STATE_DISABLED)? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); + GuiDrawRectangle(bounds, GuiGetStyle(STATUSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? BORDER_COLOR_NORMAL : BORDER_COLOR_DISABLED)), guiAlpha), + Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawText(text, GetTextBounds(STATUSBAR, bounds), GuiGetStyle(STATUSBAR, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); //-------------------------------------------------------------------- } // Dummy rectangle control, intended for placeholding void GuiDummyRec(Rectangle bounds, const char *text) { - GuiControlState state = guiState; + GuiState state = guiState; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check button state if (CheckCollisionPointRec(mousePoint, bounds)) { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; - else state = GUI_STATE_FOCUSED; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + state = STATE_PRESSED; + else + state = STATE_FOCUSED; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(DEFAULT, bounds), GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(BUTTON, (state != GUI_STATE_DISABLED)? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); + GuiDrawRectangle(bounds, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); + GuiDrawText(text, GetTextBounds(DEFAULT, bounds), TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(BUTTON, (state != STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); //------------------------------------------------------------------ } -// Scroll Bar control -int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) -{ - GuiControlState state = guiState; - - // Is the scrollbar horizontal or vertical? - bool isVertical = (bounds.width > bounds.height)? false : true; - - // The size (width or height depending on scrollbar type) of the spinner buttons - const int spinnerSize = GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)? (isVertical? (int)bounds.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH) : (int)bounds.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH)) : 0; - - // Arrow buttons [<] [>] [∧] [∨] - Rectangle arrowUpLeft = { 0 }; - Rectangle arrowDownRight = { 0 }; - - // Actual area of the scrollbar excluding the arrow buttons - Rectangle scrollbar = { 0 }; - - // Slider bar that moves --[///]----- - Rectangle slider = { 0 }; - - // Normalize value - if (value > maxValue) value = maxValue; - if (value < minValue) value = minValue; - - const int range = maxValue - minValue; - int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); - - // Calculate rectangles for all of the components - arrowUpLeft = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize }; - - if (isVertical) - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + bounds.height - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){ bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING)), bounds.height - arrowUpLeft.height - arrowDownRight.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH) }; - sliderSize = (sliderSize >= scrollbar.height)? ((int)scrollbar.height - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)scrollbar.y + (int)(((float)(value - minValue)/range)*(scrollbar.height - sliderSize)), (float)bounds.width - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)), (float)sliderSize }; - } - else - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){ (float)bounds.x + bounds.width - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x + arrowUpLeft.width, bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), bounds.width - arrowUpLeft.width - arrowDownRight.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH), bounds.height - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING))}; - sliderSize = (sliderSize >= scrollbar.width)? ((int)scrollbar.width - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){ (float)scrollbar.x + (int)(((float)(value - minValue)/range)*(scrollbar.width - sliderSize)), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)sliderSize, (float)bounds.height - 2*(GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)) }; - } - - // Update control - //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = GUI_STATE_FOCUSED; - - // Handle mouse wheel - int wheel = (int)GetMouseWheelMove(); - if (wheel != 0) value += wheel; - - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - if (CheckCollisionPointRec(mousePoint, arrowUpLeft)) value -= range/GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - else if (CheckCollisionPointRec(mousePoint, arrowDownRight)) value += range/GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - - state = GUI_STATE_PRESSED; - } - else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!isVertical) - { - Rectangle scrollArea = { arrowUpLeft.x + arrowUpLeft.width, arrowUpLeft.y, scrollbar.width, bounds.height - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) value = (int)(((float)(mousePoint.x - scrollArea.x - slider.width/2)*range)/(scrollArea.width - slider.width) + minValue); - } - else - { - Rectangle scrollArea = { arrowUpLeft.x, arrowUpLeft.y+arrowUpLeft.height, bounds.width - 2*GuiGetStyle(SCROLLBAR, BORDER_WIDTH), scrollbar.height}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) value = (int)(((float)(mousePoint.y - scrollArea.y - slider.height/2)*range)/(scrollArea.height - slider.height) + minValue); - } - } - } - - // Normalize value - if (value > maxValue) value = maxValue; - if (value < minValue) value = minValue; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SCROLLBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha)); // Draw the background - - GuiDrawRectangle(scrollbar, 0, BLANK, Fade(GetColor(GuiGetStyle(BUTTON, BASE_COLOR_NORMAL)), guiAlpha)); // Draw the scrollbar active area background - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BORDER + state*3)), guiAlpha)); // Draw the slider bar - - // Draw arrows (using icon if available) - if (GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)) - { -#if defined(RAYGUI_NO_ICONS) - GuiDrawText(isVertical? "^" : "<", RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x, arrowUpLeft.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); - GuiDrawText(isVertical? "v" : ">", RAYGUI_CLITERAL(Rectangle){ arrowDownRight.x, arrowDownRight.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); -#else - GuiDrawText(isVertical? "#121#" : "#118#", RAYGUI_CLITERAL(Rectangle){ arrowUpLeft.x, arrowUpLeft.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state*3)), guiAlpha)); // RAYGUI_ICON_ARROW_UP_FILL / RAYGUI_ICON_ARROW_LEFT_FILL - GuiDrawText(isVertical? "#120#" : "#119#", RAYGUI_CLITERAL(Rectangle){ arrowDownRight.x, arrowDownRight.y, isVertical? bounds.width : bounds.height, isVertical? bounds.width : bounds.height }, - GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state*3)), guiAlpha)); // RAYGUI_ICON_ARROW_DOWN_FILL / RAYGUI_ICON_ARROW_RIGHT_FILL -#endif - } - //-------------------------------------------------------------------- - - return value; -} - // List View control int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active) { int itemCount = 0; const char **items = NULL; - if (text != NULL) items = GuiTextSplit(text, &itemCount, NULL); + if (text != NULL) + items = GuiTextSplit(text, &itemCount, NULL); return GuiListViewEx(bounds, items, itemCount, NULL, scrollIndex, active); } @@ -2738,40 +2824,44 @@ int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active // List View control with extended parameters int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active) { - GuiControlState state = guiState; - int itemFocused = (focus == NULL)? -1 : *focus; + GuiState state = guiState; + int itemFocused = (focus == NULL) ? -1 : *focus; int itemSelected = active; // Check if we need a scroll bar bool useScrollBar = false; - if ((GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING))*count > bounds.height) useScrollBar = true; + if ((GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)) * count > bounds.height) + useScrollBar = true; // Define base item rectangle [0] - Rectangle itemBounds = { 0 }; - itemBounds.x = bounds.x + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING); - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); - itemBounds.width = bounds.width - 2*GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) - GuiGetStyle(DEFAULT, BORDER_WIDTH); + Rectangle itemBounds = {0}; + itemBounds.x = bounds.x + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING); + itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); + itemBounds.width = bounds.width - 2 * GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) - GuiGetStyle(DEFAULT, BORDER_WIDTH); itemBounds.height = (float)GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT); - if (useScrollBar) itemBounds.width -= GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH); + if (useScrollBar) + itemBounds.width -= GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH); // Get items on the list - int visibleItems = (int)bounds.height/(GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); - if (visibleItems > count) visibleItems = count; + int visibleItems = (int)bounds.height / (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); + if (visibleItems > count) + visibleItems = count; - int startIndex = (scrollIndex == NULL)? 0 : *scrollIndex; - if ((startIndex < 0) || (startIndex > (count - visibleItems))) startIndex = 0; + int startIndex = (scrollIndex == NULL) ? 0 : *scrollIndex; + if ((startIndex < 0) || (startIndex > (count - visibleItems))) + startIndex = 0; int endIndex = startIndex + visibleItems; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); // Check mouse inside list view if (CheckCollisionPointRec(mousePoint, bounds)) { - state = GUI_STATE_FOCUSED; + state = STATE_FOCUSED; // Check focused and selected item for (int i = 0; i < visibleItems; i++) @@ -2781,14 +2871,16 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, in itemFocused = startIndex + i; if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) { - if (itemSelected == (startIndex + i)) itemSelected = -1; - else itemSelected = startIndex + i; + if (itemSelected == (startIndex + i)) + itemSelected = -1; + else + itemSelected = startIndex + i; } break; } // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); + itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); } if (useScrollBar) @@ -2796,30 +2888,35 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, in int wheelMove = (int)GetMouseWheelMove(); startIndex -= wheelMove; - if (startIndex < 0) startIndex = 0; - else if (startIndex > (count - visibleItems)) startIndex = count - visibleItems; + if (startIndex < 0) + startIndex = 0; + else if (startIndex > (count - visibleItems)) + startIndex = count - visibleItems; endIndex = startIndex + visibleItems; - if (endIndex > count) endIndex = count; + if (endIndex > count) + endIndex = count; } } - else itemFocused = -1; + else + itemFocused = -1; // Reset item rectangle y to [0] - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); + itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), guiAlpha), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background // Draw visible items for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) { - if (state == GUI_STATE_DISABLED) + if (state == STATE_DISABLED) { - if ((startIndex + i) == itemSelected) GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_DISABLED)), guiAlpha)); + if ((startIndex + i) == itemSelected) + GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_DISABLED)), guiAlpha)); GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_DISABLED)), guiAlpha)); } @@ -2845,7 +2942,7 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, in } // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_PADDING)); + itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); } if (useScrollBar) @@ -2853,56 +2950,57 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, in Rectangle scrollBarBounds = { bounds.x + bounds.width - GuiGetStyle(LISTVIEW, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), bounds.y + GuiGetStyle(LISTVIEW, BORDER_WIDTH), (float)GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), - bounds.height - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) - }; + bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; // Calculate percentage of visible items and apply same percentage to scrollbar - float percentVisible = (float)(endIndex - startIndex)/count; - float sliderSize = bounds.height*percentVisible; + float percentVisible = (float)(endIndex - startIndex) / count; + float sliderSize = bounds.height * percentVisible; - int prevSliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); // Save default slider size - int prevScrollSpeed = GuiGetStyle(SCROLLBAR, SCROLL_SPEED); // Save default scroll speed - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)sliderSize); // Change slider size - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, count - visibleItems); // Change scroll speed + int prevSliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); // Save default slider size + int prevScrollSpeed = GuiGetStyle(SCROLLBAR, SCROLL_SPEED); // Save default scroll speed + GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)sliderSize); // Change slider size + GuiSetStyle(SCROLLBAR, SCROLL_SPEED, count - visibleItems); // Change scroll speed startIndex = GuiScrollBar(scrollBarBounds, startIndex, 0, count - visibleItems); - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, prevScrollSpeed); // Reset scroll speed to default + GuiSetStyle(SCROLLBAR, SCROLL_SPEED, prevScrollSpeed); // Reset scroll speed to default GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, prevSliderSize); // Reset slider size to default } //-------------------------------------------------------------------- - if (focus != NULL) *focus = itemFocused; - if (scrollIndex != NULL) *scrollIndex = startIndex; + if (focus != NULL) + *focus = itemFocused; + if (scrollIndex != NULL) + *scrollIndex = startIndex; return itemSelected; } // Color Panel control -Color GuiColorPanel(Rectangle bounds, Color color) +Color GuiColorPanel(Rectangle bounds, const char *text, Color color) { - const Color colWhite = { 255, 255, 255, 255 }; - const Color colBlack = { 0, 0, 0, 255 }; + const Color colWhite = {255, 255, 255, 255}; + const Color colBlack = {0, 0, 0, 255}; - GuiControlState state = guiState; - Vector2 pickerSelector = { 0 }; + GuiState state = guiState; + Vector2 pickerSelector = {0}; - Vector3 vcolor = { (float)color.r/255.0f, (float)color.g/255.0f, (float)color.b/255.0f }; + Vector3 vcolor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f}; Vector3 hsv = ConvertRGBtoHSV(vcolor); - pickerSelector.x = bounds.x + (float)hsv.y*bounds.width; // HSV: Saturation - pickerSelector.y = bounds.y + (1.0f - (float)hsv.z)*bounds.height; // HSV: Value + pickerSelector.x = bounds.x + (float)hsv.y * bounds.width; // HSV: Saturation + pickerSelector.y = bounds.y + (1.0f - (float)hsv.z) * bounds.height; // HSV: Value float hue = -1.0f; - Vector3 maxHue = { hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f }; + Vector3 maxHue = {hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f}; Vector3 rgbHue = ConvertHSVtoRGB(maxHue); - Color maxHueCol = { (unsigned char)(255.0f*rgbHue.x), - (unsigned char)(255.0f*rgbHue.y), - (unsigned char)(255.0f*rgbHue.z), 255 }; + Color maxHueCol = {(unsigned char)(255.0f * rgbHue.x), + (unsigned char)(255.0f * rgbHue.y), + (unsigned char)(255.0f * rgbHue.z), 255}; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); @@ -2910,14 +3008,14 @@ Color GuiColorPanel(Rectangle bounds, Color color) { if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) { - state = GUI_STATE_PRESSED; + state = STATE_PRESSED; pickerSelector = mousePoint; // Calculate color from picker - Vector2 colorPick = { pickerSelector.x - bounds.x, pickerSelector.y - bounds.y }; + Vector2 colorPick = {pickerSelector.x - bounds.x, pickerSelector.y - bounds.y}; - colorPick.x /= (float)bounds.width; // Get normalized value on x - colorPick.y /= (float)bounds.height; // Get normalized value on y + colorPick.x /= (float)bounds.width; // Get normalized value on x + colorPick.y /= (float)bounds.height; // Get normalized value on y hsv.y = colorPick.x; hsv.z = 1.0f - colorPick.y; @@ -2925,26 +3023,26 @@ Color GuiColorPanel(Rectangle bounds, Color color) Vector3 rgb = ConvertHSVtoRGB(hsv); // NOTE: Vector3ToColor() only available on raylib 1.8.1 - color = RAYGUI_CLITERAL(Color){ (unsigned char)(255.0f*rgb.x), - (unsigned char)(255.0f*rgb.y), - (unsigned char)(255.0f*rgb.z), - (unsigned char)(255.0f*(float)color.a/255.0f) }; - + color = RAYGUI_CLITERAL(Color){(unsigned char)(255.0f * rgb.x), + (unsigned char)(255.0f * rgb.y), + (unsigned char)(255.0f * rgb.z), + (unsigned char)(255.0f * (float)color.a / 255.0f)}; } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) + if (state != STATE_DISABLED) { DrawRectangleGradientEx(bounds, Fade(colWhite, guiAlpha), Fade(colWhite, guiAlpha), Fade(maxHueCol, guiAlpha), Fade(maxHueCol, guiAlpha)); DrawRectangleGradientEx(bounds, Fade(colBlack, 0), Fade(colBlack, guiAlpha), Fade(colBlack, guiAlpha), Fade(colBlack, 0)); // Draw color picker: selector - Rectangle selector = { pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)/2, (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) }; + Rectangle selector = {pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)}; GuiDrawRectangle(selector, 0, BLANK, Fade(colWhite, guiAlpha)); } else @@ -2952,7 +3050,7 @@ Color GuiColorPanel(Rectangle bounds, Color color) DrawRectangleGradientEx(bounds, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.6f), guiAlpha)); } - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); //-------------------------------------------------------------------- return color; @@ -2960,18 +3058,18 @@ Color GuiColorPanel(Rectangle bounds, Color color) // Color Bar Alpha control // NOTE: Returns alpha value normalized [0..1] -float GuiColorBarAlpha(Rectangle bounds, float alpha) +float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha) { - #if !defined(RAYGUI_COLORBARALPHA_CHECKED_SIZE) - #define RAYGUI_COLORBARALPHA_CHECKED_SIZE 10 - #endif +#if !defined(RAYGUI_COLORBARALPHA_CHECKED_SIZE) +#define RAYGUI_COLORBARALPHA_CHECKED_SIZE 10 +#endif - GuiControlState state = guiState; - Rectangle selector = { (float)bounds.x + alpha*bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)/2, (float)bounds.y - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT), (float)bounds.height + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW)*2 }; + GuiState state = guiState; + Rectangle selector = {(float)bounds.x + alpha * bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) / 2, (float)bounds.y - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT), (float)bounds.height + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2}; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); @@ -2980,14 +3078,17 @@ float GuiColorBarAlpha(Rectangle bounds, float alpha) { if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) { - state = GUI_STATE_PRESSED; - - alpha = (mousePoint.x - bounds.x)/bounds.width; - if (alpha <= 0.0f) alpha = 0.0f; - if (alpha >= 1.0f) alpha = 1.0f; - //selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; + state = STATE_PRESSED; + + alpha = (mousePoint.x - bounds.x) / bounds.width; + if (alpha <= 0.0f) + alpha = 0.0f; + if (alpha >= 1.0f) + alpha = 1.0f; + // selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; } } //-------------------------------------------------------------------- @@ -2996,28 +3097,29 @@ float GuiColorBarAlpha(Rectangle bounds, float alpha) //-------------------------------------------------------------------- // Draw alpha bar: checked background - if (state != GUI_STATE_DISABLED) + if (state != STATE_DISABLED) { - int checksX = (int)bounds.width/RAYGUI_COLORBARALPHA_CHECKED_SIZE; - int checksY = (int)bounds.height/RAYGUI_COLORBARALPHA_CHECKED_SIZE; + int checksX = (int)bounds.width / RAYGUI_COLORBARALPHA_CHECKED_SIZE; + int checksY = (int)bounds.height / RAYGUI_COLORBARALPHA_CHECKED_SIZE; for (int x = 0; x < checksX; x++) { for (int y = 0; y < checksY; y++) { - Rectangle check = { bounds.x + x*RAYGUI_COLORBARALPHA_CHECKED_SIZE, bounds.y + y*RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE }; - GuiDrawRectangle(check, 0, BLANK, ((x + y)%2)? Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.4f), guiAlpha) : Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.4f), guiAlpha)); + Rectangle check = {bounds.x + x * RAYGUI_COLORBARALPHA_CHECKED_SIZE, bounds.y + y * RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE}; + GuiDrawRectangle(check, 0, BLANK, ((x + y) % 2) ? Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.4f), guiAlpha) : Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.4f), guiAlpha)); } } - DrawRectangleGradientEx(bounds, RAYGUI_CLITERAL(Color){ 255, 255, 255, 0 }, RAYGUI_CLITERAL(Color){ 255, 255, 255, 0 }, Fade(RAYGUI_CLITERAL(Color){ 0, 0, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color){ 0, 0, 0, 255 }, guiAlpha)); + DrawRectangleGradientEx(bounds, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha)); } - else DrawRectangleGradientEx(bounds, Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); + else + DrawRectangleGradientEx(bounds, Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); // Draw alpha bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha)); + GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); //-------------------------------------------------------------------- return alpha; @@ -3029,14 +3131,14 @@ float GuiColorBarAlpha(Rectangle bounds, float alpha) // Color GuiColorBarSat() [WHITE->color] // Color GuiColorBarValue() [BLACK->color], HSV/HSL // float GuiColorBarLuminance() [BLACK->WHITE] -float GuiColorBarHue(Rectangle bounds, float hue) +float GuiColorBarHue(Rectangle bounds, const char *text, float hue) { - GuiControlState state = guiState; - Rectangle selector = { (float)bounds.x - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y + hue/360.0f*bounds.height - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)/2, (float)bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW)*2, (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) }; + GuiState state = guiState; + Rectangle selector = {(float)bounds.x - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y + hue / 360.0f * bounds.height - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) / 2, (float)bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2, (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)}; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { Vector2 mousePoint = GetMousePosition(); @@ -3045,14 +3147,16 @@ float GuiColorBarHue(Rectangle bounds, float hue) { if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) { - state = GUI_STATE_PRESSED; - - hue = (mousePoint.y - bounds.y)*360/bounds.height; - if (hue <= 0.0f) hue = 0.0f; - if (hue >= 359.0f) hue = 359.0f; + state = STATE_PRESSED; + hue = (mousePoint.y - bounds.y) * 360 / bounds.height; + if (hue <= 0.0f) + hue = 0.0f; + if (hue >= 359.0f) + hue = 359.0f; } - else state = GUI_STATE_FOCUSED; + else + state = STATE_FOCUSED; /*if (IsKeyDown(KEY_UP)) { @@ -3070,22 +3174,23 @@ float GuiColorBarHue(Rectangle bounds, float hue) // Draw control //-------------------------------------------------------------------- - if (state != GUI_STATE_DISABLED) + if (state != STATE_DISABLED) { // Draw hue bar:color bars - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 255, 0, 255 }, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + bounds.height/6), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 255, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 0, 255 }, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 2*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 0, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 255, 255 }, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 3*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 255, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 0, 0, 255, 255 }, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 4*(bounds.height/6)), (int)bounds.width, (int)ceilf(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 0, 0, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 255, 255 }, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 5*(bounds.height/6)), (int)bounds.width, (int)(bounds.height/6), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 255, 255 }, guiAlpha), Fade(RAYGUI_CLITERAL(Color) { 255, 0, 0, 255 }, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + bounds.height / 6), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 2 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 3 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 4 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha)); + DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 5 * (bounds.height / 6)), (int)bounds.width, (int)(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha)); } - else DrawRectangleGradientV((int)bounds.x, (int)bounds.y, (int)bounds.width, (int)bounds.height, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); + else + DrawRectangleGradientV((int)bounds.x, (int)bounds.y, (int)bounds.width, (int)bounds.height, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha), BLANK); + GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); // Draw hue bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state*3)), guiAlpha)); + GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); //-------------------------------------------------------------------- return hue; @@ -3097,19 +3202,19 @@ float GuiColorBarHue(Rectangle bounds, float hue) // float GuiColorBarAlpha(Rectangle bounds, float alpha) // float GuiColorBarHue(Rectangle bounds, float value) // NOTE: bounds define GuiColorPanel() size -Color GuiColorPicker(Rectangle bounds, Color color) +Color GuiColorPicker(Rectangle bounds, const char *text, Color color) { - color = GuiColorPanel(bounds, color); + color = GuiColorPanel(bounds, NULL, color); - Rectangle boundsHue = { (float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height }; - //Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; + Rectangle boundsHue = {(float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height}; + // Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; - Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){ color.r/255.0f, color.g/255.0f, color.b/255.0f }); - hsv.x = GuiColorBarHue(boundsHue, hsv.x); - //color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); + Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}); + hsv.x = GuiColorBarHue(boundsHue, NULL, hsv.x); + // color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); Vector3 rgb = ConvertHSVtoRGB(hsv); - color = RAYGUI_CLITERAL(Color){ (unsigned char)roundf(rgb.x*255.0f), (unsigned char)roundf(rgb.y*255.0f), (unsigned char)roundf(rgb.z*255.0f), color.a }; + color = RAYGUI_CLITERAL(Color){(unsigned char)roundf(rgb.x * 255.0f), (unsigned char)roundf(rgb.y * 255.0f), (unsigned char)roundf(rgb.z * 255.0f), color.a}; return color; } @@ -3117,46 +3222,48 @@ Color GuiColorPicker(Rectangle bounds, Color color) // Message Box control int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons) { - #if !defined(RAYGUI_MESSAGEBOX_BUTTON_HEIGHT) - #define RAYGUI_MESSAGEBOX_BUTTON_HEIGHT 24 - #endif - #if !defined(RAYGUI_MESSAGEBOX_BUTTON_PADDING) - #define RAYGUI_MESSAGEBOX_BUTTON_PADDING 12 - #endif +#if !defined(RAYGUI_MESSAGEBOX_BUTTON_HEIGHT) +#define RAYGUI_MESSAGEBOX_BUTTON_HEIGHT 24 +#endif +#if !defined(RAYGUI_MESSAGEBOX_BUTTON_PADDING) +#define RAYGUI_MESSAGEBOX_BUTTON_PADDING 12 +#endif - int clicked = -1; // Returns clicked button from buttons list, 0 refers to closed window button + int clicked = -1; // Returns clicked button from buttons list, 0 refers to closed window button int buttonCount = 0; const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); - Rectangle buttonBounds = { 0 }; + Rectangle buttonBounds = {0}; buttonBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING; buttonBounds.y = bounds.y + bounds.height - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; + buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING * (buttonCount + 1)) / buttonCount; buttonBounds.height = RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - Rectangle textBounds = { 0 }; - textBounds.x = bounds.x + bounds.width/2 - textSize.x/2; - textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + (bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING)/2 - textSize.y/2; + Rectangle textBounds = {0}; + textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; + textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + RAYGUI_MESSAGEBOX_BUTTON_PADDING; textBounds.width = textSize.x; - textBounds.height = textSize.y; + textBounds.height = bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 3 * RAYGUI_MESSAGEBOX_BUTTON_PADDING - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; // Draw control //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) clicked = 0; + if (GuiWindowBox(bounds, title)) + clicked = 0; int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); GuiLabel(textBounds, message); GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); prevTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); for (int i = 0; i < buttonCount; i++) { - if (GuiButton(buttonBounds, buttonsText[i])) clicked = i + 1; + if (GuiButton(buttonBounds, buttonsText[i])) + clicked = i + 1; buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); } @@ -3167,20 +3274,17 @@ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, cons } // Text Input Box control, ask for text -int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text) +int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive) { - #if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT) - #define RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT 24 - #endif - #if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_PADDING) - #define RAYGUI_TEXTINPUTBOX_BUTTON_PADDING 10 - #endif - #if !defined(RAYGUI_TEXTINPUTBOX_HEIGHT) - #define RAYGUI_TEXTINPUTBOX_HEIGHT 24 - #endif - #if !defined(RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH) - #define RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH 256 - #endif +#if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT) +#define RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT 28 +#endif +#if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_PADDING) +#define RAYGUI_TEXTINPUTBOX_BUTTON_PADDING 12 +#endif +#if !defined(RAYGUI_TEXTINPUTBOX_HEIGHT) +#define RAYGUI_TEXTINPUTBOX_HEIGHT 28 +#endif // Used to enable text edit mode // WARNING: No more than one GuiTextInputBox() should be open at the same time @@ -3190,54 +3294,71 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, co int buttonCount = 0; const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); - Rectangle buttonBounds = { 0 }; + Rectangle buttonBounds = {0}; buttonBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; buttonBounds.y = bounds.y + bounds.height - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; + buttonBounds.width = (bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING * (buttonCount + 1)) / buttonCount; buttonBounds.height = RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT; - int messageInputHeight = (int)bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - 2*RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + int messageInputHeight = (int)bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - 2 * RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - Rectangle textBounds = { 0 }; + Rectangle textBounds = {0}; if (message != NULL) { Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - textBounds.x = bounds.x + bounds.width/2 - textSize.x/2; - textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight/4 - textSize.y/2; + textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; + textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight / 4 - textSize.y / 2; textBounds.width = textSize.x; textBounds.height = textSize.y; } - Rectangle textBoxBounds = { 0 }; + Rectangle textBoxBounds = {0}; textBoxBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - textBoxBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_TEXTINPUTBOX_HEIGHT/2; - if (message == NULL) textBoxBounds.y += messageInputHeight/2; - else textBoxBounds.y += (messageInputHeight/2 + messageInputHeight/4); - textBoxBounds.width = bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING*2; + textBoxBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_TEXTINPUTBOX_HEIGHT / 2; + if (message == NULL) + textBoxBounds.y = bounds.y + 24 + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; + else + textBoxBounds.y += (messageInputHeight / 2 + messageInputHeight / 4); + textBoxBounds.width = bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING * 2; textBoxBounds.height = RAYGUI_TEXTINPUTBOX_HEIGHT; // Draw control //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) btnIndex = 0; + if (GuiWindowBox(bounds, title)) + btnIndex = 0; // Draw message if available if (message != NULL) { int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); GuiLabel(textBounds, message); GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); } - if (GuiTextBox(textBoxBounds, text, RAYGUI_TEXTINPUTBOX_MAX_TEXT_LENGTH, textEditMode)) textEditMode = !textEditMode; + if (secretViewActive != NULL) + { + static char stars[] = "****************"; + if (GuiTextBox(RAYGUI_CLITERAL(Rectangle){textBoxBounds.x, textBoxBounds.y, textBoxBounds.width - 4 - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.height}, + ((*secretViewActive == 1) || textEditMode) ? text : stars, textMaxSize, textEditMode)) + textEditMode = !textEditMode; + + *secretViewActive = GuiToggle(RAYGUI_CLITERAL(Rectangle){textBoxBounds.x + textBoxBounds.width - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.y, RAYGUI_TEXTINPUTBOX_HEIGHT, RAYGUI_TEXTINPUTBOX_HEIGHT}, (*secretViewActive == 1) ? "#44#" : "#45#", *secretViewActive); + } + else + { + if (GuiTextBox(textBoxBounds, text, textMaxSize, textEditMode)) + textEditMode = !textEditMode; + } int prevBtnTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); + GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); for (int i = 0; i < buttonCount; i++) { - if (GuiButton(buttonBounds, buttonsText[i])) btnIndex = i + 1; + if (GuiButton(buttonBounds, buttonsText[i])) + btnIndex = i + 1; buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); } @@ -3251,57 +3372,62 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, co // NOTE: Returns grid mouse-hover selected cell // About drawing lines at subpixel spacing, simple put, not easy solution: // https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster -Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs) +Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs) { - // Grid lines alpha amount - #if !defined(RAYGUI_GRID_ALPHA) - #define RAYGUI_GRID_ALPHA 0.15f - #endif +// Grid lines alpha amount +#if !defined(RAYGUI_GRID_ALPHA) +#define RAYGUI_GRID_ALPHA 0.15f +#endif - GuiControlState state = guiState; + GuiState state = guiState; Vector2 mousePoint = GetMousePosition(); - Vector2 currentCell = { -1, -1 }; + Vector2 currentCell = {-1, -1}; - int linesV = ((int)(bounds.width/spacing))*subdivs + 1; - int linesH = ((int)(bounds.height/spacing))*subdivs + 1; + int linesV = ((int)(bounds.width / spacing)) * subdivs + 1; + int linesH = ((int)(bounds.height / spacing)) * subdivs + 1; // Update control //-------------------------------------------------------------------- - if ((state != GUI_STATE_DISABLED) && !guiLocked) + if ((state != STATE_DISABLED) && !guiLocked) { if (CheckCollisionPointRec(mousePoint, bounds)) { // NOTE: Cell values must be rounded to int - currentCell.x = (int)((mousePoint.x - bounds.x)/spacing); - currentCell.y = (int)((mousePoint.y - bounds.y)/spacing); + currentCell.x = (int)((mousePoint.x - bounds.x) / spacing); + currentCell.y = (int)((mousePoint.y - bounds.y) / spacing); } } //-------------------------------------------------------------------- // Draw control //-------------------------------------------------------------------- + + // TODO: Draw background panel? + switch (state) { - case GUI_STATE_NORMAL: + case STATE_NORMAL: + { + if (subdivs > 0) { - if (subdivs > 0) + // Draw vertical grid lines + for (int i = 0; i < linesV; i++) { - // Draw vertical grid lines - for (int i = 0; i < linesV; i++) - { - Rectangle lineV = { bounds.x + spacing*i/subdivs, bounds.y, 1, bounds.height }; - GuiDrawRectangle(lineV, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA*4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); - } + Rectangle lineV = {bounds.x + spacing * i / subdivs, bounds.y, 1, bounds.height}; + GuiDrawRectangle(lineV, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); + } - // Draw horizontal grid lines - for (int i = 0; i < linesH; i++) - { - Rectangle lineH = { bounds.x, bounds.y + spacing*i/subdivs, bounds.width, 1 }; - GuiDrawRectangle(lineH, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA*4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); - } + // Draw horizontal grid lines + for (int i = 0; i < linesH; i++) + { + Rectangle lineH = {bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1}; + GuiDrawRectangle(lineH, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); } - } break; - default: break; + } + } + break; + default: + break; } return currentCell; @@ -3316,7 +3442,7 @@ Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs) // in that case, custom font image atlas is GRAY+ALPHA and pixel data can be compressed (DEFLATE) void GuiLoadStyle(const char *fileName) { - #define MAX_LINE_BUFFER_SIZE 256 +#define MAX_LINE_BUFFER_SIZE 256 bool tryBinary = false; @@ -3325,7 +3451,7 @@ void GuiLoadStyle(const char *fileName) if (rgsFile != NULL) { - char buffer[MAX_LINE_BUFFER_SIZE] = { 0 }; + char buffer[MAX_LINE_BUFFER_SIZE] = {0}; fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); if (buffer[0] == '#') @@ -3338,62 +3464,70 @@ void GuiLoadStyle(const char *fileName) { switch (buffer[0]) { - case 'p': - { - // Style property: p + case 'p': + { + // Style property: p + + sscanf(buffer, "p %d %d 0x%x", &controlId, &propertyId, &propertyValue); + GuiSetStyle(controlId, propertyId, (int)propertyValue); + } + break; + case 'f': + { + // Style font: f - sscanf(buffer, "p %d %d 0x%x", &controlId, &propertyId, &propertyValue); - GuiSetStyle(controlId, propertyId, (int)propertyValue); + int fontSize = 0; + char charmapFileName[256] = {0}; + char fontFileName[256] = {0}; + sscanf(buffer, "f %d %s %[^\r\n]s", &fontSize, charmapFileName, fontFileName); - } break; - case 'f': + Font font = {0}; + + if (charmapFileName[0] != '0') { - // Style font: f + // Load characters from charmap file, + // expected '\n' separated list of integer values + char *charValues = LoadFileText(charmapFileName); + if (charValues != NULL) + { + int glyphCount = 0; + const char **chars = TextSplit(charValues, '\n', &glyphCount); - int fontSize = 0; - char charmapFileName[256] = { 0 }; - char fontFileName[256] = { 0 }; - sscanf(buffer, "f %d %s %[^\r\n]s", &fontSize, charmapFileName, fontFileName); + int *values = (int *)RAYGUI_MALLOC(glyphCount * sizeof(int)); + for (int i = 0; i < glyphCount; i++) + values[i] = TextToInteger(chars[i]); - Font font = { 0 }; + if (font.texture.id != GetFontDefault().texture.id) + UnloadTexture(font.texture); + font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, glyphCount); + if (font.texture.id == 0) + font = GetFontDefault(); - if (charmapFileName[0] != '0') - { - // Load characters from charmap file, - // expected '\n' separated list of integer values - char *charValues = LoadFileText(charmapFileName); - if (charValues != NULL) - { - int glyphCount = 0; - const char **chars = TextSplit(charValues, '\n', &glyphCount); - - int *values = (int *)RAYGUI_MALLOC(glyphCount*sizeof(int)); - for (int i = 0; i < glyphCount; i++) values[i] = TextToInteger(chars[i]); - - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, glyphCount); - if (font.texture.id == 0) font = GetFontDefault(); - - RAYGUI_FREE(values); - } + RAYGUI_FREE(values); } - else - { - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); - if (font.texture.id == 0) font = GetFontDefault(); - } - - if ((font.texture.id > 0) && (font.glyphCount > 0)) GuiSetFont(font); + } + else + { + if (font.texture.id != GetFontDefault().texture.id) + UnloadTexture(font.texture); + font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); + if (font.texture.id == 0) + font = GetFontDefault(); + } - } break; - default: break; + if ((font.texture.id > 0) && (font.glyphCount > 0)) + GuiSetFont(font); + } + break; + default: + break; } fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); } } - else tryBinary = true; + else + tryBinary = true; fclose(rgsFile); } @@ -3402,9 +3536,10 @@ void GuiLoadStyle(const char *fileName) { rgsFile = fopen(fileName, "rb"); - if (rgsFile == NULL) return; + if (rgsFile == NULL) + return; - char signature[5] = { 0 }; + char signature[5] = {0}; short version = 0; short reserved = 0; int propertyCount = 0; @@ -3421,13 +3556,13 @@ void GuiLoadStyle(const char *fileName) { short controlId = 0; short propertyId = 0; - int propertyValue = 0; + unsigned int propertyValue = 0; for (int i = 0; i < propertyCount; i++) { fread(&controlId, 1, sizeof(short), rgsFile); fread(&propertyId, 1, sizeof(short), rgsFile); - fread(&propertyValue, 1, sizeof(int), rgsFile); + fread(&propertyValue, 1, sizeof(unsigned int), rgsFile); if (controlId == 0) // DEFAULT control { @@ -3435,9 +3570,12 @@ void GuiLoadStyle(const char *fileName) // NOTE: All DEFAULT properties should be defined first in the file GuiSetStyle(0, (int)propertyId, propertyValue); - if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) GuiSetStyle(i, (int)propertyId, propertyValue); + if (propertyId < RAYGUI_MAX_PROPS_BASE) + for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) + GuiSetStyle(i, (int)propertyId, propertyValue); } - else GuiSetStyle((int)controlId, (int)propertyId, propertyValue); + else + GuiSetStyle((int)controlId, (int)propertyId, propertyValue); } // Font loading is highly dependant on raylib API to load font data and image @@ -3448,9 +3586,9 @@ void GuiLoadStyle(const char *fileName) if (fontDataSize > 0) { - Font font = { 0 }; - int fontType = 0; // 0-Normal, 1-SDF - Rectangle whiteRec = { 0 }; + Font font = {0}; + int fontType = 0; // 0-Normal, 1-SDF + Rectangle whiteRec = {0}; fread(&font.baseSize, 1, sizeof(int), rgsFile); fread(&font.glyphCount, 1, sizeof(int), rgsFile); @@ -3465,7 +3603,7 @@ void GuiLoadStyle(const char *fileName) fread(&fontImageUncompSize, 1, sizeof(int), rgsFile); fread(&fontImageCompSize, 1, sizeof(int), rgsFile); - Image imFont = { 0 }; + Image imFont = {0}; imFont.mipmaps = 1; fread(&imFont.width, 1, sizeof(int), rgsFile); fread(&imFont.height, 1, sizeof(int), rgsFile); @@ -3480,7 +3618,8 @@ void GuiLoadStyle(const char *fileName) imFont.data = DecompressData(compData, fontImageCompSize, &dataUncompSize); // Security check, dataUncompSize must match the provided fontImageUncompSize - if (dataUncompSize != fontImageUncompSize) RAYGUI_LOG("WARNING: Uncompressed font atlas image data could be corrupted"); + if (dataUncompSize != fontImageUncompSize) + RAYGUI_LOG("WARNING: Uncompressed font atlas image data could be corrupted"); RAYGUI_FREE(compData); } @@ -3491,15 +3630,18 @@ void GuiLoadStyle(const char *fileName) fread(imFont.data, 1, fontImageUncompSize, rgsFile); } - if (font.texture.id != GetFontDefault().texture.id) UnloadTexture(font.texture); + if (font.texture.id != GetFontDefault().texture.id) + UnloadTexture(font.texture); font.texture = LoadTextureFromImage(imFont); - if (font.texture.id == 0) font = GetFontDefault(); + if (font.texture.id == 0) + font = GetFontDefault(); RAYGUI_FREE(imFont.data); // Load font recs data font.recs = (Rectangle *)RAYGUI_CALLOC(font.glyphCount, sizeof(Rectangle)); - for (int i = 0; i < font.glyphCount; i++) fread(&font.recs[i], 1, sizeof(Rectangle), rgsFile); + for (int i = 0; i < font.glyphCount; i++) + fread(&font.recs[i], 1, sizeof(Rectangle), rgsFile); // Load font chars info data font.glyphs = (GlyphInfo *)RAYGUI_CALLOC(font.glyphCount, sizeof(GlyphInfo)); @@ -3515,7 +3657,8 @@ void GuiLoadStyle(const char *fileName) // Set font texture source rectangle to be used as white texture to draw shapes // NOTE: This way, all gui can be draw using a single draw call - if ((whiteRec.width != 0) && (whiteRec.height != 0)) SetShapesTexture(font.texture, whiteRec); + if ((whiteRec.width != 0) && (whiteRec.height != 0)) + SetShapesTexture(font.texture, whiteRec); } #endif } @@ -3544,25 +3687,25 @@ void GuiLoadStyleDefault(void) GuiSetStyle(DEFAULT, BORDER_COLOR_DISABLED, 0xb5c1c2ff); GuiSetStyle(DEFAULT, BASE_COLOR_DISABLED, 0xe6e9e9ff); GuiSetStyle(DEFAULT, TEXT_COLOR_DISABLED, 0xaeb7b8ff); - GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_PADDING, 0); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); // WARNING: Some controls use other values + GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); // WARNING: Some controls use other values + GuiSetStyle(DEFAULT, TEXT_PADDING, 0); // WARNING: Some controls use other values + GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); // WARNING: Some controls use other values // Initialize control-specific property values // NOTE: Those properties are in default list but require specific values by control type - GuiSetStyle(LABEL, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); GuiSetStyle(BUTTON, BORDER_WIDTH, 2); GuiSetStyle(SLIDER, TEXT_PADDING, 4); GuiSetStyle(CHECKBOX, TEXT_PADDING, 4); - GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_RIGHT); + GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT); GuiSetStyle(TEXTBOX, TEXT_PADDING, 4); - GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); GuiSetStyle(VALUEBOX, TEXT_PADDING, 4); - GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); GuiSetStyle(SPINNER, TEXT_PADDING, 4); - GuiSetStyle(SPINNER, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(SPINNER, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); GuiSetStyle(STATUSBAR, TEXT_PADDING, 8); - GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); + GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); // Initialize extended property values // NOTE: By default, extended property values are initialized to 0 @@ -3576,15 +3719,13 @@ void GuiLoadStyleDefault(void) GuiSetStyle(PROGRESSBAR, PROGRESS_PADDING, 1); GuiSetStyle(CHECKBOX, CHECK_PADDING, 1); GuiSetStyle(COMBOBOX, COMBO_BUTTON_WIDTH, 32); - GuiSetStyle(COMBOBOX, COMBO_BUTTON_PADDING, 2); + GuiSetStyle(COMBOBOX, COMBO_BUTTON_SPACING, 2); GuiSetStyle(DROPDOWNBOX, ARROW_PADDING, 16); - GuiSetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_PADDING, 2); - GuiSetStyle(TEXTBOX, TEXT_LINES_PADDING, 4); + GuiSetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING, 2); + GuiSetStyle(TEXTBOX, TEXT_LINES_SPACING, 4); GuiSetStyle(TEXTBOX, TEXT_INNER_PADDING, 4); - GuiSetStyle(TEXTBOX, COLOR_SELECTED_FG, 0xf0fffeff); - GuiSetStyle(TEXTBOX, COLOR_SELECTED_BG, 0x839affe0); GuiSetStyle(SPINNER, SPIN_BUTTON_WIDTH, 24); - GuiSetStyle(SPINNER, SPIN_BUTTON_PADDING, 2); + GuiSetStyle(SPINNER, SPIN_BUTTON_SPACING, 2); GuiSetStyle(SCROLLBAR, BORDER_WIDTH, 0); GuiSetStyle(SCROLLBAR, ARROWS_VISIBLE, 0); GuiSetStyle(SCROLLBAR, ARROWS_SIZE, 6); @@ -3593,7 +3734,7 @@ void GuiLoadStyleDefault(void) GuiSetStyle(SCROLLBAR, SCROLL_PADDING, 0); GuiSetStyle(SCROLLBAR, SCROLL_SPEED, 12); GuiSetStyle(LISTVIEW, LIST_ITEMS_HEIGHT, 24); - GuiSetStyle(LISTVIEW, LIST_ITEMS_PADDING, 2); + GuiSetStyle(LISTVIEW, LIST_ITEMS_SPACING, 2); GuiSetStyle(LISTVIEW, SCROLLBAR_WIDTH, 12); GuiSetStyle(LISTVIEW, SCROLLBAR_SIDE, SCROLLBAR_RIGHT_SIDE); GuiSetStyle(COLORPICKER, COLOR_SELECTOR_SIZE, 8); @@ -3602,7 +3743,7 @@ void GuiLoadStyleDefault(void) GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT, 8); GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW, 2); - guiFont = GetFontDefault(); // Initialize default font + guiFont = GetFontDefault(); // Initialize default font } // Get text with icon id prepended @@ -3613,21 +3754,29 @@ const char *GuiIconText(int iconId, const char *text) #if defined(RAYGUI_NO_ICONS) return NULL; #else - static char buffer[1024] = { 0 }; - memset(buffer, 0, 1024); - - sprintf(buffer, "#%03i#", iconId); + static char buffer[1024] = {0}; + static char iconBuffer[6] = {0}; if (text != NULL) { + memset(buffer, 0, 1024); + sprintf(buffer, "#%03i#", iconId); + for (int i = 5; i < 1024; i++) { buffer[i] = text[i - 5]; - if (text[i - 5] == '\0') break; + if (text[i - 5] == '\0') + break; } + + return buffer; } + else + { + sprintf(iconBuffer, "#%03i#", iconId & 0x1ff); - return buffer; + return iconBuffer; + } #endif } @@ -3672,7 +3821,7 @@ char **GuiLoadIcons(const char *fileName, bool loadIconsName) if (rgiFile != NULL) { - char signature[5] = { 0 }; + char signature[5] = {0}; short version = 0; short reserved = 0; short iconCount = 0; @@ -3691,17 +3840,18 @@ char **GuiLoadIcons(const char *fileName, bool loadIconsName) { if (loadIconsName) { - guiIconsName = (char **)RAYGUI_MALLOC(iconCount*sizeof(char **)); + guiIconsName = (char **)RAYGUI_MALLOC(iconCount * sizeof(char **)); for (int i = 0; i < iconCount; i++) { guiIconsName[i] = (char *)RAYGUI_MALLOC(RAYGUI_ICON_MAX_NAME_LENGTH); fread(guiIconsName[i], RAYGUI_ICON_MAX_NAME_LENGTH, 1, rgiFile); } } - else fseek(rgiFile, iconCount*RAYGUI_ICON_MAX_NAME_LENGTH, SEEK_CUR); + else + fseek(rgiFile, iconCount * RAYGUI_ICON_MAX_NAME_LENGTH, SEEK_CUR); // Read icons data directly over guiIcons data array - fread(guiIcons, iconCount*(iconSize*iconSize/32), sizeof(unsigned int), rgiFile); + fread(guiIcons, iconCount * (iconSize * iconSize / 32), sizeof(unsigned int), rgiFile); } fclose(rgiFile); @@ -3713,84 +3863,114 @@ char **GuiLoadIcons(const char *fileName, bool loadIconsName) // Draw selected icon using rectangles pixel-by-pixel void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color) { - #define BIT_CHECK(a,b) ((a) & (1<<(b))) +#define BIT_CHECK(a, b) ((a) & (1u << (b))) - for (int i = 0, y = 0; i < RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32; i++) + for (int i = 0, y = 0; i < RAYGUI_ICON_SIZE * RAYGUI_ICON_SIZE / 32; i++) { for (int k = 0; k < 32; k++) { - if (BIT_CHECK(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + i], k)) + if (BIT_CHECK(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + i], k)) { - #if !defined(RAYGUI_STANDALONE) - DrawRectangle(posX + (k%RAYGUI_ICON_SIZE)*pixelSize, posY + y*pixelSize, pixelSize, pixelSize, color); - #endif +#if !defined(RAYGUI_STANDALONE) + DrawRectangle(posX + (k % RAYGUI_ICON_SIZE) * pixelSize, posY + y * pixelSize, pixelSize, pixelSize, color); +#endif } - if ((k == 15) || (k == 31)) y++; + if ((k == 15) || (k == 31)) + y++; } } } // Get icon bit data -// NOTE: Bit data array grouped as unsigned int (ICON_SIZE*ICON_SIZE/32 elements) +// NOTE: Bit data array grouped as unsigned int (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32 elements) unsigned int *GuiGetIconData(int iconId) { - static unsigned int iconData[RAYGUI_ICON_DATA_ELEMENTS] = { 0 }; - memset(iconData, 0, RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); + static unsigned int iconData[RAYGUI_ICON_DATA_ELEMENTS] = {0}; + memset(iconData, 0, RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); - if (iconId < RAYGUI_ICON_MAX_ICONS) memcpy(iconData, &guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS], RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); + if (iconId < RAYGUI_ICON_MAX_ICONS) + memcpy(iconData, &guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS], RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); return iconData; } // Set icon bit data -// NOTE: Data must be provided as unsigned int array (ICON_SIZE*ICON_SIZE/32 elements) +// NOTE: Data must be provided as unsigned int array (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32 elements) void GuiSetIconData(int iconId, unsigned int *data) { - if (iconId < RAYGUI_ICON_MAX_ICONS) memcpy(&guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS], data, RAYGUI_ICON_DATA_ELEMENTS*sizeof(unsigned int)); + if (iconId < RAYGUI_ICON_MAX_ICONS) + memcpy(&guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS], data, RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); +} + +// Set icon scale (1 by default) +void GuiSetIconScale(unsigned int scale) +{ + guiIconScale = (scale < 1) ? 1 : scale; } // Set icon pixel value void GuiSetIconPixel(int iconId, int x, int y) { - #define BIT_SET(a,b) ((a) |= (1<<(b))) +#define BIT_SET(a, b) ((a) |= (1u << (b))) // This logic works for any RAYGUI_ICON_SIZE pixels icons, // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_SET(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + y/(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)], x + (y%(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)*RAYGUI_ICON_SIZE)); + BIT_SET(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE) * RAYGUI_ICON_SIZE)); } // Clear icon pixel value void GuiClearIconPixel(int iconId, int x, int y) { - #define BIT_CLEAR(a,b) ((a) &= ~((1)<<(b))) +#define BIT_CLEAR(a, b) ((a) &= ~((1u) << (b))) // This logic works for any RAYGUI_ICON_SIZE pixels icons, // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_CLEAR(guiIcons[iconId*RAYGUI_ICON_DATA_ELEMENTS + y/(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)], x + (y%(sizeof(unsigned int)*8/RAYGUI_ICON_SIZE)*RAYGUI_ICON_SIZE)); + BIT_CLEAR(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE) * RAYGUI_ICON_SIZE)); } // Check icon pixel value bool GuiCheckIconPixel(int iconId, int x, int y) { - #define BIT_CHECK(a,b) ((a) & (1<<(b))) +#define BIT_CHECK(a, b) ((a) & (1u << (b))) - return (BIT_CHECK(guiIcons[iconId*8 + y/2], x + (y%2*16))); + return (BIT_CHECK(guiIcons[iconId * 8 + y / 2], x + (y % 2 * 16))); } -#endif // !RAYGUI_NO_ICONS +#endif // !RAYGUI_NO_ICONS //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- -// Gui get text width using default font -// NOTE: Icon is not considered here +// Gui get text width considering icon static int GetTextWidth(const char *text) { - Vector2 size = { 0 }; +#if !defined(ICON_TEXT_PADDING) +#define ICON_TEXT_PADDING 4 +#endif + + Vector2 size = {0}; + int textIconOffset = 0; if ((text != NULL) && (text[0] != '\0')) { - size = MeasureTextEx(guiFont, text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + if (text[0] == '#') + { + for (int i = 1; (text[i] != '\0') && (i < 5); i++) + { + if (text[i] == '#') + { + textIconOffset = i; + break; + } + } + } + + // Make sure guiFont is set, GuiGetStyle() initializes it lazynessly + float fontSize = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); + + size = MeasureTextEx(guiFont, text + textIconOffset, fontSize, (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); + if (textIconOffset > 0) + size.x += (RAYGUI_ICON_SIZE - ICON_TEXT_PADDING); } return (int)size.x; @@ -3803,19 +3983,26 @@ static Rectangle GetTextBounds(int control, Rectangle bounds) textBounds.x = bounds.x + GuiGetStyle(control, BORDER_WIDTH); textBounds.y = bounds.y + GuiGetStyle(control, BORDER_WIDTH); - textBounds.width = bounds.width - 2*GuiGetStyle(control, BORDER_WIDTH); - textBounds.height = bounds.height - 2*GuiGetStyle(control, BORDER_WIDTH); + textBounds.width = bounds.width - 2 * GuiGetStyle(control, BORDER_WIDTH); + textBounds.height = bounds.height - 2 * GuiGetStyle(control, BORDER_WIDTH); // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT switch (control) { - case COMBOBOX: bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_PADDING)); break; - case VALUEBOX: break; // NOTE: ValueBox text value always centered, text padding applies to label - default: - { - if (GuiGetStyle(control, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) textBounds.x -= GuiGetStyle(control, TEXT_PADDING); - else textBounds.x += GuiGetStyle(control, TEXT_PADDING); - } break; + case COMBOBOX: + bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_SPACING)); + break; + case VALUEBOX: + break; // NOTE: ValueBox text value always centered, text padding applies to label + default: + { + if (GuiGetStyle(control, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) + textBounds.x -= GuiGetStyle(control, TEXT_PADDING); + else + textBounds.x += GuiGetStyle(control, TEXT_PADDING); + textBounds.width -= 2 * GuiGetStyle(control, TEXT_PADDING); + } + break; } // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?) @@ -3830,9 +4017,9 @@ static const char *GetTextIcon(const char *text, int *iconId) { #if !defined(RAYGUI_NO_ICONS) *iconId = -1; - if (text[0] == '#') // Maybe we have an icon! + if (text[0] == '#') // Maybe we have an icon! { - char iconValue[4] = { 0 }; // Maximum length for icon value: 3 digits + '\0' + char iconValue[4] = {0}; // Maximum length for icon value: 3 digits + '\0' int pos = 1; while ((pos < 4) && (text[pos] >= '0') && (text[pos] <= '9')) @@ -3847,7 +4034,8 @@ static const char *GetTextIcon(const char *text, int *iconId) // Move text pointer after icon // WARNING: If only icon provided, it could point to EOL character: '\0' - if (*iconId >= 0) text += (pos + 1); + if (*iconId >= 0) + text += (pos + 1); } } #endif @@ -3858,55 +4046,60 @@ static const char *GetTextIcon(const char *text, int *iconId) // Gui draw text using default font static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint) { - #define TEXT_VALIGN_PIXEL_OFFSET(h) ((int)h%2) // Vertical alignment for pixel perfect +#define TEXT_VALIGN_PIXEL_OFFSET(h) ((int)h % 2) // Vertical alignment for pixel perfect - #if !defined(RAYGUI_ICON_TEXT_PADDING) - #define RAYGUI_ICON_TEXT_PADDING 4 - #endif +#if !defined(ICON_TEXT_PADDING) +#define ICON_TEXT_PADDING 4 +#endif if ((text != NULL) && (text[0] != '\0')) { int iconId = 0; - text = GetTextIcon(text, &iconId); // Check text for icon and move cursor + text = GetTextIcon(text, &iconId); // Check text for icon and move cursor // Get text position depending on alignment and iconId //--------------------------------------------------------------------------------- - - - Vector2 position = { bounds.x, bounds.y }; + Vector2 position = {bounds.x, bounds.y}; // NOTE: We get text size after icon has been processed - int textWidth = GetTextWidth(text); - int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); + // TODO: REVIEW: We consider text size in case of line breaks! -> MeasureTextEx() depends on raylib! + Vector2 textSize = MeasureTextEx(GuiGetFont(), text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); + // int textWidth = GetTextWidth(text); + // int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); // If text requires an icon, add size to measure if (iconId >= 0) { - textWidth += RAYGUI_ICON_SIZE; + textSize.x += RAYGUI_ICON_SIZE * guiIconScale; // WARNING: If only icon provided, text could be pointing to EOF character: '\0' - if ((text != NULL) && (text[0] != '\0')) textWidth += RAYGUI_ICON_TEXT_PADDING; + if ((text != NULL) && (text[0] != '\0')) + textSize.x += ICON_TEXT_PADDING; } // Check guiTextAlign global variables switch (alignment) { - case GUI_TEXT_ALIGN_LEFT: - { - position.x = bounds.x; - position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } break; - case GUI_TEXT_ALIGN_CENTER: - { - position.x = bounds.x + bounds.width/2 - textWidth/2; - position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } break; - case GUI_TEXT_ALIGN_RIGHT: - { - position.x = bounds.x + bounds.width - textWidth; - position.y = bounds.y + bounds.height/2 - textHeight/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } break; - default: break; + case TEXT_ALIGN_LEFT: + { + position.x = bounds.x; + position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } + break; + case TEXT_ALIGN_CENTER: + { + position.x = bounds.x + bounds.width / 2 - textSize.x / 2; + position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } + break; + case TEXT_ALIGN_RIGHT: + { + position.x = bounds.x + bounds.width - textSize.x; + position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); + } + break; + default: + break; } // NOTE: Make sure we get pixel-perfect coordinates, @@ -3921,8 +4114,8 @@ static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color if (iconId >= 0) { // NOTE: We consider icon height, probably different than text size - GuiDrawIcon(iconId, (int)position.x, (int)(bounds.y + bounds.height/2 - RAYGUI_ICON_SIZE/2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height)), 1, tint); - position.x += (RAYGUI_ICON_SIZE + RAYGUI_ICON_TEXT_PADDING); + GuiDrawIcon(iconId, (int)position.x, (int)(bounds.y + bounds.height / 2 - RAYGUI_ICON_SIZE * guiIconScale / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height)), guiIconScale, tint); + position.x += (RAYGUI_ICON_SIZE * guiIconScale + ICON_TEXT_PADDING); } #endif DrawTextEx(guiFont, text, position, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING), tint); @@ -3943,8 +4136,8 @@ static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, { // Draw rectangle border lines with color DrawRectangle((int)rec.x, (int)rec.y, (int)rec.width, borderWidth, borderColor); - DrawRectangle((int)rec.x, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2*borderWidth, borderColor); - DrawRectangle((int)rec.x + (int)rec.width - borderWidth, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2*borderWidth, borderColor); + DrawRectangle((int)rec.x, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2 * borderWidth, borderColor); + DrawRectangle((int)rec.x + (int)rec.width - borderWidth, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2 * borderWidth, borderColor); DrawRectangle((int)rec.x, (int)rec.y + (int)rec.height - borderWidth, (int)rec.width, borderWidth, borderColor); } } @@ -3956,45 +4149,50 @@ static const char **GuiTextSplit(const char *text, int *count, int *textRow) // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ELEMENTS + // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ITEMS // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE // NOTE: Those definitions could be externally provided if required - #if !defined(RAYGUI_TEXTSPLIT_MAX_ELEMENTS) - #define RAYGUI_TEXTSPLIT_MAX_ELEMENTS 128 - #endif - #if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) - #define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 - #endif +#if !defined(RAYGUI_TEXTSPLIT_MAX_ITEMS) +#define RAYGUI_TEXTSPLIT_MAX_ITEMS 128 +#endif +#if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) +#define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 +#endif - static const char *result[RAYGUI_TEXTSPLIT_MAX_ELEMENTS] = { NULL }; - static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = { 0 }; + static const char *result[RAYGUI_TEXTSPLIT_MAX_ITEMS] = {NULL}; + static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = {0}; memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); result[0] = buffer; int counter = 1; - if (textRow != NULL) textRow[0] = 0; + if (textRow != NULL) + textRow[0] = 0; // Count how many substrings we have on text and point to every one for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) { buffer[i] = text[i]; - if (buffer[i] == '\0') break; + if (buffer[i] == '\0') + break; else if ((buffer[i] == ';') || (buffer[i] == '\n')) { result[counter] = buffer + i + 1; if (textRow != NULL) { - if (buffer[i] == '\n') textRow[counter] = textRow[counter - 1] + 1; - else textRow[counter] = textRow[counter - 1]; + if (buffer[i] == '\n') + textRow[counter] = textRow[counter - 1] + 1; + else + textRow[counter] = textRow[counter - 1]; } - buffer[i] = '\0'; // Set an end of string at this point + buffer[i] = '\0'; // Set an end of string at this point counter++; - if (counter == RAYGUI_TEXTSPLIT_MAX_ELEMENTS) break; + if (counter == RAYGUI_TEXTSPLIT_MAX_ITEMS) + break; } } @@ -4007,51 +4205,55 @@ static const char **GuiTextSplit(const char *text, int *count, int *textRow) // NOTE: Color data should be passed normalized static Vector3 ConvertRGBtoHSV(Vector3 rgb) { - Vector3 hsv = { 0 }; + Vector3 hsv = {0}; float min = 0.0f; float max = 0.0f; float delta = 0.0f; - min = (rgb.x < rgb.y)? rgb.x : rgb.y; - min = (min < rgb.z)? min : rgb.z; + min = (rgb.x < rgb.y) ? rgb.x : rgb.y; + min = (min < rgb.z) ? min : rgb.z; - max = (rgb.x > rgb.y)? rgb.x : rgb.y; - max = (max > rgb.z)? max : rgb.z; + max = (rgb.x > rgb.y) ? rgb.x : rgb.y; + max = (max > rgb.z) ? max : rgb.z; - hsv.z = max; // Value + hsv.z = max; // Value delta = max - min; if (delta < 0.00001f) { hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? + hsv.x = 0.0f; // Undefined, maybe NAN? return hsv; } if (max > 0.0f) { // NOTE: If max is 0, this divide would cause a crash - hsv.y = (delta/max); // Saturation + hsv.y = (delta / max); // Saturation } else { // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? + hsv.x = 0.0f; // Undefined, maybe NAN? return hsv; } // NOTE: Comparing float values could not work properly - if (rgb.x >= max) hsv.x = (rgb.y - rgb.z)/delta; // Between yellow & magenta + if (rgb.x >= max) + hsv.x = (rgb.y - rgb.z) / delta; // Between yellow & magenta else { - if (rgb.y >= max) hsv.x = 2.0f + (rgb.z - rgb.x)/delta; // Between cyan & yellow - else hsv.x = 4.0f + (rgb.x - rgb.y)/delta; // Between magenta & cyan + if (rgb.y >= max) + hsv.x = 2.0f + (rgb.z - rgb.x) / delta; // Between cyan & yellow + else + hsv.x = 4.0f + (rgb.x - rgb.y) / delta; // Between magenta & cyan } - hsv.x *= 60.0f; // Convert to degrees + hsv.x *= 60.0f; // Convert to degrees - if (hsv.x < 0.0f) hsv.x += 360.0f; + if (hsv.x < 0.0f) + hsv.x += 360.0f; return hsv; } @@ -4060,7 +4262,7 @@ static Vector3 ConvertRGBtoHSV(Vector3 rgb) // NOTE: Color data should be passed normalized static Vector3 ConvertHSVtoRGB(Vector3 hsv) { - Vector3 rgb = { 0 }; + Vector3 rgb = {0}; float hh = 0.0f, p = 0.0f, q = 0.0f, t = 0.0f, ff = 0.0f; long i = 0; @@ -4074,59 +4276,190 @@ static Vector3 ConvertHSVtoRGB(Vector3 hsv) } hh = hsv.x; - if (hh >= 360.0f) hh = 0.0f; + if (hh >= 360.0f) + hh = 0.0f; hh /= 60.0f; i = (long)hh; ff = hh - i; - p = hsv.z*(1.0f - hsv.y); - q = hsv.z*(1.0f - (hsv.y*ff)); - t = hsv.z*(1.0f - (hsv.y*(1.0f - ff))); + p = hsv.z * (1.0f - hsv.y); + q = hsv.z * (1.0f - (hsv.y * ff)); + t = hsv.z * (1.0f - (hsv.y * (1.0f - ff))); switch (i) { - case 0: - { - rgb.x = hsv.z; - rgb.y = t; - rgb.z = p; - } break; - case 1: - { - rgb.x = q; - rgb.y = hsv.z; - rgb.z = p; - } break; - case 2: - { - rgb.x = p; - rgb.y = hsv.z; - rgb.z = t; - } break; - case 3: - { - rgb.x = p; - rgb.y = q; - rgb.z = hsv.z; - } break; - case 4: - { - rgb.x = t; - rgb.y = p; - rgb.z = hsv.z; - } break; - case 5: - default: - { - rgb.x = hsv.z; - rgb.y = p; - rgb.z = q; - } break; + case 0: + { + rgb.x = hsv.z; + rgb.y = t; + rgb.z = p; + } + break; + case 1: + { + rgb.x = q; + rgb.y = hsv.z; + rgb.z = p; + } + break; + case 2: + { + rgb.x = p; + rgb.y = hsv.z; + rgb.z = t; + } + break; + case 3: + { + rgb.x = p; + rgb.y = q; + rgb.z = hsv.z; + } + break; + case 4: + { + rgb.x = t; + rgb.y = p; + rgb.z = hsv.z; + } + break; + case 5: + default: + { + rgb.x = hsv.z; + rgb.y = p; + rgb.z = q; + } + break; } return rgb; } +// Scroll bar control (used by GuiScrollPanel()) +static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) +{ + GuiState state = guiState; + + // Is the scrollbar horizontal or vertical? + bool isVertical = (bounds.width > bounds.height) ? false : true; + + // The size (width or height depending on scrollbar type) of the spinner buttons + const int spinnerSize = GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE) ? (isVertical ? (int)bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH) : (int)bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)) : 0; + + // Arrow buttons [<] [>] [∧] [∨] + Rectangle arrowUpLeft = {0}; + Rectangle arrowDownRight = {0}; + + // Actual area of the scrollbar excluding the arrow buttons + Rectangle scrollbar = {0}; + + // Slider bar that moves --[///]----- + Rectangle slider = {0}; + + // Normalize value + if (value > maxValue) + value = maxValue; + if (value < minValue) + value = minValue; + + const int range = maxValue - minValue; + int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); + + // Calculate rectangles for all of the components + arrowUpLeft = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; + + if (isVertical) + { + arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + bounds.height - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; + scrollbar = RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING)), bounds.height - arrowUpLeft.height - arrowDownRight.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; + sliderSize = (sliderSize >= scrollbar.height) ? ((int)scrollbar.height - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar + slider = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)scrollbar.y + (int)(((float)(value - minValue) / range) * (scrollbar.height - sliderSize)), (float)bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)), (float)sliderSize}; + } + else + { + arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + bounds.width - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; + scrollbar = RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x + arrowUpLeft.width, bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), bounds.width - arrowUpLeft.width - arrowDownRight.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING))}; + sliderSize = (sliderSize >= scrollbar.width) ? ((int)scrollbar.width - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar + slider = RAYGUI_CLITERAL(Rectangle){(float)scrollbar.x + (int)(((float)(value - minValue) / range) * (scrollbar.width - sliderSize)), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)sliderSize, (float)bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING))}; + } + + // Update control + //-------------------------------------------------------------------- + if ((state != STATE_DISABLED) && !guiLocked) + { + Vector2 mousePoint = GetMousePosition(); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + state = STATE_FOCUSED; + + // Handle mouse wheel + int wheel = (int)GetMouseWheelMove(); + if (wheel != 0) + value += wheel; + + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + if (CheckCollisionPointRec(mousePoint, arrowUpLeft)) + value -= range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + else if (CheckCollisionPointRec(mousePoint, arrowDownRight)) + value += range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); + + state = STATE_PRESSED; + } + else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + if (!isVertical) + { + Rectangle scrollArea = {arrowUpLeft.x + arrowUpLeft.width, arrowUpLeft.y, scrollbar.width, bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; + if (CheckCollisionPointRec(mousePoint, scrollArea)) + value = (int)(((float)(mousePoint.x - scrollArea.x - slider.width / 2) * range) / (scrollArea.width - slider.width) + minValue); + } + else + { + Rectangle scrollArea = {arrowUpLeft.x, arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), scrollbar.height}; + if (CheckCollisionPointRec(mousePoint, scrollArea)) + value = (int)(((float)(mousePoint.y - scrollArea.y - slider.height / 2) * range) / (scrollArea.height - slider.height) + minValue); + } + } + } + + // Normalize value + if (value > maxValue) + value = maxValue; + if (value < minValue) + value = minValue; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + GuiDrawRectangle(bounds, GuiGetStyle(SCROLLBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha)); // Draw the background + + GuiDrawRectangle(scrollbar, 0, BLANK, Fade(GetColor(GuiGetStyle(BUTTON, BASE_COLOR_NORMAL)), guiAlpha)); // Draw the scrollbar active area background + GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BORDER + state * 3)), guiAlpha)); // Draw the slider bar + + // Draw arrows (using icon if available) + if (GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)) + { +#if defined(RAYGUI_NO_ICONS) + GuiDrawText(isVertical ? "^" : "<", RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x, arrowUpLeft.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); + GuiDrawText(isVertical ? "v" : ">", RAYGUI_CLITERAL(Rectangle){arrowDownRight.x, arrowDownRight.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); +#else + GuiDrawText(isVertical ? "#121#" : "#118#", RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x, arrowUpLeft.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state * 3)), guiAlpha)); // ICON_ARROW_UP_FILL / ICON_ARROW_LEFT_FILL + GuiDrawText(isVertical ? "#120#" : "#119#", RAYGUI_CLITERAL(Rectangle){arrowDownRight.x, arrowDownRight.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, + TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state * 3)), guiAlpha)); // ICON_ARROW_DOWN_FILL / ICON_ARROW_RIGHT_FILL +#endif + } + //-------------------------------------------------------------------- + + return value; +} + #if defined(RAYGUI_STANDALONE) // Returns a Color struct from hexadecimal value static Color GetColor(int hexValue) @@ -4153,7 +4486,8 @@ static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) bool collision = false; if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && - (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; + (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) + collision = true; return collision; } @@ -4161,10 +4495,12 @@ static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f static Color Fade(Color color, float alpha) { - if (alpha < 0.0f) alpha = 0.0f; - else if (alpha > 1.0f) alpha = 1.0f; + if (alpha < 0.0f) + alpha = 0.0f; + else if (alpha > 1.0f) + alpha = 1.0f; - Color result = { color.r, color.g, color.b, (unsigned char)(255.0f*alpha) }; + Color result = {color.r, color.g, color.b, (unsigned char)(255.0f * alpha)}; return result; } @@ -4172,9 +4508,9 @@ static Color Fade(Color color, float alpha) // Formatting of text with variables to 'embed' static const char *TextFormat(const char *text, ...) { - #if !defined(RAYGUI_TEXTFORMAT_MAX_SIZE) - #define RAYGUI_TEXTFORMAT_MAX_SIZE 256 - #endif +#if !defined(RAYGUI_TEXTFORMAT_MAX_SIZE) +#define RAYGUI_TEXTFORMAT_MAX_SIZE 256 +#endif static char buffer[RAYGUI_TEXTFORMAT_MAX_SIZE]; @@ -4190,7 +4526,7 @@ static const char *TextFormat(const char *text, ...) // NOTE: This function is only used by GuiColorPicker() static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2) { - Rectangle bounds = { (float)posX, (float)posY, (float)width, (float)height }; + Rectangle bounds = {(float)posX, (float)posY, (float)width, (float)height}; DrawRectangleGradientEx(bounds, color1, color2, color2, color1); } @@ -4200,18 +4536,18 @@ const char **TextSplit(const char *text, char delimiter, int *count) // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ELEMENTS + // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ITEMS // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE - #if !defined(RAYGUI_TEXTSPLIT_MAX_ELEMENTS) - #define RAYGUI_TEXTSPLIT_MAX_ELEMENTS 128 - #endif - #if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) - #define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 - #endif +#if !defined(RAYGUI_TEXTSPLIT_MAX_ITEMS) +#define RAYGUI_TEXTSPLIT_MAX_ITEMS 128 +#endif +#if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) +#define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 +#endif - static const char *result[RAYGUI_TEXTSPLIT_MAX_ELEMENTS] = { NULL }; - static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = { 0 }; + static const char *result[RAYGUI_TEXTSPLIT_MAX_ITEMS] = {NULL}; + static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = {0}; memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); result[0] = buffer; @@ -4225,14 +4561,16 @@ const char **TextSplit(const char *text, char delimiter, int *count) for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) { buffer[i] = text[i]; - if (buffer[i] == '\0') break; + if (buffer[i] == '\0') + break; else if (buffer[i] == delimiter) { - buffer[i] = '\0'; // Set an end of string at this point + buffer[i] = '\0'; // Set an end of string at this point result[counter] = buffer + i + 1; counter++; - if (counter == RAYGUI_TEXTSPLIT_MAX_ELEMENTS) break; + if (counter == RAYGUI_TEXTSPLIT_MAX_ITEMS) + break; } } } @@ -4250,19 +4588,21 @@ static int TextToInteger(const char *text) if ((text[0] == '+') || (text[0] == '-')) { - if (text[0] == '-') sign = -1; + if (text[0] == '-') + sign = -1; text++; } - for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) value = value*10 + (int)(text[i] - '0'); + for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) + value = value * 10 + (int)(text[i] - '0'); - return value*sign; + return value * sign; } // Encode codepoint into UTF-8 text (char array size returned as parameter) static const char *CodepointToUTF8(int codepoint, int *byteSize) { - static char utf8[6] = { 0 }; + static char utf8[6] = {0}; int size = 0; if (codepoint <= 0x7f) @@ -4279,7 +4619,7 @@ static const char *CodepointToUTF8(int codepoint, int *byteSize) else if (codepoint <= 0xffff) { utf8[0] = (char)(((codepoint >> 12) & 0x0f) | 0xe0); - utf8[1] = (char)(((codepoint >> 6) & 0x3f) | 0x80); + utf8[1] = (char)(((codepoint >> 6) & 0x3f) | 0x80); utf8[2] = (char)((codepoint & 0x3f) | 0x80); size = 3; } @@ -4287,7 +4627,7 @@ static const char *CodepointToUTF8(int codepoint, int *byteSize) { utf8[0] = (char)(((codepoint >> 18) & 0x07) | 0xf0); utf8[1] = (char)(((codepoint >> 12) & 0x3f) | 0x80); - utf8[2] = (char)(((codepoint >> 6) & 0x3f) | 0x80); + utf8[2] = (char)(((codepoint >> 6) & 0x3f) | 0x80); utf8[3] = (char)((codepoint & 0x3f) | 0x80); size = 4; } @@ -4304,20 +4644,20 @@ static const char *CodepointToUTF8(int codepoint, int *byteSize) // but that character is not supported by the default font in raylib static int GetCodepoint(const char *text, int *bytesProcessed) { -/* - UTF-8 specs from https://www.ietf.org/rfc/rfc3629.txt - - Char. number range | UTF-8 octet sequence - (hexadecimal) | (binary) - --------------------+--------------------------------------------- - 0000 0000-0000 007F | 0xxxxxxx - 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx -*/ + /* + UTF-8 specs from https://www.ietf.org/rfc/rfc3629.txt + + Char. number range | UTF-8 octet sequence + (hexadecimal) | (binary) + --------------------+--------------------------------------------- + 0000 0000-0000 007F | 0xxxxxxx + 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + */ // NOTE: on decode errors we return as soon as possible - int code = 0x3f; // Codepoint (defaults to '?') + int code = 0x3f; // Codepoint (defaults to '?') int octet = (unsigned char)(text[0]); // The first UTF8 octet *bytesProcessed = 1; @@ -4333,7 +4673,11 @@ static int GetCodepoint(const char *text, int *bytesProcessed) // [0]xC2-DF [1]UTF8-tail(x80-BF) unsigned char octet1 = text[1]; - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) + { + *bytesProcessed = 2; + return code; + } // Unexpected sequence if ((octet >= 0xc2) && (octet <= 0xdf)) { @@ -4347,11 +4691,19 @@ static int GetCodepoint(const char *text, int *bytesProcessed) unsigned char octet1 = text[1]; unsigned char octet2 = '\0'; - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) + { + *bytesProcessed = 2; + return code; + } // Unexpected sequence octet2 = text[2]; - if ((octet2 == '\0') || ((octet2 >> 6) != 2)) { *bytesProcessed = 3; return code; } // Unexpected sequence + if ((octet2 == '\0') || ((octet2 >> 6) != 2)) + { + *bytesProcessed = 3; + return code; + } // Unexpected sequence // [0]xE0 [1]xA0-BF [2]UTF8-tail(x80-BF) // [0]xE1-EC [1]UTF8-tail [2]UTF8-tail(x80-BF) @@ -4359,7 +4711,11 @@ static int GetCodepoint(const char *text, int *bytesProcessed) // [0]xEE-EF [1]UTF8-tail [2]UTF8-tail(x80-BF) if (((octet == 0xe0) && !((octet1 >= 0xa0) && (octet1 <= 0xbf))) || - ((octet == 0xed) && !((octet1 >= 0x80) && (octet1 <= 0x9f)))) { *bytesProcessed = 2; return code; } + ((octet == 0xed) && !((octet1 >= 0x80) && (octet1 <= 0x9f)))) + { + *bytesProcessed = 2; + return code; + } if ((octet >= 0xe0) && (0 <= 0xef)) { @@ -4370,28 +4726,45 @@ static int GetCodepoint(const char *text, int *bytesProcessed) else if ((octet & 0xf8) == 0xf0) { // Four octets - if (octet > 0xf4) return code; + if (octet > 0xf4) + return code; unsigned char octet1 = text[1]; unsigned char octet2 = '\0'; unsigned char octet3 = '\0'; - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) { *bytesProcessed = 2; return code; } // Unexpected sequence + if ((octet1 == '\0') || ((octet1 >> 6) != 2)) + { + *bytesProcessed = 2; + return code; + } // Unexpected sequence octet2 = text[2]; - if ((octet2 == '\0') || ((octet2 >> 6) != 2)) { *bytesProcessed = 3; return code; } // Unexpected sequence + if ((octet2 == '\0') || ((octet2 >> 6) != 2)) + { + *bytesProcessed = 3; + return code; + } // Unexpected sequence octet3 = text[3]; - if ((octet3 == '\0') || ((octet3 >> 6) != 2)) { *bytesProcessed = 4; return code; } // Unexpected sequence + if ((octet3 == '\0') || ((octet3 >> 6) != 2)) + { + *bytesProcessed = 4; + return code; + } // Unexpected sequence // [0]xF0 [1]x90-BF [2]UTF8-tail [3]UTF8-tail // [0]xF1-F3 [1]UTF8-tail [2]UTF8-tail [3]UTF8-tail // [0]xF4 [1]x80-8F [2]UTF8-tail [3]UTF8-tail if (((octet == 0xf0) && !((octet1 >= 0x90) && (octet1 <= 0xbf))) || - ((octet == 0xf4) && !((octet1 >= 0x80) && (octet1 <= 0x8f)))) { *bytesProcessed = 2; return code; } // Unexpected sequence + ((octet == 0xf4) && !((octet1 >= 0x80) && (octet1 <= 0x8f)))) + { + *bytesProcessed = 2; + return code; + } // Unexpected sequence if (octet >= 0xf0) { @@ -4400,10 +4773,11 @@ static int GetCodepoint(const char *text, int *bytesProcessed) } } - if (code > 0x10ffff) code = 0x3f; // Codepoints after U+10ffff are invalid + if (code > 0x10ffff) + code = 0x3f; // Codepoints after U+10ffff are invalid return code; } -#endif // RAYGUI_STANDALONE +#endif // RAYGUI_STANDALONE -#endif // RAYGUI_IMPLEMENTATION \ No newline at end of file +#endif // RAYGUI_IMPLEMENTATION diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index fea1e89c..2a20ed8d 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -17,18 +17,20 @@ Permission is granted to anyone to use this software for any purpose, including extern crate bindgen; -use std::path::{Path, PathBuf}; use std::env; +use std::path::{Path, PathBuf}; /// latest version on github's release page as of time or writing -const LATEST_RAYLIB_VERSION: &str = "3.7.0"; -const LATEST_RAYLIB_API_VERSION: &str = "3"; +const LATEST_RAYLIB_VERSION: &str = "4.2.0"; +const LATEST_RAYLIB_API_VERSION: &str = "4"; #[cfg(feature = "nobuild")] fn build_with_cmake(_src_path: &str) {} #[cfg(not(feature = "nobuild"))] fn build_with_cmake(src_path: &str) { + use cmake::build; + // CMake uses different lib directories on different systems. // I do not know how CMake determines what directory to use, // so we will check a few possibilities and use whichever is present. @@ -47,15 +49,17 @@ fn build_with_cmake(src_path: &str) { let (platform, platform_os) = platform_from_target(&target); let mut conf = cmake::Config::new(src_path); - let builder; + let mut builder; #[cfg(debug_assertions)] { builder = conf.profile("Debug"); + builder = builder.define("CMAKE_BUILD_TYPE", "Debug") } #[cfg(not(debug_assertions))] { builder = conf.profile("Release"); + builder = builder.define("CMAKE_BUILD_TYPE", "Release") } builder @@ -75,7 +79,7 @@ fn build_with_cmake(src_path: &str) { // This seems redundant, but I felt it was needed incase raylib changes it's default #[cfg(not(feature = "wayland"))] builder.define("USE_WAYLAND", "OFF"); - + // Scope implementing flags for forcing OpenGL version // See all possible flags at https://github.com/raysan5/raylib/wiki/CMake-Build-Options { @@ -103,7 +107,9 @@ fn build_with_cmake(src_path: &str) { match platform { Platform::Desktop => conf.define("PLATFORM", "Desktop"), - Platform::Web => conf.define("PLATFORM", "Web").define("CMAKE_C_FLAGS", "-s ASYNCIFY"), + Platform::Web => conf + .define("PLATFORM", "Web") + .define("CMAKE_C_FLAGS", "-s ASYNCIFY"), Platform::RPI => conf.define("PLATFORM", "Raspberry Pi"), }; @@ -148,7 +154,7 @@ fn gen_bindings() { let plat = match platform { Platform::Desktop => "-DPLATFORM_DESKTOP", Platform::RPI => "-DPLATFORM_RPI", - Platform::Web => "-DPLATFORM_WEB" + Platform::Web => "-DPLATFORM_WEB", }; let mut builder = bindgen::Builder::default() @@ -184,7 +190,7 @@ fn gen_rgui() { { cc::Build::new() .file("binding/rgui_wrapper.cpp") - .include(".") + .include("binding") .warnings(false) // .flag("-std=c99") .extra_warnings(false) @@ -194,7 +200,7 @@ fn gen_rgui() { { cc::Build::new() .file("binding/rgui_wrapper.c") - .include(".") + .include("binding") .warnings(false) // .flag("-std=c99") .extra_warnings(false) @@ -248,7 +254,7 @@ fn link(platform: Platform, platform_os: PlatformOS) { println!("cargo:rustc-link-lib=brcmEGL"); println!("cargo:rustc-link-lib=brcmGLESv2"); println!("cargo:rustc-link-lib=vcos"); - } + } println!("cargo:rustc-link-lib=static=raylib"); } diff --git a/raylib-sys/raylib b/raylib-sys/raylib index b6c8d343..bf2ad9df 160000 --- a/raylib-sys/raylib +++ b/raylib-sys/raylib @@ -1 +1 @@ -Subproject commit b6c8d343dca2ef19c23c50975328a028124cf3cb +Subproject commit bf2ad9df5fdcaa385b2a7f66fd85632eeebbadaa diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 63d49ef8..067e5d8c 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib" -version = "4.0.0" +version = "4.2.0" authors = ["DeltaPHC "] license = "Zlib" readme = "../README.md" @@ -12,7 +12,7 @@ categories = ["api-bindings", "game-engines", "graphics"] edition = "2018" [dependencies] -raylib-sys = { version = "= 4.0.0", path = "../raylib-sys" } +raylib-sys = { version = "= 4.2.0", path = "../raylib-sys" } libc = "0.2.45" lazy_static = "1.2.0" cfg-if = "1.0.0" From 74aae175ad62ab8c00318b08b632a78e3fcef73c Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 12 Nov 2022 22:53:19 -0800 Subject: [PATCH 07/30] Raylib building --- checklist.md | 647 +++++++++++++++++++++++++++++++++++ raylib/Cargo.toml | 2 +- raylib/src/consts.rs | 5 +- raylib/src/core/collision.rs | 11 +- raylib/src/core/file.rs | 16 +- raylib/src/core/models.rs | 8 - raylib/src/rgui/safe.rs | 309 ++++++++--------- 7 files changed, 795 insertions(+), 203 deletions(-) create mode 100644 checklist.md diff --git a/checklist.md b/checklist.md new file mode 100644 index 00000000..58ffbf36 --- /dev/null +++ b/checklist.md @@ -0,0 +1,647 @@ +```c +// Window-related functions +RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context +RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed +RLAPI void CloseWindow(void); // Close window and unload OpenGL context +RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully +RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) +RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowResized(void); // Check if window has been resized last frame +RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) +RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) +RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) +RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) +RLAPI void SetWindowSize(int width, int height); // Set window dimensions +RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) +RLAPI void *GetWindowHandle(void); // Get native window handle +RLAPI int GetScreenWidth(void); // Get current screen width +RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) +RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) +RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI int GetCurrentMonitor(void); // Get current connected monitor +RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position +RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) +RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) +RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres +RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres +RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate +RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor +RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor +RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +RLAPI void SetClipboardText(const char *text); // Set clipboard text content +RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling +RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling + +// Custom frame control functions +// NOTE: Those functions are intended for advance users that want full control over the frame processing +// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() +// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL +RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) +RLAPI void PollInputEvents(void); // Register all input events +RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution) + +// Cursor-related functions +RLAPI void ShowCursor(void); // Shows cursor +RLAPI void HideCursor(void); // Hides cursor +RLAPI bool IsCursorHidden(void); // Check if cursor is not visible +RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) +RLAPI void DisableCursor(void); // Disables cursor (lock cursor) +RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen + +// Drawing-related functions +RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) +RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing +RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) +RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D) +RLAPI void EndMode2D(void); // Ends 2D mode with custom camera +RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D) +RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode +RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture +RLAPI void EndTextureMode(void); // Ends drawing to render texture +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +RLAPI void EndScissorMode(void); // End scissor mode +RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) + +// VR stereo config functions for VR simulator +RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters +RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config + +// Shader management functions +// NOTE: Shader functionality is not available on OpenGL 1.1 +RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) + +// Screen-space-related functions +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position +RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position + +// Timing-related functions +RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) +RLAPI int GetFPS(void); // Get current FPS +RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) +RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() + +// Misc. functions +RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) +RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator +RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) +RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) + +RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) +RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level +RLAPI void *MemAlloc(int size); // Internal memory allocator +RLAPI void *MemRealloc(void *ptr, int size); // Internal memory reallocator +RLAPI void MemFree(void *ptr); // Internal memory free + +RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) + +// Set custom callbacks +// WARNING: Callbacks setup is intended for advance users +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log +RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader +RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver +RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader +RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver + +// Files management functions +RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) +RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() +RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success +RLAPI bool ExportDataAsCode(const char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success +RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string +RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() +RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +RLAPI bool FileExists(const char *fileName); // Check if file exists +RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists +RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) +RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) +RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') +RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) +RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) +RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) +RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string) +RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success +RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory +RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths +RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan +RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths +RLAPI bool IsFileDropped(void); // Check if dropped filepaths +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) + +// Compression/Encoding functionality +RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree() +RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() +RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() +RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() + +//------------------------------------------------------------------------------------ +// Input Handling Functions (Module: core) +//------------------------------------------------------------------------------------ + +// Input-related functions: keyboard +RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once +RLAPI bool IsKeyDown(int key); // Check if a key is being pressed +RLAPI bool IsKeyReleased(int key); // Check if a key has been released once +RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed +RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty +RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty + +// Input-related functions: gamepads +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) + +// Input-related functions: mouse +RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed +RLAPI int GetMouseX(void); // Get mouse position X +RLAPI int GetMouseY(void); // Get mouse position Y +RLAPI Vector2 GetMousePosition(void); // Get mouse position XY +RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames +RLAPI void SetMousePosition(int x, int y); // Set mouse position XY +RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling +RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement for X or Y, whichever is larger +RLAPI Vector2 GetMouseWheelMoveV(void); // Get mouse wheel movement for both X and Y +RLAPI void SetMouseCursor(int cursor); // Set mouse cursor + +// Input-related functions: touch +RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) +RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) +RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) +RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index +RLAPI int GetTouchPointCount(void); // Get number of touch points + +//------------------------------------------------------------------------------------ +// Gestures and Touch Handling Functions (Module: rgestures) +//------------------------------------------------------------------------------------ +RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle + +//------------------------------------------------------------------------------------ +// Camera System Functions (Module: rcamera) +//------------------------------------------------------------------------------------ +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode + +RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) + +//------------------------------------------------------------------------------------ +// Basic Shapes Drawing Functions (Module: shapes) +//------------------------------------------------------------------------------------ +// Set texture and rectangle to be used on shapes drawing +// NOTE: It can be useful when using basic shapes and one single font, +// defining a font char white rectangle would allow drawing everything in a single draw call +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing + +// Basic shapes drawing functions +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line +RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) +RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness +RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point +RLAPI void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points +RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence +RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) +RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse +RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline +RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) +RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) +RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides +RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters + +// Basic shapes collision detection functions +RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles +RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles +RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle +RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference +RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision + +//------------------------------------------------------------------------------------ +// Texture Loading and Drawing Functions (Module: textures) +//------------------------------------------------------------------------------------ + +// Image loading functions +// NOTE: This functions do not require GPU access +RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' +RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data +RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) +RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) +RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success +RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success + +// Image generation functions +RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color +RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient +RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient +RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient +RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked +RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise +RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells + +// Image manipulation functions +RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) +RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) +RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value +RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color +RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image +RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) +RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image +RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI void ImageFlipVertical(Image *image); // Flip image vertically +RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg +RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint +RLAPI void ImageColorInvert(Image *image); // Modify image color: invert +RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale +RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color +RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) +RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) +RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() +RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() +RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle +RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position + +// Image drawing functions +// NOTE: Image software-rendering functions (CPU) +RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color +RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image +RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) +RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image +RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image +RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) +RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) +RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) +RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) +RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) + +// Texture loading functions +// NOTE: These functions require GPU access +RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) +RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported +RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) +RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) +RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data +RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data + +// Texture configuration functions +RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture +RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode + +// Texture drawing functions +RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D +RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon + +// Color/pixel related functions +RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] +RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] +RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] +RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] +RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint +RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value +RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer +RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format + +//------------------------------------------------------------------------------------ +// Font Loading and Text Drawing Functions (Module: text) +//------------------------------------------------------------------------------------ + +// Font loading/unloading functions +RLAPI Font GetFontDefault(void); // Get the default Font +RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set +RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' +RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use +RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) +RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) +RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success + +// Text drawing functions +RLAPI void DrawFPS(int posX, int posY); // Draw current FPS +RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) +RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) +RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) + +// Text font info functions +RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font +RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font +RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found +RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found +RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found + +// Text codepoints management functions (unicode characters) +RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter +RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory +RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string +RLAPI int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +RLAPI const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) +RLAPI char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) + +// Text strings management functions (no UTF-8 strings, only byte chars) +// NOTE: Some strings allocate memory internally for returned strings, just be careful! +RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied +RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) +RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) +RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) +RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) + +//------------------------------------------------------------------------------------ +// Basic 3d Shapes Drawing Functions (Module: models) +//------------------------------------------------------------------------------------ + +// Basic geometric 3D shapes drawing functions +RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line +RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space +RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube +RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) +RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) +RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured +RLAPI void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture +RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires +RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos +RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ +RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line +RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) + +//------------------------------------------------------------------------------------ +// Model 3d Loading and Drawing Functions (Module: models) +//------------------------------------------------------------------------------------ + +// Model management functions +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) +RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) + +// Model drawing functions +RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation + +// Mesh management functions +RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids +RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index +RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU +RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents + +// Mesh generation functions +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh +RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data + +// Material loading/unloading functions +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh + +// Model animations loading/unloading functions +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match + +// Collision detection functions +RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere +RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere +RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box +RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad + +//------------------------------------------------------------------------------------ +// Audio Loading and Playing Functions (Module: audio) +//------------------------------------------------------------------------------------ +typedef void (*AudioCallback)(void *bufferData, unsigned int frames); + +// Audio device management functions +RLAPI void InitAudioDevice(void); // Initialize audio device and context +RLAPI void CloseAudioDevice(void); // Close the audio device and context +RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +RLAPI void SetMasterVolume(float volume); // Set master volume (listener) + +// Wave/Sound loading/unloading functions +RLAPI Wave LoadWave(const char *fileName); // Load wave data from file +RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' +RLAPI Sound LoadSound(const char *fileName); // Load sound from file +RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data +RLAPI void UnloadWave(Wave wave); // Unload wave data +RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success +RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success + +// Wave/Sound management functions +RLAPI void PlaySound(Sound sound); // Play a sound +RLAPI void StopSound(Sound sound); // Stop playing a sound +RLAPI void PauseSound(Sound sound); // Pause a sound +RLAPI void ResumeSound(Sound sound); // Resume a paused sound +RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) +RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) +RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel +RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) +RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) +RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) +RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave +RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array +RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() + +// Music management functions +RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file +RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data +RLAPI void UnloadMusicStream(Music music); // Unload music stream +RLAPI void PlayMusicStream(Music music); // Start music playing +RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing +RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming +RLAPI void StopMusicStream(Music music); // Stop music playing +RLAPI void PauseMusicStream(Music music); // Pause music playing +RLAPI void ResumeMusicStream(Music music); // Resume playing paused music +RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) +RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) +RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) +RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) + +// AudioStream management functions +RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) +RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory +RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data +RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream +RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream +RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream +RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing +RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream +RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) +RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) +RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams +RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data + +RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream +RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream + +#if defined(__cplusplus) +} +#endif + +#endif // RAYLIB_H +``` \ No newline at end of file diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 067e5d8c..a8555ab8 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] raylib-sys = { version = "= 4.2.0", path = "../raylib-sys" } -libc = "0.2.45" +libc = "0.2.137" lazy_static = "1.2.0" cfg-if = "1.0.0" serde = { version = "1.0.125", features = ["derive"], optional = true } diff --git a/raylib/src/consts.rs b/raylib/src/consts.rs index 6c60a83f..797de7af 100644 --- a/raylib/src/consts.rs +++ b/raylib/src/consts.rs @@ -23,21 +23,20 @@ pub use ffi::DEG2RAD; // TODO Fix when rlgl bindings are in pub const MAX_MATERIAL_MAPS: u32 = 12; pub const MAX_SHADER_LOCATIONS: u32 = 32; -pub use ffi::guiIconName; pub use ffi::GuiCheckBoxProperty; pub use ffi::GuiColorPickerProperty; pub use ffi::GuiComboBoxProperty; pub use ffi::GuiControl; pub use ffi::GuiControlProperty; -pub use ffi::GuiControlState; pub use ffi::GuiDefaultProperty; pub use ffi::GuiDropdownBoxProperty; +pub use ffi::GuiIconName; pub use ffi::GuiListViewProperty; pub use ffi::GuiProgressBarProperty; pub use ffi::GuiScrollBarProperty; -pub use ffi::GuiScrollBarSide; pub use ffi::GuiSliderProperty; pub use ffi::GuiSpinnerProperty; +pub use ffi::GuiState; pub use ffi::GuiTextAlignment; pub use ffi::GuiTextBoxProperty; pub use ffi::GuiToggleProperty; diff --git a/raylib/src/core/collision.rs b/raylib/src/core/collision.rs index cf5ffb9e..4cd7fc16 100644 --- a/raylib/src/core/collision.rs +++ b/raylib/src/core/collision.rs @@ -2,7 +2,8 @@ use crate::core::math::{BoundingBox, Ray, Rectangle, Vector2}; use crate::core::models::Model; use crate::ffi; -use crate::math::RayCollision; +use crate::math::{Matrix, RayCollision}; +use crate::models::Mesh; impl Rectangle { /// Check collision between two rectangles @@ -148,8 +149,8 @@ pub fn get_ray_collision_sphere( /// Gets collision info between ray and model. #[inline] -pub fn get_ray_collision_model(ray: Ray, model: &Model) -> RayCollision { - unsafe { ffi::GetRayCollisionModel(ray.into(), model.0).into() } +pub fn get_ray_collision_mesh(ray: Ray, model: &Mesh, transform: &Matrix) -> RayCollision { + unsafe { ffi::GetRayCollisionMesh(ray.into(), model.0, transform.into()).into() } } /// Gets collision info between ray and triangle. @@ -172,5 +173,7 @@ pub fn get_ray_collision_quad( p3: impl Into, p4: impl Into, ) -> RayCollision { - unsafe { ffi::GetRayCollisionQuad(ray.into(), p1.into(), p2.into(), p3.into(), p4.into()).into() } + unsafe { + ffi::GetRayCollisionQuad(ray.into(), p1.into(), p2.into(), p3.into(), p4.into()).into() + } } diff --git a/raylib/src/core/file.rs b/raylib/src/core/file.rs index 52055fa9..2d0f6ec4 100644 --- a/raylib/src/core/file.rs +++ b/raylib/src/core/file.rs @@ -15,24 +15,16 @@ impl RaylibHandle { pub fn get_dropped_files(&self) -> Vec { let mut v = Vec::new(); unsafe { - let mut count: i32 = 0; - let dropfiles = ffi::GetDroppedFiles(&mut count); - for i in 0..count { - let filestr = CStr::from_ptr(*dropfiles.offset(i as isize)) + let dropfiles = ffi::LoadDroppedFiles(); + for i in 0..dropfiles.count { + let filestr = CStr::from_ptr(*dropfiles.paths.offset(i as isize)) .to_str() .unwrap(); let file = String::from(filestr); v.push(file); } + ffi::UnloadDroppedFiles(dropfiles) } v } - - /// Clears dropped files paths buffer. - #[inline] - pub fn clear_dropped_files(&mut self) { - unsafe { - ffi::ClearDroppedFiles(); - } - } } diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index 7b393fc9..6d8a9631 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -387,14 +387,6 @@ pub trait RaylibMesh: AsRef + AsMut { } } - /// Computes mesh binormals. - #[inline] - fn gen_mesh_binormals(&mut self) { - unsafe { - ffi::GenMeshBinormals(self.as_mut()); - } - } - /// Exports mesh as an OBJ file. #[inline] fn export_mesh(&self, filename: &str) { diff --git a/raylib/src/rgui/safe.rs b/raylib/src/rgui/safe.rs index 6a627d01..20b59e55 100644 --- a/raylib/src/rgui/safe.rs +++ b/raylib/src/rgui/safe.rs @@ -7,6 +7,31 @@ use crate::ffi; use std::ffi::CStr; +pub trait IntoCStr { + fn as_cstr_ptr(&self) -> *const std::os::raw::c_char; +} + +impl IntoCStr for dyn AsRef { + fn as_cstr_ptr(&self) -> *const std::os::raw::c_char { + std::ffi::CString::new(self.as_ref()) + .unwrap() + .as_c_str() + .as_ptr() + } +} + +impl IntoCStr for dyn AsRef { + fn as_cstr_ptr(&self) -> *const std::os::raw::c_char { + self.as_ref().as_ptr() + } +} + +impl IntoCStr for Option<&CStr> { + fn as_cstr_ptr(&self) -> *const std::os::raw::c_char { + self.map(CStr::as_ptr).unwrap_or(std::ptr::null()) + } +} + /// Global gui modification functions impl RaylibHandle { /// Enable gui controls (global state) @@ -36,12 +61,12 @@ impl RaylibHandle { } /// Set gui state (global state) #[inline] - pub fn gui_set_state(&mut self, state: crate::consts::GuiControlState) { + pub fn gui_set_state(&mut self, state: crate::consts::GuiState) { unsafe { ffi::GuiSetState(state as i32) } } /// Get gui state (global state) #[inline] - pub fn gui_get_state(&mut self) -> crate::consts::GuiControlState { + pub fn gui_get_state(&mut self) -> crate::consts::GuiState { unsafe { std::mem::transmute(ffi::GuiGetState()) } } /// Set gui custom font (global state) @@ -69,8 +94,8 @@ impl RaylibHandle { } /// Load style file (.rgs) #[inline] - pub fn gui_load_style(&mut self, filename: Option<&CStr>) { - unsafe { ffi::GuiLoadStyle(filename.map(CStr::as_ptr).unwrap_or(std::ptr::null())) } + pub fn gui_load_style(&mut self, filename: impl IntoCStr) { + unsafe { ffi::GuiLoadStyle(filename.as_cstr_ptr()) } } /// Load style default over global style #[inline] @@ -109,12 +134,12 @@ pub trait RaylibDrawGui { } /// Set gui state (global state) #[inline] - fn gui_set_state(&mut self, state: crate::consts::GuiControlState) { + fn gui_set_state(&mut self, state: crate::consts::GuiState) { unsafe { ffi::GuiSetState(state as i32) } } /// Get gui state (global state) #[inline] - fn gui_get_state(&mut self) -> crate::consts::GuiControlState { + fn gui_get_state(&mut self) -> crate::consts::GuiState { unsafe { std::mem::transmute(ffi::GuiGetState()) } } /// Set gui custom font (global state) @@ -142,8 +167,8 @@ pub trait RaylibDrawGui { } /// Load style file (.rgs) #[inline] - fn gui_load_style(&mut self, filename: Option<&CStr>) { - unsafe { ffi::GuiLoadStyle(filename.map(CStr::as_ptr).unwrap_or(std::ptr::null())) } + fn gui_load_style(&mut self, filename: impl IntoCStr) { + unsafe { ffi::GuiLoadStyle(filename.as_cstr_ptr()) } } /// Load style default over global style #[inline] @@ -152,170 +177,116 @@ pub trait RaylibDrawGui { } /// Window Box control, shows a window that can be closed #[inline] - fn gui_window_box(&mut self, bounds: impl Into, title: Option<&CStr>) -> bool { - unsafe { - ffi::GuiWindowBox( - bounds.into(), - title.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_window_box(&mut self, bounds: impl Into, title: impl IntoCStr) -> bool { + unsafe { ffi::GuiWindowBox(bounds.into(), title.as_cstr_ptr()) } } /// Group Box control with text name #[inline] - fn gui_group_box(&mut self, bounds: impl Into, text: Option<&CStr>) { - unsafe { - ffi::GuiGroupBox( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_group_box(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiGroupBox(bounds.into(), text.as_cstr_ptr()) } } /// Line separator control, could contain text #[inline] - fn gui_line(&mut self, bounds: impl Into, text: Option<&CStr>) { - unsafe { - ffi::GuiLine( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_line(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiLine(bounds.into(), text.as_cstr_ptr()) } } /// Panel control, useful to group controls #[inline] - fn gui_panel(&mut self, bounds: impl Into) { - unsafe { ffi::GuiPanel(bounds.into()) } + fn gui_panel(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiPanel(bounds.into(), text.as_cstr_ptr()) } } /// Scroll Panel control #[inline] fn gui_scroll_panel( &mut self, bounds: impl Into, + text: impl IntoCStr, content: impl Into, scroll: impl Into, ) -> (Rectangle, Vector2) { let mut scroll = scroll.into(); - let bounds: ffi::Rectangle = - unsafe { ffi::GuiScrollPanel(bounds.into(), content.into(), &mut scroll) }; + let bounds: ffi::Rectangle = unsafe { + ffi::GuiScrollPanel( + bounds.into(), + text.as_cstr_ptr(), + content.into(), + &mut scroll, + ) + }; return (bounds.into(), scroll.into()); } /// Label control, shows text #[inline] - fn gui_label(&mut self, bounds: impl Into, text: Option<&CStr>) { - unsafe { - ffi::GuiLabel( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_label(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiLabel(bounds.into(), text.as_cstr_ptr()) } } /// Button control, returns true when clicked #[inline] - fn gui_button(&mut self, bounds: impl Into, text: Option<&CStr>) -> bool { - unsafe { - ffi::GuiButton( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_button(&mut self, bounds: impl Into, text: impl IntoCStr) -> bool { + unsafe { ffi::GuiButton(bounds.into(), text.as_cstr_ptr()) } } /// Label button control, show true when clicked #[inline] - fn gui_label_button(&mut self, bounds: impl Into, text: Option<&CStr>) -> bool { - unsafe { - ffi::GuiLabelButton( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_label_button(&mut self, bounds: impl Into, text: impl IntoCStr) -> bool { + unsafe { ffi::GuiLabelButton(bounds.into(), text.as_cstr_ptr()) } } /// Toggle Button control, returns true when active #[inline] fn gui_toggle( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, active: bool, ) -> bool { - unsafe { - ffi::GuiToggle( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - active, - ) - } + unsafe { ffi::GuiToggle(bounds.into(), text.as_cstr_ptr(), active) } } /// Toggle Group control, returns active toggle index #[inline] fn gui_toggle_group( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, active: i32, ) -> i32 { - unsafe { - ffi::GuiToggleGroup( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - active, - ) - } + unsafe { ffi::GuiToggleGroup(bounds.into(), text.as_cstr_ptr(), active) } } /// Check Box control, returns true when active #[inline] fn gui_check_box( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, checked: bool, ) -> bool { - unsafe { - ffi::GuiCheckBox( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - checked, - ) - } + unsafe { ffi::GuiCheckBox(bounds.into(), text.as_cstr_ptr(), checked) } } /// Combo Box control, returns selected item index #[inline] fn gui_combo_box( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, active: i32, ) -> i32 { - unsafe { - ffi::GuiComboBox( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - active, - ) - } + unsafe { ffi::GuiComboBox(bounds.into(), text.as_cstr_ptr(), active) } } /// Dropdown Box control, returns selected item #[inline] fn gui_dropdown_box( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, active: &mut i32, edit_mode: bool, ) -> bool { - unsafe { - ffi::GuiDropdownBox( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - active, - edit_mode, - ) - } + unsafe { ffi::GuiDropdownBox(bounds.into(), text.as_cstr_ptr(), active, edit_mode) } } /// Spinner control, returns selected value #[inline] fn gui_spinner( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, value: &mut i32, min_value: i32, max_value: i32, @@ -325,7 +296,7 @@ pub trait RaylibDrawGui { ffi::GuiSpinner( bounds.into(), // text.map(CStr::as_ptr).unwrap_or(crate::rstr!("").as_ptr()), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text.as_cstr_ptr(), value, min_value, max_value, @@ -338,7 +309,7 @@ pub trait RaylibDrawGui { fn gui_value_box( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, value: &mut i32, min_value: i32, max_value: i32, @@ -347,7 +318,7 @@ pub trait RaylibDrawGui { unsafe { ffi::GuiValueBox( bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text.as_cstr_ptr(), value, min_value, max_value, @@ -400,8 +371,8 @@ pub trait RaylibDrawGui { fn gui_slider( &mut self, bounds: impl Into, - text_left: Option<&CStr>, - text_right: Option<&CStr>, + text_left: impl IntoCStr, + text_right: impl IntoCStr, value: f32, min_value: f32, max_value: f32, @@ -409,8 +380,8 @@ pub trait RaylibDrawGui { unsafe { ffi::GuiSlider( bounds.into(), - text_left.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - text_right.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text_left.as_cstr_ptr(), + text_right.as_cstr_ptr(), value, min_value, max_value, @@ -422,8 +393,8 @@ pub trait RaylibDrawGui { fn gui_slider_bar( &mut self, bounds: impl Into, - text_left: Option<&CStr>, - text_right: Option<&CStr>, + text_left: impl IntoCStr, + text_right: impl IntoCStr, value: f32, min_value: f32, max_value: f32, @@ -431,8 +402,8 @@ pub trait RaylibDrawGui { unsafe { ffi::GuiSliderBar( bounds.into(), - text_left.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - text_right.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text_left.as_cstr_ptr(), + text_right.as_cstr_ptr(), value, min_value, max_value, @@ -444,8 +415,8 @@ pub trait RaylibDrawGui { fn gui_progress_bar( &mut self, bounds: impl Into, - text_left: Option<&CStr>, - text_right: Option<&CStr>, + text_left: impl IntoCStr, + text_right: impl IntoCStr, value: f32, min_value: f32, max_value: f32, @@ -453,8 +424,8 @@ pub trait RaylibDrawGui { unsafe { ffi::GuiProgressBar( bounds.into(), - text_left.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - text_right.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text_left.as_cstr_ptr(), + text_right.as_cstr_ptr(), value, min_value, max_value, @@ -463,62 +434,35 @@ pub trait RaylibDrawGui { } /// Status Bar control, shows info text #[inline] - fn gui_status_bar(&mut self, bounds: impl Into, text: Option<&CStr>) { - unsafe { - ffi::GuiStatusBar( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } + fn gui_status_bar(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiStatusBar(bounds.into(), text.as_cstr_ptr()) } } /// Dummy control for placeholders #[inline] - fn gui_dummy_rec(&mut self, bounds: impl Into, text: Option<&CStr>) { - unsafe { - ffi::GuiStatusBar( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - } - } - /// Scroll Bar control - #[inline] - fn gui_scroll_bar( - &mut self, - bounds: impl Into, - value: i32, - min_value: i32, - max_value: i32, - ) -> i32 { - unsafe { ffi::GuiScrollBar(bounds.into(), value, min_value, max_value) } + fn gui_dummy_rec(&mut self, bounds: impl Into, text: impl IntoCStr) { + unsafe { ffi::GuiStatusBar(bounds.into(), text.as_cstr_ptr()) } } /// Grid control #[inline] fn gui_grid( &mut self, bounds: impl Into, + text: impl IntoCStr, spacing: f32, subdivs: i32, ) -> Vector2 { - unsafe { ffi::GuiGrid(bounds.into(), spacing, subdivs).into() } + unsafe { ffi::GuiGrid(bounds.into(), text.as_cstr_ptr(), spacing, subdivs).into() } } /// List View control, returns selected list item index #[inline] fn gui_list_view( &mut self, bounds: impl Into, - text: Option<&CStr>, + text: impl IntoCStr, scroll_index: &mut i32, active: i32, ) -> i32 { - unsafe { - ffi::GuiListView( - bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - scroll_index, - active, - ) - } + unsafe { ffi::GuiListView(bounds.into(), text.as_cstr_ptr(), scroll_index, active) } } /// List View with extended parameters #[inline] @@ -550,16 +494,16 @@ pub trait RaylibDrawGui { fn gui_message_box( &mut self, bounds: impl Into, - text: Option<&CStr>, - message: Option<&CStr>, - buttons: Option<&CStr>, + text: impl IntoCStr, + message: impl IntoCStr, + buttons: impl IntoCStr, ) -> i32 { unsafe { ffi::GuiMessageBox( bounds.into(), - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - message.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - buttons.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + text.as_cstr_ptr(), + message.as_cstr_ptr(), + buttons.as_cstr_ptr(), ) } } @@ -568,22 +512,34 @@ pub trait RaylibDrawGui { fn gui_text_input_box( &mut self, bounds: impl Into, - title: Option<&CStr>, - message: Option<&CStr>, - buttons: Option<&CStr>, + title: impl IntoCStr, + message: impl IntoCStr, + buttons: impl IntoCStr, text: &mut Vec, - ) -> i32 { + text_max_size: i32, + secret_view_active: Option, + ) -> (i32, Option) { + let mut secret_view_active_int: Option = + secret_view_active.map(|s| if s { 1 } else { 0 }); + // rgui.h: line 3699 MAX_FILENAME_LEN text.reserve((256 - text.len()).max(0) as usize); - unsafe { + let btn_index = unsafe { ffi::GuiTextInputBox( bounds.into(), - title.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - message.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - buttons.map(CStr::as_ptr).unwrap_or(std::ptr::null()), + title.as_cstr_ptr(), + message.as_cstr_ptr(), + buttons.as_cstr_ptr(), text.as_mut_ptr() as *mut _, + text_max_size, + secret_view_active_int + .as_mut() + .map(|ptr| ptr as *mut i32) + .unwrap_or(std::ptr::null_mut()), ) - } + }; + + (btn_index, secret_view_active_int.map(|i| i != 0)) } /// Color Picker control @@ -591,9 +547,10 @@ pub trait RaylibDrawGui { fn gui_color_picker( &mut self, bounds: impl Into, + text: impl IntoCStr, color: impl Into, ) -> Color { - unsafe { ffi::GuiColorPicker(bounds.into(), color.into()).into() } + unsafe { ffi::GuiColorPicker(bounds.into(), text.as_cstr_ptr(), color.into()).into() } } // Get text with icon id prepended // NOTE: Useful to add icons by name id (enum) instead of @@ -601,19 +558,16 @@ pub trait RaylibDrawGui { #[inline] fn gui_icon_text( &mut self, - icon_id: crate::consts::guiIconName, - text: Option<&CStr>, + icon_id: crate::consts::GuiIconName, + text: impl IntoCStr, ) -> String { - let buffer = unsafe { - ffi::GuiIconText( - icon_id as i32, - text.map(CStr::as_ptr).unwrap_or(std::ptr::null()), - ) - }; + let buffer = unsafe { ffi::GuiIconText(icon_id as i32, text.as_cstr_ptr()) }; if buffer.is_null() { - return text - .map(|s| s.to_string_lossy().to_string()) - .unwrap_or("".to_owned()); + let ptr = text.as_cstr_ptr(); + if ptr.is_null() { + return String::default(); + } + return unsafe { CStr::from_ptr(ptr).to_string_lossy().to_string() }; } let c_str = unsafe { CStr::from_ptr(buffer) }; let str_slice = c_str.to_str().unwrap_or(""); @@ -625,7 +579,12 @@ pub trait RaylibDrawGui { /// Color Bar Alpha control /// NOTE: Returns alpha value normalized [0..1] #[inline] - fn gui_color_bar_alpha(&mut self, bounds: impl Into, alpha: f32) -> f32 { - unsafe { ffi::GuiColorBarAlpha(bounds.into(), alpha).into() } + fn gui_color_bar_alpha( + &mut self, + bounds: impl Into, + text: impl IntoCStr, + alpha: f32, + ) -> f32 { + unsafe { ffi::GuiColorBarAlpha(bounds.into(), text.as_cstr_ptr(), alpha).into() } } } From eb2d40f08c0d87cb6098d154b48a56f65f5390f2 Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 12 Nov 2022 22:56:06 -0800 Subject: [PATCH 08/30] adding ci --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 15 -------- 2 files changed, 77 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f0cdf7a7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI + +on: + pull_request: + push: + +jobs: + test: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install alsa and udev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + if: runner.os == 'linux' + - name: Build & run tests + run: cargo test + all-doc-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ubuntu-latest-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install alsa and udev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + - name: Run doc tests with all features (this also compiles README examples) + run: cargo test --doc --all-features + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ubuntu-latest-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + override: true + - name: Install alsa and udev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + - name: Run clippy + run: cargo clippy --workspace --all-targets --all-features + - name: Check format + run: cargo fmt --all -- --check \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 50ef95e2..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Rust - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Build - run: cd raylib && cargo build --verbose --features nobuild - # - name: Run tests [Requires window system] - # run: cargo test -p raylib-test --verbose From 5464ae2761958a478c88cd8e0682556ca1fb8f41 Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 12 Nov 2022 23:01:24 -0800 Subject: [PATCH 09/30] just windows right now --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0cdf7a7..a9190658 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ jobs: test: strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + # os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 241d6bf699ca0949a17efe47bf85ecb6cefd7dd3 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sat, 28 Jan 2023 23:08:35 +0100 Subject: [PATCH 10/30] WIP 4.5.0+redesign --- raylib-sys/Cargo.toml | 2 +- raylib-sys/raylib | 2 +- raylib-test/src/drawing.rs | 12 +- raylib/Cargo.toml | 8 +- raylib/src/core/audio.rs | 73 ++++---- raylib/src/core/buffer.rs | 63 +++++++ raylib/src/core/camera.rs | 2 +- raylib/src/core/data.rs | 25 ++- raylib/src/core/drawing.rs | 338 +++++++++++++------------------------ raylib/src/core/file.rs | 26 +-- raylib/src/core/input.rs | 2 +- raylib/src/core/macros.rs | 60 +++++-- raylib/src/core/math.rs | 2 - raylib/src/core/misc.rs | 8 +- raylib/src/core/mod.rs | 28 ++- raylib/src/core/models.rs | 226 ++++++++----------------- raylib/src/core/shaders.rs | 91 ++++------ raylib/src/core/text.rs | 59 +++---- raylib/src/core/texture.rs | 193 ++++++--------------- raylib/src/core/vr.rs | 4 +- raylib/src/core/window.rs | 102 ++++++----- raylib/src/lib.rs | 2 - raylib/src/rgui/safe.rs | 18 +- samples/Cargo.toml | 4 +- samples/arkanoid.rs | 10 +- samples/camera2D.rs | 93 +++++----- samples/extensions.rs | 8 +- samples/font.rs | 14 +- samples/logo.rs | 15 +- samples/options.rs | 4 +- samples/texture.rs | 7 +- samples/yaw_pitch_roll.rs | 42 ++--- 32 files changed, 668 insertions(+), 875 deletions(-) create mode 100644 raylib/src/core/buffer.rs diff --git a/raylib-sys/Cargo.toml b/raylib-sys/Cargo.toml index 82e5f0ab..0884506d 100644 --- a/raylib-sys/Cargo.toml +++ b/raylib-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raylib-sys" -version = "4.2.0" +version = "4.5.0" authors = ["DeltaPHC "] license = "Zlib" description = "Raw FFI bindings for Raylib" diff --git a/raylib-sys/raylib b/raylib-sys/raylib index bf2ad9df..df5a736c 160000 --- a/raylib-sys/raylib +++ b/raylib-sys/raylib @@ -1 +1 @@ -Subproject commit bf2ad9df5fdcaa385b2a7f66fd85632eeebbadaa +Subproject commit df5a736c009d98187e703a55c604345e12777bb7 diff --git a/raylib-test/src/drawing.rs b/raylib-test/src/drawing.rs index f1ce4fb0..2b84b57f 100644 --- a/raylib-test/src/drawing.rs +++ b/raylib-test/src/drawing.rs @@ -3,13 +3,13 @@ mod draw_test { use crate::tests::*; use raylib::prelude::*; ray_draw_test!(test_pixel); - fn test_pixel(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_pixel(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_pixel(10, 10, Color::RED); d.draw_pixel_v(Vector2::new(20.0, 20.0), Color::RED); } ray_draw_test!(test_line); - fn test_line(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_line(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_line(0, 5, 100, 5, Color::RED); d.draw_line_v( @@ -31,7 +31,7 @@ mod draw_test { ); } ray_draw_test!(test_circle); - fn test_circle(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_circle(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_circle(20, 20, 10.0, Color::RED); d.draw_circle_v(Vector2::new(40.0, 20.0), 10.0, Color::RED); @@ -60,7 +60,7 @@ mod draw_test { } ray_draw_test!(test_rectangle); - fn test_rectangle(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_rectangle(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_rectangle(10, 10, 10, 10, Color::RED); d.draw_rectangle_v( @@ -102,7 +102,7 @@ mod draw_test { } ray_draw_test!(test_triangle); - fn test_triangle(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_triangle(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_triangle( Vector2::new(30.0, 30.0), @@ -119,7 +119,7 @@ mod draw_test { } ray_draw_test!(test_poly); - fn test_poly(d: &mut RaylibDrawHandle, _: &TestAssets) { + fn test_poly(d: &RaylibDrawHandle, _: &TestAssets) { d.clear_background(Color::WHITE); d.draw_poly(Vector2::new(100.0, 100.0), 12, 20.0, 45.0, Color::RED); } diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index a8555ab8..3e67e01f 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "raylib" -version = "4.2.0" -authors = ["DeltaPHC "] +version = "4.5.0" +authors = ["DeltaPHC ", "Teddy Astie "] license = "Zlib" readme = "../README.md" description = "Safe Rust bindings for Raylib." @@ -9,10 +9,10 @@ documentation = "https://docs.rs/raylib" repository = "https://github.com/deltaphc/raylib-rs" keywords = ["bindings", "raylib", "gamedev"] categories = ["api-bindings", "game-engines", "graphics"] -edition = "2018" +edition = "2021" [dependencies] -raylib-sys = { version = "= 4.2.0", path = "../raylib-sys" } +raylib-sys = { version = "= 4.5.0", path = "../raylib-sys" } libc = "0.2.137" lazy_static = "1.2.0" cfg-if = "1.0.0" diff --git a/raylib/src/core/audio.rs b/raylib/src/core/audio.rs index f897b80e..ee112acd 100644 --- a/raylib/src/core/audio.rs +++ b/raylib/src/core/audio.rs @@ -3,14 +3,18 @@ use crate::core::RaylibThread; use crate::ffi; use std::ffi::CString; -use std::mem::ManuallyDrop; -make_thin_wrapper!(Wave, ffi::Wave, ffi::UnloadWave); -make_thin_wrapper!(Sound, ffi::Sound, ffi::UnloadSound); -make_thin_wrapper!(Music, ffi::Music, ffi::UnloadMusicStream); -make_thin_wrapper!(AudioStream, ffi::AudioStream, ffi::UnloadAudioStream); +use super::buffer::RaylibBuffer; -make_rslice!(WaveSamples, f32, ffi::UnloadWaveSamples); +make_thin_wrapper!(Wave, ffi::Wave, ffi::UnloadWave); +make_bound_thin_wrapper!(Sound, ffi::Sound, ffi::UnloadSound, RaylibAudio); +make_bound_thin_wrapper!(Music, ffi::Music, ffi::UnloadMusicStream, RaylibAudio); +make_bound_thin_wrapper!( + AudioStream, + ffi::AudioStream, + ffi::UnloadAudioStream, + RaylibAudio +); /// A marker trait specifying an audio sample (`u8`, `i16`, or `f32`). pub trait AudioSample {} @@ -18,7 +22,7 @@ impl AudioSample for u8 {} impl AudioSample for i16 {} impl AudioSample for f32 {} -/// This token is used to indicate VR is initialized +/// This token is used to indicate audio is initialized #[derive(Debug)] pub struct RaylibAudio(()); @@ -335,31 +339,26 @@ impl Wave { /// NOTE 1: Returned sample values are normalized to range [-1..1] /// NOTE 2: Sample data allocated should be freed with UnloadWaveSamples() #[inline] - pub fn load_wave_samples(&self) -> WaveSamples { - let as_slice = unsafe { - let data = ffi::LoadWaveSamples(self.0); - Box::from_raw(std::slice::from_raw_parts_mut( - data, - self.frame_count() as usize, - )) - }; - WaveSamples(ManuallyDrop::new(as_slice)) + pub fn load_wave_samples(&self) -> RaylibBuffer<'static, f32> { + unsafe { + RaylibBuffer::new(ffi::LoadWaveSamples(self.0), self.frame_count() as usize).unwrap() + } } } -impl AsRef for Sound { +impl AsRef for Sound<'_, '_> { fn as_ref(&self) -> &ffi::AudioStream { &self.0.stream } } -impl AsMut for Sound { +impl AsMut for Sound<'_, '_> { fn as_mut(&mut self) -> &mut ffi::AudioStream { &mut self.0.stream } } -impl Sound { +impl<'bind, 'a> Sound<'bind, 'a> { pub fn frame_count(&self) -> u32 { self.0.frameCount } @@ -369,22 +368,25 @@ impl Sound { inner } /// Loads sound from file. - pub fn load_sound(filename: &str) -> Result { + pub fn load_sound(_: &'bind RaylibAudio, filename: &str) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let s = unsafe { ffi::LoadSound(c_filename.as_ptr()) }; if s.stream.buffer.is_null() { return Err(format!("failed to load sound {}", filename)); } - Ok(Sound(s)) + Ok(unsafe { Sound::from_raw(s) }) } /// Loads sound from wave data. - pub fn load_sound_from_wave(wave: &Wave) -> Result { + pub fn load_sound_from_wave( + _: &'bind RaylibAudio, + wave: &Wave, + ) -> Result, String> { let s = unsafe { ffi::LoadSoundFromWave(wave.0) }; if s.stream.buffer.is_null() { return Err(format!("failed to load sound from wave")); } - Ok(Sound(s)) + Ok(unsafe { Sound::from_raw(s) }) } // Figure out how to make this safe @@ -401,20 +403,24 @@ impl Sound { // } } -impl Music { +impl<'bind, 'a> Music<'bind, 'a> { /// Loads music stream from file. // #[inline] - pub fn load_music_stream(_: &RaylibThread, filename: &str) -> Result { + pub fn load_music_stream( + _: &'bind RaylibAudio, + _: &RaylibThread, + filename: &str, + ) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let m = unsafe { ffi::LoadMusicStream(c_filename.as_ptr()) }; if m.stream.buffer.is_null() { return Err(format!("music could not be loaded from file {}", filename)); } - Ok(Music(m)) + Ok(unsafe { Music::from_raw(m) }) } } -impl AudioStream { +impl<'bind, 'a> AudioStream<'bind, 'a> { pub fn sample_rate(&self) -> u32 { self.0.sampleRate } @@ -433,23 +439,22 @@ impl AudioStream { /// Initializes audio stream (to stream raw PCM data). #[inline] pub fn load_audio_stream( + _: &'bind RaylibAudio, _: &RaylibThread, sample_rate: u32, sample_size: u32, channels: u32, - ) -> AudioStream { - unsafe { AudioStream(ffi::LoadAudioStream(sample_rate, sample_size, channels)) } + ) -> AudioStream<'bind, 'a> { + unsafe { AudioStream::from_raw(ffi::LoadAudioStream(sample_rate, sample_size, channels)) } } /// Updates audio stream buffers with data. #[inline] pub fn update_audio_stream(&mut self, data: &[T]) { + assert_eq!(self.sampleSize as usize, core::mem::size_of::() * 8); + unsafe { - ffi::UpdateAudioStream( - self.0, - data.as_ptr() as *const std::os::raw::c_void, - (data.len() * std::mem::size_of::()) as i32, - ); + ffi::UpdateAudioStream(self.0, data.as_ptr() as _, data.len() as i32); } } } diff --git a/raylib/src/core/buffer.rs b/raylib/src/core/buffer.rs new file mode 100644 index 00000000..911b8a02 --- /dev/null +++ b/raylib/src/core/buffer.rs @@ -0,0 +1,63 @@ +use std::{marker::PhantomData, ops::Index, ptr::NonNull, slice}; + +use crate::ffi; + +#[repr(transparent)] +pub(crate) struct ContigousBuffer<'a, T>(NonNull, PhantomData<&'a T>); + +impl<'a, T> ContigousBuffer<'a, T> { + pub fn new(buffer: *mut T) -> Option { + NonNull::new(buffer) + .map(|p| Some(ContigousBuffer(p, PhantomData))) + .flatten() + } + + pub unsafe fn get_slice(&'a self, len: usize) -> &'a [T] { + slice::from_raw_parts(self.0.as_ptr(), len) + } + + pub unsafe fn get_mut_slice(&'a mut self, len: usize) -> &'a mut [T] { + slice::from_raw_parts_mut(self.0.as_ptr(), len) + } + + pub fn get_ptr(&self) -> *mut T { + self.0.as_ptr() + } +} + +pub struct RaylibBuffer<'a, T>(&'a mut [T], ContigousBuffer<'a, T>); + +impl<'a, T> RaylibBuffer<'a, T> { + pub unsafe fn new(data: *mut T, len: usize) -> Option { + Some(RaylibBuffer( + slice::from_raw_parts_mut(data, len), + ContigousBuffer::new(data)?, + )) + } + + pub fn get_slice(&'a self) -> &'a [T] { + self.0 + } + + pub fn get_mut_slice(&'a mut self) -> &'a mut [T] { + self.0 + } + + pub fn get_ptr(&self) -> *mut T { + self.1.get_ptr() + } +} + +impl<'a, T> Index for RaylibBuffer<'a, T> { + type Output = T; + + fn index(&self, index: usize) -> &Self::Output { + unsafe { &*self.get_ptr().offset(index as isize) } + } +} + +impl<'a, T> Drop for RaylibBuffer<'a, T> { + fn drop(&mut self) { + unsafe { ffi::MemFree(self.1.get_ptr() as _) } + } +} diff --git a/raylib/src/core/camera.rs b/raylib/src/core/camera.rs index d2dd9f84..fa23059a 100644 --- a/raylib/src/core/camera.rs +++ b/raylib/src/core/camera.rs @@ -94,7 +94,7 @@ impl Camera3D { } } -impl RaylibHandle { +impl RaylibHandle<'_> { /// Sets camera mode. #[inline] pub fn set_camera_mode( diff --git a/raylib/src/core/data.rs b/raylib/src/core/data.rs index 8f65e643..f638aeef 100644 --- a/raylib/src/core/data.rs +++ b/raylib/src/core/data.rs @@ -1,24 +1,23 @@ //! Data manipulation functions. Compress and Decompress with DEFLATE use crate::ffi; +use crate::core::buffer::RaylibBuffer; /// Compress data (DEFLATE algorythm) /// ```rust /// use raylib::prelude::*; /// let data = compress_data(b"1111111111"); /// let expected: &[u8] = &[61, 193, 33, 1, 0, 0, 0, 128, 160, 77, 254, 63, 103, 3, 98]; -/// assert_eq!(data, Ok(expected)); +/// assert_eq!(data.unwrap().get_slice(), expected); /// ``` -pub fn compress_data(data: &[u8]) -> Result<&'static [u8], String> { +pub fn compress_data(data: &[u8]) -> Result, String> { let mut out_length: i32 = 0; // CompressData doesn't actually modify the data, but the header is wrong let buffer = { unsafe { ffi::CompressData(data.as_ptr() as *mut _, data.len() as i32, &mut out_length) } }; - if buffer.is_null() { - return Err("could not compress data".to_string()); - } - let buffer = unsafe { std::slice::from_raw_parts(buffer, out_length as usize) }; - return Ok(buffer); + + unsafe { RaylibBuffer::new(buffer, out_length as usize) } + .ok_or_else(|| "could not compress data".to_string()) } /// Decompress data (DEFLATE algorythm) @@ -27,17 +26,15 @@ pub fn compress_data(data: &[u8]) -> Result<&'static [u8], String> { /// let input: &[u8] = &[61, 193, 33, 1, 0, 0, 0, 128, 160, 77, 254, 63, 103, 3, 98]; /// let expected: &[u8] = b"1111111111"; /// let data = decompress_data(input); -/// assert_eq!(data, Ok(expected)); +/// assert_eq!(data.unwrap().get_slice(), expected); /// ``` -pub fn decompress_data(data: &[u8]) -> Result<&'static [u8], String> { +pub fn decompress_data(data: &[u8]) -> Result, String> { let mut out_length: i32 = 0; // CompressData doesn't actually modify the data, but the header is wrong let buffer = { unsafe { ffi::DecompressData(data.as_ptr() as *mut _, data.len() as i32, &mut out_length) } }; - if buffer.is_null() { - return Err("could not compress data".to_string()); - } - let buffer = unsafe { std::slice::from_raw_parts(buffer, out_length as usize) }; - return Ok(buffer); + + unsafe { RaylibBuffer::new(buffer, out_length as usize) } + .ok_or_else(|| "could not decompress data".to_string()) } diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index 63af5df6..8b5e8ffd 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -6,52 +6,63 @@ use crate::core::math::{Vector2, Vector3}; use crate::core::texture::Texture2D; use crate::core::vr::VrStereoConfig; use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; +use crate::{ffi, RaylibRenderLoop}; +use std::cell::RefMut; use std::convert::AsRef; use std::ffi::CString; +use std::marker::PhantomData; /// Seems like all draw commands must be issued from the main thread -impl RaylibHandle { +impl RaylibRenderLoop<'_> { /// Setup canvas (framebuffer) to start drawing - #[must_use] - pub fn begin_drawing(&mut self, _: &RaylibThread) -> RaylibDrawHandle { + pub fn draw_loop) -> bool>(&self, mut loop_fn: F) { + loop { + unsafe { + ffi::BeginDrawing(); + }; + + let cont = (loop_fn)(self.0.borrow_mut()); + + unsafe { + ffi::EndDrawing(); + } + + if !cont { + break; + } + } + } + + /// Render a single frame. + pub fn frame)>(&self, mut frame_fn: F) { unsafe { ffi::BeginDrawing(); }; - let d = RaylibDrawHandle(self); - d - } -} -pub struct RaylibDrawHandle<'a>(&'a mut RaylibHandle); + (frame_fn)(self.0.borrow_mut()); -impl<'a> Drop for RaylibDrawHandle<'a> { - fn drop(&mut self) { unsafe { ffi::EndDrawing(); } } } -impl<'a> std::ops::Deref for RaylibDrawHandle<'a> { - type Target = RaylibHandle; +#[derive(Debug)] +pub struct RaylibDrawHandle<'bind>(pub(crate) PhantomData<&'bind RaylibHandle<'bind>>); - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl<'a> RaylibDraw for RaylibDrawHandle<'a> {} +impl RaylibDraw for RaylibDrawHandle<'_> {} // Texture2D Stuff pub struct RaylibTextureMode<'a, T>(&'a T, &'a mut ffi::RenderTexture2D); -impl<'a, T> Drop for RaylibTextureMode<'a, T> { + +impl Drop for RaylibTextureMode<'_, T> { fn drop(&mut self) { unsafe { ffi::EndTextureMode() } } } -impl<'a, T> std::ops::Deref for RaylibTextureMode<'a, T> { + +impl std::ops::Deref for RaylibTextureMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -74,20 +85,22 @@ where } } -// Only the DrawHandle and the RaylibHandle can start a texture -impl<'a> RaylibTextureModeExt for RaylibDrawHandle<'a> {} -impl RaylibTextureModeExt for &mut RaylibHandle {} -impl<'a, T> RaylibDraw for RaylibTextureMode<'a, T> {} +// Only the DrawHandle and the RaylibRenderLoop can start a texture +impl RaylibTextureModeExt for RaylibDrawHandle<'_> {} +impl RaylibTextureModeExt for &mut RaylibRenderLoop<'_> {} +impl RaylibDraw for RaylibTextureMode<'_, T> {} // VR Stuff pub struct RaylibVRMode<'a, T>(&'a T, &'a mut VrStereoConfig); -impl<'a, T> Drop for RaylibVRMode<'a, T> { + +impl Drop for RaylibVRMode<'_, T> { fn drop(&mut self) { unsafe { ffi::EndVrStereoMode() } } } -impl<'a, T> std::ops::Deref for RaylibVRMode<'a, T> { + +impl std::ops::Deref for RaylibVRMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -110,17 +123,17 @@ where } impl RaylibVRModeExt for D {} -impl<'a, T> RaylibDraw for RaylibVRMode<'a, T> {} +impl RaylibDraw for RaylibVRMode<'_, T> {} // 2D Mode pub struct RaylibMode2D<'a, T>(&'a mut T); -impl<'a, T> Drop for RaylibMode2D<'a, T> { +impl Drop for RaylibMode2D<'_, T> { fn drop(&mut self) { unsafe { ffi::EndMode2D() } } } -impl<'a, T> std::ops::Deref for RaylibMode2D<'a, T> { +impl std::ops::Deref for RaylibMode2D<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -143,17 +156,17 @@ where } impl RaylibMode2DExt for D {} -impl<'a, T> RaylibDraw for RaylibMode2D<'a, T> {} +impl RaylibDraw for RaylibMode2D<'_, T> {} // 3D Mode pub struct RaylibMode3D<'a, T>(&'a mut T); -impl<'a, T> Drop for RaylibMode3D<'a, T> { +impl Drop for RaylibMode3D<'_, T> { fn drop(&mut self) { unsafe { ffi::EndMode3D() } } } -impl<'a, T> std::ops::Deref for RaylibMode3D<'a, T> { +impl std::ops::Deref for RaylibMode3D<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -176,18 +189,19 @@ where } impl RaylibMode3DExt for D {} -impl<'a, T> RaylibDraw for RaylibMode3D<'a, T> {} -impl<'a, T> RaylibDraw3D for RaylibMode3D<'a, T> {} +impl RaylibDraw for RaylibMode3D<'_, T> {} +impl RaylibDraw3D for RaylibMode3D<'_, T> {} // shader Mode pub struct RaylibShaderMode<'a, T>(&'a mut T, &'a ffi::Shader); -impl<'a, T> Drop for RaylibShaderMode<'a, T> { + +impl Drop for RaylibShaderMode<'_, T> { fn drop(&mut self) { unsafe { ffi::EndShaderMode() } } } -impl<'a, T> std::ops::Deref for RaylibShaderMode<'a, T> { +impl std::ops::Deref for RaylibShaderMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -238,18 +252,18 @@ where } impl RaylibBlendModeExt for D {} -impl<'a, T> RaylibDraw for RaylibBlendMode<'a, T> {} -impl<'a, T> RaylibDraw3D for RaylibBlendMode<'a, T> {} +impl RaylibDraw for RaylibBlendMode<'_, T> {} +impl RaylibDraw3D for RaylibBlendMode<'_, T> {} // Scissor Mode stuff pub struct RaylibScissorMode<'a, T>(&'a mut T); -impl<'a, T> Drop for RaylibScissorMode<'a, T> { +impl Drop for RaylibScissorMode<'_, T> { fn drop(&mut self) { unsafe { ffi::EndScissorMode() } } } -impl<'a, T> std::ops::Deref for RaylibScissorMode<'a, T> { +impl std::ops::Deref for RaylibScissorMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -275,15 +289,15 @@ where } impl RaylibScissorModeExt for D {} -impl<'a, T> RaylibDraw for RaylibScissorMode<'a, T> {} -impl<'a, T: RaylibDraw3D> RaylibDraw3D for RaylibScissorMode<'a, T> {} +impl RaylibDraw for RaylibScissorMode<'_, T> {} +impl RaylibDraw3D for RaylibScissorMode<'_, T> {} // Actual drawing functions pub trait RaylibDraw { /// Sets background color (framebuffer clear color). #[inline] - fn clear_background(&mut self, color: impl Into) { + fn clear_background(&self, color: impl Into) { unsafe { ffi::ClearBackground(color.into()); } @@ -485,7 +499,7 @@ pub trait RaylibDraw { /// Draws a color-filled circle (Vector version). #[inline] fn draw_circle_v( - &mut self, + &self, center: impl Into, radius: f32, color: impl Into, @@ -498,7 +512,7 @@ pub trait RaylibDraw { /// Draws circle outline. #[inline] fn draw_circle_lines( - &mut self, + &self, center_x: i32, center_y: i32, radius: f32, @@ -512,7 +526,7 @@ pub trait RaylibDraw { /// Draws ellipse. #[inline] fn draw_ellipse( - &mut self, + &self, center_x: i32, center_y: i32, radius_h: f32, @@ -527,7 +541,7 @@ pub trait RaylibDraw { /// Draws ellipse. #[inline] fn draw_ellipse_lines( - &mut self, + &self, center_x: i32, center_y: i32, radius_h: f32, @@ -542,7 +556,7 @@ pub trait RaylibDraw { /// Draw ring #[inline] fn draw_ring( - &mut self, + &self, center: impl Into, inner_radius: f32, outer_radius: f32, @@ -567,7 +581,7 @@ pub trait RaylibDraw { /// Draw ring lines #[inline] fn draw_ring_lines( - &mut self, + &self, center: impl Into, inner_radius: f32, outer_radius: f32, @@ -592,7 +606,7 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle. #[inline] fn draw_rectangle( - &mut self, + &self, x: i32, y: i32, width: i32, @@ -607,7 +621,7 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle (Vector version). #[inline] fn draw_rectangle_v( - &mut self, + &self, position: impl Into, size: impl Into, color: impl Into, @@ -619,7 +633,7 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle from `rec`. #[inline] - fn draw_rectangle_rec(&mut self, rec: impl Into, color: impl Into) { + fn draw_rectangle_rec(&self, rec: impl Into, color: impl Into) { unsafe { ffi::DrawRectangleRec(rec.into(), color.into()); } @@ -628,7 +642,7 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle with pro parameters. #[inline] fn draw_rectangle_pro( - &mut self, + &self, rec: impl Into, origin: impl Into, rotation: f32, @@ -644,7 +658,7 @@ pub trait RaylibDraw { /// **NOTE**: Gradient goes from bottom (`color1`) to top (`color2`). #[inline] fn draw_rectangle_gradient_v( - &mut self, + &self, x: i32, y: i32, width: i32, @@ -662,7 +676,7 @@ pub trait RaylibDraw { /// **NOTE**: Gradient goes from bottom (`color1`) to top (`color2`). #[inline] fn draw_rectangle_gradient_h( - &mut self, + &self, x: i32, y: i32, width: i32, @@ -680,7 +694,7 @@ pub trait RaylibDraw { /// **NOTE**: Colors refer to corners, starting at top-left corner and going counter-clockwise. #[inline] fn draw_rectangle_gradient_ex( - &mut self, + &self, rec: impl Into, col1: impl Into, col2: impl Into, @@ -701,7 +715,7 @@ pub trait RaylibDraw { /// Draws rectangle outline. #[inline] fn draw_rectangle_lines( - &mut self, + &self, x: i32, y: i32, width: i32, @@ -716,7 +730,7 @@ pub trait RaylibDraw { /// Draws rectangle outline with extended parameters. #[inline] fn draw_rectangle_lines_ex( - &mut self, + &self, rec: impl Into, line_thick: f32, color: impl Into, @@ -728,7 +742,7 @@ pub trait RaylibDraw { /// Draws rectangle outline with extended parameters. #[inline] fn draw_rectangle_rounded( - &mut self, + &self, rec: impl Into, roundness: f32, segments: i32, @@ -742,7 +756,7 @@ pub trait RaylibDraw { /// Draws rectangle outline with extended parameters. #[inline] fn draw_rectangle_rounded_lines( - &mut self, + &self, rec: impl Into, roundness: f32, segments: i32, @@ -763,7 +777,7 @@ pub trait RaylibDraw { /// Draws a triangle. #[inline] fn draw_triangle( - &mut self, + &self, v1: impl Into, v2: impl Into, v3: impl Into, @@ -777,7 +791,7 @@ pub trait RaylibDraw { /// Draws a triangle using lines. #[inline] fn draw_triangle_lines( - &mut self, + &self, v1: impl Into, v2: impl Into, v3: impl Into, @@ -790,7 +804,7 @@ pub trait RaylibDraw { /// Draw a triangle fan defined by points. #[inline] - fn draw_triangle_fan(&mut self, points: &[Vector2], color: impl Into) { + fn draw_triangle_fan(&self, points: &[Vector2], color: impl Into) { unsafe { ffi::DrawTriangleFan( points.as_ptr() as *mut ffi::Vector2, @@ -802,7 +816,7 @@ pub trait RaylibDraw { /// Draw a triangle strip defined by points #[inline] - fn draw_triangle_strip(&mut self, points: &[Vector2], color: impl Into) { + fn draw_triangle_strip(&self, points: &[Vector2], color: impl Into) { unsafe { ffi::DrawTriangleStrip( points.as_ptr() as *mut ffi::Vector2, @@ -815,7 +829,7 @@ pub trait RaylibDraw { /// Draws a regular polygon of n sides (Vector version). #[inline] fn draw_poly( - &mut self, + &self, center: impl Into, sides: i32, radius: f32, @@ -830,7 +844,7 @@ pub trait RaylibDraw { /// Draws a regular polygon of n sides (Vector version). #[inline] fn draw_poly_lines( - &mut self, + &self, center: impl Into, sides: i32, radius: f32, @@ -845,7 +859,7 @@ pub trait RaylibDraw { /// Draws a `texture` using specified position and `tint` color. #[inline] fn draw_texture( - &mut self, + &self, texture: impl AsRef, x: i32, y: i32, @@ -859,7 +873,7 @@ pub trait RaylibDraw { /// Draws a `texture` using specified `position` vector and `tint` color. #[inline] fn draw_texture_v( - &mut self, + &self, texture: impl AsRef, position: impl Into, tint: impl Into, @@ -872,7 +886,7 @@ pub trait RaylibDraw { /// Draws a `texture` with extended parameters. #[inline] fn draw_texture_ex( - &mut self, + &self, texture: impl AsRef, position: impl Into, rotation: f32, @@ -893,7 +907,7 @@ pub trait RaylibDraw { /// Draws from a region of `texture` defined by the `source_rec` rectangle. #[inline] fn draw_texture_rec( - &mut self, + &self, texture: impl AsRef, source_rec: impl Into, position: impl Into, @@ -909,79 +923,10 @@ pub trait RaylibDraw { } } - /// Draw texture quad with tiling and offset parameters - #[inline] - fn draw_texture_quad( - &mut self, - texture: impl AsRef, - tiling: impl Into, - offset: impl Into, - quad: impl Into, - tint: impl Into, - ) { - unsafe { - ffi::DrawTextureQuad( - *texture.as_ref(), - tiling.into(), - offset.into(), - quad.into(), - tint.into(), - ); - } - } - - /// Draw from a region of `texture` defined by the `source_rec` rectangle with pro parameters. - #[inline] - fn draw_texture_pro( - &mut self, - texture: impl AsRef, - source_rec: impl Into, - dest_rec: impl Into, - origin: impl Into, - rotation: f32, - tint: impl Into, - ) { - unsafe { - ffi::DrawTexturePro( - *texture.as_ref(), - source_rec.into(), - dest_rec.into(), - origin.into(), - rotation, - tint.into(), - ); - } - } - - /// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. - #[inline] - fn draw_texture_tiled( - &mut self, - texture: impl AsRef, - source_rec: impl Into, - dest_rec: impl Into, - origin: impl Into, - rotation: f32, - scale: f32, - tint: impl Into, - ) { - unsafe { - ffi::DrawTextureTiled( - *texture.as_ref(), - source_rec.into(), - dest_rec.into(), - origin.into(), - rotation, - scale, - tint.into(), - ) - } - } - ///Draws a texture (or part of it) that stretches or shrinks nicely #[inline] fn draw_texture_n_patch( - &mut self, + &self, texture: impl AsRef, n_patch_info: impl Into, dest_rec: impl Into, @@ -1001,32 +946,9 @@ pub trait RaylibDraw { } } - ///Draws a texture (or part of it) that stretches or shrinks nicely - #[inline] - fn draw_texture_poly( - &mut self, - texture: impl AsRef, - center: impl Into, - points: &[Vector2], - texcoords: &[Vector2], - tint: impl Into, - ) { - assert!(points.len() == texcoords.len()); - unsafe { - ffi::DrawTexturePoly( - *texture.as_ref(), - center.into(), - points.as_ptr() as *mut _, - texcoords.as_ptr() as *mut _, - points.len() as _, - tint.into(), - ); - } - } - /// Shows current FPS. #[inline] - fn draw_fps(&mut self, x: i32, y: i32) { + fn draw_fps(&self, x: i32, y: i32) { unsafe { ffi::DrawFPS(x, y); } @@ -1034,14 +956,7 @@ pub trait RaylibDraw { /// Draws text (using default font). #[inline] - fn draw_text( - &mut self, - text: &str, - x: i32, - y: i32, - font_size: i32, - color: impl Into, - ) { + fn draw_text(&self, text: &str, x: i32, y: i32, font_size: i32, color: impl Into) { let c_text = CString::new(text).unwrap(); unsafe { ffi::DrawText(c_text.as_ptr(), x, y, font_size, color.into()); @@ -1051,7 +966,7 @@ pub trait RaylibDraw { /// Draws text using `font` and additional parameters. #[inline] fn draw_text_ex( - &mut self, + &self, font: impl AsRef, text: &str, position: impl Into, @@ -1075,7 +990,7 @@ pub trait RaylibDraw { /// Draw one character (codepoint) #[inline] fn draw_text_codepoint( - &mut self, + &self, font: impl AsRef, codepoint: i32, position: impl Into, @@ -1098,7 +1013,7 @@ pub trait RaylibDraw3D { /// Draw a point in 3D space, actually a small line #[allow(non_snake_case)] #[inline] - fn draw_point3D(&mut self, position: impl Into, color: impl Into) { + fn draw_point3D(&self, position: impl Into, color: impl Into) { unsafe { ffi::DrawPoint3D(position.into(), color.into()); } @@ -1108,7 +1023,7 @@ pub trait RaylibDraw3D { #[allow(non_snake_case)] #[inline] fn draw_triangle3D( - &mut self, + &self, v1: impl Into, v2: impl Into, v3: impl Into, @@ -1122,7 +1037,7 @@ pub trait RaylibDraw3D { /// // Draw a triangle strip defined by points #[allow(non_snake_case)] #[inline] - fn draw_triangle_strip3D(&mut self, points: &[Vector3], color: impl Into) { + fn draw_triangle_strip3D(&self, points: &[Vector3], color: impl Into) { unsafe { ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color.into()); } @@ -1132,7 +1047,7 @@ pub trait RaylibDraw3D { #[inline] #[allow(non_snake_case)] fn draw_line_3D( - &mut self, + &self, start_pos: impl Into, end_pos: impl Into, color: impl Into, @@ -1146,7 +1061,7 @@ pub trait RaylibDraw3D { #[inline] #[allow(non_snake_case)] fn draw_circle_3D( - &mut self, + &self, center: impl Into, radius: f32, rotation_axis: impl Into, @@ -1167,7 +1082,7 @@ pub trait RaylibDraw3D { /// Draws a cube. #[inline] fn draw_cube( - &mut self, + &self, position: impl Into, width: f32, height: f32, @@ -1182,7 +1097,7 @@ pub trait RaylibDraw3D { /// Draws a cube (Vector version). #[inline] fn draw_cube_v( - &mut self, + &self, position: impl Into, size: impl Into, color: impl Into, @@ -1195,7 +1110,7 @@ pub trait RaylibDraw3D { /// Draws a cube in wireframe. #[inline] fn draw_cube_wires( - &mut self, + &self, position: impl Into, width: f32, height: f32, @@ -1207,33 +1122,10 @@ pub trait RaylibDraw3D { } } - /// Draws a textured cube. - #[inline] - fn draw_cube_texture( - &mut self, - texture: &Texture2D, - position: impl Into, - width: f32, - height: f32, - length: f32, - color: impl Into, - ) { - unsafe { - ffi::DrawCubeTexture( - texture.0, - position.into(), - width, - height, - length, - color.into(), - ); - } - } - /// Draws a sphere. #[inline] fn draw_sphere( - &mut self, + &self, center_pos: impl Into, radius: f32, color: impl Into, @@ -1246,7 +1138,7 @@ pub trait RaylibDraw3D { /// Draws a sphere with extended parameters. #[inline] fn draw_sphere_ex( - &mut self, + &self, center_pos: impl Into, radius: f32, rings: i32, @@ -1261,7 +1153,7 @@ pub trait RaylibDraw3D { /// Draws a sphere in wireframe. #[inline] fn draw_sphere_wires( - &mut self, + &self, center_pos: impl Into, radius: f32, rings: i32, @@ -1276,7 +1168,7 @@ pub trait RaylibDraw3D { /// Draws a cylinder. #[inline] fn draw_cylinder( - &mut self, + &self, position: impl Into, radius_top: f32, radius_bottom: f32, @@ -1299,7 +1191,7 @@ pub trait RaylibDraw3D { /// Draws a cylinder in wireframe. #[inline] fn draw_cylinder_wires( - &mut self, + &self, position: impl Into, radius_top: f32, radius_bottom: f32, @@ -1322,7 +1214,7 @@ pub trait RaylibDraw3D { /// Draws an X/Z plane. #[inline] fn draw_plane( - &mut self, + &self, center_pos: impl Into, size: impl Into, color: impl Into, @@ -1334,7 +1226,7 @@ pub trait RaylibDraw3D { /// Draws a ray line. #[inline] - fn draw_ray(&mut self, ray: Ray, color: impl Into) { + fn draw_ray(&self, ray: Ray, color: impl Into) { unsafe { ffi::DrawRay(ray.into(), color.into()); } @@ -1342,7 +1234,7 @@ pub trait RaylibDraw3D { /// Draws a grid (centered at (0, 0, 0)). #[inline] - fn draw_grid(&mut self, slices: i32, spacing: f32) { + fn draw_grid(&self, slices: i32, spacing: f32) { unsafe { ffi::DrawGrid(slices, spacing); } @@ -1351,7 +1243,7 @@ pub trait RaylibDraw3D { /// Draws a model (with texture if set). #[inline] fn draw_model( - &mut self, + &self, model: impl AsRef, position: impl Into, scale: f32, @@ -1365,7 +1257,7 @@ pub trait RaylibDraw3D { /// Draws a model with extended parameters. #[inline] fn draw_model_ex( - &mut self, + &self, model: impl AsRef, position: impl Into, rotation_axis: impl Into, @@ -1388,7 +1280,7 @@ pub trait RaylibDraw3D { /// Draws a model with wires (with texture if set). #[inline] fn draw_model_wires( - &mut self, + &self, model: impl AsRef, position: impl Into, scale: f32, @@ -1402,7 +1294,7 @@ pub trait RaylibDraw3D { /// Draws a model with wires. #[inline] fn draw_model_wires_ex( - &mut self, + &self, model: impl AsRef, position: impl Into, rotation_axis: impl Into, @@ -1424,11 +1316,7 @@ pub trait RaylibDraw3D { /// Draws a bounding box (wires). #[inline] - fn draw_bounding_box( - &mut self, - bbox: impl Into, - color: impl Into, - ) { + fn draw_bounding_box(&self, bbox: impl Into, color: impl Into) { unsafe { ffi::DrawBoundingBox(bbox.into(), color.into()); } @@ -1437,7 +1325,7 @@ pub trait RaylibDraw3D { /// Draws a billboard texture. #[inline] fn draw_billboard( - &mut self, + &self, camera: impl Into, texture: &Texture2D, center: impl Into, @@ -1452,7 +1340,7 @@ pub trait RaylibDraw3D { /// Draws a billboard texture defined by `source_rec`. #[inline] fn draw_billboard_rec( - &mut self, + &self, camera: Camera3D, texture: &Texture2D, source_rec: impl Into, diff --git a/raylib/src/core/file.rs b/raylib/src/core/file.rs index 2d0f6ec4..7aae1ed2 100644 --- a/raylib/src/core/file.rs +++ b/raylib/src/core/file.rs @@ -2,9 +2,10 @@ use crate::ffi; use crate::core::RaylibHandle; +use core::slice; use std::ffi::CStr; -impl RaylibHandle { +impl<'a> RaylibHandle<'a> { /// Checks if a file has been dropped into the window. #[inline] pub fn is_file_dropped(&self) -> bool { @@ -13,18 +14,17 @@ impl RaylibHandle { /// Gets dropped filenames. pub fn get_dropped_files(&self) -> Vec { - let mut v = Vec::new(); - unsafe { - let dropfiles = ffi::LoadDroppedFiles(); - for i in 0..dropfiles.count { - let filestr = CStr::from_ptr(*dropfiles.paths.offset(i as isize)) - .to_str() - .unwrap(); - let file = String::from(filestr); - v.push(file); - } - ffi::UnloadDroppedFiles(dropfiles) - } + let dropfiles = unsafe { ffi::LoadDroppedFiles() }; + + let v: Vec = + unsafe { slice::from_raw_parts(dropfiles.paths, dropfiles.count as usize) } + .iter() + .map(|p| unsafe { CStr::from_ptr(*p) }) + .map(|cstr| String::from(cstr.to_string_lossy())) + .collect(); + + unsafe { ffi::UnloadDroppedFiles(dropfiles) }; + v } } diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index 79762960..37c8160d 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -6,7 +6,7 @@ use crate::ffi; use std::ffi::{CStr}; -impl RaylibHandle { +impl RaylibHandle<'_> { /// Detect if a key has been pressed once. #[inline] pub fn is_key_pressed(&self, key: crate::consts::KeyboardKey) -> bool { diff --git a/raylib/src/core/macros.rs b/raylib/src/core/macros.rs index c18ae5fa..6ab24771 100644 --- a/raylib/src/core/macros.rs +++ b/raylib/src/core/macros.rs @@ -8,6 +8,16 @@ macro_rules! make_thin_wrapper { }; } +macro_rules! make_bound_thin_wrapper { + ($name:ident, $t:ty, $dropfunc:expr, $binding:ty) => { + #[repr(transparent)] + #[derive(Debug)] + pub struct $name<'a, 'bind: 'a>(pub(crate) $t, pub std::marker::PhantomData<&'a Self>, pub std::marker::PhantomData<&'bind $binding>); + + impl_wrapper_bounded!($name, $t, $dropfunc, 0, 'a); + }; +} + macro_rules! impl_wrapper { ($name:ident, $t:ty, $dropfunc:expr, $rawfield:tt) => { impl $name { @@ -73,41 +83,39 @@ macro_rules! impl_wrapper { }; } -macro_rules! make_rslice { - ($name:ident, $t:ty, $dropfunc:expr) => { - #[repr(transparent)] - #[derive(Debug)] - pub struct $name(pub(crate) std::mem::ManuallyDrop>); - - impl_rslice!($name, std::boxed::Box<[$t]>, $dropfunc, 0); - }; -} +macro_rules! impl_wrapper_bounded { + ($name:ident, $t:ty, $dropfunc:expr, $rawfield:tt, $lt:lifetime) => { + impl<'bind, $lt> $name<'bind, $lt> { + /// Take the raw ffi type. Must manually free memory by calling the proper unload function + pub unsafe fn unwrap(self) -> $t { + let inner = self.$rawfield; + std::mem::forget(self); + inner + } + } -macro_rules! impl_rslice { - ($name:ident, $t:ty, $dropfunc:expr, $rawfield:tt) => { - impl Drop for $name { + impl<'bind, $lt> Drop for $name<'bind, $lt> { #[allow(unused_unsafe)] fn drop(&mut self) { unsafe { - let inner = std::mem::ManuallyDrop::take(&mut self.0); - ($dropfunc)(std::boxed::Box::leak(inner).as_mut_ptr() as *mut _); + ($dropfunc)(self.$rawfield); } } } - impl std::convert::AsRef<$t> for $name { + impl<'bind, $lt> std::convert::AsRef<$t> for $name<'bind, $lt> { fn as_ref(&self) -> &$t { &self.$rawfield } } - impl std::convert::AsMut<$t> for $name { + impl<'bind, $lt> std::convert::AsMut<$t> for $name<'bind, $lt> { fn as_mut(&mut self) -> &mut $t { &mut self.$rawfield } } - impl std::ops::Deref for $name { + impl<'bind, $lt> std::ops::Deref for $name<'bind, $lt> { type Target = $t; #[inline] fn deref(&self) -> &Self::Target { @@ -115,11 +123,27 @@ macro_rules! impl_rslice { } } - impl std::ops::DerefMut for $name { + impl<'bind, $lt> std::ops::DerefMut for $name<'bind, $lt> { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.$rawfield } } + + impl<'bind, $lt> $name<'bind, $lt> { + /// returns the unwrapped raylib-sys object + pub fn to_raw(self) -> $t { + let raw = self.$rawfield; + std::mem::forget(self); + raw + } + + /// converts raylib-sys object to a "safe" + /// version. Make sure to call this function + /// from the thread the resource was created. + pub unsafe fn from_raw(raw: $t) -> Self { + Self(raw, std::marker::PhantomData, std::marker::PhantomData) + } + } }; } diff --git a/raylib/src/core/math.rs b/raylib/src/core/math.rs index a9af1cfe..a912b5b6 100644 --- a/raylib/src/core/math.rs +++ b/raylib/src/core/math.rs @@ -24,8 +24,6 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "nalgebra_interop")] use nalgebra as na; -make_rslice!(RSliceVec4, Vector4, ffi::MemFree); - macro_rules! optional_serde_struct { ($def:item) => { cfg_if::cfg_if! { diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index f73edbc2..d2300bd5 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -1,7 +1,7 @@ //! Useful functions that don't fit anywhere else use crate::core::texture::Image; use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; +use crate::{ffi, RaylibRenderLoop}; use std::ffi::CString; /// Returns a random value between min and max (both included) @@ -28,9 +28,9 @@ pub fn open_url(url: &str) { } } -impl RaylibHandle { +impl RaylibRenderLoop<'_> { /// Load pixels from the screen into a CPU image - pub fn load_image_from_screen(&self, _: &RaylibThread) -> Image { + pub fn load_image_from_screen(&mut self, _: &RaylibThread) -> Image { unsafe { Image(ffi::LoadImageFromScreen()) } } @@ -41,7 +41,9 @@ impl RaylibHandle { ffi::TakeScreenshot(c_filename.as_ptr()); } } +} +impl RaylibHandle<'_> { /// Returns a random value between min and max (both included) /// ```rust /// use raylib::*; diff --git a/raylib/src/core/mod.rs b/raylib/src/core/mod.rs index ce84e4d3..60f8fc45 100644 --- a/raylib/src/core/mod.rs +++ b/raylib/src/core/mod.rs @@ -2,6 +2,7 @@ mod macros; pub mod audio; +mod buffer; pub mod camera; pub mod collision; pub mod color; @@ -20,10 +21,15 @@ pub mod vr; pub mod window; use crate::ffi; + +use std::cell::RefCell; use std::ffi::CString; use std::marker::PhantomData; +use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; +use self::drawing::RaylibDrawHandle; + // shamelessly stolen from imgui #[macro_export] macro_rules! rstr { @@ -57,9 +63,18 @@ pub struct RaylibThread(PhantomData<*const ()>); /// [`RaylibBuilder`]: struct.RaylibBuilder.html /// [`init`]: fn.init.html #[derive(Debug)] -pub struct RaylibHandle(()); // inner field is private, preventing manual construction +pub struct RaylibHandle<'rl>(Rc>); // inner field is private, preventing manual construction + +impl<'th, 'a: 'th> RaylibHandle<'a> { + pub fn render_loop(&self, _: &'th RaylibThread) -> Rc> { + self.0.clone() + } +} + +#[derive(Debug)] +pub struct RaylibRenderLoop<'a>(RefCell>); -impl Drop for RaylibHandle { +impl Drop for RaylibHandle<'_> { fn drop(&mut self) { if IS_INITIALIZED.load(Ordering::Relaxed) { unsafe { @@ -161,7 +176,7 @@ impl RaylibBuilder { /// # Panics /// /// Attempting to initialize Raylib more than once will result in a panic. - pub fn build(&self) -> (RaylibHandle, RaylibThread) { + pub fn build(&self) -> (RaylibHandle<'_>, RaylibThread) { use crate::consts::ConfigFlags::*; let mut flags = 0u32; if self.fullscreen_mode { @@ -196,7 +211,7 @@ impl RaylibBuilder { /// # Panics /// /// Attempting to initialize Raylib more than once will result in a panic. -fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle { +fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle<'_> { if IS_INITIALIZED.load(Ordering::Relaxed) { panic!("Attempted to initialize raylib-rs more than once!"); } else { @@ -208,6 +223,9 @@ fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle { panic!("Attempting to create window failed!"); } IS_INITIALIZED.store(true, Ordering::Relaxed); - RaylibHandle(()) + + RaylibHandle(Rc::new(RaylibRenderLoop(RefCell::new(RaylibDrawHandle( + PhantomData, + ))))) } } diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index 6d8a9631..776872ac 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -3,56 +3,25 @@ use crate::core::math::{BoundingBox, Vector3}; use crate::core::texture::Image; use crate::core::{RaylibHandle, RaylibThread}; use crate::{consts, ffi}; +use core::slice; use std::ffi::CString; fn no_drop(_thing: T) {} -make_thin_wrapper!(Model, ffi::Model, ffi::UnloadModel); -make_thin_wrapper!(WeakModel, ffi::Model, no_drop); make_thin_wrapper!(Mesh, ffi::Mesh, |mesh: ffi::Mesh| ffi::UnloadMesh(mesh)); -make_thin_wrapper!(WeakMesh, ffi::Mesh, no_drop); +make_bound_thin_wrapper!(Model, ffi::Model, ffi::UnloadModel, RaylibHandle<'bind>); make_thin_wrapper!(Material, ffi::Material, ffi::UnloadMaterial); -make_thin_wrapper!(WeakMaterial, ffi::Material, no_drop); make_thin_wrapper!(BoneInfo, ffi::BoneInfo, no_drop); make_thin_wrapper!( ModelAnimation, ffi::ModelAnimation, ffi::UnloadModelAnimation ); -make_thin_wrapper!(WeakModelAnimation, ffi::ModelAnimation, no_drop); make_thin_wrapper!(MaterialMap, ffi::MaterialMap, no_drop); -// Weak things can be clone -impl Clone for WeakModel { - fn clone(&self) -> WeakModel { - WeakModel(self.0) - } -} - -// Weak things can be clone -impl Clone for WeakMesh { - fn clone(&self) -> WeakMesh { - WeakMesh(self.0) - } -} - -// Weak things can be clone -impl Clone for WeakMaterial { - fn clone(&self) -> WeakMaterial { - WeakMaterial(self.0) - } -} - -// Weak things can be clone -impl Clone for WeakModelAnimation { - fn clone(&self) -> WeakModelAnimation { - WeakModelAnimation(self.0) - } -} - -impl RaylibHandle { +impl<'bind, 'a> RaylibHandle<'a> { /// Loads model from files (mesh and material). // #[inline] - pub fn load_model(&mut self, _: &RaylibThread, filename: &str) -> Result { + pub fn load_model(&'bind self, _: &RaylibThread, filename: &str) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let m = unsafe { ffi::LoadModel(c_filename.as_ptr()) }; if m.meshes.is_null() && m.materials.is_null() && m.bones.is_null() && m.bindPose.is_null() @@ -60,22 +29,22 @@ impl RaylibHandle { return Err(format!("could not load model {}", filename)); } // TODO check if null pointer checks are necessary. - Ok(Model(m)) + Ok(unsafe { Model::from_raw(m) }) } // Loads model from a generated mesh pub fn load_model_from_mesh( - &mut self, + &'bind self, _: &RaylibThread, - mesh: WeakMesh, - ) -> Result { + mesh: &Mesh, + ) -> Result, String> { let m = unsafe { ffi::LoadModelFromMesh(mesh.0) }; if m.meshes.is_null() || m.materials.is_null() { return Err("Could not load model from mesh".to_owned()); } - Ok(Model(m)) + Ok(unsafe { Model::from_raw(m) }) } pub fn load_model_animations( @@ -114,16 +83,7 @@ impl RaylibHandle { } } -impl RaylibModel for WeakModel {} -impl RaylibModel for Model {} - -impl Model { - pub unsafe fn make_weak(self) -> WeakModel { - let m = WeakModel(self.0); - std::mem::forget(self); - m - } -} +impl<'bind, 'a> RaylibModel for Model<'bind, 'a> {} pub trait RaylibModel: AsRef + AsMut { fn transform(&self) -> &crate::math::Matrix { @@ -134,74 +94,81 @@ pub trait RaylibModel: AsRef + AsMut { self.as_mut().transform = mat.into(); } - fn meshes(&self) -> &[WeakMesh] { + fn meshes<'a>(&'a self) -> &'a [Mesh] { unsafe { - std::slice::from_raw_parts( - self.as_ref().meshes as *const WeakMesh, + slice::from_raw_parts( + self.as_ref().meshes as *const Mesh, self.as_ref().meshCount as usize, ) } } - fn meshes_mut(&mut self) -> &mut [WeakMesh] { + + fn meshes_mut<'a>(&'a mut self) -> &'a mut [Mesh] { unsafe { - std::slice::from_raw_parts_mut( - self.as_mut().meshes as *mut WeakMesh, - self.as_mut().meshCount as usize, + slice::from_raw_parts_mut( + self.as_ref().meshes as *mut Mesh, + self.as_ref().meshCount as usize, ) } } - fn materials(&self) -> &[WeakMaterial] { + + fn materials<'a>(&'a self) -> &'a [Material] { unsafe { - std::slice::from_raw_parts( - self.as_ref().materials as *const WeakMaterial, + slice::from_raw_parts( + self.as_ref().materials as *const Material, self.as_ref().materialCount as usize, ) } } - fn materials_mut(&mut self) -> &mut [WeakMaterial] { + + fn materials_mut<'a>(&'a mut self) -> &'a mut [Material] { unsafe { - std::slice::from_raw_parts_mut( - self.as_mut().materials as *mut WeakMaterial, - self.as_mut().materialCount as usize, + slice::from_raw_parts_mut( + self.as_ref().materials as *mut Material, + self.as_ref().materialCount as usize, ) } } - fn bones(&self) -> Option<&[BoneInfo]> { + fn bones<'a>(&'a self) -> Option<&'a [BoneInfo]> { if self.as_ref().bones.is_null() { return None; } Some(unsafe { - std::slice::from_raw_parts( + slice::from_raw_parts( self.as_ref().bones as *const BoneInfo, self.as_ref().boneCount as usize, ) }) } - fn bones_mut(&mut self) -> Option<&mut [BoneInfo]> { + + fn bones_mut<'a>(&'a mut self) -> Option<&'a mut [BoneInfo]> { if self.as_ref().bones.is_null() { return None; } Some(unsafe { - std::slice::from_raw_parts_mut( - self.as_mut().bones as *mut BoneInfo, - self.as_mut().boneCount as usize, + slice::from_raw_parts_mut( + self.as_ref().bones as *mut BoneInfo, + self.as_ref().boneCount as usize, ) }) } - fn bind_pose(&self) -> Option<&crate::math::Transform> { + + fn bind_pose<'a>(&'a self) -> Option<&'a crate::math::Transform> { if self.as_ref().bindPose.is_null() { return None; } + Some(unsafe { std::mem::transmute(self.as_ref().bindPose) }) } - fn bind_pose_mut(&mut self) -> Option<&mut crate::math::Transform> { + fn bind_pose_mut<'a>(&'a mut self) -> Option<&'a mut crate::math::Transform> { if self.as_ref().bindPose.is_null() { return None; } + Some(unsafe { std::mem::transmute(self.as_mut().bindPose) }) } @@ -212,18 +179,10 @@ pub trait RaylibModel: AsRef + AsMut { } } -impl RaylibMesh for WeakMesh {} impl RaylibMesh for Mesh {} -impl Mesh { - pub unsafe fn make_weak(self) -> WeakMesh { - let m = WeakMesh(self.0); - std::mem::forget(self); - m - } -} pub trait RaylibMesh: AsRef + AsMut { - fn vertices(&self) -> &[Vector3] { + fn vertices<'a>(&'a self) -> &'a [Vector3] { unsafe { std::slice::from_raw_parts( self.as_ref().vertices as *const Vector3, @@ -231,7 +190,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn vertices_mut(&mut self) -> &mut [Vector3] { + fn vertices_mut<'a>(&'a mut self) -> &'a mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().vertices as *mut Vector3, @@ -239,7 +198,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn normals(&self) -> &[Vector3] { + fn normals<'a>(&'a self) -> &'a [Vector3] { unsafe { std::slice::from_raw_parts( self.as_ref().normals as *const Vector3, @@ -247,7 +206,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn normals_mut(&mut self) -> &mut [Vector3] { + fn normals_mut<'a>(&'a mut self) -> &'a mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().normals as *mut Vector3, @@ -255,7 +214,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn tangents(&self) -> &[Vector3] { + fn tangents<'a>(&'a self) -> &'a [Vector3] { unsafe { std::slice::from_raw_parts( self.as_ref().tangents as *const Vector3, @@ -263,7 +222,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn tangents_mut(&mut self) -> &mut [Vector3] { + fn tangents_mut<'a>(&'a mut self) -> &'a mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().tangents as *mut Vector3, @@ -271,7 +230,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn colors(&self) -> &[crate::color::Color] { + fn colors<'a>(&'a self) -> &'a [crate::color::Color] { unsafe { std::slice::from_raw_parts( self.as_ref().colors as *const crate::color::Color, @@ -279,7 +238,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn colors_mut(&mut self) -> &mut [crate::color::Color] { + fn colors_mut<'a>(&'a mut self) -> &'a mut [crate::color::Color] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().colors as *mut crate::color::Color, @@ -287,7 +246,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn indicies(&self) -> &[u16] { + fn indicies<'a>(&'a self) -> &'a [u16] { unsafe { std::slice::from_raw_parts( self.as_ref().indices as *const u16, @@ -295,7 +254,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn indicies_mut(&mut self) -> &mut [u16] { + fn indicies_mut<'a>(&'a mut self) -> &'a mut [u16] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().indices as *mut u16, @@ -398,12 +357,6 @@ pub trait RaylibMesh: AsRef + AsMut { } impl Material { - pub unsafe fn make_weak(self) -> WeakMaterial { - let m = WeakMaterial(self.0); - std::mem::forget(self); - m - } - pub fn load_materials(filename: &str) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let mut m_size = 0; @@ -424,19 +377,18 @@ impl Material { } } -impl RaylibMaterial for WeakMaterial {} impl RaylibMaterial for Material {} pub trait RaylibMaterial: AsRef + AsMut { - fn shader(&self) -> &crate::shaders::WeakShader { + fn shader<'a>(&'a self) -> &'a crate::shaders::Shader { unsafe { std::mem::transmute(&self.as_ref().shader) } } - fn shader_mut(&mut self) -> &mut crate::shaders::WeakShader { + fn shader_mut<'a>(&'a mut self) -> &'a mut crate::shaders::Shader { unsafe { std::mem::transmute(&mut self.as_mut().shader) } } - fn maps(&self) -> &[MaterialMap] { + fn maps<'a>(&'a self) -> &'a [MaterialMap] { unsafe { std::slice::from_raw_parts( self.as_ref().maps as *const MaterialMap, @@ -445,7 +397,7 @@ pub trait RaylibMaterial: AsRef + AsMut { } } - fn maps_mut(&mut self) -> &mut [MaterialMap] { + fn maps_mut<'a>(&'a mut self) -> &'a mut [MaterialMap] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().maps as *mut MaterialMap, @@ -466,18 +418,9 @@ pub trait RaylibMaterial: AsRef + AsMut { } impl RaylibModelAnimation for ModelAnimation {} -impl RaylibModelAnimation for WeakModelAnimation {} - -impl ModelAnimation { - pub unsafe fn make_weak(self) -> WeakModelAnimation { - let m = WeakModelAnimation(self.0); - std::mem::forget(self); - m - } -} pub trait RaylibModelAnimation: AsRef + AsMut { - fn bones(&self) -> &[BoneInfo] { + fn bones<'a>(&'a self) -> &'a [BoneInfo] { unsafe { std::slice::from_raw_parts( self.as_ref().bones as *const BoneInfo, @@ -486,7 +429,7 @@ pub trait RaylibModelAnimation: AsRef + AsMut &mut [BoneInfo] { + fn bones_mut<'a>(&'a mut self) -> &'a mut [BoneInfo] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().bones as *mut BoneInfo, @@ -495,8 +438,9 @@ pub trait RaylibModelAnimation: AsRef + AsMut Vec<&[crate::math::Transform]> { + fn frame_poses<'a>(&'a self) -> Vec<&'a [crate::math::Transform]> { let anim = self.as_ref(); + let mut top = Vec::with_capacity(anim.frameCount as usize); for i in 0..anim.frameCount { @@ -511,7 +455,7 @@ pub trait RaylibModelAnimation: AsRef + AsMut Vec<&mut [crate::math::Transform]> { + fn frame_poses_mut<'a>(&'a mut self) -> Vec<&'a mut [crate::math::Transform]> { let anim = self.as_ref(); let mut top = Vec::with_capacity(anim.frameCount as usize); @@ -529,66 +473,30 @@ pub trait RaylibModelAnimation: AsRef + AsMut &crate::texture::WeakTexture2D { + pub fn texture<'a>(&'a self) -> &'a crate::texture::Texture2D { unsafe { std::mem::transmute(&self.0.texture) } } - pub fn texture_mut(&mut self) -> &mut crate::texture::WeakTexture2D { + pub fn texture_mut<'a>(&'a mut self) -> &'a mut crate::texture::Texture2D { unsafe { std::mem::transmute(&mut self.0.texture) } } - pub fn color(&self) -> &crate::color::Color { + pub fn color<'a>(&'a self) -> &'a crate::color::Color { unsafe { std::mem::transmute(&self.0.color) } } - pub fn color_mut(&mut self) -> &mut crate::color::Color { + pub fn color_mut<'a>(&'a mut self) -> &'a mut crate::color::Color { unsafe { std::mem::transmute(&mut self.0.color) } } - pub fn value(&self) -> &f32 { + pub fn value<'a>(&'a self) -> &'a f32 { unsafe { std::mem::transmute(&self.0.value) } } - pub fn value_mut(&mut self) -> &mut f32 { + pub fn value_mut<'a>(&'a mut self) -> &'a mut f32 { unsafe { std::mem::transmute(&mut self.0.value) } } } -impl RaylibHandle { - pub fn load_material_default(&self, _: &RaylibThread) -> WeakMaterial { - WeakMaterial(unsafe { ffi::LoadMaterialDefault() }) - } - - /// Weak materials will leak memeory if they are not unlaoded - /// Unload material from GPU memory (VRAM) - pub unsafe fn unload_material(&mut self, _: &RaylibThread, material: WeakMaterial) { - { - ffi::UnloadMaterial(*material.as_ref()) - } - } - - /// Weak models will leak memeory if they are not unlaoded - /// Unload model from GPU memory (VRAM) - pub unsafe fn unload_model(&mut self, _: &RaylibThread, model: WeakModel) { - { - ffi::UnloadModel(*model.as_ref()) - } - } - - /// Weak model_animations will leak memeory if they are not unlaoded - /// Unload model_animation from GPU memory (VRAM) - pub unsafe fn unload_model_animation( - &mut self, - _: &RaylibThread, - model_animation: WeakModelAnimation, - ) { - { - ffi::UnloadModelAnimation(*model_animation.as_ref()) - } - } - - /// Weak meshs will leak memeory if they are not unlaoded - /// Unload mesh from GPU memory (VRAM) - pub unsafe fn unload_mesh(&mut self, _: &RaylibThread, mesh: WeakMesh) { - { - ffi::UnloadMesh(*mesh.as_ref()) - } +impl<'bind> RaylibHandle<'bind> { + pub fn load_material_default(&self, _: &RaylibThread) -> Material { + Material(unsafe { ffi::LoadMaterialDefault() }) } } diff --git a/raylib/src/core/shaders.rs b/raylib/src/core/shaders.rs index cf6e5c2e..a0c9dc1a 100644 --- a/raylib/src/core/shaders.rs +++ b/raylib/src/core/shaders.rs @@ -5,85 +5,75 @@ use crate::core::math::{Vector2, Vector3, Vector4}; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; use std::ffi::CString; +use std::mem::ManuallyDrop; use std::os::raw::{c_char, c_void}; -fn no_drop(_thing: T) {} -make_thin_wrapper!(Shader, ffi::Shader, ffi::UnloadShader); -make_thin_wrapper!(WeakShader, ffi::Shader, no_drop); +make_bound_thin_wrapper!(Shader, ffi::Shader, ffi::UnloadShader, RaylibHandle<'bind>); // #[cfg(feature = "nightly")] // impl !Send for Shader {} // #[cfg(feature = "nightly")] // unsafe impl Sync for Shader {} -impl RaylibHandle { +impl<'bind, 'a, 'rl> RaylibHandle<'rl> { /// Loads a custom shader and binds default locations. pub fn load_shader( - &mut self, + &'bind self, _: &RaylibThread, vs_filename: Option<&str>, fs_filename: Option<&str>, - ) -> Result { + ) -> Result, String> { let c_vs_filename = vs_filename.map(|f| CString::new(f).unwrap()); let c_fs_filename = fs_filename.map(|f| CString::new(f).unwrap()); // Trust me, I have tried ALL the RUST option ergonamics. This is the only way // to get this to work without raylib breaking for whatever reason let shader = match (c_vs_filename, c_fs_filename) { - (Some(vs), Some(fs)) => unsafe { Shader(ffi::LoadShader(vs.as_ptr(), fs.as_ptr())) }, - (None, Some(fs)) => unsafe { Shader(ffi::LoadShader(std::ptr::null(), fs.as_ptr())) }, - (Some(vs), None) => unsafe { Shader(ffi::LoadShader(vs.as_ptr(), std::ptr::null())) }, - (None, None) => unsafe { Shader(ffi::LoadShader(std::ptr::null(), std::ptr::null())) }, + (Some(vs), Some(fs)) => unsafe { ffi::LoadShader(vs.as_ptr(), fs.as_ptr()) }, + (None, Some(fs)) => unsafe { ffi::LoadShader(std::ptr::null(), fs.as_ptr()) }, + (Some(vs), None) => unsafe { ffi::LoadShader(vs.as_ptr(), std::ptr::null()) }, + (None, None) => unsafe { ffi::LoadShader(std::ptr::null(), std::ptr::null()) }, }; - return Ok(shader); + Ok(unsafe { Shader::from_raw(shader) }) } /// Loads shader from code strings and binds default locations. pub fn load_shader_from_memory( - &mut self, + &'bind self, _: &RaylibThread, vs_code: Option<&str>, fs_code: Option<&str>, - ) -> Shader { + ) -> Shader<'bind, 'a> { let c_vs_code = vs_code.map(|f| CString::new(f).unwrap()); let c_fs_code = fs_code.map(|f| CString::new(f).unwrap()); - return match (c_vs_code, c_fs_code) { - (Some(vs), Some(fs)) => unsafe { - Shader(ffi::LoadShaderFromMemory( + + unsafe { + Shader::from_raw(match (c_vs_code, c_fs_code) { + (Some(vs), Some(fs)) => ffi::LoadShaderFromMemory( vs.as_ptr() as *mut c_char, fs.as_ptr() as *mut c_char, - )) - }, - (None, Some(fs)) => unsafe { - Shader(ffi::LoadShaderFromMemory( - std::ptr::null_mut(), - fs.as_ptr() as *mut c_char, - )) - }, - (Some(vs), None) => unsafe { - Shader(ffi::LoadShaderFromMemory( - vs.as_ptr() as *mut c_char, - std::ptr::null_mut(), - )) - }, - (None, None) => unsafe { - Shader(ffi::LoadShaderFromMemory( - std::ptr::null_mut(), - std::ptr::null_mut(), - )) - }, - }; + ), + (None, Some(fs)) => { + ffi::LoadShaderFromMemory(std::ptr::null_mut(), fs.as_ptr() as *mut c_char) + } + (Some(vs), None) => { + ffi::LoadShaderFromMemory(vs.as_ptr() as *mut c_char, std::ptr::null_mut()) + } + (None, None) => { + ffi::LoadShaderFromMemory(std::ptr::null_mut(), std::ptr::null_mut()) + } + }) + } } /// Get default shader. Modifying it modifies everthing that uses that shader - #[cfg(target_os = "windows")] - pub fn get_shader_default() -> WeakShader { + pub fn get_shader_default(&'bind self) -> ManuallyDrop> { unsafe { - WeakShader(ffi::Shader { + ManuallyDrop::new(Shader::from_raw(ffi::Shader { id: ffi::rlGetShaderIdDefault(), - locs: ffi::rlGetShaderLocsDefault() - }) + locs: ffi::rlGetShaderLocsDefault(), + })) } } } @@ -177,13 +167,7 @@ impl ShaderV for &[i32] { } } -impl Shader { - pub unsafe fn make_weak(self) -> WeakShader { - let m = WeakShader(self.0); - std::mem::forget(self); - m - } - +impl<'bind, 'a> Shader<'bind, 'a> { /// Sets shader uniform value #[inline] pub fn set_shader_value(&mut self, uniform_loc: i32, value: S) { @@ -232,8 +216,7 @@ impl Shader { } } -impl RaylibShader for WeakShader {} -impl RaylibShader for Shader {} +impl<'bind, 'a> RaylibShader for Shader<'bind, 'a> {} pub trait RaylibShader: AsRef + AsMut { #[inline] @@ -302,10 +285,9 @@ pub trait RaylibShader: AsRef + AsMut { } } -impl RaylibHandle { +impl<'a> RaylibHandle<'a> { /// Sets a custom projection matrix (replaces internal projection matrix). #[inline] - #[cfg(target_os = "windows")] pub fn set_matrix_projection(&mut self, _: &RaylibThread, proj: Matrix) { unsafe { ffi::rlSetMatrixProjection(proj.into()); @@ -314,7 +296,6 @@ impl RaylibHandle { /// Sets a custom modelview matrix (replaces internal modelview matrix). #[inline] - #[cfg(target_os = "windows")] pub fn set_matrix_modelview(&mut self, _: &RaylibThread, view: Matrix) { unsafe { ffi::rlSetMatrixModelview(view.into()); @@ -323,14 +304,12 @@ impl RaylibHandle { /// Gets internal modelview matrix. #[inline] - #[cfg(target_os = "windows")] pub fn get_matrix_modelview(&self) -> Matrix { unsafe { ffi::rlGetMatrixModelview().into() } } /// Gets internal projection matrix. #[inline] - #[cfg(target_os = "windows")] pub fn get_matrix_projection(&self) -> Matrix { unsafe { ffi::rlGetMatrixProjection().into() } } diff --git a/raylib/src/core/text.rs b/raylib/src/core/text.rs index f6915682..cb65db07 100644 --- a/raylib/src/core/text.rs +++ b/raylib/src/core/text.rs @@ -7,10 +7,10 @@ use crate::ffi; use std::convert::{AsMut, AsRef}; use std::ffi::CString; +use std::mem::ManuallyDrop; fn no_drop(_thing: T) {} -make_thin_wrapper!(Font, ffi::Font, ffi::UnloadFont); -make_thin_wrapper!(WeakFont, ffi::Font, no_drop); +make_bound_thin_wrapper!(Font, ffi::Font, ffi::UnloadFont, RaylibHandle<'bind>); make_thin_wrapper!(GlyphInfo, ffi::GlyphInfo, no_drop); #[repr(transparent)] @@ -67,13 +67,7 @@ impl std::ops::DerefMut for RSliceGlyphInfo { // #[cfg(feature = "nightly")] // unsafe impl Sync for WeakFont {} -impl AsRef for Font { - fn as_ref(&self) -> &ffi::Texture2D { - return &self.0.texture; - } -} - -impl AsRef for WeakFont { +impl<'bind, 'a> AsRef for Font<'bind, 'a> { fn as_ref(&self) -> &ffi::Texture2D { return &self.0.texture; } @@ -86,14 +80,14 @@ pub enum FontLoadEx<'a> { Chars(&'a [i32]), } -impl RaylibHandle { - pub fn unload_font(&mut self, font: WeakFont) { - unsafe { ffi::UnloadFont(font.0) }; - } - +impl<'bind> RaylibHandle<'_> { /// Loads font from file into GPU memory (VRAM). #[inline] - pub fn load_font(&mut self, _: &RaylibThread, filename: &str) -> Result { + pub fn load_font( + &'bind self, + _: &RaylibThread, + filename: &str, + ) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let f = unsafe { ffi::LoadFont(c_filename.as_ptr()) }; if f.glyphs.is_null() || f.texture.id == 0 { @@ -102,18 +96,18 @@ impl RaylibHandle { filename )); } - Ok(Font(f)) + Ok(unsafe { Font::from_raw(f) }) } /// Loads font from file with extended parameters. #[inline] pub fn load_font_ex( - &mut self, + &'bind self, _: &RaylibThread, filename: &str, font_size: i32, chars: FontLoadEx, - ) -> Result { + ) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let f = unsafe { match chars { @@ -134,30 +128,30 @@ impl RaylibHandle { filename )); } - Ok(Font(f)) + Ok(unsafe { Font::from_raw(f) }) } /// Load font from Image (XNA style) #[inline] pub fn load_font_from_image( - &mut self, + &'bind self, _: &RaylibThread, image: &Image, key: impl Into, first_char: i32, - ) -> Result { + ) -> Result, String> { let f = unsafe { ffi::LoadFontFromImage(image.0, key.into(), first_char) }; if f.glyphs.is_null() { return Err(format!("Error loading font from image.")); } - Ok(Font(f)) + Ok(unsafe { Font::from_raw(f) }) } /// Loads font data for further use (see also `Font::from_data`). /// Now supports .tiff #[inline] pub fn load_font_data( - &mut self, + &self, data: &[u8], font_size: i32, chars: Option<&[i32]>, @@ -194,8 +188,7 @@ impl RaylibHandle { } } -impl RaylibFont for WeakFont {} -impl RaylibFont for Font {} +impl RaylibFont for Font<'_, '_> {} pub trait RaylibFont: AsRef + AsMut { fn base_size(&self) -> i32 { @@ -222,19 +215,15 @@ pub trait RaylibFont: AsRef + AsMut { } } -impl Font { - pub fn make_weak(self) -> WeakFont { - let w = WeakFont(self.0); - std::mem::forget(self); - return w; - } +impl<'a, 'bind> Font<'bind, 'a> { /// Returns a new `Font` using provided `GlyphInfo` data and parameters. fn from_data( + &'bind mut self, chars: &[ffi::GlyphInfo], base_size: i32, padding: i32, pack_method: i32, - ) -> Result { + ) -> Result, String> { let f = unsafe { let mut f = std::mem::zeroed::(); f.baseSize = base_size; @@ -311,11 +300,11 @@ pub fn gen_image_font_atlas( } } -impl RaylibHandle { +impl<'bind, 'a> RaylibHandle<'_> { /// Gets the default font. #[inline] - pub fn get_font_default(&self) -> WeakFont { - WeakFont(unsafe { ffi::GetFontDefault() }) + pub fn get_font_default(&'bind self) -> ManuallyDrop> { + ManuallyDrop::new(unsafe { Font::from_raw(ffi::GetFontDefault()) }) } } diff --git a/raylib/src/core/texture.rs b/raylib/src/core/texture.rs index a8f316cd..94758fad 100644 --- a/raylib/src/core/texture.rs +++ b/raylib/src/core/texture.rs @@ -4,10 +4,8 @@ use crate::core::math::Rectangle; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; use std::ffi::CString; -use std::mem::ManuallyDrop; -make_rslice!(ImagePalette, Color, ffi::UnloadImagePalette); -make_rslice!(ImageColors, Color, ffi::UnloadImageColors); +use super::buffer::RaylibBuffer; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -45,77 +43,34 @@ impl Into for &NPatchInfo { } } -fn no_drop(_thing: T) {} -make_thin_wrapper!(Image, ffi::Image, ffi::UnloadImage); -make_thin_wrapper!(Texture2D, ffi::Texture2D, ffi::UnloadTexture); -make_thin_wrapper!(WeakTexture2D, ffi::Texture2D, no_drop); -make_thin_wrapper!( +#[repr(transparent)] +#[derive(Debug)] +pub struct Image(pub(crate) ffi::Image); + +impl_wrapper!(Image, ffi::Image, (ffi::UnloadImage), 0); + +make_bound_thin_wrapper!( + Texture2D, + ffi::Texture2D, + ffi::UnloadTexture, + RaylibHandle<'bind> +); +make_bound_thin_wrapper!( RenderTexture2D, ffi::RenderTexture2D, - ffi::UnloadRenderTexture + ffi::UnloadRenderTexture, + RaylibHandle<'bind> ); -make_thin_wrapper!(WeakRenderTexture2D, ffi::RenderTexture2D, no_drop); - -// Weak things can be clone -impl Clone for WeakTexture2D { - fn clone(&self) -> WeakTexture2D { - WeakTexture2D(self.0) - } -} -// Weak things can be clone -impl Clone for WeakRenderTexture2D { - fn clone(&self) -> WeakRenderTexture2D { - WeakRenderTexture2D(self.0) - } -} - -impl RaylibRenderTexture2D for WeakRenderTexture2D {} -impl RaylibRenderTexture2D for RenderTexture2D {} - -impl AsRef for RenderTexture2D { +impl<'bind, 'a> AsRef for RenderTexture2D<'bind, 'a> { fn as_ref(&self) -> &ffi::Texture2D { - self.texture() + &self.0.texture } } -impl AsMut for RenderTexture2D { +impl<'bind, 'a> AsMut for RenderTexture2D<'bind, 'a> { fn as_mut(&mut self) -> &mut ffi::Texture2D { - self.texture_mut() - } -} - -impl AsRef for WeakRenderTexture2D { - fn as_ref(&self) -> &ffi::Texture2D { - self.texture() - } -} - -impl AsMut for WeakRenderTexture2D { - fn as_mut(&mut self) -> &mut ffi::Texture2D { - self.texture_mut() - } -} - -impl RenderTexture2D { - pub unsafe fn make_weak(self) -> WeakRenderTexture2D { - let m = WeakRenderTexture2D(self.0); - std::mem::forget(self); - m - } -} - -pub trait RaylibRenderTexture2D: AsRef + AsMut { - fn id(&self) -> u32 { - self.as_ref().id - } - - fn texture(&self) -> &WeakTexture2D { - unsafe { std::mem::transmute(&self.as_ref().texture) } - } - - fn texture_mut(&mut self) -> &mut WeakTexture2D { - unsafe { std::mem::transmute(&mut self.as_mut().texture) } + &mut self.0.texture } } @@ -135,7 +90,7 @@ impl Image { pub fn mipmaps(&self) -> i32 { self.0.mipmaps } - pub unsafe fn data(&self) -> *mut ::std::os::raw::c_void { + pub unsafe fn data(&self) -> *mut core::ffi::c_void { self.0.data } @@ -174,26 +129,24 @@ impl Image { } /// Gets pixel data from `image` as a Vec of Color structs. - pub fn get_image_data(&self) -> ImageColors { + pub fn get_image_data(&self) -> RaylibBuffer { unsafe { let image_data = ffi::LoadImageColors(self.0); let image_data_len = (self.width * self.height) as usize; - ImageColors(ManuallyDrop::new(Box::from_raw( - std::slice::from_raw_parts_mut(image_data as *mut _, image_data_len), - ))) + + RaylibBuffer::new(image_data as _, image_data_len).unwrap() } } /// Extract color palette from image to maximum size #[inline] - pub fn extract_palette(&self, max_palette_size: u32) -> ImagePalette { + pub fn extract_palette(&self, max_palette_size: u32) -> RaylibBuffer { unsafe { let mut palette_len = 0; let image_data = ffi::LoadImagePalette(self.0, max_palette_size as i32, &mut palette_len); - ImagePalette(ManuallyDrop::new(Box::from_raw( - std::slice::from_raw_parts_mut(image_data as *mut _, palette_len as usize), - ))) + + RaylibBuffer::new(image_data as _, palette_len as usize).unwrap() } } @@ -676,16 +629,18 @@ impl Image { } Ok(Image(i)) } - + /// Loads image from a given memory buffer as a vector of arrays - pub fn load_image_from_mem(filetype: &str, bytes: &Vec, size: i32) -> Result { + pub fn load_image_from_mem( + filetype: &str, + bytes: &Vec, + size: i32, + ) -> Result { let c_filetype = CString::new(filetype).unwrap(); let c_bytes = bytes.as_ptr(); let i = unsafe { ffi::LoadImageFromMemory(c_filetype.as_ptr(), c_bytes, size) }; if i.data.is_null() { - return Err(format!( - "Image data is null. Check provided buffer data" - )) + return Err(format!("Image data is null. Check provided buffer data")); }; Ok(Image(i)) } @@ -738,36 +693,10 @@ impl Image { } } -impl RaylibTexture2D for WeakTexture2D {} -impl RaylibTexture2D for Texture2D {} -impl RaylibTexture2D for WeakRenderTexture2D {} -impl RaylibTexture2D for RenderTexture2D {} - -impl Texture2D { - pub unsafe fn make_weak(self) -> WeakTexture2D { - let m = WeakTexture2D(self.0); - std::mem::forget(self); - m - } -} +impl<'bind, 'a> RaylibTexture2D for Texture2D<'bind, 'a> {} +impl<'bind, 'a> RaylibTexture2D for RenderTexture2D<'bind, 'a> {} pub trait RaylibTexture2D: AsRef + AsMut { - fn width(&self) -> i32 { - self.as_ref().width - } - - fn height(&self) -> i32 { - self.as_ref().height - } - - fn mipmaps(&self) -> i32 { - self.as_ref().width - } - - fn format(&self) -> i32 { - self.as_ref().format - } - /// Updates GPU texture with new data. #[inline] fn update_texture(&mut self, pixels: &[u8]) { @@ -786,10 +715,7 @@ pub trait RaylibTexture2D: AsRef + AsMut { ); } unsafe { - ffi::UpdateTexture( - *self.as_mut(), - pixels.as_ptr() as *const std::os::raw::c_void, - ); + ffi::UpdateTexture(*self.as_mut(), pixels.as_ptr() as *const core::ffi::c_void); } } @@ -835,73 +761,60 @@ pub fn get_pixel_data_size(width: i32, height: i32, format: ffi::PixelFormat) -> unsafe { ffi::GetPixelDataSize(width, height, format as i32) } } -impl RaylibHandle { +impl<'bind, 'a> RaylibHandle<'_> { /// Loads texture from file into GPU memory (VRAM). - pub fn load_texture(&mut self, _: &RaylibThread, filename: &str) -> Result { + pub fn load_texture( + &'bind self, + _: &RaylibThread, + filename: &str, + ) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let t = unsafe { ffi::LoadTexture(c_filename.as_ptr()) }; if t.id == 0 { return Err(format!("failed to load {} as a texture.", filename)); } - Ok(Texture2D(t)) + Ok(unsafe { Texture2D::from_raw(t) }) } /// Load cubemap from image, multiple image cubemap layouts supported pub fn load_texture_cubemap( - &mut self, + &'bind self, _: &RaylibThread, image: &Image, layout: crate::consts::CubemapLayout, - ) -> Result { + ) -> Result, String> { let t = unsafe { ffi::LoadTextureCubemap(image.0, layout as i32) }; if t.id == 0 { return Err(format!("failed to load image as a texture cubemap.")); } - Ok(Texture2D(t)) + Ok(unsafe { Texture2D::from_raw(t) }) } /// Loads texture from image data. #[inline] pub fn load_texture_from_image( - &mut self, + &'bind self, _: &RaylibThread, image: &Image, - ) -> Result { + ) -> Result, String> { let t = unsafe { ffi::LoadTextureFromImage(image.0) }; if t.id == 0 { return Err(format!("failed to load image as a texture.")); } - Ok(Texture2D(t)) + Ok(unsafe { Texture2D::from_raw(t) }) } /// Loads texture for rendering (framebuffer). pub fn load_render_texture( - &mut self, + &'bind self, _: &RaylibThread, width: u32, height: u32, - ) -> Result { + ) -> Result, String> { let t = unsafe { ffi::LoadRenderTexture(width as i32, height as i32) }; if t.id == 0 { return Err(format!("failed to create render texture.")); } - Ok(RenderTexture2D(t)) - } -} - -impl RaylibHandle { - /// Weak Textures will leak memeory if they are not unlaoded - /// Unload textures from GPU memory (VRAM) - pub unsafe fn unload_texture(&mut self, _: &RaylibThread, texture: WeakTexture2D) { - { - ffi::UnloadTexture(*texture.as_ref()) - } - } - /// Weak RenderTextures will leak memeory if they are not unlaoded - /// Unload RenderTextures from GPU memory (VRAM) - pub unsafe fn unload_render_texture(&mut self, _: &RaylibThread, texture: WeakRenderTexture2D) { - { - ffi::UnloadRenderTexture(*texture.as_ref()) - } + Ok(unsafe { RenderTexture2D::from_raw(t) }) } } diff --git a/raylib/src/core/vr.rs b/raylib/src/core/vr.rs index b363fd52..cb48a0b2 100644 --- a/raylib/src/core/vr.rs +++ b/raylib/src/core/vr.rs @@ -52,9 +52,9 @@ impl Into for &VrDeviceInfo { } } -impl RaylibHandle { +impl RaylibHandle<'_> { pub fn load_vr_stereo_config( - &mut self, + &self, _: &RaylibThread, device: impl Into, ) -> VrStereoConfig { diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 28c2ad20..808e3458 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -2,10 +2,10 @@ use crate::core::math::{Matrix, Ray, Vector2}; use crate::core::{RaylibHandle, RaylibThread}; use crate::ffi; +use core::ffi::c_char; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::ffi::{CStr, CString, IntoStringError, NulError}; -use std::os::raw::c_char; #[cfg(feature = "with_serde")] use serde::{Deserialize, Serialize}; @@ -379,7 +379,7 @@ pub fn get_camera_matrix2D(camera: impl Into) -> Matrix { unsafe { ffi::GetCameraMatrix2D(camera.into()).into() } } -impl RaylibHandle { +impl RaylibHandle<'_> { /// Get clipboard text content pub fn get_clipboard_text(&self) -> Result { unsafe { @@ -400,7 +400,7 @@ impl RaylibHandle { } // Screen-space-related functions -impl RaylibHandle { +impl RaylibHandle<'_> { /// Returns a ray trace from mouse position pub fn get_mouse_ray( &self, @@ -452,9 +452,9 @@ impl RaylibHandle { } // Timing related functions -impl RaylibHandle { +impl RaylibHandle<'_> { /// Set target FPS (maximum) - pub fn set_target_fps(&mut self, fps: u32) { + pub fn set_target_fps(&self, fps: u32) { unsafe { ffi::SetTargetFPS(fps as i32); } @@ -477,7 +477,7 @@ impl RaylibHandle { } // Window handling functions -impl RaylibHandle { +impl RaylibHandle<'_> { /// Checks if `KEY_ESCAPE` or Close icon was pressed. /// Do not call on web unless you are compiling with asyncify. #[inline] @@ -559,53 +559,49 @@ impl RaylibHandle { /// Get the window config state pub fn get_window_state(&self) -> WindowState { - let mut state = WindowState::default(); unsafe { - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_VSYNC_HINT as u32) { - state.set_vsync_hint(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as u32) { - state.set_fullscreen_mode(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as u32) { - state.set_window_resizable(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as u32) { - state.set_window_undecorated(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as u32) { - state.set_window_hidden(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as u32) { - state.set_window_minimized(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as u32) { - state.set_window_maximized(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as u32) { - state.set_window_unfocused(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as u32) { - state.set_window_topmost(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as u32) { - state.set_window_always_run(true); - } - - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as u32) { - state.set_window_transparent(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as u32) { - state.set_window_highdpi(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_MSAA_4X_HINT as u32) { - state.set_msaa(true); - } - if ffi::IsWindowState(ffi::ConfigFlags::FLAG_INTERLACED_HINT as u32) { - state.set_interlaced_hint(true); - } + WindowState::default() + .set_vsync_hint(ffi::IsWindowState(ffi::ConfigFlags::FLAG_VSYNC_HINT as u32)) + .set_fullscreen_mode(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as u32, + )) + .set_window_resizable(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as u32, + )) + .set_window_undecorated(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as u32, + )) + .set_window_hidden(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as u32, + )) + .set_window_minimized(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as u32, + )) + .set_window_maximized(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as u32, + )) + .set_window_unfocused(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as u32, + )) + .set_window_topmost(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as u32, + )) + .set_window_always_run(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as u32, + )) + .set_window_transparent(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as u32, + )) + .set_window_highdpi(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as u32, + )) + .set_msaa(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_MSAA_4X_HINT as u32, + )) + .set_interlaced_hint(ffi::IsWindowState( + ffi::ConfigFlags::FLAG_INTERLACED_HINT as u32, + )) } - state } /// Sets icon for window (only on desktop platforms). @@ -679,7 +675,7 @@ impl RaylibHandle { } // Cursor-related functions -impl RaylibHandle { +impl RaylibHandle<'_> { /// Shows mouse cursor. #[inline] pub fn show_cursor(&mut self) { @@ -720,7 +716,7 @@ impl RaylibHandle { /// Get native window handle #[inline] - pub unsafe fn get_window_handle(&mut self) -> *mut ::std::os::raw::c_void { + pub unsafe fn get_window_handle(&mut self) -> *mut core::ffi::c_void { ffi::GetWindowHandle() } } diff --git a/raylib/src/lib.rs b/raylib/src/lib.rs index 60803c53..b77a16d0 100644 --- a/raylib/src/lib.rs +++ b/raylib/src/lib.rs @@ -54,8 +54,6 @@ Permission is granted to anyone to use this software for any purpose, including //! } //! } //! ``` -#![cfg_attr(feature = "nightly", feature(optin_builtin_traits))] -#![allow(dead_code)] pub mod consts; pub mod core; pub mod ease; diff --git a/raylib/src/rgui/safe.rs b/raylib/src/rgui/safe.rs index 20b59e55..508e5041 100644 --- a/raylib/src/rgui/safe.rs +++ b/raylib/src/rgui/safe.rs @@ -1,11 +1,13 @@ use crate::core::color::Color; use crate::core::drawing::RaylibDraw; use crate::core::math::{Rectangle, Vector2}; -use crate::core::text::WeakFont; use crate::core::RaylibHandle; use crate::ffi; +use crate::text::Font; use std::ffi::CStr; +use std::marker::PhantomData; +use std::mem::ManuallyDrop; pub trait IntoCStr { fn as_cstr_ptr(&self) -> *const std::os::raw::c_char; @@ -33,7 +35,7 @@ impl IntoCStr for Option<&CStr> { } /// Global gui modification functions -impl RaylibHandle { +impl RaylibHandle<'_> { /// Enable gui controls (global state) #[inline] pub fn gui_enable(&mut self) { @@ -76,8 +78,8 @@ impl RaylibHandle { } /// Get gui custom font (global state) #[inline] - pub fn gui_get_font(&mut self) -> WeakFont { - unsafe { WeakFont(ffi::GuiGetFont()) } + pub fn gui_get_font<'bind>(&'bind mut self) -> ManuallyDrop> { + unsafe { ManuallyDrop::new(Font(ffi::GuiGetFont(), PhantomData, PhantomData)) } } /// Set one style property /// SHOULD use one of the Gui*Property enums @@ -104,9 +106,9 @@ impl RaylibHandle { } } -impl RaylibDrawGui for D {} +impl<'a, D: RaylibDraw> RaylibDrawGui<'a> for D {} -pub trait RaylibDrawGui { +pub trait RaylibDrawGui<'a> { /// Enable gui controls (global state) #[inline] fn gui_enable(&mut self) { @@ -149,8 +151,8 @@ pub trait RaylibDrawGui { } /// Get gui custom font (global state) #[inline] - fn gui_get_font(&mut self) -> WeakFont { - unsafe { WeakFont(ffi::GuiGetFont()) } + fn gui_get_font<'bind>(&'bind mut self) -> ManuallyDrop> { + unsafe { ManuallyDrop::new(Font(ffi::GuiGetFont(), PhantomData, PhantomData)) } } /// Set one style property /// SHOULD use one of the Gui*Property enums diff --git a/samples/Cargo.toml b/samples/Cargo.toml index 49b5a4f6..505cbaa2 100644 --- a/samples/Cargo.toml +++ b/samples/Cargo.toml @@ -2,14 +2,14 @@ name = "raylib-examples" version = "4.0.0" authors = ["David Ayeke"] -edition = "2018" +edition = "2021" license = "Zlib" readme = "../README.md" repository = "https://github.com/deltaphc/raylib-rs" [dependencies] -raylib = { version = "4.0", path = "../raylib" } +raylib = { version = "4.5", path = "../raylib" } structopt = "0.2" specs-derive = "0.4.1" rand = "0.7" diff --git a/samples/arkanoid.rs b/samples/arkanoid.rs index f7eb380b..f6b49922 100644 --- a/samples/arkanoid.rs +++ b/samples/arkanoid.rs @@ -67,7 +67,9 @@ impl Default for Game { fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Arkanoid"); + let (rl, thread) = opt.open_window("Arkanoid"); + let render = rl.render_loop(&thread); + let (_w, _h) = (opt.width, opt.height); let _game_over = false; @@ -79,7 +81,7 @@ fn main() { while !rl.window_should_close() { update_game(&mut game, &rl); - draw_game(&game, &mut rl, &thread); + render.frame(|d| draw_game(&game, &rl, &d, &thread)); } } @@ -273,9 +275,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } } -fn draw_game(game: &Game, rl: &mut RaylibHandle, thread: &RaylibThread) { +fn draw_game(game: &Game, rl: &RaylibHandle, d: &RaylibDrawHandle, thread: &RaylibThread) { let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - let mut d = rl.begin_drawing(thread); + d.clear_background(Color::RAYWHITE); if !game.game_over { // Draw player bar diff --git a/samples/camera2D.rs b/samples/camera2D.rs index d4a6a606..a966ba91 100644 --- a/samples/camera2D.rs +++ b/samples/camera2D.rs @@ -74,53 +74,54 @@ fn main() { camera.rotation = 0.0; } - let mut d = rl.begin_drawing(&thread); - d.clear_background(Color::RAYWHITE); - { - let mut d2 = d.begin_mode2D(camera); - d2.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); - - for i in 0..MAX_BUILDINGS { - d2.draw_rectangle_rec(&buildings[i], build_colors[i]); + rl.render_loop().frame(|mut d| { + d.clear_background(Color::RAYWHITE); + { + let mut d2 = d.begin_mode2D(camera); + d2.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); + + for i in 0..MAX_BUILDINGS { + d2.draw_rectangle_rec(&buildings[i], build_colors[i]); + } + d2.draw_rectangle_rec(&player, Color::RED); + + d2.draw_line( + camera.target.x as i32, + -h * 10, + camera.target.x as i32, + h * 10, + Color::GREEN, + ); + d2.draw_line( + -w * 10, + camera.target.y as i32, + w * 10, + camera.target.y as i32, + Color::GREEN, + ); } - d2.draw_rectangle_rec(&player, Color::RED); - - d2.draw_line( - camera.target.x as i32, - -h * 10, - camera.target.x as i32, - h * 10, - Color::GREEN, - ); - d2.draw_line( - -w * 10, - camera.target.y as i32, - w * 10, - camera.target.y as i32, - Color::GREEN, - ); - } - d.draw_text("SCREEN AREA", 640, 10, 20, Color::RED); - - d.draw_rectangle(0, 0, w, 5, Color::RED); - d.draw_rectangle(0, 5, 5, h - 10, Color::RED); - d.draw_rectangle(w - 5, 5, 5, h - 10, Color::RED); - d.draw_rectangle(0, h - 5, w, 5, Color::RED); - - d.draw_rectangle(10, 10, 250, 113, Color::SKYBLUE.fade(0.5)); - d.draw_rectangle_lines(10, 10, 250, 113, Color::BLUE); - - d.draw_text("Free 2d camera controls:", 20, 20, 10, Color::BLACK); - d.draw_text("- Right/Left to move Offset", 40, 40, 10, Color::DARKGRAY); - d.draw_text("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color::DARKGRAY); - d.draw_text("- A / S to Rotate", 40, 80, 10, Color::DARKGRAY); - d.draw_text( - "- R to reset Zoom and Rotation", - 40, - 100, - 10, - Color::DARKGRAY, - ); + d.draw_text("SCREEN AREA", 640, 10, 20, Color::RED); + + d.draw_rectangle(0, 0, w, 5, Color::RED); + d.draw_rectangle(0, 5, 5, h - 10, Color::RED); + d.draw_rectangle(w - 5, 5, 5, h - 10, Color::RED); + d.draw_rectangle(0, h - 5, w, 5, Color::RED); + + d.draw_rectangle(10, 10, 250, 113, Color::SKYBLUE.fade(0.5)); + d.draw_rectangle_lines(10, 10, 250, 113, Color::BLUE); + + d.draw_text("Free 2d camera controls:", 20, 20, 10, Color::BLACK); + d.draw_text("- Right/Left to move Offset", 40, 40, 10, Color::DARKGRAY); + d.draw_text("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color::DARKGRAY); + d.draw_text("- A / S to Rotate", 40, 80, 10, Color::DARKGRAY); + d.draw_text( + "- R to reset Zoom and Rotation", + 40, + 100, + 10, + Color::DARKGRAY, + ); + }); } } diff --git a/samples/extensions.rs b/samples/extensions.rs index 142a1ef5..74a46d82 100644 --- a/samples/extensions.rs +++ b/samples/extensions.rs @@ -5,7 +5,7 @@ use structopt::StructOpt; mod options; trait RaylibDrawExt: RaylibDraw { - fn custom_draw(&mut self, font: &WeakFont) { + fn custom_draw(&mut self, font: &Font) { self.draw_text_ex(font, "custom", rvec2(0, 0), 16.0, 0.0, Color::GREEN); } } @@ -15,11 +15,13 @@ impl RaylibDrawExt for T where T: RaylibDraw {} fn main() { let opt = options::Opt::from_args(); let (mut rl, thread) = opt.open_window("Logo"); - let font = rl.get_font_default(); + let font = &rl.get_font_default(); while !rl.window_should_close() { // Detect window close button or ESC key - let mut d = rl.begin_drawing(&thread); + let mut d = &rl.begin_drawing(&thread); d.clear_background(Color::WHITE); d.custom_draw(&font); } + + drop(rl); } diff --git a/samples/font.rs b/samples/font.rs index 2b093f33..bb585c3e 100644 --- a/samples/font.rs +++ b/samples/font.rs @@ -1,4 +1,5 @@ extern crate raylib; + use raylib::prelude::*; fn main() { @@ -6,14 +7,18 @@ fn main() { let h = 450; let rust_orange = Color::new(222, 165, 132, 255); let ray_white = Color::new(255, 255, 255, 255); + let (mut rl, thread) = raylib::init().size(w, h).title("Logo").build(); + let render = (&rl).render_loop(); + rl.set_target_fps(60); + let font = rl .load_font(&thread, "static/alagard.png") .expect("couldn't load font"); - while !rl.window_should_close() { + + render.draw_loop(|d| -> bool { // Detect window close button or ESC key - let mut d = rl.begin_drawing(&thread); d.clear_background(ray_white); d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); @@ -33,6 +38,7 @@ fn main() { 1.0, rust_orange, ); - // rl.take_screenshot(&thread, "logo.png"); - } + + !rl.window_should_close() + }); } diff --git a/samples/logo.rs b/samples/logo.rs index 6f21798e..7d61efb6 100644 --- a/samples/logo.rs +++ b/samples/logo.rs @@ -6,7 +6,7 @@ mod options; fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Logo"); + let (rl, thread) = opt.open_window("Logo"); let (w, h) = (opt.width, opt.height); let rust_orange = Color::new(222, 165, 132, 255); let ray_white = Color::new(255, 255, 255, 255); @@ -14,11 +14,12 @@ fn main() { rl.set_target_fps(60); while !rl.window_should_close() { // Detect window close button or ESC key - let mut d = rl.begin_drawing(&thread); - d.clear_background(ray_white); - d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); - d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); - d.draw_text("rust", w / 2 - 69, h / 2 + 18, 50, rust_orange); - d.draw_text("raylib", w / 2 - 44, h / 2 + 48, 50, rust_orange); + rl.render_loop(&thread).frame(|d| { + d.clear_background(ray_white); + d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); + d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); + d.draw_text("rust", w / 2 - 69, h / 2 + 18, 50, rust_orange); + d.draw_text("raylib", w / 2 - 44, h / 2 + 48, 50, rust_orange); + }) } } diff --git a/samples/options.rs b/samples/options.rs index 2f9e26d4..b8dbd7ad 100644 --- a/samples/options.rs +++ b/samples/options.rs @@ -14,12 +14,12 @@ pub struct Opt { pub fps: u32, } -impl Opt { +impl<'a> Opt { #[allow(dead_code)] pub fn new() -> Self { Opt::from_args() } - pub fn open_window(&self, name: &str) -> (raylib::RaylibHandle, raylib::RaylibThread) { + pub fn open_window(&self, name: &str) -> (raylib::RaylibHandle<'a>, raylib::RaylibThread) { let (mut rl, thread) = raylib::init() .size(self.width, self.height) .title(name) diff --git a/samples/texture.rs b/samples/texture.rs index c95f89de..37e03e4c 100644 --- a/samples/texture.rs +++ b/samples/texture.rs @@ -19,8 +19,9 @@ fn main() { rl.set_target_fps(60); while !rl.window_should_close() { // Detect window close button or ESC key - let mut d = rl.begin_drawing(&thread); - d.clear_background(Color::BLACK); - d.draw_texture(&t, 0, 0, Color::WHITE); + rl.render_loop().frame(|d| { + d.clear_background(Color::BLACK); + d.draw_texture(&t, 0, 0, Color::WHITE); + }); } } diff --git a/samples/yaw_pitch_roll.rs b/samples/yaw_pitch_roll.rs index 97e82331..ce705173 100644 --- a/samples/yaw_pitch_roll.rs +++ b/samples/yaw_pitch_roll.rs @@ -113,8 +113,8 @@ fn main() { model.set_transform(&mat); // Draw framebuffer texture (Ahrs Display) - let center_x = (framebuffer.texture().width() / 2) as f32; - let center_y = (framebuffer.texture().height() / 2) as f32; + let center_x = (framebuffer.texture.width / 2) as f32; + let center_y = (framebuffer.texture.height / 2) as f32; let scale_factor = 0.5; { let mut d = d.begin_texture_mode(&thread, &mut framebuffer); @@ -125,18 +125,18 @@ fn main() { Rectangle::new( 0.0, 0.0, - tex_background.width() as f32, - tex_background.height() as f32, + tex_background.width as f32, + tex_background.height as f32, ), Rectangle::new( center_x, center_y, - tex_background.width() as f32 * scale_factor, - tex_background.height() as f32 * scale_factor, + tex_background.width as f32 * scale_factor, + tex_background.height as f32 * scale_factor, ), Vector2::new( - tex_background.width() as f32 / 2.0 * scale_factor, - tex_background.height() as f32 / 2.0 * scale_factor + tex_background.width as f32 / 2.0 * scale_factor, + tex_background.height as f32 / 2.0 * scale_factor + pitch_offset * scale_factor, ), roll, @@ -148,18 +148,18 @@ fn main() { Rectangle::new( 0.0, 0.0, - tex_pitch.width() as f32, - tex_pitch.height() as f32 as f32, + tex_pitch.width as f32, + tex_pitch.height as f32 as f32, ), Rectangle::new( center_x, center_y, - tex_pitch.width() as f32 * scale_factor, - tex_pitch.height() as f32 * scale_factor, + tex_pitch.width as f32 * scale_factor, + tex_pitch.height as f32 * scale_factor, ), Vector2::new( - tex_pitch.width() as f32 / 2.0 * scale_factor, - tex_pitch.height() as f32 / 2.0 * scale_factor + tex_pitch.width as f32 / 2.0 * scale_factor, + tex_pitch.height as f32 / 2.0 * scale_factor + pitch_offset * scale_factor, ), roll, @@ -171,18 +171,18 @@ fn main() { Rectangle::new( 0.0, 0.0, - tex_plane.width() as f32, - tex_plane.height() as f32 as f32, + tex_plane.width as f32, + tex_plane.height as f32 as f32, ), Rectangle::new( center_x, center_y, - tex_plane.width() as f32 * scale_factor, - tex_plane.height() as f32 * scale_factor, + tex_plane.width as f32 * scale_factor, + tex_plane.height as f32 * scale_factor, ), Vector2::new( - tex_plane.width() as f32 / 2.0 * scale_factor, - tex_plane.height() as f32 / 2.0 * scale_factor, + tex_plane.width as f32 / 2.0 * scale_factor, + tex_plane.height as f32 / 2.0 * scale_factor, ), 0.0, Color::WHITE, @@ -244,7 +244,7 @@ fn main() { // Draw framebuffer texture d.draw_texture_rec( - framebuffer.texture(), + framebuffer.texture, Rectangle::new( 0.0, 0.0, From ee35237bf05d9142592c40a5c98dfc06720d2c78 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sat, 11 Mar 2023 17:59:01 +0100 Subject: [PATCH 11/30] Replace renderloop with frame(), no longer expect mutable handles While (im)mutable handles are fundamentally not a bad idea, the Rust semantics of mutable borrow mecanism doesn't really match what we are trying to do and can cause some weird errors. It is actually best to make things a lot simpler while losing a bit on guaranties on raylib state. Additionally, replace the rather confusing "renderloop" with a simple frame callback mecanism. --- raylib/src/core/audio.rs | 44 ++-- raylib/src/core/camera.rs | 10 +- raylib/src/core/drawing.rs | 80 ++----- raylib/src/core/input.rs | 14 +- raylib/src/core/misc.rs | 2 +- raylib/src/core/mod.rs | 33 +-- raylib/src/core/models.rs | 4 +- raylib/src/core/window.rs | 28 +-- samples/3d_camera_first_person.rs | 66 +++--- samples/Cargo.toml | 4 +- samples/arkanoid.rs | 5 +- samples/asteroids.rs | 347 ++++++++++++++++++------------ samples/camera2D.rs | 6 +- samples/drop.rs | 2 +- samples/font.rs | 4 +- samples/input.rs | 17 +- samples/model_shader.rs | 31 +-- samples/options.rs | 6 +- samples/raymarch.rs | 38 ++-- samples/rgui.rs | 2 +- samples/roguelike.rs | 139 ++++++------ samples/specs.rs | 41 ++-- samples/texture.rs | 4 +- 23 files changed, 487 insertions(+), 440 deletions(-) diff --git a/raylib/src/core/audio.rs b/raylib/src/core/audio.rs index ee112acd..5f23abdb 100644 --- a/raylib/src/core/audio.rs +++ b/raylib/src/core/audio.rs @@ -58,7 +58,7 @@ impl RaylibAudio { /// Plays a sound. #[inline] - pub fn play_sound(&mut self, sound: &Sound) { + pub fn play_sound(&self, sound: &Sound) { unsafe { ffi::PlaySound(sound.0); } @@ -66,7 +66,7 @@ impl RaylibAudio { /// Play a sound (using multichannel buffer pool) #[inline] - pub fn play_sound_multi(&mut self, sound: &Sound) { + pub fn play_sound_multi(&self, sound: &Sound) { unsafe { ffi::PlaySoundMulti(sound.0); } @@ -74,7 +74,7 @@ impl RaylibAudio { /// Pauses a sound. #[inline] - pub fn pause_sound(&mut self, sound: &Sound) { + pub fn pause_sound(&self, sound: &Sound) { unsafe { ffi::PauseSound(sound.0); } @@ -82,7 +82,7 @@ impl RaylibAudio { /// Resumes a paused sound. #[inline] - pub fn resume_sound(&mut self, sound: &Sound) { + pub fn resume_sound(&self, sound: &Sound) { unsafe { ffi::ResumeSound(sound.0); } @@ -90,7 +90,7 @@ impl RaylibAudio { /// Stops playing a sound. #[inline] - pub fn stop_sound(&mut self, sound: &Sound) { + pub fn stop_sound(&self, sound: &Sound) { unsafe { ffi::StopSound(sound.0); } @@ -98,7 +98,7 @@ impl RaylibAudio { /// Stops playing a sound. #[inline] - pub fn stop_sound_multi(&mut self) { + pub fn stop_sound_multi(&self) { unsafe { ffi::StopSoundMulti(); } @@ -112,7 +112,7 @@ impl RaylibAudio { /// Sets volume for a sound (`1.0` is max level). #[inline] - pub fn set_sound_volume(&mut self, sound: &Sound, volume: f32) { + pub fn set_sound_volume(&self, sound: &Sound, volume: f32) { unsafe { ffi::SetSoundVolume(sound.0, volume); } @@ -120,7 +120,7 @@ impl RaylibAudio { /// Sets pitch for a sound (`1.0` is base level). #[inline] - pub fn set_sound_pitch(&mut self, sound: &Sound, pitch: f32) { + pub fn set_sound_pitch(&self, sound: &Sound, pitch: f32) { unsafe { ffi::SetSoundPitch(sound.0, pitch); } @@ -128,7 +128,7 @@ impl RaylibAudio { /// Starts music playing. #[inline] - pub fn play_music_stream(&mut self, music: &mut Music) { + pub fn play_music_stream(&self, music: &mut Music) { unsafe { ffi::PlayMusicStream(music.0); } @@ -136,7 +136,7 @@ impl RaylibAudio { /// Updates buffers for music streaming. #[inline] - pub fn update_music_stream(&mut self, music: &mut Music) { + pub fn update_music_stream(&self, music: &mut Music) { unsafe { ffi::UpdateMusicStream(music.0); } @@ -144,7 +144,7 @@ impl RaylibAudio { /// Stops music playing. #[inline] - pub fn stop_music_stream(&mut self, music: &mut Music) { + pub fn stop_music_stream(&self, music: &mut Music) { unsafe { ffi::StopMusicStream(music.0); } @@ -152,7 +152,7 @@ impl RaylibAudio { /// Pauses music playing. #[inline] - pub fn pause_music_stream(&mut self, music: &mut Music) { + pub fn pause_music_stream(&self, music: &mut Music) { unsafe { ffi::PauseMusicStream(music.0); } @@ -160,7 +160,7 @@ impl RaylibAudio { /// Resumes playing paused music. #[inline] - pub fn resume_music_stream(&mut self, music: &mut Music) { + pub fn resume_music_stream(&self, music: &mut Music) { unsafe { ffi::ResumeMusicStream(music.0); } @@ -174,7 +174,7 @@ impl RaylibAudio { /// Sets volume for music (`1.0` is max level). #[inline] - pub fn set_music_volume(&mut self, music: &mut Music, volume: f32) { + pub fn set_music_volume(&self, music: &mut Music, volume: f32) { unsafe { ffi::SetMusicVolume(music.0, volume); } @@ -182,7 +182,7 @@ impl RaylibAudio { /// Sets pitch for music (`1.0` is base level). #[inline] - pub fn set_music_pitch(&mut self, music: &mut Music, pitch: f32) { + pub fn set_music_pitch(&self, music: &mut Music, pitch: f32) { unsafe { ffi::SetMusicPitch(music.0, pitch); } @@ -202,7 +202,7 @@ impl RaylibAudio { /// Plays audio stream. #[inline] - pub fn play_audio_stream(&mut self, stream: &mut AudioStream) { + pub fn play_audio_stream(&self, stream: &mut AudioStream) { unsafe { ffi::PlayAudioStream(stream.0); } @@ -210,7 +210,7 @@ impl RaylibAudio { /// Pauses audio stream. #[inline] - pub fn pause_audio_stream(&mut self, stream: &mut AudioStream) { + pub fn pause_audio_stream(&self, stream: &mut AudioStream) { unsafe { ffi::PauseAudioStream(stream.0); } @@ -218,7 +218,7 @@ impl RaylibAudio { /// Resumes audio stream. #[inline] - pub fn resume_audio_stream(&mut self, stream: &mut AudioStream) { + pub fn resume_audio_stream(&self, stream: &mut AudioStream) { unsafe { ffi::ResumeAudioStream(stream.0); } @@ -232,7 +232,7 @@ impl RaylibAudio { /// Stops audio stream. #[inline] - pub fn stop_audio_stream(&mut self, stream: &mut AudioStream) { + pub fn stop_audio_stream(&self, stream: &mut AudioStream) { unsafe { ffi::StopAudioStream(stream.0); } @@ -240,7 +240,7 @@ impl RaylibAudio { /// Sets volume for audio stream (`1.0` is max level). #[inline] - pub fn set_audio_stream_volume(&mut self, stream: &mut AudioStream, volume: f32) { + pub fn set_audio_stream_volume(&self, stream: &mut AudioStream, volume: f32) { unsafe { ffi::SetAudioStreamVolume(stream.0, volume); } @@ -248,7 +248,7 @@ impl RaylibAudio { /// Sets pitch for audio stream (`1.0` is base level). #[inline] - pub fn set_audio_stream_pitch(&mut self, stream: &mut AudioStream, pitch: f32) { + pub fn set_audio_stream_pitch(&self, stream: &mut AudioStream, pitch: f32) { unsafe { ffi::SetAudioStreamPitch(stream.0, pitch); } @@ -256,7 +256,7 @@ impl RaylibAudio { /// Sets pitch for audio stream (`1.0` is base level). #[inline] - pub fn is_audio_stream_processed(&mut self, stream: &AudioStream) -> bool { + pub fn is_audio_stream_processed(&self, stream: &AudioStream) -> bool { unsafe { ffi::IsAudioStreamProcessed(stream.0) } } } diff --git a/raylib/src/core/camera.rs b/raylib/src/core/camera.rs index fa23059a..50a53d51 100644 --- a/raylib/src/core/camera.rs +++ b/raylib/src/core/camera.rs @@ -98,7 +98,7 @@ impl RaylibHandle<'_> { /// Sets camera mode. #[inline] pub fn set_camera_mode( - &mut self, + &self, camera: impl Into, mode: crate::consts::CameraMode, ) { @@ -119,7 +119,7 @@ impl RaylibHandle<'_> { /// Sets camera pan key to combine with mouse movement (free camera). #[inline] - pub fn set_camera_pan_control(&mut self, pan_key: crate::consts::KeyboardKey) { + pub fn set_camera_pan_control(&self, pan_key: crate::consts::KeyboardKey) { unsafe { ffi::SetCameraPanControl(pan_key as i32); } @@ -127,7 +127,7 @@ impl RaylibHandle<'_> { /// Sets camera alt key to combine with mouse movement (free camera). #[inline] - pub fn set_camera_alt_control(&mut self, alt_key: crate::consts::KeyboardKey) { + pub fn set_camera_alt_control(&self, alt_key: crate::consts::KeyboardKey) { unsafe { ffi::SetCameraAltControl(alt_key as i32); } @@ -135,7 +135,7 @@ impl RaylibHandle<'_> { /// Sets camera smooth zoom key to combine with mouse (free camera). #[inline] - pub fn set_camera_smooth_zoom_control(&mut self, sz_key: crate::consts::KeyboardKey) { + pub fn set_camera_smooth_zoom_control(&self, sz_key: crate::consts::KeyboardKey) { unsafe { ffi::SetCameraSmoothZoomControl(sz_key as i32); } @@ -144,7 +144,7 @@ impl RaylibHandle<'_> { /// Sets camera move controls (1st person and 3rd person cameras). #[inline] pub fn set_camera_move_controls( - &mut self, + &self, front_key: crate::consts::KeyboardKey, back_key: crate::consts::KeyboardKey, right_key: crate::consts::KeyboardKey, diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index 8b5e8ffd..4185d7ed 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -7,46 +7,10 @@ use crate::core::texture::Texture2D; use crate::core::vr::VrStereoConfig; use crate::core::{RaylibHandle, RaylibThread}; use crate::{ffi, RaylibRenderLoop}; -use std::cell::RefMut; use std::convert::AsRef; use std::ffi::CString; use std::marker::PhantomData; -/// Seems like all draw commands must be issued from the main thread -impl RaylibRenderLoop<'_> { - /// Setup canvas (framebuffer) to start drawing - pub fn draw_loop) -> bool>(&self, mut loop_fn: F) { - loop { - unsafe { - ffi::BeginDrawing(); - }; - - let cont = (loop_fn)(self.0.borrow_mut()); - - unsafe { - ffi::EndDrawing(); - } - - if !cont { - break; - } - } - } - - /// Render a single frame. - pub fn frame)>(&self, mut frame_fn: F) { - unsafe { - ffi::BeginDrawing(); - }; - - (frame_fn)(self.0.borrow_mut()); - - unsafe { - ffi::EndDrawing(); - } - } -} - #[derive(Debug)] pub struct RaylibDrawHandle<'bind>(pub(crate) PhantomData<&'bind RaylibHandle<'bind>>); @@ -127,7 +91,7 @@ impl RaylibDraw for RaylibVRMode<'_, T> {} // 2D Mode -pub struct RaylibMode2D<'a, T>(&'a mut T); +pub struct RaylibMode2D<'a, T>(&'a T); impl Drop for RaylibMode2D<'_, T> { fn drop(&mut self) { unsafe { ffi::EndMode2D() } @@ -147,7 +111,7 @@ where { #[allow(non_snake_case)] #[must_use] - fn begin_mode2D(&mut self, camera: impl Into) -> RaylibMode2D { + fn begin_mode2D(&self, camera: impl Into) -> RaylibMode2D { unsafe { ffi::BeginMode2D(camera.into()); } @@ -160,7 +124,7 @@ impl RaylibDraw for RaylibMode2D<'_, T> {} // 3D Mode -pub struct RaylibMode3D<'a, T>(&'a mut T); +pub struct RaylibMode3D<'a, T>(&'a T); impl Drop for RaylibMode3D<'_, T> { fn drop(&mut self) { unsafe { ffi::EndMode3D() } @@ -180,7 +144,7 @@ where { #[allow(non_snake_case)] #[must_use] - fn begin_mode3D(&mut self, camera: impl Into) -> RaylibMode3D { + fn begin_mode3D(&self, camera: impl Into) -> RaylibMode3D { unsafe { ffi::BeginMode3D(camera.into()); } @@ -226,7 +190,7 @@ impl<'a, T> RaylibDraw3D for RaylibShaderMode<'a, T> {} // Blend Mode -pub struct RaylibBlendMode<'a, T>(&'a mut T); +pub struct RaylibBlendMode<'a, T>(&'a T); impl<'a, T> Drop for RaylibBlendMode<'a, T> { fn drop(&mut self) { unsafe { ffi::EndBlendMode() } @@ -245,7 +209,7 @@ where Self: Sized, { #[must_use] - fn begin_blend_mode(&mut self, blend_mode: crate::consts::BlendMode) -> RaylibBlendMode { + fn begin_blend_mode(&self, blend_mode: crate::consts::BlendMode) -> RaylibBlendMode { unsafe { ffi::BeginBlendMode((blend_mode as u32) as i32) } RaylibBlendMode(self) } @@ -257,7 +221,7 @@ impl RaylibDraw3D for RaylibBlendMode<'_, T> {} // Scissor Mode stuff -pub struct RaylibScissorMode<'a, T>(&'a mut T); +pub struct RaylibScissorMode<'a, T>(&'a T); impl Drop for RaylibScissorMode<'_, T> { fn drop(&mut self) { unsafe { ffi::EndScissorMode() } @@ -277,7 +241,7 @@ where { #[must_use] fn begin_scissor_mode( - &mut self, + &self, x: i32, y: i32, width: i32, @@ -305,7 +269,7 @@ pub trait RaylibDraw { /// Define default texture used to draw shapes fn set_shapes_texture( - &mut self, + &self, texture: impl AsRef, source: impl Into, ) { @@ -313,14 +277,14 @@ pub trait RaylibDraw { } // // Draw gui widget - // fn draw_gui(&mut self, widget: G) -> crate::rgui::DrawResult { + // fn draw_gui(&self, widget: G) -> crate::rgui::DrawResult { // widget.draw() // } // SHAPES /// Draws a pixel. #[inline] - fn draw_pixel(&mut self, x: i32, y: i32, color: impl Into) { + fn draw_pixel(&self, x: i32, y: i32, color: impl Into) { unsafe { ffi::DrawPixel(x, y, color.into()); } @@ -328,7 +292,7 @@ pub trait RaylibDraw { /// Draws a pixel (Vector version). #[inline] - fn draw_pixel_v(&mut self, position: impl Into, color: impl Into) { + fn draw_pixel_v(&self, position: impl Into, color: impl Into) { unsafe { ffi::DrawPixelV(position.into(), color.into()); } @@ -337,7 +301,7 @@ pub trait RaylibDraw { /// Draws a line. #[inline] fn draw_line( - &mut self, + &self, start_pos_x: i32, start_pos_y: i32, end_pos_x: i32, @@ -352,7 +316,7 @@ pub trait RaylibDraw { /// Draws a line (Vector version). #[inline] fn draw_line_v( - &mut self, + &self, start_pos: impl Into, end_pos: impl Into, color: impl Into, @@ -365,7 +329,7 @@ pub trait RaylibDraw { /// Draws a line with thickness. #[inline] fn draw_line_ex( - &mut self, + &self, start_pos: impl Into, end_pos: impl Into, thick: f32, @@ -379,7 +343,7 @@ pub trait RaylibDraw { /// Draws a line using cubic-bezier curves in-out. #[inline] fn draw_line_bezier( - &mut self, + &self, start_pos: impl Into, end_pos: impl Into, thick: f32, @@ -392,7 +356,7 @@ pub trait RaylibDraw { /// Draw line using quadratic bezier curves with a control point #[inline] fn draw_line_bezier_quad( - &mut self, + &self, start_pos: impl Into, end_pos: impl Into, control_pos: impl Into, @@ -412,7 +376,7 @@ pub trait RaylibDraw { /// Draw lines sequence #[inline] - fn draw_line_strip(&mut self, points: &[Vector2], color: impl Into) { + fn draw_line_strip(&self, points: &[Vector2], color: impl Into) { unsafe { ffi::DrawLineStrip( points.as_ptr() as *mut ffi::Vector2, @@ -425,7 +389,7 @@ pub trait RaylibDraw { /// Draws a color-filled circle. #[inline] fn draw_circle( - &mut self, + &self, center_x: i32, center_y: i32, radius: f32, @@ -438,7 +402,7 @@ pub trait RaylibDraw { /// Draw a piece of a circle #[inline] fn draw_circle_sector( - &mut self, + &self, center: impl Into, radius: f32, start_angle: f32, @@ -461,7 +425,7 @@ pub trait RaylibDraw { /// Draw circle sector outline #[inline] fn draw_circle_sector_lines( - &mut self, + &self, center: impl Into, radius: f32, start_angle: f32, @@ -484,7 +448,7 @@ pub trait RaylibDraw { /// Draws a gradient-filled circle. #[inline] fn draw_circle_gradient( - &mut self, + &self, center_x: i32, center_y: i32, radius: f32, diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index 37c8160d..127381c1 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -33,7 +33,7 @@ impl RaylibHandle<'_> { /// Gets latest key pressed. #[inline] - pub fn get_key_pressed(&mut self) -> Option { + pub fn get_key_pressed(&self) -> Option { let key = unsafe { ffi::GetKeyPressed() }; if key > 0 { return key_from_i32(key); @@ -43,7 +43,7 @@ impl RaylibHandle<'_> { /// Gets latest key pressed. #[inline] - pub fn get_key_pressed_number(&mut self) -> Option { + pub fn get_key_pressed_number(&self) -> Option { let key = unsafe { ffi::GetKeyPressed() }; if key > 0 { return Some(key as u32); @@ -53,7 +53,7 @@ impl RaylibHandle<'_> { /// Gets latest char (unicode) pressed #[inline] - pub fn get_char_pressed(&mut self) -> Option { + pub fn get_char_pressed(&self) -> Option { let char_code = unsafe { ffi::GetCharPressed() }; if char_code > 0 { return char::from_u32(char_code as u32); @@ -63,7 +63,7 @@ impl RaylibHandle<'_> { /// Sets a custom key to exit program (default is ESC). // #[inline] - pub fn set_exit_key(&mut self, key: Option) { + pub fn set_exit_key(&self, key: Option) { unsafe { match key { Some(k) => ffi::SetExitKey((k as u32) as i32), @@ -198,7 +198,7 @@ impl RaylibHandle<'_> { /// Sets mouse position. #[inline] - pub fn set_mouse_position(&mut self, position: impl Into) { + pub fn set_mouse_position(&self, position: impl Into) { unsafe { let Vector2 { x, y } = position.into(); ffi::SetMousePosition(x as i32, y as i32); @@ -207,7 +207,7 @@ impl RaylibHandle<'_> { /// Sets mouse offset. #[inline] - pub fn set_mouse_offset(&mut self, offset: impl Into) { + pub fn set_mouse_offset(&self, offset: impl Into) { unsafe { let Vector2 { x, y } = offset.into(); ffi::SetMouseOffset(x as i32, y as i32); @@ -216,7 +216,7 @@ impl RaylibHandle<'_> { /// Sets mouse scaling. #[inline] - pub fn set_mouse_scale(&mut self, scale_x: f32, scale_y: f32) { + pub fn set_mouse_scale(&self, scale_x: f32, scale_y: f32) { unsafe { ffi::SetMouseScale(scale_x, scale_y); } diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index d2300bd5..e595691b 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -57,7 +57,7 @@ impl RaylibHandle<'_> { } /// Set the seed for random number generation - pub fn set_random_seed(&mut self, seed: u32) { + pub fn set_random_seed(&self, seed: u32) { unsafe { ffi::SetRandomSeed(seed); } diff --git a/raylib/src/core/mod.rs b/raylib/src/core/mod.rs index 60f8fc45..66992d80 100644 --- a/raylib/src/core/mod.rs +++ b/raylib/src/core/mod.rs @@ -22,10 +22,9 @@ pub mod window; use crate::ffi; -use std::cell::RefCell; +use std::cell::{RefCell, RefMut}; use std::ffi::CString; use std::marker::PhantomData; -use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use self::drawing::RaylibDrawHandle; @@ -63,17 +62,27 @@ pub struct RaylibThread(PhantomData<*const ()>); /// [`RaylibBuilder`]: struct.RaylibBuilder.html /// [`init`]: fn.init.html #[derive(Debug)] -pub struct RaylibHandle<'rl>(Rc>); // inner field is private, preventing manual construction +pub struct RaylibHandle<'rl>(RefCell>); // inner field is private, preventing manual construction + +#[derive(Debug)] +pub struct RaylibRenderLoop<'a>(RefCell>); impl<'th, 'a: 'th> RaylibHandle<'a> { - pub fn render_loop(&self, _: &'th RaylibThread) -> Rc> { - self.0.clone() + /// Render a frame. + /// Returns the frame_fn return value unmodifed. + pub fn frame) -> R>( + &self, + _: &'th RaylibThread, + frame_fn: F, + ) -> R { + unsafe { ffi::BeginDrawing() }; + let ret = frame_fn(self.0.borrow_mut()); + unsafe { ffi::EndDrawing() }; + + ret } } -#[derive(Debug)] -pub struct RaylibRenderLoop<'a>(RefCell>); - impl Drop for RaylibHandle<'_> { fn drop(&mut self) { if IS_INITIALIZED.load(Ordering::Relaxed) { @@ -176,7 +185,7 @@ impl RaylibBuilder { /// # Panics /// /// Attempting to initialize Raylib more than once will result in a panic. - pub fn build(&self) -> (RaylibHandle<'_>, RaylibThread) { + pub fn build(&self) -> (RaylibHandle<'static>, RaylibThread) { use crate::consts::ConfigFlags::*; let mut flags = 0u32; if self.fullscreen_mode { @@ -211,7 +220,7 @@ impl RaylibBuilder { /// # Panics /// /// Attempting to initialize Raylib more than once will result in a panic. -fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle<'_> { +fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle<'static> { if IS_INITIALIZED.load(Ordering::Relaxed) { panic!("Attempted to initialize raylib-rs more than once!"); } else { @@ -224,8 +233,6 @@ fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle<'_> { } IS_INITIALIZED.store(true, Ordering::Relaxed); - RaylibHandle(Rc::new(RaylibRenderLoop(RefCell::new(RaylibDrawHandle( - PhantomData, - ))))) + RaylibHandle(RefCell::new(RaylibDrawHandle(PhantomData))) } } diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index 776872ac..2ef30a1c 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -48,7 +48,7 @@ impl<'bind, 'a> RaylibHandle<'a> { } pub fn load_model_animations( - &mut self, + &self, _: &RaylibThread, filename: &str, ) -> Result, String> { @@ -71,7 +71,7 @@ impl<'bind, 'a> RaylibHandle<'a> { } pub fn update_model_animation( - &mut self, + &self, _: &RaylibThread, mut model: impl AsMut, anim: impl AsRef, diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 808e3458..f7088ff5 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -390,7 +390,7 @@ impl RaylibHandle<'_> { } /// Set clipboard text content - pub fn set_clipboard_text(&mut self, text: &str) -> Result<(), NulError> { + pub fn set_clipboard_text(&self, text: &str) -> Result<(), NulError> { let s = CString::new(text)?; unsafe { ffi::SetClipboardText(s.as_ptr()); @@ -541,19 +541,19 @@ impl RaylibHandle<'_> { /// Toggles fullscreen mode (only on desktop platforms). #[inline] - pub fn toggle_fullscreen(&mut self) { + pub fn toggle_fullscreen(&self) { unsafe { ffi::ToggleFullscreen(); } } /// Set window configuration state using flags - pub fn set_window_state(&mut self, state: WindowState) { + pub fn set_window_state(&self, state: WindowState) { unsafe { ffi::SetWindowState(state.0 as u32) } } /// Clear window configuration state flags - pub fn clear_window_state(&mut self, state: WindowState) { + pub fn clear_window_state(&self, state: WindowState) { unsafe { ffi::ClearWindowState(state.0 as u32) } } @@ -606,7 +606,7 @@ impl RaylibHandle<'_> { /// Sets icon for window (only on desktop platforms). #[inline] - pub fn set_window_icon(&mut self, image: impl AsRef) { + pub fn set_window_icon(&self, image: impl AsRef) { unsafe { ffi::SetWindowIcon(*image.as_ref()); } @@ -623,7 +623,7 @@ impl RaylibHandle<'_> { /// Sets window position on screen (only on desktop platforms). #[inline] - pub fn set_window_position(&mut self, x: i32, y: i32) { + pub fn set_window_position(&self, x: i32, y: i32) { unsafe { ffi::SetWindowPosition(x, y); } @@ -631,7 +631,7 @@ impl RaylibHandle<'_> { /// Sets monitor for the current window (fullscreen mode). #[inline] - pub fn set_window_monitor(&mut self, monitor: i32) { + pub fn set_window_monitor(&self, monitor: i32) { let len = get_monitor_count(); debug_assert!(monitor < len && monitor >= 0, "monitor index out of range"); unsafe { @@ -641,7 +641,7 @@ impl RaylibHandle<'_> { /// Sets minimum window dimensions (for `FLAG_WINDOW_RESIZABLE`). #[inline] - pub fn set_window_min_size(&mut self, width: i32, height: i32) { + pub fn set_window_min_size(&self, width: i32, height: i32) { unsafe { ffi::SetWindowMinSize(width, height); } @@ -649,7 +649,7 @@ impl RaylibHandle<'_> { /// Sets window dimensions. #[inline] - pub fn set_window_size(&mut self, width: i32, height: i32) { + pub fn set_window_size(&self, width: i32, height: i32) { unsafe { ffi::SetWindowSize(width, height); } @@ -678,7 +678,7 @@ impl RaylibHandle<'_> { impl RaylibHandle<'_> { /// Shows mouse cursor. #[inline] - pub fn show_cursor(&mut self) { + pub fn show_cursor(&self) { unsafe { ffi::ShowCursor(); } @@ -686,7 +686,7 @@ impl RaylibHandle<'_> { /// Hides mouse cursor. #[inline] - pub fn hide_cursor(&mut self) { + pub fn hide_cursor(&self) { unsafe { ffi::HideCursor(); } @@ -700,7 +700,7 @@ impl RaylibHandle<'_> { /// Enables mouse cursor (unlock cursor). #[inline] - pub fn enable_cursor(&mut self) { + pub fn enable_cursor(&self) { unsafe { ffi::EnableCursor(); } @@ -708,7 +708,7 @@ impl RaylibHandle<'_> { /// Disables mouse cursor (lock cursor). #[inline] - pub fn disable_cursor(&mut self) { + pub fn disable_cursor(&self) { unsafe { ffi::DisableCursor(); } @@ -716,7 +716,7 @@ impl RaylibHandle<'_> { /// Get native window handle #[inline] - pub unsafe fn get_window_handle(&mut self) -> *mut core::ffi::c_void { + pub unsafe fn get_window_handle(&self) -> *mut core::ffi::c_void { ffi::GetWindowHandle() } } diff --git a/samples/3d_camera_first_person.rs b/samples/3d_camera_first_person.rs index 60a11f06..b0483494 100644 --- a/samples/3d_camera_first_person.rs +++ b/samples/3d_camera_first_person.rs @@ -14,13 +14,13 @@ struct Column { impl Column { fn create_random() -> Column { let mut rng = rand::thread_rng(); - let height: f32 = rng.gen_range(1.0..12.0); + let height: f32 = rng.gen_range(1.0, 12.0); let position = Vector3::new( - rng.gen_range(-15.0..15.0), + rng.gen_range(-15.0, 15.0), height / 2.0, - rng.gen_range(-15.0..15.0), + rng.gen_range(-15.0, 15.0), ); - let color = Color::new(rng.gen_range(20..255), rng.gen_range(10..55), 30, 255); + let color = Color::new(rng.gen_range(20, 255), rng.gen_range(10, 55), 30, 255); Column { height, @@ -31,7 +31,7 @@ impl Column { } fn main() { - let (mut rl, thread) = raylib::init() + let (rl, thread) = raylib::init() .size(WINDOW_WIDTH, WINDOW_HEIGHT) .title("Hello, world!") .build(); @@ -50,36 +50,36 @@ fn main() { while !rl.window_should_close() { rl.update_camera(&mut camera); - let mut d = rl.begin_drawing(&thread); + rl.frame(&thread, |d| { + d.clear_background(Color::DARKGREEN); + { + let d2 = d.begin_mode3D(camera); - d.clear_background(Color::DARKGREEN); - { - let mut d2 = d.begin_mode3D(camera); + d2.draw_plane( + Vector3::new(0.0, 0.0, 0.0), + Vector2::new(32.0, 32.0), + Color::LIGHTGRAY, + ); + d2.draw_cube(Vector3::new(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::BLUE); + d2.draw_cube(Vector3::new(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::LIME); + d2.draw_cube(Vector3::new(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, Color::GOLD); - d2.draw_plane( - Vector3::new(0.0, 0.0, 0.0), - Vector2::new(32.0, 32.0), - Color::LIGHTGRAY, - ); - d2.draw_cube(Vector3::new(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::BLUE); - d2.draw_cube(Vector3::new(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::LIME); - d2.draw_cube(Vector3::new(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, Color::GOLD); - - for column in columns.iter() { - d2.draw_cube(column.position, 2.0, column.height, 2.0, column.color); - d2.draw_cube_wires(column.position, 2.0, column.height, 2.0, Color::MAROON); + for column in columns.iter() { + d2.draw_cube(column.position, 2.0, column.height, 2.0, column.color); + d2.draw_cube_wires(column.position, 2.0, column.height, 2.0, Color::MAROON); + } } - } - d.draw_rectangle(10, 10, 220, 70, Color::SKYBLUE); - d.draw_rectangle_lines(10, 10, 220, 70, Color::BLUE); - d.draw_text( - "First person camera default controls:", - 20, - 20, - 10, - Color::BLACK, - ); - d.draw_text("- Move with keys: W, A, S, D", 40, 40, 10, Color::DARKGRAY); - d.draw_text("- Mouse move to look around", 40, 60, 10, Color::DARKGRAY); + d.draw_rectangle(10, 10, 220, 70, Color::SKYBLUE); + d.draw_rectangle_lines(10, 10, 220, 70, Color::BLUE); + d.draw_text( + "First person camera default controls:", + 20, + 20, + 10, + Color::BLACK, + ); + d.draw_text("- Move with keys: W, A, S, D", 40, 40, 10, Color::DARKGRAY); + d.draw_text("- Mouse move to look around", 40, 60, 10, Color::DARKGRAY); + }); } } diff --git a/samples/Cargo.toml b/samples/Cargo.toml index 505cbaa2..6638af8d 100644 --- a/samples/Cargo.toml +++ b/samples/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "raylib-examples" -version = "4.0.0" -authors = ["David Ayeke"] +version = "4.5.0" +authors = ["David Ayeke", "Teddy Astie"] edition = "2021" license = "Zlib" readme = "../README.md" diff --git a/samples/arkanoid.rs b/samples/arkanoid.rs index f6b49922..2a713bb7 100644 --- a/samples/arkanoid.rs +++ b/samples/arkanoid.rs @@ -68,7 +68,6 @@ impl Default for Game { fn main() { let opt = options::Opt::from_args(); let (rl, thread) = opt.open_window("Arkanoid"); - let render = rl.render_loop(&thread); let (_w, _h) = (opt.width, opt.height); @@ -81,7 +80,7 @@ fn main() { while !rl.window_should_close() { update_game(&mut game, &rl); - render.frame(|d| draw_game(&game, &rl, &d, &thread)); + rl.frame(&thread, |d| draw_game(&game, &rl, &d)); } } @@ -275,7 +274,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } } -fn draw_game(game: &Game, rl: &RaylibHandle, d: &RaylibDrawHandle, thread: &RaylibThread) { +fn draw_game(game: &Game, rl: &RaylibHandle, d: &RaylibDrawHandle) { let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); d.clear_background(Color::RAYWHITE); diff --git a/samples/asteroids.rs b/samples/asteroids.rs index 12890f57..d72b3df3 100644 --- a/samples/asteroids.rs +++ b/samples/asteroids.rs @@ -93,17 +93,17 @@ impl Default for Game { } } -const SHIP_HEIGHT : f32 = 10f32 / 0.363970f32; -const PLAYER_SPEED : f32 = 6f32; -const MAX_BIG_METEORS : usize = 4; -const MAX_MEDIUM_METEORS : usize = 8; -const MAX_SMALL_METEORS : usize = 16; -const METEORS_SPEED : f32 = 2f32; -const MAX_SHOTS : usize = 10; +const SHIP_HEIGHT: f32 = 10f32 / 0.363970f32; +const PLAYER_SPEED: f32 = 6f32; +const MAX_BIG_METEORS: usize = 4; +const MAX_MEDIUM_METEORS: usize = 8; +const MAX_SMALL_METEORS: usize = 16; +const METEORS_SPEED: f32 = 2f32; +const MAX_SHOTS: usize = 10; fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Asteroids"); + let (rl, thread) = opt.open_window("Asteroids"); let (_w, _h) = (opt.width, opt.height); let _game_over = false; @@ -115,7 +115,7 @@ fn main() { while !rl.window_should_close() { update_game(&mut game, &rl); - draw_game(&game, &mut rl, &thread); + draw_game(&game, &rl, &thread); } } @@ -126,9 +126,11 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { game.player.position = Vector2::new(half_width, half_height - (SHIP_HEIGHT / 2f32)); game.player.acceleration = 0f32; - game.player.collider = Vector3::new(game.player.position.x + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), - game.player.position.y - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), - 12f32); + game.player.collider = Vector3::new( + game.player.position.x + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), + game.player.position.y - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), + 12f32, + ); game.player.color = Color::MAROON; game.destroyed_meteor_count = 0; @@ -152,8 +154,7 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { while !correct_range { if x > half_width as i32 - 150 && x < half_width as i32 + 150 { x = rl.get_random_value(0, width as i32); - } - else { + } else { correct_range = true; } } @@ -165,8 +166,7 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { while !correct_range { if y > half_height as i32 - 150 && y < half_height as i32 + 150 { y = rl.get_random_value(0, height as i32); - } - else { + } else { correct_range = true; } } @@ -180,8 +180,7 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { if vel_x == 0 && vel_y == 0 { vel_x = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); vel_y = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - } - else { + } else { correct_range = true; } } @@ -232,12 +231,10 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if game.player.acceleration < 1f32 { game.player.acceleration += 0.04; } - } - else { + } else { if game.player.acceleration > 0f32 { game.player.acceleration -= 0.02; - } - else if game.player.acceleration < 0f32 { + } else if game.player.acceleration < 0f32 { game.player.acceleration = 0f32; } } @@ -245,8 +242,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if rl.is_key_down(KEY_DOWN) { if game.player.acceleration > 0f32 { game.player.acceleration -= 0.04; - } - else if game.player.acceleration < 0f32 { + } else if game.player.acceleration < 0f32 { game.player.acceleration = 0f32; } } @@ -258,23 +254,25 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if game.player.position.x > width + SHIP_HEIGHT { game.player.position.x = -SHIP_HEIGHT; - } - else if game.player.position.x < -SHIP_HEIGHT { - game.player.position.x = width + SHIP_HEIGHT; + } else if game.player.position.x < -SHIP_HEIGHT { + game.player.position.x = width + SHIP_HEIGHT; } if game.player.position.y > height + SHIP_HEIGHT { game.player.position.y = -SHIP_HEIGHT; - } - else if game.player.position.y < -SHIP_HEIGHT { + } else if game.player.position.y < -SHIP_HEIGHT { game.player.position.y = height + SHIP_HEIGHT; } if rl.is_key_pressed(KEY_SPACE) { for shot in &mut game.shots { if !shot.active { - shot.position = Vector2::new(game.player.position.x + game.player.rotation.to_radians().sin() * SHIP_HEIGHT, - game.player.position.y - game.player.rotation.to_radians().cos() * SHIP_HEIGHT); + shot.position = Vector2::new( + game.player.position.x + + game.player.rotation.to_radians().sin() * SHIP_HEIGHT, + game.player.position.y + - game.player.rotation.to_radians().cos() * SHIP_HEIGHT, + ); shot.active = true; shot.speed.x = 1.5 * game.player.rotation.to_radians().sin() * PLAYER_SPEED; shot.speed.y = 1.5 * game.player.rotation.to_radians().cos() * PLAYER_SPEED; @@ -294,8 +292,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if shot.position.x > width + shot.radius { shot.active = false; shot.life_spawn = 0; - } - else if shot.position.x < -shot.radius { + } else if shot.position.x < -shot.radius { shot.active = false; shot.life_spawn = 0; } @@ -303,8 +300,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if shot.position.y > height + shot.radius { shot.active = false; shot.life_spawn = 0; - } - else if shot.position.y < -shot.radius { + } else if shot.position.y < -shot.radius { shot.active = false; shot.life_spawn = 0; } @@ -317,8 +313,14 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } for meteor in &mut game.big_meteors { - if meteor.active && - check_collision_circles(shot.position, shot.radius, meteor.position, meteor.radius) { + if meteor.active + && check_collision_circles( + shot.position, + shot.radius, + meteor.position, + meteor.radius, + ) + { shot.active = false; shot.life_spawn = 0; @@ -327,21 +329,27 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for _ in 0..2 { if game.medium_meteor_count % 2 == 0 { - game.medium_meteors[game.medium_meteor_count as usize].position = + game.medium_meteors[game.medium_meteor_count as usize] + .position = Vector2::new(meteor.position.x, meteor.position.y); game.medium_meteors[game.medium_meteor_count as usize].speed = - Vector2::new(shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, - shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0); - } - else { - game.medium_meteors[game.medium_meteor_count as usize].position = + Vector2::new( + shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, + shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0, + ); + } else { + game.medium_meteors[game.medium_meteor_count as usize] + .position = Vector2::new(meteor.position.x, meteor.position.y); game.medium_meteors[game.medium_meteor_count as usize].speed = - Vector2::new(shot.rotation.to_radians().cos() * METEORS_SPEED, - shot.rotation.to_radians().sin() * METEORS_SPEED); + Vector2::new( + shot.rotation.to_radians().cos() * METEORS_SPEED, + shot.rotation.to_radians().sin() * METEORS_SPEED, + ); } - game.medium_meteors[game.medium_meteor_count as usize].active = true; + game.medium_meteors[game.medium_meteor_count as usize].active = + true; game.medium_meteor_count += 1; } @@ -350,8 +358,14 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } for meteor in &mut game.medium_meteors { - if meteor.active && - check_collision_circles(shot.position, shot.radius, meteor.position, meteor.radius) { + if meteor.active + && check_collision_circles( + shot.position, + shot.radius, + meteor.position, + meteor.radius, + ) + { shot.active = false; shot.life_spawn = 0; @@ -363,15 +377,18 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { game.small_meteors[game.small_meteor_count as usize].position = Vector2::new(meteor.position.x, meteor.position.y); game.small_meteors[game.small_meteor_count as usize].speed = - Vector2::new(shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, - shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0); - } - else { + Vector2::new( + shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, + shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0, + ); + } else { game.small_meteors[game.small_meteor_count as usize].position = Vector2::new(meteor.position.x, meteor.position.y); game.small_meteors[game.small_meteor_count as usize].speed = - Vector2::new(shot.rotation.to_radians().cos() * METEORS_SPEED, - shot.rotation.to_radians().sin() * METEORS_SPEED); + Vector2::new( + shot.rotation.to_radians().cos() * METEORS_SPEED, + shot.rotation.to_radians().sin() * METEORS_SPEED, + ); } game.small_meteors[game.small_meteor_count as usize].active = true; @@ -383,8 +400,14 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } for meteor in &mut game.small_meteors { - if meteor.active && - check_collision_circles(shot.position, shot.radius, meteor.position, meteor.radius) { + if meteor.active + && check_collision_circles( + shot.position, + shot.radius, + meteor.position, + meteor.radius, + ) + { shot.active = false; shot.life_spawn = 0; @@ -397,29 +420,51 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } } - game.player.collider = Vector3::new(game.player.position.x + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), - game.player.position.y - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), - 12f32); + game.player.collider = Vector3::new( + game.player.position.x + + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), + game.player.position.y + - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), + 12f32, + ); for meteor in &game.big_meteors { - if meteor.active && check_collision_circles(Vector2::new(game.player.collider.x, game.player.collider.y), game.player.collider.z, - meteor.position, meteor.radius) { - game.game_over = true; - } + if meteor.active + && check_collision_circles( + Vector2::new(game.player.collider.x, game.player.collider.y), + game.player.collider.z, + meteor.position, + meteor.radius, + ) + { + game.game_over = true; + } } for meteor in &game.medium_meteors { - if meteor.active && check_collision_circles(Vector2::new(game.player.collider.x, game.player.collider.y), game.player.collider.z, - meteor.position, meteor.radius) { - game.game_over = true; - } + if meteor.active + && check_collision_circles( + Vector2::new(game.player.collider.x, game.player.collider.y), + game.player.collider.z, + meteor.position, + meteor.radius, + ) + { + game.game_over = true; + } } for meteor in &game.small_meteors { - if meteor.active && check_collision_circles(Vector2::new(game.player.collider.x, game.player.collider.y), game.player.collider.z, - meteor.position, meteor.radius) { - game.game_over = true; - } + if meteor.active + && check_collision_circles( + Vector2::new(game.player.collider.x, game.player.collider.y), + game.player.collider.z, + meteor.position, + meteor.radius, + ) + { + game.game_over = true; + } } for meteor in &mut game.big_meteors { @@ -429,15 +474,13 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if meteor.position.x > width + meteor.radius { meteor.position.x = -meteor.radius; - } - else if meteor.position.x < 0f32 - meteor.radius { + } else if meteor.position.x < 0f32 - meteor.radius { meteor.position.x = width + meteor.radius; } if meteor.position.y > height + meteor.radius { meteor.position.y = -meteor.radius; - } - else if meteor.position.y < 0f32 - meteor.radius { + } else if meteor.position.y < 0f32 - meteor.radius { meteor.position.y = height + meteor.radius; } } @@ -450,15 +493,13 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if meteor.position.x > width + meteor.radius { meteor.position.x = -meteor.radius; - } - else if meteor.position.x < 0f32 - meteor.radius { + } else if meteor.position.x < 0f32 - meteor.radius { meteor.position.x = width + meteor.radius; } if meteor.position.y > height + meteor.radius { meteor.position.y = -meteor.radius; - } - else if meteor.position.y < 0f32 - meteor.radius { + } else if meteor.position.y < 0f32 - meteor.radius { meteor.position.y = height + meteor.radius; } } @@ -471,26 +512,25 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { if meteor.position.x > width + meteor.radius { meteor.position.x = -meteor.radius; - } - else if meteor.position.x < 0f32 - meteor.radius { + } else if meteor.position.x < 0f32 - meteor.radius { meteor.position.x = width + meteor.radius; } if meteor.position.y > height + meteor.radius { meteor.position.y = -meteor.radius; - } - else if meteor.position.y < 0f32 - meteor.radius { + } else if meteor.position.y < 0f32 - meteor.radius { meteor.position.y = height + meteor.radius; } } } } - if game.destroyed_meteor_count == MAX_BIG_METEORS as u32 + MAX_MEDIUM_METEORS as u32 + MAX_SMALL_METEORS as u32 { + if game.destroyed_meteor_count + == MAX_BIG_METEORS as u32 + MAX_MEDIUM_METEORS as u32 + MAX_SMALL_METEORS as u32 + { game.victory = true; } - } - else { + } else { if rl.is_key_pressed(KEY_ENTER) { init_game(game, rl); game.game_over = false; @@ -498,66 +538,101 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } } -fn draw_game(game: &Game, rl: &mut RaylibHandle, thread: &RaylibThread) { +fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { let (width, height) = (rl.get_screen_width() as i32, rl.get_screen_height() as i32); - let mut d = rl.begin_drawing(thread); + + rl.frame(thread, |d| { + let half_width = width / 2; + let half_height = height / 2; + + d.clear_background(Color::RAYWHITE); + + if !game.game_over { + let cosf = f32::cos(game.player.rotation.to_radians()); + let sinf = f32::sin(game.player.rotation.to_radians()); + let v1 = Vector2::new( + game.player.position.x + sinf * SHIP_HEIGHT, + game.player.position.y - cosf * SHIP_HEIGHT, + ); + let v2 = Vector2::new( + game.player.position.x - cosf * 10f32, + game.player.position.y - sinf * 10f32, + ); + let v3 = Vector2::new( + game.player.position.x + cosf * 10f32, + game.player.position.y + sinf * 10f32, + ); + d.draw_triangle(v1, v2, v3, game.player.color); - let half_width = width / 2; - let half_height = height / 2; - - d.clear_background(Color::RAYWHITE); - - if !game.game_over { - let cosf = f32::cos(game.player.rotation.to_radians()); - let sinf = f32::sin(game.player.rotation.to_radians()); - let v1 = Vector2::new(game.player.position.x + sinf * SHIP_HEIGHT,game.player.position.y - cosf * SHIP_HEIGHT); - let v2 = Vector2::new(game.player.position.x - cosf * 10f32, game.player.position.y - sinf * 10f32); - let v3 = Vector2::new(game.player.position.x + cosf * 10f32, game.player.position.y + sinf * 10f32); - d.draw_triangle(v1, v2, v3, game.player.color); - - for meteor in &game.big_meteors { - if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); - } - else { - d.draw_circle_v(meteor.position, meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3)); + for meteor in &game.big_meteors { + if meteor.active { + d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + } else { + d.draw_circle_v( + meteor.position, + meteor.radius, + Color::fade(&Color::LIGHTGRAY, 0.3), + ); + } } - } - for meteor in &game.medium_meteors { - if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); - } - else { - d.draw_circle_v(meteor.position, meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3)); + for meteor in &game.medium_meteors { + if meteor.active { + d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + } else { + d.draw_circle_v( + meteor.position, + meteor.radius, + Color::fade(&Color::LIGHTGRAY, 0.3), + ); + } } - } - for meteor in &game.small_meteors { - if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); - } - else { - d.draw_circle_v(meteor.position, meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3)); + for meteor in &game.small_meteors { + if meteor.active { + d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + } else { + d.draw_circle_v( + meteor.position, + meteor.radius, + Color::fade(&Color::LIGHTGRAY, 0.3), + ); + } } - } - for shot in &game.shots { - if shot.active { - d.draw_circle_v(shot.position, shot.radius, shot.color); + for shot in &game.shots { + if shot.active { + d.draw_circle_v(shot.position, shot.radius, shot.color); + } } - } - if game.victory { - d.draw_text("VICTORY", half_width - measure_text("VICTORY", 20), half_height, 20, Color::LIGHTGRAY); - } + if game.victory { + d.draw_text( + "VICTORY", + half_width - measure_text("VICTORY", 20), + half_height, + 20, + Color::LIGHTGRAY, + ); + } - if game.pause { - d.draw_text("GAME PAUSED", half_width - measure_text("GAME PAUSED", 40), half_height - 40, 40, Color::GRAY); + if game.pause { + d.draw_text( + "GAME PAUSED", + half_width - measure_text("GAME PAUSED", 40), + half_height - 40, + 40, + Color::GRAY, + ); + } + } else { + d.draw_text( + "PRESS [ENTER] TO PLAY AGAIN", + half_width - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20), + half_height - 50, + 20, + Color::GRAY, + ); } - } - else { - d.draw_text("PRESS [ENTER] TO PLAY AGAIN", half_width - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20), half_height - 50, 20, Color::GRAY); - } - + }) } diff --git a/samples/camera2D.rs b/samples/camera2D.rs index a966ba91..9387bc0a 100644 --- a/samples/camera2D.rs +++ b/samples/camera2D.rs @@ -9,7 +9,7 @@ const MAX_BUILDINGS: usize = 100; fn main() { use raylib::consts::KeyboardKey::*; let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Camera 2D"); + let (rl, thread) = opt.open_window("Camera 2D"); let (w, h) = (opt.width, opt.height); let mut player = Rectangle::new(400.0, 280.0, 40.0, 40.0); @@ -74,10 +74,10 @@ fn main() { camera.rotation = 0.0; } - rl.render_loop().frame(|mut d| { + rl.frame(&thread, |d| { d.clear_background(Color::RAYWHITE); { - let mut d2 = d.begin_mode2D(camera); + let d2 = d.begin_mode2D(camera); d2.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); for i in 0..MAX_BUILDINGS { diff --git a/samples/drop.rs b/samples/drop.rs index 07c9bce0..8837c6b1 100644 --- a/samples/drop.rs +++ b/samples/drop.rs @@ -88,7 +88,7 @@ fn test_audio_dropping(opt: &options::Opt) { /// checks that fonts can be dropped after window is closed fn test_font_dropping(opt: &options::Opt) { let _f = { - let (mut rl, thread) = raylib::init() + let (rl, thread) = raylib::init() .size(opt.width, opt.height) .title("Drop") .build(); diff --git a/samples/font.rs b/samples/font.rs index bb585c3e..b8354556 100644 --- a/samples/font.rs +++ b/samples/font.rs @@ -8,8 +8,8 @@ fn main() { let rust_orange = Color::new(222, 165, 132, 255); let ray_white = Color::new(255, 255, 255, 255); - let (mut rl, thread) = raylib::init().size(w, h).title("Logo").build(); - let render = (&rl).render_loop(); + let (rl, thread) = raylib::init().size(w, h).title("Logo").build(); + let render = rl.render_loop(&thread); rl.set_target_fps(60); diff --git a/samples/input.rs b/samples/input.rs index c2e58150..2218dd46 100644 --- a/samples/input.rs +++ b/samples/input.rs @@ -6,7 +6,7 @@ mod options; fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Input"); + let (rl, thread) = opt.open_window("Input"); let (_w, _h) = (opt.width, opt.height); let _rust_orange = Color::new(222, 165, 132, 255); let _ray_white = Color::new(255, 255, 255, 255); @@ -14,12 +14,13 @@ fn main() { rl.set_target_fps(60); while !rl.window_should_close() { let pressed_key = rl.get_key_pressed(); - let mut d = rl.begin_drawing(&thread); - d.clear_background(Color::WHITE); - if let Some(pressed_key) = pressed_key { - // Certain keyboards may have keys raylib does not expect. Uncomment this line if so. - // let pressed_key: u32 = unsafe { std::mem::transmute(pressed_key) }; - d.draw_text(&format!("{:?}", pressed_key), 100, 12, 10, Color::BLACK); - } + rl.frame(&thread, |d| { + d.clear_background(Color::WHITE); + if let Some(pressed_key) = pressed_key { + // Certain keyboards may have keys raylib does not expect. Uncomment this line if so. + // let pressed_key: u32 = unsafe { std::mem::transmute(pressed_key) }; + d.draw_text(&format!("{:?}", pressed_key), 100, 12, 10, Color::BLACK); + } + }); } } diff --git a/samples/model_shader.rs b/samples/model_shader.rs index 075be706..b263d433 100644 --- a/samples/model_shader.rs +++ b/samples/model_shader.rs @@ -52,22 +52,23 @@ fn main() { while !rl.window_should_close() { rl.update_camera(&mut camera); - let mut drawing = rl.begin_drawing(&thread); - drawing.clear_background(Color::WHITE); - { - let mut mode_3d = drawing.begin_mode3D(camera); + rl.frame(&thread, |mut drawing| { + drawing.clear_background(Color::WHITE); + { + let mode_3d = &drawing.begin_mode3D(camera); - mode_3d.draw_model(&model, model_position, 0.2, Color::WHITE); - mode_3d.draw_grid(10, 1.0); - } + mode_3d.draw_model(&model, model_position, 0.2, Color::WHITE); + mode_3d.draw_grid(10, 1.0); + } - drawing.draw_text( - "(c) Watermill 3D model by Alberto Cano", - w - 210, - h - 20, - 10, - Color::GRAY, - ); - drawing.draw_fps(10, 10) + drawing.draw_text( + "(c) Watermill 3D model by Alberto Cano", + w - 210, + h - 20, + 10, + Color::GRAY, + ); + drawing.draw_fps(10, 10); + }); } } diff --git a/samples/options.rs b/samples/options.rs index b8dbd7ad..2489f2c6 100644 --- a/samples/options.rs +++ b/samples/options.rs @@ -14,13 +14,13 @@ pub struct Opt { pub fps: u32, } -impl<'a> Opt { +impl Opt { #[allow(dead_code)] pub fn new() -> Self { Opt::from_args() } - pub fn open_window(&self, name: &str) -> (raylib::RaylibHandle<'a>, raylib::RaylibThread) { - let (mut rl, thread) = raylib::init() + pub fn open_window(&self, name: &str) -> (raylib::RaylibHandle<'static>, raylib::RaylibThread) { + let (rl, thread) = raylib::init() .size(self.width, self.height) .title(name) .build(); diff --git a/samples/raymarch.rs b/samples/raymarch.rs index 7411a985..a8428890 100644 --- a/samples/raymarch.rs +++ b/samples/raymarch.rs @@ -8,7 +8,7 @@ const SHADER: &str = include_str!("static/raymarching.fs"); pub fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Camera 2D"); + let (rl, thread) = opt.open_window("Camera 2D"); let (w, h) = (opt.width, opt.height); let mut camera = Camera3D::perspective( @@ -57,24 +57,24 @@ pub fn main() { // Draw //---------------------------------------------------------------------------------- - let mut d = rl.begin_drawing(&thread); - - d.clear_background(Color::RAYWHITE); - - // We only draw a white full-screen rectangle, - // frame is generated in shader using raymarching - { - let mut d = d.begin_shader_mode(&shader); - d.draw_rectangle(0, 0, w, h, Color::WHITE); - } - - d.draw_text( - "(c) Raymarching shader by Iñigo Quilez. MIT License.", - w - 280, - h - 20, - 10, - Color::GRAY, - ); + rl.frame(&thread, |mut d| { + d.clear_background(Color::RAYWHITE); + + // We only draw a white full-screen rectangle, + // frame is generated in shader using raymarching + { + let d = d.begin_shader_mode(&shader); + d.draw_rectangle(0, 0, w, h, Color::WHITE); + } + + d.draw_text( + "(c) Raymarching shader by Iñigo Quilez. MIT License.", + w - 280, + h - 20, + 10, + Color::GRAY, + ); + }); //---------------------------------------------------------------------------------- } diff --git a/samples/rgui.rs b/samples/rgui.rs index e9df553c..2051ef5c 100644 --- a/samples/rgui.rs +++ b/samples/rgui.rs @@ -164,7 +164,7 @@ pub fn main() { ffi::GuiSetStyle( TEXTBOX as i32, TEXT_ALIGNMENT as i32, - GUI_TEXT_ALIGN_CENTER as i32, + TEXT_ALIGN_CENTER as i32, ); } // dbg!(spinnerEditMode); diff --git a/samples/roguelike.rs b/samples/roguelike.rs index 91f3fd46..de11c166 100644 --- a/samples/roguelike.rs +++ b/samples/roguelike.rs @@ -4,6 +4,7 @@ /// IMHO Don't write code like this. Use ECS and other methods to have game objects and components. /// Only do this as an exercise. extern crate raylib; +use crate::KeyboardKey::KEY_A; use rand::distributions::WeightedIndex; use rand::prelude::*; use rand::Rng; @@ -14,7 +15,6 @@ use std::fs::File; use std::io::{Read, Write}; use structopt::StructOpt; use tcod::map::{FovAlgorithm, Map as FovMap}; -use crate::KeyboardKey::KEY_A; mod options; @@ -418,7 +418,7 @@ impl Object { } } - pub fn draw(&self, d: &mut RaylibDrawHandle) { + pub fn draw(&self, d: &RaylibDrawHandle) { let c: Color = self.color.into(); d.draw_text( &self.char, @@ -920,7 +920,7 @@ fn get_equipped_in_slot(slot: Slot, inventory: &[Object]) -> Option { } fn play_game( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod, game: &mut Game, @@ -952,11 +952,12 @@ fn play_game( } // drawing - let mut d = rl.begin_drawing(&thread); - d.clear_background(Color::GRAY); - let player = &objects[PLAYER]; - let fov_recompute = previous_player_positon != (player.x, player.y); - render_all(tcod, &mut d, game, objects, fov_recompute); + rl.frame(&thread, |d| { + d.clear_background(Color::GRAY); + let player = &objects[PLAYER]; + let fov_recompute = previous_player_positon != (player.x, player.y); + render_all(tcod, &d, game, objects, fov_recompute); + }); } } @@ -978,7 +979,7 @@ fn main() { } fn handle_keys( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod, game: &mut Game, @@ -1019,16 +1020,16 @@ fn handle_keys( // menus let mut exit = false; while !rl.window_should_close() { - let inventory_index = { - let mut d = rl.begin_drawing(thread); - render_all(tcod, &mut d, game, objects, false); - inventory_menu( + let mut inventory_index = None; + rl.frame(&thread, |d| { + render_all(tcod, &d, game, objects, false); + inventory_index = inventory_menu( &game.inventory, "Press the key next to an item to use it, or any other to cancel.", pressed_key, - &mut d, - ) - }; + &d, + ); + }); // using items if let Some(inventory_index) = inventory_index { use_item(rl, &thread, inventory_index, tcod, game, objects); @@ -1044,16 +1045,16 @@ fn handle_keys( } else if rl.is_key_pressed(KEY_F) { let mut exit = false; while !rl.window_should_close() { - let inventory_index = { - let mut d = rl.begin_drawing(thread); - render_all(tcod, &mut d, game, objects, false); - inventory_menu( + let mut inventory_index = None; + rl.frame(thread, |d| { + render_all(tcod, &d, game, objects, false); + inventory_index = inventory_menu( &game.inventory, "Press the key next to an item to drop it, or any other to cancel.\n'", pressed_key, - &mut d, - ) - }; + &d, + ); + }); // using items if let Some(inventory_index) = inventory_index { drop_item(inventory_index, game, objects); @@ -1098,9 +1099,10 @@ Defense: {}", player.defense(game) ); { - let mut d = rl.begin_drawing(thread); - render_all(tcod, &mut d, game, objects, false); - msgbox(&msg, CHARACTER_SCREEN_WIDTH, pressed_key, &mut d); + rl.frame(thread, |d| { + render_all(tcod, &d, game, objects, false); + msgbox(&msg, CHARACTER_SCREEN_WIDTH, pressed_key, &d); + }); } if let Some(_key) = rl.get_key_pressed_number() { break; @@ -1153,7 +1155,7 @@ fn drop_item(inventory_id: usize, game: &mut Game, objects: &mut Vec) { } fn use_item( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, inventory_id: usize, tcod: &mut Tcod, @@ -1190,7 +1192,7 @@ fn use_item( } fn cast_heal( - _rl: &mut RaylibHandle, + _rl: &RaylibHandle, _thread: &RaylibThread, _inventory_id: usize, _tcod: &mut Tcod, @@ -1213,7 +1215,7 @@ fn cast_heal( } fn cast_lightning( - _rl: &mut RaylibHandle, + _rl: &RaylibHandle, _thread: &RaylibThread, _inventory_id: usize, tcod: &mut Tcod, @@ -1245,7 +1247,7 @@ fn cast_lightning( } fn cast_confuse( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, _inventory_id: usize, tcod: &mut Tcod, @@ -1283,7 +1285,7 @@ fn cast_confuse( } fn cast_fireball( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, _inventory_id: usize, tcod: &mut Tcod, @@ -1330,7 +1332,7 @@ fn cast_fireball( } fn toggle_equipment( - _rl: &mut RaylibHandle, + _rl: &RaylibHandle, _thread: &RaylibThread, inventory_id: usize, _tcod: &mut Tcod, @@ -1450,7 +1452,7 @@ fn move_by(id: usize, dx: i32, dy: i32, map: &Map, objects: &mut [Object]) { } } -fn level_up(rl: &mut RaylibHandle, thread: &RaylibThread, game: &mut Game, objects: &mut [Object]) { +fn level_up(rl: &RaylibHandle, thread: &RaylibThread, game: &mut Game, objects: &mut [Object]) { let player = &mut objects[PLAYER]; let level_up_xp = LEVEL_UP_BASE + player.level * LEVEL_UP_FACTOR; // see if the player's experience is enough to level-up @@ -1468,19 +1470,20 @@ fn level_up(rl: &mut RaylibHandle, thread: &RaylibThread, game: &mut Game, objec let mut choice = None; while choice.is_none() { let pressed_key = rl.get_key_pressed_number(); - let mut d = rl.begin_drawing(thread); - // keep asking until a choice is made - choice = menu( - "Level up! Choose a stat to raise:\n", - &[ - format!("Constitution (+20 HP, from {})", fighter.base_max_hp), - format!("Strength (+1 attack, from {})", fighter.base_power), - format!("Agility (+1 defense, from {})", fighter.base_defense), - ], - LEVEL_SCREEN_WIDTH, - pressed_key, - &mut d, - ); + rl.frame(thread, |d| { + // keep asking until a choice is made + choice = menu( + "Level up! Choose a stat to raise:\n", + &[ + format!("Constitution (+20 HP, from {})", fighter.base_max_hp), + format!("Strength (+1 attack, from {})", fighter.base_power), + format!("Agility (+1 defense, from {})", fighter.base_defense), + ], + LEVEL_SCREEN_WIDTH, + pressed_key, + &d, + ); + }); } fighter.xp -= level_up_xp; match choice.unwrap() { @@ -1528,7 +1531,7 @@ fn monster_death(monster: &mut Object, game: &mut Game) { } fn render_bar( - d: &mut RaylibDrawHandle, + d: &RaylibDrawHandle, x: i32, y: i32, total_width: i32, @@ -1567,7 +1570,7 @@ fn render_bar( ); } -fn main_menu(rl: &mut RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { +fn main_menu(rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { let img = Image::load_image("static/menu_background.png").expect("could not load background image"); let (w, h) = (img.width(), img.height()); @@ -1579,17 +1582,10 @@ fn main_menu(rl: &mut RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { while !rl.window_should_close() { // show the background image, at twice the regular console resolution let pressed_key = rl.get_key_pressed_number(); - let choice = { - let mut d = rl.begin_drawing(thread); + let mut choice = None; + rl.frame(thread, |d| { d.clear_background(Color::BLACK); - d.draw_texture_pro( - &img, - Rectangle::new(0.0, 0.0, w as f32, h as f32), - Rectangle::new(0.0, 0.0, 800.0, 640.0), - Vector2::new(0.0, 0.0), - 0.0, - Color::WHITE, - ); + d.draw_texture_ex(&img, Vector2::new(0.0, 0.0), 0.0, 1.0, Color::WHITE); // Game title d.draw_text( "TOMBS OF THE ANCIENT KINGS", @@ -1607,8 +1603,9 @@ fn main_menu(rl: &mut RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { ); // show options and wait for the player's choice let choices = &["Play a new game", "Continue last game", "Quit"]; - menu("", choices, 24, pressed_key, &mut d) - }; + choice = menu("", choices, 24, pressed_key, &d); + }); + match choice { Some(0) => { // new game @@ -1624,8 +1621,9 @@ fn main_menu(rl: &mut RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { } Err(_e) => { { - let mut d = rl.begin_drawing(thread); - msgbox("\nNo saved game to load.\n", 24, pressed_key, &mut d); + rl.frame(thread, |d| { + msgbox("\nNo saved game to load.\n", 24, pressed_key, &d); + }); } continue; } @@ -1640,7 +1638,7 @@ fn main_menu(rl: &mut RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { } } -fn msgbox(text: &str, width: i32, pressed_key: Option, d: &mut RaylibDrawHandle) { +fn msgbox(text: &str, width: i32, pressed_key: Option, d: &RaylibDrawHandle) { let options: &[&str] = &[]; menu(text, options, width, pressed_key, d); } @@ -1649,7 +1647,7 @@ fn inventory_menu( inventory: &[Object], header: &str, pressed_key: Option, - root: &mut RaylibDrawHandle, + root: &RaylibDrawHandle, ) -> Option { // how a menu with each item of the inventory as an option let options = if inventory.len() == 0 { @@ -1681,7 +1679,7 @@ fn inventory_menu( fn render_all( tcod: &mut Tcod, - d: &mut RaylibDrawHandle, + d: &RaylibDrawHandle, game: &mut Game, objects: &mut [Object], fov_recompute: bool, @@ -1791,7 +1789,7 @@ fn render_all( } fn target_tile( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod, game: &mut Game, @@ -1814,14 +1812,15 @@ fn target_tile( return None; } // ... - let mut d = rl.begin_drawing(thread); - render_all(tcod, &mut d, game, objects, false); + rl.frame(&thread, |d| { + render_all(tcod, &d, game, objects, false); + }); } None } fn target_monster( - rl: &mut RaylibHandle, + rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod, game: &mut Game, @@ -1858,7 +1857,7 @@ fn menu>( options: &[T], width: i32, pressed_key: Option, - d: &mut RaylibDrawHandle, + d: &RaylibDrawHandle, ) -> Option { assert!( options.len() <= 26, diff --git a/samples/specs.rs b/samples/specs.rs index f661e2fd..3bd99297 100644 --- a/samples/specs.rs +++ b/samples/specs.rs @@ -68,7 +68,7 @@ struct PlayerSys; impl<'a> System<'a> for PlayerSys { type SystemData = ( Entities<'a>, - ReadExpect<'a, RaylibHandle>, + ReadExpect<'a, RaylibHandle<'static>>, ReadExpect<'a, EntityMap>, WriteStorage<'a, Player>, ReadStorage<'a, Pos>, @@ -110,14 +110,14 @@ struct DrawSys { } impl<'a> System<'a> for DrawSys { type SystemData = ( - WriteExpect<'a, RaylibHandle>, + WriteExpect<'a, RaylibHandle<'static>>, ReadStorage<'a, Player>, ReadStorage<'a, Tile>, ReadStorage<'a, Pos>, ReadStorage<'a, Fire>, ); - fn run(&mut self, (mut rl, player, tiles, pos, fire): Self::SystemData) { + fn run(&mut self, (rl, player, tiles, pos, fire): Self::SystemData) { let (_, sh) = (rl.get_screen_width(), rl.get_screen_height()); let tw = sh / TILE_COUNT - 2 * MARGIN; @@ -125,23 +125,24 @@ impl<'a> System<'a> for DrawSys { let size = Vector2::new(tw as f32, tw as f32) + margin; let tile_size = Vector2::new(tw as f32, tw as f32); - let mut d = rl.begin_drawing(&self.thread); - d.clear_background(Color::BLACK); - // draw the tiles - for (pos, _) in (&pos, &tiles).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::RAYWHITE); - } - // draw the fire tiles - for (pos, _, _) in (&pos, &tiles, &fire).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::RED); - } - // draw the player tiles - for (pos, _, _) in (&pos, &tiles, &player).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::GREEN); - } + rl.frame(&self.thread, |d| { + d.clear_background(Color::BLACK); + // draw the tiles + for (pos, _) in (&pos, &tiles).join() { + let p: Vector2 = pos.into(); + d.draw_rectangle_v(p * size + margin, tile_size, Color::RAYWHITE); + } + // draw the fire tiles + for (pos, _, _) in (&pos, &tiles, &fire).join() { + let p: Vector2 = pos.into(); + d.draw_rectangle_v(p * size + margin, tile_size, Color::RED); + } + // draw the player tiles + for (pos, _, _) in (&pos, &tiles, &player).join() { + let p: Vector2 = pos.into(); + d.draw_rectangle_v(p * size + margin, tile_size, Color::GREEN); + } + }); } } diff --git a/samples/texture.rs b/samples/texture.rs index 37e03e4c..a0abdb6c 100644 --- a/samples/texture.rs +++ b/samples/texture.rs @@ -6,7 +6,7 @@ mod options; fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Texture"); + let (rl, thread) = opt.open_window("Texture"); let (_w, _h) = (opt.width, opt.height); let i = Image::load_image("static/billboard.png").expect("could not load image billboard"); let _ = rl @@ -19,7 +19,7 @@ fn main() { rl.set_target_fps(60); while !rl.window_should_close() { // Detect window close button or ESC key - rl.render_loop().frame(|d| { + rl.frame(&thread, |d| { d.clear_background(Color::BLACK); d.draw_texture(&t, 0, 0, Color::WHITE); }); From 04c925d618e93eddbe832c3f476082b9d9802a6d Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sun, 19 Mar 2023 00:21:10 +0100 Subject: [PATCH 12/30] Fix some demos --- samples/drop.rs | 5 +++-- samples/extensions.rs | 9 ++++---- samples/font.rs | 49 ++++++++++++++++++++--------------------- samples/logo.rs | 2 +- samples/model_shader.rs | 2 +- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/samples/drop.rs b/samples/drop.rs index 8837c6b1..77c2908d 100644 --- a/samples/drop.rs +++ b/samples/drop.rs @@ -23,8 +23,8 @@ fn test_rslice(opt: &options::Opt) { /// Checks that shader files are droppable after window is closed fn test_shader_dropping(opt: &options::Opt) { let _ten_millis = time::Duration::from_millis(10); + let (rl, thread) = opt.open_window("Drop Shader"); let _v = { - let (mut rl, thread) = opt.open_window("Drop Shader"); rl.load_shader(&thread, None, Some("static/shader/pbr.fs")) .expect("shader didn't load") }; @@ -55,6 +55,7 @@ fn test_model_dropping(opt: &options::Opt) { /// Checks that audio files are droppable after window is closed fn test_audio_dropping(opt: &options::Opt) { + let audio = raylib::audio::RaylibAudio::init_audio_device(); let ten_millis = time::Duration::from_millis(10); let w = { let (_, _thread) = raylib::init() @@ -66,7 +67,7 @@ fn test_audio_dropping(opt: &options::Opt) { thread::sleep(ten_millis); let _s = { let (_rl, _thread) = opt.open_window("Drop Sound"); - Sound::load_sound("static/wave.ogg").expect("couldn't load wave") + Sound::load_sound(&audio, "static/wave.ogg").expect("couldn't load wave") }; thread::sleep(ten_millis); diff --git a/samples/extensions.rs b/samples/extensions.rs index 74a46d82..6b926c65 100644 --- a/samples/extensions.rs +++ b/samples/extensions.rs @@ -14,13 +14,14 @@ impl RaylibDrawExt for T where T: RaylibDraw {} fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Logo"); + let (rl, thread) = opt.open_window("Logo"); let font = &rl.get_font_default(); while !rl.window_should_close() { // Detect window close button or ESC key - let mut d = &rl.begin_drawing(&thread); - d.clear_background(Color::WHITE); - d.custom_draw(&font); + rl.frame(&thread, |mut d| { + d.clear_background(Color::WHITE); + d.custom_draw(&font); + }); } drop(rl); diff --git a/samples/font.rs b/samples/font.rs index b8354556..f8d132e4 100644 --- a/samples/font.rs +++ b/samples/font.rs @@ -9,7 +9,6 @@ fn main() { let ray_white = Color::new(255, 255, 255, 255); let (rl, thread) = raylib::init().size(w, h).title("Logo").build(); - let render = rl.render_loop(&thread); rl.set_target_fps(60); @@ -17,28 +16,28 @@ fn main() { .load_font(&thread, "static/alagard.png") .expect("couldn't load font"); - render.draw_loop(|d| -> bool { - // Detect window close button or ESC key - d.clear_background(ray_white); - d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); - d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); - d.draw_text_ex( - &font, - "rust", - Vector2::new((w / 2 - 69) as f32, (h / 2 + 18) as f32), - 50.0, - 1.0, - rust_orange, - ); - d.draw_text_ex( - &font, - "raylib", - Vector2::new((w / 2 - 44) as f32, (h / 2 + 48) as f32), - 50.0, - 1.0, - rust_orange, - ); - - !rl.window_should_close() - }); + while !rl.window_should_close() { + rl.frame(&thread, |d| { + // Detect window close button or ESC key + d.clear_background(ray_white); + d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); + d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); + d.draw_text_ex( + &font, + "rust", + Vector2::new((w / 2 - 69) as f32, (h / 2 + 18) as f32), + 50.0, + 1.0, + rust_orange, + ); + d.draw_text_ex( + &font, + "raylib", + Vector2::new((w / 2 - 44) as f32, (h / 2 + 48) as f32), + 50.0, + 1.0, + rust_orange, + ); + }); + } } diff --git a/samples/logo.rs b/samples/logo.rs index 7d61efb6..134fafb0 100644 --- a/samples/logo.rs +++ b/samples/logo.rs @@ -14,7 +14,7 @@ fn main() { rl.set_target_fps(60); while !rl.window_should_close() { // Detect window close button or ESC key - rl.render_loop(&thread).frame(|d| { + rl.frame(&thread, |d| { d.clear_background(ray_white); d.draw_rectangle(w / 2 - 128, h / 2 - 128, 256, 256, rust_orange); d.draw_rectangle(w / 2 - 112, h / 2 - 112, 224, 224, ray_white); diff --git a/samples/model_shader.rs b/samples/model_shader.rs index b263d433..e7a0cb3a 100644 --- a/samples/model_shader.rs +++ b/samples/model_shader.rs @@ -5,7 +5,7 @@ mod options; fn main() { let opt = options::Opt::from_args(); - let (mut rl, thread) = opt.open_window("Model shader example"); + let (rl, thread) = opt.open_window("Model shader example"); let (w, h) = (opt.width, opt.height); let mut camera = Camera3D::perspective( From 931999fe821665882d1d11d1fbea56bb09247594 Mon Sep 17 00:00:00 2001 From: Astie Teddy Date: Sat, 25 Mar 2023 11:44:52 +0100 Subject: [PATCH 13/30] WIP 4.5.0 redesign --- raylib-sys/Cargo.toml | 3 + raylib-sys/binding/rgui_wrapper.c | 6 +- raylib-sys/raylib | 2 +- raylib-sys/src/lib.rs | 5 +- raylib-sys/src/math.rs | 31 + raylib/Cargo.toml | 3 +- raylib/src/core/collision.rs | 26 +- raylib/src/core/math.rs | 2145 ----------------------------- 8 files changed, 63 insertions(+), 2158 deletions(-) create mode 100644 raylib-sys/src/math.rs delete mode 100644 raylib/src/core/math.rs diff --git a/raylib-sys/Cargo.toml b/raylib-sys/Cargo.toml index 0884506d..2b9b58e7 100644 --- a/raylib-sys/Cargo.toml +++ b/raylib-sys/Cargo.toml @@ -15,6 +15,9 @@ exclude = [ "raylib/templates/*" ] +[dependencies] +mint = "0.5" + [build-dependencies] fs_extra = "1.2" cmake = "0.1.49" diff --git a/raylib-sys/binding/rgui_wrapper.c b/raylib-sys/binding/rgui_wrapper.c index 6dfdf59b..ebe46a21 100644 --- a/raylib-sys/binding/rgui_wrapper.c +++ b/raylib-sys/binding/rgui_wrapper.c @@ -1,7 +1,7 @@ #include "../raylib/src/raylib.h" -#define RAYGUI_IMPLEMENTATION -#define RAYGUI_SUPPORT_ICONS +//#define RAYGUI_IMPLEMENTATION +//#define RAYGUI_SUPPORT_ICONS #define RLGL_IMPLEMENTATION #define RLGL_SUPPORT_TRACELOG // #include "rlgl.h" // Don't include rlgl since it's in raylib -#include "raygui.h" \ No newline at end of file +//#include "raygui.h" \ No newline at end of file diff --git a/raylib-sys/raylib b/raylib-sys/raylib index df5a736c..fec96137 160000 --- a/raylib-sys/raylib +++ b/raylib-sys/raylib @@ -1 +1 @@ -Subproject commit df5a736c009d98187e703a55c604345e12777bb7 +Subproject commit fec96137e8d10ee6c88914fbe5e5429c13ee1dac diff --git a/raylib-sys/src/lib.rs b/raylib-sys/src/lib.rs index c64a12e5..3353b64d 100644 --- a/raylib-sys/src/lib.rs +++ b/raylib-sys/src/lib.rs @@ -1,7 +1,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] + include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -#[cfg(target_os = "macos")] -pub const MAX_MATERIAL_MAPS: u32 = 12; \ No newline at end of file +pub mod math; +pub use math::*; diff --git a/raylib-sys/src/math.rs b/raylib-sys/src/math.rs new file mode 100644 index 00000000..7576cab7 --- /dev/null +++ b/raylib-sys/src/math.rs @@ -0,0 +1,31 @@ +use crate::{Matrix, Quaternion, Vector2, Vector3, Vector4}; +use mint; +use std::mem; + +macro_rules! mint_transmutable { + ($ffit:ty, $mt:ty) => { + impl From<$mt> for $ffit { + fn from(value: $mt) -> Self { + unsafe { mem::transmute(value) } + } + } + + impl Into<$mt> for $ffit { + fn into(self) -> $mt { + unsafe { mem::transmute(self) } + } + } + }; +} + +mint_transmutable!(Vector2, mint::Vector2); +mint_transmutable!(Vector3, mint::Vector3); +mint_transmutable!(Vector4, mint::Vector4); + +mint_transmutable!(Matrix, mint::ColumnMatrix4); +mint_transmutable!(Quaternion, mint::Quaternion); + +#[test] +fn math_test() { + // Do some transmutation tests. +} \ No newline at end of file diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 3e67e01f..cc45ca97 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -18,13 +18,12 @@ lazy_static = "1.2.0" cfg-if = "1.0.0" serde = { version = "1.0.125", features = ["derive"], optional = true } serde_json = { version = "1.0.64", optional = true } -nalgebra = { version = "0.26", optional = true } +nalgebra = { version = "0.32" } [features] nightly = [] nobuild = ["raylib-sys/nobuild"] with_serde = ["serde", "serde_json"] -nalgebra_interop = ["nalgebra"] wayland = ["raylib-sys/wayland"] [package.metadata.docs.rs] diff --git a/raylib/src/core/collision.rs b/raylib/src/core/collision.rs index 4cd7fc16..35423277 100644 --- a/raylib/src/core/collision.rs +++ b/raylib/src/core/collision.rs @@ -1,9 +1,10 @@ //! Common collision handling code -use crate::core::math::{BoundingBox, Ray, Rectangle, Vector2}; -use crate::core::models::Model; -use crate::ffi; -use crate::math::{Matrix, RayCollision}; -use crate::models::Mesh; +use crate::{ + core::math::{BoundingBox, Ray, Rectangle, Vector2}, + ffi, + math::{Matrix, RayCollision}, + models::Mesh, +}; impl Rectangle { /// Check collision between two rectangles @@ -76,6 +77,11 @@ pub fn check_collision_point_triangle( unsafe { ffi::CheckCollisionPointTriangle(point.into(), p1.into(), p2.into(), p3.into()) } } +#[inline] +pub fn check_collision_point_poly(point: Vector2, points: &[Vector2]) -> bool { + unsafe { ffi::CheckCollisionPointPoly(point.into(), points.as_ptr() as _, points.len() as _) } +} + /// Check the collision between two lines defined by two points each, returns collision point by reference #[inline] pub fn check_collision_lines( @@ -102,6 +108,16 @@ pub fn check_collision_lines( } } +#[inline] +pub fn check_collision_point_line( + point: Vector2, + p1: Vector2, + p2: Vector2, + threshold: i32, +) -> bool { + unsafe { ffi::CheckCollisionPointLine(point.into(), p1.into(), p2.into(), threshold) } +} + /// Detects collision between two spheres. #[inline] pub fn check_collision_spheres( diff --git a/raylib/src/core/math.rs b/raylib/src/core/math.rs deleted file mode 100644 index a912b5b6..00000000 --- a/raylib/src/core/math.rs +++ /dev/null @@ -1,2145 +0,0 @@ -/* raylib-rs - raymath.rs - Structs and functions for game-related math and linear algebra - -Copyright (c) 2018-2019 Paul Clement (@deltaphc) - -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. -*/ - -use crate::ffi; -use crate::misc::AsF32; -use std::f32::consts::PI; -use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; - -#[cfg(feature = "with_serde")] -use serde::{Deserialize, Serialize}; -#[cfg(feature = "nalgebra_interop")] -use nalgebra as na; - -macro_rules! optional_serde_struct { - ($def:item) => { - cfg_if::cfg_if! { - if #[cfg(feature = "with_serde")] { - #[repr(C)] - #[derive(Default, Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] - $def - } else { - #[repr(C)] - #[derive(Default, Debug, Copy, Clone, PartialEq)] - $def - } - } - } -} - -optional_serde_struct! { - pub struct Vector2 { - pub x: f32, - pub y: f32, - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector2 { - fn from(v: na::Vector2) -> Vector2 { - Vector2 { - x: v.x, - y: v.y - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector2 { - fn from(v: na::base::coordinates::XY) -> Vector2 { - Vector2 { - x: v.x, - y: v.y - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Vector2 { - fn into(self) -> na::Vector2 { - na::Vector2::new(self.x, self.y) - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector2 { - fn from(v: na::Vector2) -> Vector2 { - Vector2 { x: v.x, y: v.y } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector2 { - fn from(v: na::base::coordinates::XY) -> Vector2 { - Vector2 { x: v.x, y: v.y } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Vector2 { - fn into(self) -> na::Vector2 { - na::Vector2::new(self.x, self.y) - } -} - -impl From for Vector2 { - fn from(v: ffi::Vector2) -> Vector2 { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for Vector2 { - fn into(self) -> ffi::Vector2 { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Vector2 { - fn into(self) -> ffi::Vector2 { - ffi::Vector2 { - x: self.x, - y: self.y, - } - } -} - -/// A convenience function for linearly interpolating an `f32`. -#[inline] -pub fn lerp(v0: f32, v1: f32, amount: f32) -> f32 { - return v0 + amount * (v1 - v0); -} - -/// A convenience function for making a new `Vector2`. -#[inline] -pub fn rvec2(x: T1, y: T2) -> Vector2 { - Vector2::new(x.as_f32(), y.as_f32()) -} - -/// A convenience function for making a new `Vector3`. -#[inline] -pub fn rvec3(x: T1, y: T2, z: T3) -> Vector3 { - Vector3::new(x.as_f32(), y.as_f32(), z.as_f32()) -} - -/// A convenience function for making a new `Quaternion`. -#[inline] -pub fn rquat(x: T1, y: T2, z: T3, w: T4) -> Quaternion { - Quaternion::new(x.as_f32(), y.as_f32(), z.as_f32(), w.as_f32()) -} - -/// A convenience function for making a new `Rectangle`. -#[inline] -pub fn rrect( - x: T1, - y: T2, - width: T3, - height: T4, -) -> Rectangle { - Rectangle::new(x.as_f32(), y.as_f32(), width.as_f32(), height.as_f32()) -} - -impl Vector2 { - /// Constant `Vector2` with both components set to zero. - const ZERO: Vector2 = Vector2 { x: 0.0, y: 0.0 }; - - /// Constant `Vector2` with both components set to one. - const ONE: Vector2 = Vector2 { x: 1.0, y: 1.0 }; - - /// Returns a new `Vector2` with specified components. - pub const fn new(x: f32, y: f32) -> Vector2 { - Vector2 { x, y } - } - - /// Returns a new `Vector2` with both components set to zero. - #[inline] - pub const fn zero() -> Vector2 { - Vector2 { x: 0.0, y: 0.0 } - } - - /// Returns a new `Vector2` with both components set to one. - #[inline] - pub const fn one() -> Vector2 { - Vector2 { x: 1.0, y: 1.0 } - } - - /// Calculates the vector length. - pub fn length(&self) -> f32 { - ((self.x * self.x) + (self.y * self.y)).sqrt() - } - - /// Calculates the vector length square (**2); - pub fn length_sqr(&self) -> f32 { - (self.x * self.x) + (self.y * self.y) - } - - /// Calculates the dot product with vector `v`. - pub fn dot(&self, v: Vector2) -> f32 { - self.x * v.x + self.y * v.y - } - - /// Calculates the distance towards vector `v`. - pub fn distance_to(&self, v: Vector2) -> f32 { - ((self.x - v.x) * (self.x - v.x) + (self.y - v.y) * (self.y - v.y)).sqrt() - } - - /// Calculates the angle towards vector `v` in radians. - pub fn angle_to(&self, v: Vector2) -> f32 { - let mut result = (v.y - self.y).atan2(v.x - self.x); - if result < 0.0 { - result += 2.0 * PI; - } - result - } - - /// Scales the vector by multiplying both components by `scale`. - pub fn scale(&mut self, scale: f32) { - *self *= scale; - } - - /// Returns a new `Vector2` with components scaled by `scale`. - pub fn scale_by(&self, scale: f32) -> Vector2 { - *self * scale - } - - /// Normalizes the vector. - pub fn normalize(&mut self) { - *self = self.normalized(); - } - - /// Returns a new `Vector2` with normalized components from the current vector. - pub fn normalized(&self) -> Vector2 { - let length_sqr = self.length_sqr(); - if length_sqr == 0.0 { - return *self; - } - *self / length_sqr.sqrt() - } - - /// Returns a new `Vector2` with componenets linearly interpolated by `amount` towards vector `v`. - pub fn lerp(&self, v: Vector2, amount: f32) -> Vector2 { - Vector2 { - x: self.x + amount * (v.x - self.x), - y: self.y + amount * (v.y - self.y), - } - } - - /// Returns a new `Vector2` with componenets clamp to a certain interval. - pub fn clamp(&self, min: f32, max: f32) -> Vector2 { - Vector2 { - x: self.x.clamp(min, max), - y: self.y.clamp(min, max), - } - } -} - -impl From<(f32, f32)> for Vector2 { - #[inline] - fn from((x, y): (f32, f32)) -> Vector2 { - Vector2 { x, y } - } -} - -impl Add for Vector2 { - type Output = Vector2; - fn add(self, v: Vector2) -> Self { - Vector2 { - x: self.x + v.x, - y: self.y + v.y, - } - } -} - -impl Add for Vector2 { - type Output = Vector2; - fn add(self, value: f32) -> Self { - Vector2 { - x: self.x + value, - y: self.y + value, - } - } -} - -impl AddAssign for Vector2 { - fn add_assign(&mut self, v: Vector2) { - *self = *self + v; - } -} - -impl AddAssign for Vector2 { - fn add_assign(&mut self, value: f32) { - *self = *self + value; - } -} - -impl Sub for Vector2 { - type Output = Vector2; - fn sub(self, v: Vector2) -> Self { - Vector2 { - x: self.x - v.x, - y: self.y - v.y, - } - } -} - -impl Sub for Vector2 { - type Output = Vector2; - fn sub(self, value: f32) -> Self { - Vector2 { - x: self.x - value, - y: self.y - value, - } - } -} - -impl SubAssign for Vector2 { - fn sub_assign(&mut self, v: Vector2) { - *self = *self - v; - } -} - -impl SubAssign for Vector2 { - fn sub_assign(&mut self, value: f32) { - *self = *self - value; - } -} - -impl Mul for Vector2 { - type Output = Vector2; - fn mul(self, v: Vector2) -> Self { - Vector2 { - x: self.x * v.x, - y: self.y * v.y, - } - } -} - -impl Mul for Vector2 { - type Output = Vector2; - fn mul(self, value: f32) -> Self { - Vector2 { - x: self.x * value, - y: self.y * value, - } - } -} - -impl MulAssign for Vector2 { - fn mul_assign(&mut self, v: Vector2) { - *self = *self * v; - } -} - -impl MulAssign for Vector2 { - fn mul_assign(&mut self, value: f32) { - *self = *self * value; - } -} - -impl Div for Vector2 { - type Output = Vector2; - fn div(self, v: Vector2) -> Self { - Vector2 { - x: self.x / v.x, - y: self.y / v.y, - } - } -} - -impl Div for Vector2 { - type Output = Vector2; - fn div(self, value: f32) -> Self { - Vector2 { - x: self.x / value, - y: self.y / value, - } - } -} - -impl DivAssign for Vector2 { - fn div_assign(&mut self, v: Vector2) { - *self = *self / v; - } -} - -impl DivAssign for Vector2 { - fn div_assign(&mut self, value: f32) { - *self = *self / value; - } -} - -impl Neg for Vector2 { - type Output = Vector2; - fn neg(self) -> Self { - Vector2 { - x: -self.x, - y: -self.y, - } - } -} - -optional_serde_struct! { - pub struct Vector3 { - pub x: f32, - pub y: f32, - pub z: f32, - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector3 { - fn from(v: na::Vector3) -> Vector3 { - Vector3 { - x: v.x, - y: v.y, - z: v.z - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector3 { - fn from(v: na::base::coordinates::XYZ) -> Vector3 { - Vector3 { - x: v.x, - y: v.y, - z: v.z - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Vector3 { - fn into(self) -> na::Vector3 { - na::Vector3::new(self.x, self.y, self.z) - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector3 { - fn from(v: na::Vector3) -> Vector3 { - Vector3 { - x: v.x, - y: v.y, - z: v.z, - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector3 { - fn from(v: na::base::coordinates::XYZ) -> Vector3 { - Vector3 { - x: v.x, - y: v.y, - z: v.z, - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Vector3 { - fn into(self) -> na::Vector3 { - na::Vector3::new(self.x, self.y, self.z) - } -} - -impl From for Vector3 { - fn from(v: ffi::Vector3) -> Vector3 { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for Vector3 { - fn into(self) -> ffi::Vector3 { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Vector3 { - fn into(self) -> ffi::Vector3 { - ffi::Vector3 { - x: self.x, - y: self.y, - z: self.z, - } - } -} - -impl Vector3 { - /// Returns a new `Vector3` with specified components. - pub const fn new(x: f32, y: f32, z: f32) -> Vector3 { - Vector3 { x, y, z } - } - - pub fn up() -> Vector3 { - Vector3::new(0.0, 1.0, 0.0) - } - - pub fn forward() -> Vector3 { - Vector3::new(0.0, 0.0, 1.0) - } - - pub fn right() -> Vector3 { - Vector3::new(1.0, 0.0, 0.0) - } - - pub fn left() -> Vector3 { - Vector3::new(-1.0, 0.0, 0.0) - } - - /// Returns a new `Vector3` with all components set to zero. - pub fn zero() -> Vector3 { - Vector3 { - x: 0.0, - y: 0.0, - z: 0.0, - } - } - - /// Returns a new `Vector3` with all components set to one. - pub fn one() -> Vector3 { - Vector3 { - x: 1.0, - y: 1.0, - z: 1.0, - } - } - - /// Returns a new `Vector3` containing the cross product between `self` and vector `v`. - pub fn cross(&self, v: Vector3) -> Vector3 { - Vector3 { - x: self.y * v.z - self.z * v.y, - y: self.z * v.x - self.x * v.z, - z: self.x * v.y - self.y * v.x, - } - } - - /// Returns a new `Vector3` perpendicular to `self`. - pub fn perpendicular(&self) -> Vector3 { - let mut min = self.x.abs(); - let mut cardinal_axis = Vector3 { - x: 1.0, - y: 0.0, - z: 0.0, - }; - - if self.y.abs() < min { - min = self.y.abs(); - cardinal_axis = Vector3 { - x: 0.0, - y: 1.0, - z: 0.0, - }; - } - - if self.z.abs() < min { - cardinal_axis = Vector3 { - x: 0.0, - y: 0.0, - z: 1.0, - }; - } - - self.cross(cardinal_axis) - } - - /// Calculates the vector length. - pub fn length(&self) -> f32 { - (self.x * self.x + self.y * self.y + self.z * self.z).sqrt() - } - - /// Calculates the dot product with vector `v`. - pub fn dot(&self, v: Vector3) -> f32 { - self.x * v.x + self.y * v.y + self.z * v.z - } - - /// Calculates the distance towards vector `v`. - pub fn distance_to(&self, v: Vector3) -> f32 { - let dx = v.x - self.x; - let dy = v.y - self.y; - let dz = v.z - self.z; - (dx * dx + dy * dy + dz * dz).sqrt() - } - - /// Scales the vector by multiplying both components by `scale`. - pub fn scale(&mut self, scale: f32) { - *self *= scale; - } - - /// Returns a new `Vector3` with components scaled by `scale`. - pub fn scale_by(&self, scale: f32) -> Vector3 { - *self * scale - } - - /// Normalizes the current vector. - pub fn normalize(&mut self) { - *self = self.normalized(); - } - - /// Returns a new `Vector3` with normalized components from the current vector. - pub fn normalized(&self) -> Vector3 { - let mut length = self.length(); - if length == 0.0 { - length = 1.0; - } - let ilength = 1.0 / length; - - Vector3 { - x: self.x * ilength, - y: self.y * ilength, - z: self.z * ilength, - } - } - - /// Normalizes and changes both `self` and `v` to be orthogonal to eachother. - pub fn ortho_normalize(&mut self, v: &mut Vector3) { - *self = self.normalized(); - let vn = self.cross(*v).normalized(); - *v = vn.cross(*self); - } - - /// Transforms the current vector using Matrix `mat`. - pub fn transform(&mut self, mat: Matrix) { - *self = self.transform_with(mat); - } - - /// Returns a new `Vector3` containing components transformed by Matrix `mat`. - pub fn transform_with(&self, mat: Matrix) -> Vector3 { - Vector3 { - x: mat.m0 * self.x + mat.m4 * self.y + mat.m8 * self.z + mat.m12, - y: mat.m1 * self.x + mat.m5 * self.y + mat.m9 * self.z + mat.m13, - z: mat.m2 * self.x + mat.m6 * self.y + mat.m10 * self.z + mat.m14, - } - } - - /// Rotates the current vector using Quaternion `q`. - pub fn rotate(&mut self, q: Quaternion) { - *self = self.rotate_by(q); - } - - /// Returns a new `Vector3` with components rotated by Quaternion `q`. - pub fn rotate_by(&self, q: Quaternion) -> Vector3 { - Vector3 { - x: self.x * (q.x * q.x + q.w * q.w - q.y * q.y - q.z * q.z) - + self.y * (2.0 * q.x * q.y - 2.0 * q.w * q.z) - + self.z * (2.0 * q.x * q.z + 2.0 * q.w * q.y), - y: self.x * (2.0 * q.w * q.z + 2.0 * q.x * q.y) - + self.y * (q.w * q.w - q.x * q.x + q.y * q.y - q.z * q.z) - + self.z * (-2.0 * q.w * q.x + 2.0 * q.y * q.z), - z: self.x * (-2.0 * q.w * q.y + 2.0 * q.x * q.z) - + self.y * (2.0 * q.w * q.x + 2.0 * q.y * q.z) - + self.z * (q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z), - } - } - - /// Returns a new `Vector3` with componenets linearly interpolated by `amount` towards vector `v`. - pub fn lerp(&self, v: Vector3, amount: f32) -> Vector3 { - Vector3 { - x: self.x + amount * (v.x - self.x), - y: self.y + amount * (v.y - self.y), - z: self.z + amount * (v.z - self.z), - } - } - - /// Reflects the current vector from `normal`. - pub fn reflect(&mut self, normal: Vector3) { - *self = self.reflect_from(normal); - } - - /// Returns a new `Vector3` reflected from the current vector using `normal`. - pub fn reflect_from(&self, normal: Vector3) -> Vector3 { - let dot_product = self.dot(normal); - Vector3 { - x: self.x - (2.0 * normal.x) * dot_product, - y: self.y - (2.0 * normal.y) * dot_product, - z: self.z - (2.0 * normal.z) * dot_product, - } - } - - /// Returns a new `Vector3` containing the minimum of each corresponding component. - pub fn min(&self, v: Vector3) -> Vector3 { - Vector3 { - x: self.x.min(v.x), - y: self.y.min(v.y), - z: self.z.min(v.z), - } - } - - /// Returns a new `Vector3` containing the maximum of each corresponding component. - pub fn max(&self, v: Vector3) -> Vector3 { - Vector3 { - x: self.x.max(v.x), - y: self.y.max(v.y), - z: self.z.max(v.z), - } - } - - /// Returns barycenter coordinates (u, v, w) from point p (current vector) with respect to triangle (`a`, `b`, `c`). - pub fn barycenter(&self, a: Vector3, b: Vector3, c: Vector3) -> Vector3 { - let v0 = b - a; - let v1 = c - a; - let v2 = *self - a; - let d00 = v0.dot(v0); - let d01 = v0.dot(v1); - let d11 = v1.dot(v1); - let d20 = v2.dot(v0); - let d21 = v2.dot(v1); - let denom = d00 * d11 - d01 * d01; - - let y = (d11 * d20 - d01 * d21) / denom; - let z = (d00 * d21 - d01 * d20) / denom; - Vector3 { - x: 1.0 - (z + y), - y, - z, - } - } - - /// Returns a 3-length `f32` array containing components `[x, y, z]` of the current vector. - pub fn to_array(&self) -> [f32; 3] { - [self.x, self.y, self.z] - } - - /// Returns a new `Vector3` with componenets clamp to a certain interval. - pub fn clamp(&self, min: f32, max: f32) -> Vector3 { - Vector3 { - x: self.x.clamp(min, max), - y: self.y.clamp(min, max), - z: self.z.clamp(min, max), - } - } -} - -impl From<(f32, f32, f32)> for Vector3 { - #[inline] - fn from((x, y, z): (f32, f32, f32)) -> Vector3 { - Vector3 { x, y, z } - } -} - -impl Add for Vector3 { - type Output = Vector3; - fn add(self, v: Vector3) -> Self { - Vector3 { - x: self.x + v.x, - y: self.y + v.y, - z: self.z + v.z, - } - } -} - -impl Add for Vector3 { - type Output = Vector3; - fn add(self, value: f32) -> Self { - Vector3 { - x: self.x + value, - y: self.y + value, - z: self.z + value, - } - } -} - -impl AddAssign for Vector3 { - fn add_assign(&mut self, v: Vector3) { - *self = *self + v; - } -} - -impl AddAssign for Vector3 { - fn add_assign(&mut self, value: f32) { - *self = *self + value; - } -} - -impl Sub for Vector3 { - type Output = Vector3; - fn sub(self, v: Vector3) -> Self { - Vector3 { - x: self.x - v.x, - y: self.y - v.y, - z: self.z - v.z, - } - } -} - -impl Sub for Vector3 { - type Output = Vector3; - fn sub(self, value: f32) -> Self { - Vector3 { - x: self.x - value, - y: self.y - value, - z: self.z - value, - } - } -} - -impl SubAssign for Vector3 { - fn sub_assign(&mut self, v: Vector3) { - *self = *self - v; - } -} - -impl SubAssign for Vector3 { - fn sub_assign(&mut self, value: f32) { - *self = *self - value; - } -} - -impl Mul for Vector3 { - type Output = Vector3; - fn mul(self, v: Vector3) -> Self { - Vector3 { - x: self.x * v.x, - y: self.y * v.y, - z: self.z * v.z, - } - } -} - -impl Mul for Vector3 { - type Output = Vector3; - fn mul(self, value: f32) -> Self { - Vector3 { - x: self.x * value, - y: self.y * value, - z: self.z * value, - } - } -} - -impl MulAssign for Vector3 { - fn mul_assign(&mut self, v: Vector3) { - *self = *self * v; - } -} - -impl MulAssign for Vector3 { - fn mul_assign(&mut self, value: f32) { - *self = *self * value; - } -} - -impl Div for Vector3 { - type Output = Vector3; - fn div(self, v: Vector3) -> Self { - Vector3 { - x: self.x / v.x, - y: self.y / v.y, - z: self.z / v.z, - } - } -} - -impl Div for Vector3 { - type Output = Vector3; - fn div(self, value: f32) -> Self { - Vector3 { - x: self.x / value, - y: self.y / value, - z: self.z / value, - } - } -} - -impl DivAssign for Vector3 { - fn div_assign(&mut self, v: Vector3) { - *self = *self / v; - } -} - -impl DivAssign for Vector3 { - fn div_assign(&mut self, value: f32) { - *self = *self / value; - } -} - -impl Neg for Vector3 { - type Output = Vector3; - fn neg(self) -> Self { - Vector3 { - x: -self.x, - y: -self.y, - z: -self.z, - } - } -} - -optional_serde_struct! { - pub struct Vector4 { - pub x: f32, - pub y: f32, - pub z: f32, - pub w: f32, - } -} - -pub type Quaternion = Vector4; - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector4 { - fn from(v: na::Vector4) -> Vector4 { - Vector4 { - x: v.x, - y: v.y, - z: v.z, - w: v.w - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Vector4 { - fn from(v: na::base::coordinates::XYZW) -> Vector4 { - Vector4 { - x: v.x, - y: v.y, - z: v.z, - w: v.w - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Vector4 { - fn into(self) -> na::Vector4 { - na::Vector4::new(self.x, self.y, self.z, self.w) - } -} - -impl From for Vector4 { - fn from(v: ffi::Vector4) -> Vector4 { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for Vector4 { - fn into(self) -> ffi::Vector4 { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Vector4 { - fn into(self) -> ffi::Vector4 { - ffi::Vector4 { - x: self.x, - y: self.y, - z: self.z, - w: self.w, - } - } -} - -impl Quaternion { - /// Returns a new `Quaternion` with specified components. - pub const fn new(x: f32, y: f32, z: f32, w: f32) -> Quaternion { - Quaternion { x, y, z, w } - } - - /// Returns the identity quaternion. - pub fn identity() -> Quaternion { - Quaternion { - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - } - } - - /// Returns quaternion based on the rotation from one vector to another. - pub fn from_vec3_pair(from: Vector3, to: Vector3) -> Quaternion { - let cross = from.cross(to); - Quaternion { - x: cross.x, - y: cross.y, - z: cross.y, - w: 1.0 + from.dot(to), - } - .normalized() - } - - /// Returns a quaternion for a given rotation matrix. - pub fn from_matrix(mat: Matrix) -> Quaternion { - let trace = mat.trace(); - - if trace > 0.0 { - let s = (trace + 1.0).sqrt() * 2.0; - let inv_s = 1.0 / s; - - Quaternion { - w: s * 0.25, - x: (mat.m6 - mat.m9) * inv_s, - y: (mat.m8 - mat.m2) * inv_s, - z: (mat.m1 - mat.m4) * inv_s, - } - } else { - let m00 = mat.m0; - let m11 = mat.m5; - let m22 = mat.m10; - - if m00 > m11 && m00 > m22 { - let s = (1.0 + m00 - m11 - m22).sqrt() * 2.0; - let inv_s = 1.0 / s; - - Quaternion { - w: (mat.m6 - mat.m9) * inv_s, - x: s * 0.25, - y: (mat.m4 + mat.m1) * inv_s, - z: (mat.m8 + mat.m2) * inv_s, - } - } else if m11 > m22 { - let s = (1.0 + m11 - m00 - m22).sqrt() * 2.0; - let inv_s = 1.0 / s; - - Quaternion { - w: (mat.m8 - mat.m2) * inv_s, - x: (mat.m4 + mat.m1) * inv_s, - y: s * 0.25, - z: (mat.m9 + mat.m6) * inv_s, - } - } else { - let s = (1.0 + m22 - m00 - m11).sqrt() * 2.0; - let inv_s = 1.0 / s; - - Quaternion { - w: (mat.m1 - mat.m4) * inv_s, - x: (mat.m8 + mat.m2) * inv_s, - y: (mat.m9 + mat.m6) * inv_s, - z: s * 0.25, - } - } - } - } - - /// Returns a rotation matrix for the current quaternion. - pub fn to_matrix(&self) -> Matrix { - let x = self.x; - let y = self.y; - let z = self.z; - let w = self.w; - - let x2 = x + x; - let y2 = y + y; - let z2 = z + z; - - let length = self.length(); - let length_squared = length * length; - - let xx = x * x2 / length_squared; - let xy = x * y2 / length_squared; - let xz = x * z2 / length_squared; - - let yy = y * y2 / length_squared; - let yz = y * z2 / length_squared; - let zz = z * z2 / length_squared; - - let wx = w * x2 / length_squared; - let wy = w * y2 / length_squared; - let wz = w * z2 / length_squared; - - Matrix { - m0: 1.0 - (yy + zz), - m1: xy - wz, - m2: xz + wy, - m3: 0.0, - m4: xy + wz, - m5: 1.0 - (xx + zz), - m6: yz - wx, - m7: 0.0, - m8: xz - wy, - m9: yz + wx, - m10: 1.0 - (xx + yy), - m11: 0.0, - m12: 0.0, - m13: 0.0, - m14: 0.0, - m15: 1.0, - } - } - - /// Returns a quaternion equivalent to Euler angles. - pub fn from_euler(roll: f32, pitch: f32, yaw: f32) -> Quaternion { - let x0 = (roll * 0.5).cos(); - let x1 = (roll * 0.5).sin(); - let y0 = (pitch * 0.5).cos(); - let y1 = (pitch * 0.5).sin(); - let z0 = (yaw * 0.5).cos(); - let z1 = (yaw * 0.5).sin(); - - Quaternion { - x: (x1 * y0 * z0) - (x0 * y1 * z1), - y: (x0 * y1 * z0) + (x1 * y0 * z1), - z: (x0 * y0 * z1) - (x1 * y1 * z0), - w: (x0 * y0 * z0) + (x1 * y1 * z1), - } - } - - /// Returns a vector containing Euler angles in radians (roll, pitch, yaw), based on the current quaternion. - pub fn to_euler(&self) -> Vector3 { - // roll (x-axis rotation) - let x0 = 2.0 * (self.w * self.x + self.y * self.z); - let x1 = 1.0 - 2.0 * (self.x * self.x + self.y * self.y); - - // pitch (y-axis rotation) - let mut y0 = 2.0 * (self.w * self.y - self.z * self.x); - y0 = if y0 > 1.0 { 1.0 } else { y0 }; - y0 = if y0 < -1.0 { -1.0 } else { y0 }; - - // yaw (z-axis rotation) - let z0 = 2.0 * (self.w * self.z + self.x * self.y); - let z1 = 1.0 - 2.0 * (self.y * self.y + self.z * self.z); - - Vector3 { - x: x0.atan2(x1), - y: y0.asin(), - z: z0.atan2(z1), - } - } - - /// Returns rotation quaternion for an `axis` and `angle` (in radians). - pub fn from_axis_angle(axis: Vector3, angle: f32) -> Quaternion { - let mut result = Quaternion::identity(); - let mut axis = axis; - let mut angle = angle; - - if axis.length() != 0.0 { - angle *= 0.5; - } - - axis.normalize(); - - let sinres = angle.sin(); - let cosres = angle.cos(); - - result.x = axis.x * sinres; - result.y = axis.y * sinres; - result.z = axis.z * sinres; - result.w = cosres; - result.normalized() - } - - /// Returns a 2-tuple containing the axis (`Vector3`) and angle (`f32` in radians) for the current quaternion. - pub fn to_axis_angle(&self) -> (Vector3, f32) { - let mut q = *self; - if q.w.abs() > 1.0 { - q = q.normalized(); - } - - let mut res_axis = Vector3::zero(); - let res_angle = 2.0 * q.w.acos(); - let den = (1.0 - q.w * q.w).sqrt(); - - if den > 0.0001 { - res_axis.x = q.x / den; - res_axis.y = q.y / den; - res_axis.z = q.z / den; - } else { - // This occurs when the angle is zero. - // Not a problem: just set an arbitrary normalized axis. - res_axis.x = 1.0; - } - - (res_axis, res_angle) - } - - /// Computes the length of the current quaternion. - pub fn length(&self) -> f32 { - (self.x * self.x + self.y * self.y + self.z * self.z + self.w * self.w).sqrt() - } - - /// Returns a normalized version of the current quaternion. - pub fn normalized(&self) -> Quaternion { - let mut length = self.length(); - if length == 0.0 { - length = 1.0; - } - let ilength = 1.0 / length; - - Quaternion { - x: self.x * ilength, - y: self.y * ilength, - z: self.z * ilength, - w: self.w * ilength, - } - } - - /// Returns an inverted version of the current quaternion. - pub fn inverted(&self) -> Quaternion { - let mut result = *self; - let length = self.length(); - let length_sq = length * length; - - if length_sq != 0.0 { - let i = 1.0 / length_sq; - result.x *= -i; - result.y *= -i; - result.z *= -i; - result.w *= i; - } - result - } - - /// Calculates linear interpolation between current and `q` quaternions. - pub fn lerp(&self, q: Quaternion, amount: f32) -> Quaternion { - Quaternion { - x: self.x + amount * (q.x - self.x), - y: self.y + amount * (q.y - self.y), - z: self.z + amount * (q.z - self.z), - w: self.w + amount * (q.w - self.w), - } - } - - /// Calculates slerp-optimized interpolation between current and `q` quaternions. - pub fn nlerp(&self, q: Quaternion, amount: f32) -> Quaternion { - self.lerp(q, amount).normalized() - } - - /// Calculates spherical linear interpolation between current and `q` quaternions. - pub fn slerp(&self, q: Quaternion, amount: f32) -> Quaternion { - let cos_half_theta = self.x * q.x + self.y * q.y + self.z * q.z + self.w * q.w; - - if cos_half_theta.abs() >= 1.0 { - *self - } else if cos_half_theta > 0.95 { - self.nlerp(q, amount) - } else { - let half_theta = cos_half_theta.acos(); - let sin_half_theta = (1.0 - cos_half_theta * cos_half_theta).sqrt(); - - if sin_half_theta.abs() < 0.001 { - Quaternion { - x: (self.x * 0.5 + q.x * 0.5), - y: (self.y * 0.5 + q.y * 0.5), - z: (self.z * 0.5 + q.z * 0.5), - w: (self.w * 0.5 + q.w * 0.5), - } - } else { - let ratio_a = ((1.0 - amount) * half_theta).sin() / sin_half_theta; - let ratio_b = (amount * half_theta).sin() / sin_half_theta; - - Quaternion { - x: (self.x * ratio_a + q.x * ratio_b), - y: (self.y * ratio_a + q.y * ratio_b), - z: (self.z * ratio_a + q.z * ratio_b), - w: (self.w * ratio_a + q.w * ratio_b), - } - } - } - } - - /// Returns a transformed version of the current quaternion given a transformation matrix. - pub fn transform(&self, mat: Matrix) -> Quaternion { - Quaternion { - x: mat.m0 * self.x + mat.m4 * self.y + mat.m8 * self.z + mat.m12 * self.w, - y: mat.m1 * self.x + mat.m5 * self.y + mat.m9 * self.z + mat.m13 * self.w, - z: mat.m2 * self.x + mat.m6 * self.y + mat.m10 * self.z + mat.m14 * self.w, - w: mat.m3 * self.x + mat.m7 * self.y + mat.m11 * self.z + mat.m15 * self.w, - } - } - - /// Returns a new `Quaternion` with componenets clamp to a certain interval. - pub fn clamp(&self, min: f32, max: f32) -> Quaternion { - Quaternion { - x: self.x.clamp(min, max), - y: self.y.clamp(min, max), - z: self.z.clamp(min, max), - w: self.w.clamp(min, max), - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Quaternion { - fn from(q: na::geometry::Quaternion) -> Quaternion { - Quaternion { - x: q.coords.x, - y: q.coords.y, - z: q.coords.z, - w: q.coords.w, - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Quaternion { - fn into(self) -> na::geometry::Quaternion { - na::geometry::Quaternion::new(self.x, self.y, self.z, self.w) - } -} - -#[cfg(feature = "nalgebra_interop")] -impl From> for Quaternion { - fn from(q: na::geometry::Quaternion) -> Quaternion { - Quaternion { - x: q.coords.x, - y: q.coords.y, - z: q.coords.z, - w: q.coords.w - } - } -} - -#[cfg(feature = "nalgebra_interop")] -impl Into> for Quaternion { - fn into(self) -> na::geometry::Quaternion { - na::geometry::Quaternion::new(self.x, self.y, self.z, self.w) - } -} - -impl From<(f32, f32, f32, f32)> for Quaternion { - #[inline] - fn from((x, y, z, w): (f32, f32, f32, f32)) -> Quaternion { - Quaternion { x, y, z, w } - } -} - -impl Mul for Quaternion { - type Output = Quaternion; - fn mul(self, q: Quaternion) -> Quaternion { - let qax = self.x; - let qay = self.y; - let qaz = self.z; - let qaw = self.w; - let qbx = q.x; - let qby = q.y; - let qbz = q.z; - let qbw = q.w; - - Quaternion { - x: (qax * qbw) + (qaw * qbx) + (qay * qbz) - (qaz * qby), - y: (qay * qbw) + (qaw * qby) + (qaz * qbx) - (qax * qbz), - z: (qaz * qbw) + (qaw * qbz) + (qax * qby) - (qay * qbx), - w: (qaw * qbw) - (qax * qbx) - (qay * qby) - (qaz * qbz), - } - } -} - -impl MulAssign for Quaternion { - fn mul_assign(&mut self, q: Quaternion) { - *self = *self * q; - } -} - -optional_serde_struct! { - pub struct Matrix { - pub m0: f32, - pub m4: f32, - pub m8: f32, - pub m12: f32, - pub m1: f32, - pub m5: f32, - pub m9: f32, - pub m13: f32, - pub m2: f32, - pub m6: f32, - pub m10: f32, - pub m14: f32, - pub m3: f32, - pub m7: f32, - pub m11: f32, - pub m15: f32, - } -} - -impl From for Matrix { - fn from(r: ffi::Matrix) -> Matrix { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for Matrix { - fn into(self) -> ffi::Matrix { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Matrix { - fn into(self) -> ffi::Matrix { - ffi::Matrix { - m0: self.m0, - m4: self.m4, - m8: self.m8, - m12: self.m12, - m1: self.m1, - m5: self.m5, - m9: self.m9, - m13: self.m13, - m2: self.m2, - m6: self.m6, - m10: self.m10, - m14: self.m14, - m3: self.m3, - m7: self.m7, - m11: self.m11, - m15: self.m15, - } - } -} - -impl Matrix { - /// Returns the identity matrix. - pub fn identity() -> Matrix { - Matrix { - m0: 1.0, - m4: 0.0, - m8: 0.0, - m12: 0.0, - m1: 0.0, - m5: 1.0, - m9: 0.0, - m13: 0.0, - m2: 0.0, - m6: 0.0, - m10: 1.0, - m14: 0.0, - m3: 0.0, - m7: 0.0, - m11: 0.0, - m15: 1.0, - } - } - - /// Returns the zero matriz. - pub fn zero() -> Matrix { - Matrix { - m0: 0.0, - m4: 0.0, - m8: 0.0, - m12: 0.0, - m1: 0.0, - m5: 0.0, - m9: 0.0, - m13: 0.0, - m2: 0.0, - m6: 0.0, - m10: 0.0, - m14: 0.0, - m3: 0.0, - m7: 0.0, - m11: 0.0, - m15: 0.0, - } - } - - /// Returns a translation matrix. - pub fn translate(x: f32, y: f32, z: f32) -> Matrix { - Matrix { - m0: 1.0, - m4: 0.0, - m8: 0.0, - m12: x, - m1: 0.0, - m5: 1.0, - m9: 0.0, - m13: y, - m2: 0.0, - m6: 0.0, - m10: 1.0, - m14: z, - m3: 0.0, - m7: 0.0, - m11: 0.0, - m15: 1.0, - } - } - - /// Returns a rotation matrix. - pub fn rotate(axis: Vector3, angle: f32) -> Matrix { - let mut x = axis.x; - let mut y = axis.y; - let mut z = axis.z; - let mut length = (x * x + y * y + z * z).sqrt(); - - if (length != 1.0) && (length != 0.0) { - length = 1.0 / length; - x *= length; - y *= length; - z *= length; - } - - let sinres = angle.sin(); - let cosres = angle.cos(); - let t = 1.0 - cosres; - - Matrix { - m0: (x * x * t) + cosres, - m1: (y * x * t) + (z * sinres), - m2: (z * x * t) - (y * sinres), - m3: 0.0, - - m4: (x * y * t) - (z * sinres), - m5: (y * y * t) + cosres, - m6: (z * y * t) + (x * sinres), - m7: 0.0, - - m8: (x * z * t) + (y * sinres), - m9: (y * z * t) - (x * sinres), - m10: (z * z * t) + cosres, - m11: 0.0, - - m12: 0.0, - m13: 0.0, - m14: 0.0, - m15: 1.0, - } - } - - /// Returns a translation matrix around the X axis. - pub fn rotate_x(angle: f32) -> Matrix { - let mut result = Matrix::identity(); - - let cosres = angle.cos(); - let sinres = angle.sin(); - - result.m5 = cosres; - result.m6 = -sinres; - result.m9 = sinres; - result.m10 = cosres; - result - } - - /// Returns a translation matrix around the Y axis. - pub fn rotate_y(angle: f32) -> Matrix { - let mut result = Matrix::identity(); - - let cosres = angle.cos(); - let sinres = angle.sin(); - - result.m0 = cosres; - result.m2 = sinres; - result.m8 = -sinres; - result.m10 = cosres; - result - } - - /// Returns a translation matrix around the Z axis. - pub fn rotate_z(angle: f32) -> Matrix { - let mut result = Matrix::identity(); - - let cosres = angle.cos(); - let sinres = angle.sin(); - - result.m0 = cosres; - result.m1 = -sinres; - result.m4 = sinres; - result.m5 = cosres; - result - } - - /// Returns xyz-rotation matrix (angles in radians) - pub fn rotate_xyz(ang: Vector3) -> Self { - let mut result = Self::identity(); - - let cosz = -ang.z.cos(); - let sinz = -ang.z.sin(); - let cosy = -ang.y.cos(); - let siny = -ang.y.sin(); - let cosx = -ang.x.cos(); - let sinx = -ang.x.sin(); - - result.m0 = cosz * cosy; - result.m4 = (cosz * siny * sinx) - (sinz * cosx); - result.m8 = (cosz * siny * cosx) + (sinz * sinx); - - result.m1 = sinz * cosy; - result.m5 = (sinz * siny * sinx) + (cosz * cosx); - result.m9 = (sinz * siny * cosx) - (cosz * sinx); - - result.m2 = -siny; - result.m6 = cosy * sinx; - result.m10 = cosy * cosx; - - result - } - - /// Returns a scaling matrix. - pub fn scale(x: f32, y: f32, z: f32) -> Matrix { - Matrix { - m0: x, - m4: 0.0, - m8: 0.0, - m12: 0.0, - m1: 0.0, - m5: y, - m9: 0.0, - m13: 0.0, - m2: 0.0, - m6: 0.0, - m10: z, - m14: 0.0, - m3: 0.0, - m7: 0.0, - m11: 0.0, - m15: 1.0, - } - } - - /// Returns perspective projection matrix based on frustum parameters. - pub fn frustum(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Matrix { - let rl = right - left; - let tb = top - bottom; - let fne = far - near; - - Matrix { - m0: (near * 2.0) / rl, - m1: 0.0, - m2: 0.0, - m3: 0.0, - - m4: 0.0, - m5: (near * 2.0) / tb, - m6: 0.0, - m7: 0.0, - - m8: (right + left) / rl, - m9: (top + bottom) / tb, - m10: -(far + near) / fne, - m11: -1.0, - - m12: 0.0, - m13: 0.0, - m14: -(far * near * 2.0) / fne, - m15: 0.0, - } - } - - /// Returns perspective projection matrix. - pub fn perspective(fovy: f32, aspect: f32, near: f32, far: f32) -> Matrix { - let top = near * (fovy * 0.5).tan(); - let right = top * aspect; - Matrix::frustum(-right, right, -top, top, near, far) - } - - /// Returns orthographic projection matrix. - pub fn ortho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32) -> Matrix { - let rl = right - left; - let tb = top - bottom; - let fne = far - near; - - Matrix { - m0: 2.0 / rl, - m1: 0.0, - m2: 0.0, - m3: 0.0, - m4: 0.0, - m5: 2.0 / tb, - m6: 0.0, - m7: 0.0, - m8: 0.0, - m9: 0.0, - m10: -2.0 / fne, - m11: 0.0, - m12: -(left + right) / rl, - m13: -(top + bottom) / tb, - m14: -(far + near) / fne, - m15: 1.0, - } - } - - /// Returns camera look-at matrix (view matrix). - pub fn look_at(eye: Vector3, target: Vector3, up: Vector3) -> Matrix { - let z = (eye - target).normalized(); - let x = up.cross(z).normalized(); - let y = z.cross(x).normalized(); - - Matrix { - m0: x.x, - m1: x.y, - m2: x.z, - m3: 0.0, - m4: y.x, - m5: y.y, - m6: y.z, - m7: 0.0, - m8: z.x, - m9: z.y, - m10: z.z, - m11: 0.0, - m12: eye.x, - m13: eye.y, - m14: eye.z, - m15: 1.0, - } - .inverted() - } - - /// Calculates the determinant of the current matrix. - pub fn determinant(&self) -> f32 { - let a00 = self.m0; - let a01 = self.m1; - let a02 = self.m2; - let a03 = self.m3; - let a10 = self.m4; - let a11 = self.m5; - let a12 = self.m6; - let a13 = self.m7; - let a20 = self.m8; - let a21 = self.m9; - let a22 = self.m10; - let a23 = self.m11; - let a30 = self.m12; - let a31 = self.m13; - let a32 = self.m14; - let a33 = self.m15; - - a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 - + a10 * a31 * a22 * a03 - + a20 * a11 * a32 * a03 - - a10 * a21 * a32 * a03 - - a30 * a21 * a02 * a13 - + a20 * a31 * a02 * a13 - + a30 * a01 * a22 * a13 - - a00 * a31 * a22 * a13 - - a20 * a01 * a32 * a13 - + a00 * a21 * a32 * a13 - + a30 * a11 * a02 * a23 - - a10 * a31 * a02 * a23 - - a30 * a01 * a12 * a23 - + a00 * a31 * a12 * a23 - + a10 * a01 * a32 * a23 - - a00 * a11 * a32 * a23 - - a20 * a11 * a02 * a33 - + a10 * a21 * a02 * a33 - + a20 * a01 * a12 * a33 - - a00 * a21 * a12 * a33 - - a10 * a01 * a22 * a33 - + a00 * a11 * a22 * a33 - } - - /// Calculates the trace of the matrix (sum of the values along the diagonal). - pub fn trace(&self) -> f32 { - self.m0 + self.m5 + self.m10 + self.m15 - } - - /// Returns a new `Matrix` transposed from the current one. - pub fn transposed(&self) -> Matrix { - Matrix { - m0: self.m0, - m1: self.m4, - m2: self.m8, - m3: self.m12, - m4: self.m1, - m5: self.m5, - m6: self.m9, - m7: self.m13, - m8: self.m2, - m9: self.m6, - m10: self.m10, - m11: self.m14, - m12: self.m3, - m13: self.m7, - m14: self.m11, - m15: self.m15, - } - } - - /// Returns a new `Matrix` inverted from the current one. - pub fn inverted(&self) -> Matrix { - let a00 = self.m0; - let a01 = self.m1; - let a02 = self.m2; - let a03 = self.m3; - let a10 = self.m4; - let a11 = self.m5; - let a12 = self.m6; - let a13 = self.m7; - let a20 = self.m8; - let a21 = self.m9; - let a22 = self.m10; - let a23 = self.m11; - let a30 = self.m12; - let a31 = self.m13; - let a32 = self.m14; - let a33 = self.m15; - - let b00 = (a00 * a11) - (a01 * a10); - let b01 = (a00 * a12) - (a02 * a10); - let b02 = (a00 * a13) - (a03 * a10); - let b03 = (a01 * a12) - (a02 * a11); - let b04 = (a01 * a13) - (a03 * a11); - let b05 = (a02 * a13) - (a03 * a12); - let b06 = (a20 * a31) - (a21 * a30); - let b07 = (a20 * a32) - (a22 * a30); - let b08 = (a20 * a33) - (a23 * a30); - let b09 = (a21 * a32) - (a22 * a31); - let b10 = (a21 * a33) - (a23 * a31); - let b11 = (a22 * a33) - (a23 * a32); - - let inv_det = 1.0 - / ((b00 * b11) - (b01 * b10) + (b02 * b09) + (b03 * b08) - (b04 * b07) + (b05 * b06)); - - Matrix { - m0: ((a11 * b11) - (a12 * b10) + (a13 * b09)) * inv_det, - m1: ((-a01 * b11) + (a02 * b10) - (a03 * b09)) * inv_det, - m2: ((a31 * b05) - (a32 * b04) + (a33 * b03)) * inv_det, - m3: ((-a21 * b05) + (a22 * b04) - (a23 * b03)) * inv_det, - m4: ((-a10 * b11) + (a12 * b08) - (a13 * b07)) * inv_det, - m5: ((a00 * b11) - (a02 * b08) + (a03 * b07)) * inv_det, - m6: ((-a30 * b05) + (a32 * b02) - (a33 * b01)) * inv_det, - m7: ((a20 * b05) - (a22 * b02) + (a23 * b01)) * inv_det, - m8: ((a10 * b10) - (a11 * b08) + (a13 * b06)) * inv_det, - m9: ((-a00 * b10) + (a01 * b08) - (a03 * b06)) * inv_det, - m10: ((a30 * b04) - (a31 * b02) + (a33 * b00)) * inv_det, - m11: ((-a20 * b04) + (a21 * b02) - (a23 * b00)) * inv_det, - m12: ((-a10 * b09) + (a11 * b07) - (a12 * b06)) * inv_det, - m13: ((a00 * b09) - (a01 * b07) + (a02 * b06)) * inv_det, - m14: ((-a30 * b03) + (a31 * b01) - (a32 * b00)) * inv_det, - m15: ((a20 * b03) - (a21 * b01) + (a22 * b00)) * inv_det, - } - } - - /// Returns a new `Matrix` normalized from the current one. - pub fn normalized(&self) -> Matrix { - let det = self.determinant(); - Matrix { - m0: self.m0 / det, - m1: self.m1 / det, - m2: self.m2 / det, - m3: self.m3 / det, - m4: self.m4 / det, - m5: self.m5 / det, - m6: self.m6 / det, - m7: self.m7 / det, - m8: self.m8 / det, - m9: self.m9 / det, - m10: self.m10 / det, - m11: self.m11 / det, - m12: self.m12 / det, - m13: self.m13 / det, - m14: self.m14 / det, - m15: self.m15 / det, - } - } - - /// Returns a 16-length `f32` array containing the current matrix data. - pub fn to_array(&self) -> [f32; 16] { - [ - self.m0, self.m1, self.m2, self.m3, self.m4, self.m5, self.m6, self.m7, self.m8, - self.m9, self.m10, self.m11, self.m12, self.m13, self.m14, self.m15, - ] - } -} - -impl Add for Matrix { - type Output = Matrix; - fn add(self, mat: Matrix) -> Matrix { - Matrix { - m0: self.m0 + mat.m0, - m1: self.m1 + mat.m1, - m2: self.m2 + mat.m2, - m3: self.m3 + mat.m3, - m4: self.m4 + mat.m4, - m5: self.m5 + mat.m5, - m6: self.m6 + mat.m6, - m7: self.m7 + mat.m7, - m8: self.m8 + mat.m8, - m9: self.m9 + mat.m9, - m10: self.m10 + mat.m10, - m11: self.m11 + mat.m11, - m12: self.m12 + mat.m12, - m13: self.m13 + mat.m13, - m14: self.m14 + mat.m14, - m15: self.m15 + mat.m15, - } - } -} - -impl AddAssign for Matrix { - fn add_assign(&mut self, mat: Matrix) { - *self = *self + mat; - } -} - -impl Sub for Matrix { - type Output = Matrix; - fn sub(self, mat: Matrix) -> Matrix { - Matrix { - m0: self.m0 - mat.m0, - m1: self.m1 - mat.m1, - m2: self.m2 - mat.m2, - m3: self.m3 - mat.m3, - m4: self.m4 - mat.m4, - m5: self.m5 - mat.m5, - m6: self.m6 - mat.m6, - m7: self.m7 - mat.m7, - m8: self.m8 - mat.m8, - m9: self.m9 - mat.m9, - m10: self.m10 - mat.m10, - m11: self.m11 - mat.m11, - m12: self.m12 - mat.m12, - m13: self.m13 - mat.m13, - m14: self.m14 - mat.m14, - m15: self.m15 - mat.m15, - } - } -} - -impl SubAssign for Matrix { - fn sub_assign(&mut self, mat: Matrix) { - *self = *self - mat; - } -} - -impl Mul for Matrix { - type Output = Matrix; - fn mul(self, mat: Matrix) -> Matrix { - Matrix { - m0: self.m0 * mat.m0 + self.m1 * mat.m4 + self.m2 * mat.m8 + self.m3 * mat.m12, - m1: self.m0 * mat.m1 + self.m1 * mat.m5 + self.m2 * mat.m9 + self.m3 * mat.m13, - m2: self.m0 * mat.m2 + self.m1 * mat.m6 + self.m2 * mat.m10 + self.m3 * mat.m14, - m3: self.m0 * mat.m3 + self.m1 * mat.m7 + self.m2 * mat.m11 + self.m3 * mat.m15, - m4: self.m4 * mat.m0 + self.m5 * mat.m4 + self.m6 * mat.m8 + self.m7 * mat.m12, - m5: self.m4 * mat.m1 + self.m5 * mat.m5 + self.m6 * mat.m9 + self.m7 * mat.m13, - m6: self.m4 * mat.m2 + self.m5 * mat.m6 + self.m6 * mat.m10 + self.m7 * mat.m14, - m7: self.m4 * mat.m3 + self.m5 * mat.m7 + self.m6 * mat.m11 + self.m7 * mat.m15, - m8: self.m8 * mat.m0 + self.m9 * mat.m4 + self.m10 * mat.m8 + self.m11 * mat.m12, - m9: self.m8 * mat.m1 + self.m9 * mat.m5 + self.m10 * mat.m9 + self.m11 * mat.m13, - m10: self.m8 * mat.m2 + self.m9 * mat.m6 + self.m10 * mat.m10 + self.m11 * mat.m14, - m11: self.m8 * mat.m3 + self.m9 * mat.m7 + self.m10 * mat.m11 + self.m11 * mat.m15, - m12: self.m12 * mat.m0 + self.m13 * mat.m4 + self.m14 * mat.m8 + self.m15 * mat.m12, - m13: self.m12 * mat.m1 + self.m13 * mat.m5 + self.m14 * mat.m9 + self.m15 * mat.m13, - m14: self.m12 * mat.m2 + self.m13 * mat.m6 + self.m14 * mat.m10 + self.m15 * mat.m14, - m15: self.m12 * mat.m3 + self.m13 * mat.m7 + self.m14 * mat.m11 + self.m15 * mat.m15, - } - } -} - -impl MulAssign for Matrix { - fn mul_assign(&mut self, mat: Matrix) { - *self = *self * mat; - } -} - -optional_serde_struct! { - pub struct Ray { - pub position: Vector3, - pub direction: Vector3, - } -} - -impl From for Ray { - fn from(r: ffi::Ray) -> Ray { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for Ray { - fn into(self) -> ffi::Ray { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Ray { - fn into(self) -> ffi::Ray { - ffi::Ray { - position: self.position.into(), - direction: self.direction.into(), - } - } -} - -optional_serde_struct! { - pub struct Rectangle { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, - } -} - -impl From for Rectangle { - fn from(r: ffi::Rectangle) -> Rectangle { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for Rectangle { - fn into(self) -> ffi::Rectangle { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Rectangle { - fn into(self) -> ffi::Rectangle { - ffi::Rectangle { - x: self.x, - y: self.y, - width: self.width, - height: self.height, - } - } -} - -impl Rectangle { - pub const EMPTY: Rectangle = Rectangle::new(0.0, 0.0, 0.0, 0.0); - pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self { - Self { - x, - y, - width, - height, - } - } -} - -optional_serde_struct! { - pub struct BoundingBox { - pub min: Vector3, - pub max: Vector3, - } -} - -impl BoundingBox { - pub fn new(min: Vector3, max: Vector3) -> BoundingBox { - BoundingBox { min, max } - } -} - -impl From for BoundingBox { - fn from(r: ffi::BoundingBox) -> BoundingBox { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for BoundingBox { - fn into(self) -> ffi::BoundingBox { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &BoundingBox { - fn into(self) -> ffi::BoundingBox { - ffi::BoundingBox { - min: self.min.into(), - max: self.max.into(), - } - } -} - -optional_serde_struct! { - pub struct RayCollision { - pub hit: bool, - pub distance: f32, - pub point: Vector3, - pub normal: Vector3, - } -} - -impl From for RayCollision { - fn from(r: ffi::RayCollision) -> RayCollision { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for RayCollision { - fn into(self) -> ffi::RayCollision { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &RayCollision { - fn into(self) -> ffi::RayCollision { - ffi::RayCollision { - hit: self.hit.into(), - distance: self.distance.into(), - point: self.point.into(), - normal: self.normal.into() - } - } -} - -optional_serde_struct! { - pub struct Transform { - pub translation: Vector3, - pub rotation: Quaternion, - pub scale: Vector3, - } -} - -impl From for Transform { - fn from(r: ffi::Transform) -> Transform { - unsafe { std::mem::transmute(r) } - } -} - -impl Into for Transform { - fn into(self) -> ffi::Transform { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Transform { - fn into(self) -> ffi::Transform { - ffi::Transform { - translation: self.translation.into(), - rotation: self.rotation.into(), - scale: self.scale.into(), - } - } -} - -#[cfg(test)] -mod math_test { - use super::{Ray, Vector2, Vector3, Vector4}; - use crate::ffi; - - #[test] - fn test_into() { - let v2: ffi::Vector2 = (Vector2 { x: 1.0, y: 2.0 }).into(); - assert!(v2.x == 1.0 && v2.y == 2.0, "bad memory transmutation"); - - let v3: ffi::Vector3 = (Vector3 { - x: 1.0, - y: 2.0, - z: 3.0, - }) - .into(); - assert!( - v3.x == 1.0 && v3.y == 2.0 && v3.z == 3.0, - "bad memory transmutation" - ); - - let v4: ffi::Vector4 = (Vector4 { - x: 1.0, - y: 2.0, - z: 3.0, - w: 4.0, - }) - .into(); - assert!( - v4.x == 1.0 && v4.y == 2.0 && v4.z == 3.0 && v4.w == 4.0, - "bad memory transmutation" - ); - - let r: ffi::Ray = (Ray { - position: v3.into(), - direction: Vector3 { - x: 3.0, - y: 2.0, - z: 1.0, - }, - }) - .into(); - assert!( - r.position.x == 1.0 - && r.position.y == 2.0 - && r.position.z == 3.0 - && r.direction.x == 3.0 - && r.direction.y == 2.0 - && r.direction.z == 1.0, - "bad memory transmutation" - ) - } -} From 9e3dbdc764b58ad549a95c8f30859d2b4d00b832 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sat, 25 Mar 2023 18:22:46 +0100 Subject: [PATCH 14/30] Work in progress complete overhaul. Add support for some unimplemented raylib 4.5.0. Replace impl Into with mint vectors. Remove some wrappers, move their implementation into raylib-sys's structures. Cleanup various parts. Improve raylib-sys, may be able to use other raylib librairies. --- .gitmodules | 7 +- Cargo.toml | 2 +- raylib-sys/binding/binding.h | 4 +- raylib-sys/binding/config.h | 230 - raylib-sys/binding/raygui.h | 4783 ------------------ raylib-sys/binding/rgui_wrapper.cpp | 13 - raylib-sys/binding/rgui_wrapper.h | 9 - raylib-sys/binding/wrapper.c | 4 + raylib-sys/build.rs | 58 +- raylib-sys/src/camera.rs | 62 + {raylib/src/core => raylib-sys/src}/color.rs | 562 +- raylib-sys/src/lib.rs | 9 +- raylib-sys/src/math.rs | 93 +- raylib/Cargo.toml | 1 + raylib/src/core/audio.rs | 29 +- raylib/src/core/buffer.rs | 6 +- raylib/src/core/camera.rs | 166 +- raylib/src/core/collision.rs | 148 +- raylib/src/core/data.rs | 2 +- raylib/src/core/drawing.rs | 567 +-- raylib/src/core/file.rs | 6 +- raylib/src/core/input.rs | 79 +- raylib/src/core/logging.rs | 3 +- raylib/src/core/misc.rs | 25 +- raylib/src/core/mod.rs | 6 +- raylib/src/core/models.rs | 154 +- raylib/src/core/shaders.rs | 38 +- raylib/src/core/text.rs | 64 +- raylib/src/core/texture.rs | 293 +- raylib/src/core/vr.rs | 50 +- raylib/src/core/window.rs | 135 +- raylib/src/ease.rs | 4 +- raylib/src/lib.rs | 16 +- raylib/src/prelude.rs | 42 - raylib/src/rgui/safe.rs | 16 +- samples/Cargo.toml | 1 + samples/arkanoid.rs | 24 +- samples/asteroids.rs | 69 +- samples/options.rs | 7 +- samples/texture.rs | 1 - 40 files changed, 1179 insertions(+), 6609 deletions(-) delete mode 100644 raylib-sys/binding/config.h delete mode 100644 raylib-sys/binding/raygui.h delete mode 100644 raylib-sys/binding/rgui_wrapper.cpp delete mode 100644 raylib-sys/binding/rgui_wrapper.h create mode 100644 raylib-sys/binding/wrapper.c create mode 100644 raylib-sys/src/camera.rs rename {raylib/src/core => raylib-sys/src}/color.rs (83%) delete mode 100644 raylib/src/prelude.rs diff --git a/.gitmodules b/.gitmodules index c13092d8..c5046731 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,9 @@ [submodule "raylib-sys/raylib"] path = raylib-sys/raylib url = https://github.com/raysan5/raylib - branch = "4.0.0" + branch = "4.5.0" + +[submodule "raylib-sys/raygui"] + path = raylib-sys/raygui + url = https://github.com/raysan5/raygui + branch = "master" diff --git a/Cargo.toml b/Cargo.toml index d7a8786b..f629a369 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["raylib", "raylib-sys", "raylib-test", "samples", "showcase"] +members = ["raylib", "raylib-sys", "samples"] diff --git a/raylib-sys/binding/binding.h b/raylib-sys/binding/binding.h index 00f36084..3c432446 100644 --- a/raylib-sys/binding/binding.h +++ b/raylib-sys/binding/binding.h @@ -1,5 +1,7 @@ -#include "raygui.h" +#include "../raylib/src/raylib.h" #include "../raylib/src/rlgl.h" +#include "../raylib/src/rcamera.h" +#include "../raygui/src/raygui.h" typedef enum { diff --git a/raylib-sys/binding/config.h b/raylib-sys/binding/config.h deleted file mode 100644 index 2c61b466..00000000 --- a/raylib-sys/binding/config.h +++ /dev/null @@ -1,230 +0,0 @@ -/********************************************************************************************** - * - * raylib configuration flags - * - * This file defines all the configuration flags for the different raylib modules - * - * LICENSE: zlib/libpng - * - * Copyright (c) 2018-2022 Ahmad Fatoum & Ramon Santamaria (@raysan5) - * - * 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. - * - **********************************************************************************************/ - -//------------------------------------------------------------------------------------ -// Module selection - Some modules could be avoided -// Mandatory modules: rcore, rlgl, utils -//------------------------------------------------------------------------------------ -#define SUPPORT_MODULE_RSHAPES 1 -#define SUPPORT_MODULE_RTEXTURES 1 -#define SUPPORT_MODULE_RTEXT 1 // WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures -#define SUPPORT_MODULE_RMODELS 1 -#define SUPPORT_MODULE_RAUDIO 1 - -//------------------------------------------------------------------------------------ -// Module: rcore - Configuration Flags -//------------------------------------------------------------------------------------ -// Camera module is included (rcamera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital -#define SUPPORT_CAMERA_SYSTEM 1 -// Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag -#define SUPPORT_GESTURES_SYSTEM 1 -// Mouse gestures are directly mapped like touches and processed by gestures system -#define SUPPORT_MOUSE_GESTURES 1 -// Reconfigure standard input to receive key inputs, works with SSH connection. -#define SUPPORT_SSH_KEYBOARD_RPI 1 -// Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. -// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. -#define SUPPORT_WINMM_HIGHRES_TIMER 1 -// Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used -//#define SUPPORT_BUSY_WAIT_LOOP 1 -// Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy -#define SUPPORT_PARTIALBUSY_WAIT_LOOP -// Wait for events passively (sleeping while no events) instead of polling them actively every frame -//#define SUPPORT_EVENTS_WAITING 1 -// Allow automatic screen capture of current screen pressing F12, defined in KeyCallback() -#define SUPPORT_SCREEN_CAPTURE 1 -// Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() -#define SUPPORT_GIF_RECORDING 1 -// Support CompressData() and DecompressData() functions -#define SUPPORT_COMPRESSION_API 1 -// Support automatic generated events, loading and recording of those events when required -//#define SUPPORT_EVENTS_AUTOMATION 1 -// Support custom frame control, only for advance users -// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents() -// Enabling this flag allows manual control of the frame processes, use at your own risk -//#define SUPPORT_CUSTOM_FRAME_CONTROL 1 - -// rcore: Configuration values -//------------------------------------------------------------------------------------ -#define MAX_FILEPATH_CAPACITY 8192 // Maximum file paths capacity -#define MAX_FILEPATH_LENGTH 4096 // Maximum length for filepaths (Linux PATH_MAX default value) - -#define MAX_KEYBOARD_KEYS 512 // Maximum number of keyboard keys supported -#define MAX_MOUSE_BUTTONS 8 // Maximum number of mouse buttons supported -#define MAX_GAMEPADS 4 // Maximum number of gamepads supported -#define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad) -#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad) -#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported -#define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue -#define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue - -#define MAX_DECOMPRESSION_SIZE 64 // Max size allocated for decompression in MB - -//------------------------------------------------------------------------------------ -// Module: rlgl - Configuration values -//------------------------------------------------------------------------------------ - -// Enable OpenGL Debug Context (only available on OpenGL 4.3) -//#define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT 1 - -// Show OpenGL extensions and capabilities detailed logs on init -//#define RLGL_SHOW_GL_DETAILS_INFO 1 - -//#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096 // Default internal render batch elements limits -#define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering) -#define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture) -#define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) - -#define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack - -#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported - -#define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance -#define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance - -// Default shader vertex attribute names to set location points -// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience -#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Binded by default to shader location: 0 -#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Binded by default to shader location: 1 -#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Binded by default to shader location: 2 -#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Binded by default to shader location: 3 -#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Binded by default to shader location: 4 -#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Binded by default to shader location: 5 - -#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix -#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix -#define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix -#define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix -#define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)) -#define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color) -#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0) -#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1) -#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2) - -//------------------------------------------------------------------------------------ -// Module: rshapes - Configuration Flags -//------------------------------------------------------------------------------------ -// Use QUADS instead of TRIANGLES for drawing when possible -// Some lines-based shapes could still use lines -#define SUPPORT_QUADS_DRAW_MODE 1 - -//------------------------------------------------------------------------------------ -// Module: rtextures - Configuration Flags -//------------------------------------------------------------------------------------ -// Selecte desired fileformats to be supported for image data loading -#define SUPPORT_FILEFORMAT_PNG 1 -//#define SUPPORT_FILEFORMAT_BMP 1 -//#define SUPPORT_FILEFORMAT_TGA 1 -//#define SUPPORT_FILEFORMAT_JPG 1 -#define SUPPORT_FILEFORMAT_GIF 1 -#define SUPPORT_FILEFORMAT_QOI 1 -//#define SUPPORT_FILEFORMAT_PSD 1 -#define SUPPORT_FILEFORMAT_DDS 1 -#define SUPPORT_FILEFORMAT_HDR 1 -//#define SUPPORT_FILEFORMAT_KTX 1 -//#define SUPPORT_FILEFORMAT_ASTC 1 -//#define SUPPORT_FILEFORMAT_PKM 1 -//#define SUPPORT_FILEFORMAT_PVR 1 - -// Support image export functionality (.png, .bmp, .tga, .jpg, .qoi) -#define SUPPORT_IMAGE_EXPORT 1 -// Support procedural image generation functionality (gradient, spot, perlin-noise, cellular) -#define SUPPORT_IMAGE_GENERATION 1 -// Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... -// If not defined, still some functions are supported: ImageFormat(), ImageCrop(), ImageToPOT() -#define SUPPORT_IMAGE_MANIPULATION 1 - -//------------------------------------------------------------------------------------ -// Module: rtext - Configuration Flags -//------------------------------------------------------------------------------------ -// Default font is loaded on window initialization to be available for the user to render simple text -// NOTE: If enabled, uses external module functions to load default raylib font -#define SUPPORT_DEFAULT_FONT 1 -// Selected desired font fileformats to be supported for loading -#define SUPPORT_FILEFORMAT_FNT 1 -#define SUPPORT_FILEFORMAT_TTF 1 - -// Support text management functions -// If not defined, still some functions are supported: TextLength(), TextFormat() -#define SUPPORT_TEXT_MANIPULATION 1 - -// rtext: Configuration values -//------------------------------------------------------------------------------------ -#define MAX_TEXT_BUFFER_LENGTH 1024 // Size of internal static buffers used on some functions: - // TextFormat(), TextSubtext(), TextToUpper(), TextToLower(), TextToPascal(), TextSplit() -#define MAX_TEXTSPLIT_COUNT 128 // Maximum number of substrings to split: TextSplit() - -//------------------------------------------------------------------------------------ -// Module: rmodels - Configuration Flags -//------------------------------------------------------------------------------------ -// Selected desired model fileformats to be supported for loading -#define SUPPORT_FILEFORMAT_OBJ 1 -#define SUPPORT_FILEFORMAT_MTL 1 -#define SUPPORT_FILEFORMAT_IQM 1 -#define SUPPORT_FILEFORMAT_GLTF 1 -#define SUPPORT_FILEFORMAT_VOX 1 -// Support procedural mesh generation functions, uses external par_shapes.h library -// NOTE: Some generated meshes DO NOT include generated texture coordinates -#define SUPPORT_MESH_GENERATION 1 - -// rmodels: Configuration values -//------------------------------------------------------------------------------------ -#define MAX_MATERIAL_MAPS 12 // Maximum number of shader maps supported -#define MAX_MESH_VERTEX_BUFFERS 7 // Maximum vertex buffers (VBO) per mesh - -//------------------------------------------------------------------------------------ -// Module: raudio - Configuration Flags -//------------------------------------------------------------------------------------ -// Desired audio fileformats to be supported for loading -#define SUPPORT_FILEFORMAT_WAV 1 -#define SUPPORT_FILEFORMAT_OGG 1 -#define SUPPORT_FILEFORMAT_XM 1 -#define SUPPORT_FILEFORMAT_MOD 1 -#define SUPPORT_FILEFORMAT_MP3 1 -//#define SUPPORT_FILEFORMAT_FLAC 1 - -// raudio: Configuration values -//------------------------------------------------------------------------------------ -#define AUDIO_DEVICE_FORMAT ma_format_f32 // Device output format (miniaudio: float-32bit) -#define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo -#define AUDIO_DEVICE_SAMPLE_RATE 0 // Device sample rate (device default) - -#define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Maximum number of audio pool channels - -//------------------------------------------------------------------------------------ -// Module: utils - Configuration Flags -//------------------------------------------------------------------------------------ -// Standard file io library (stdio.h) included -#define SUPPORT_STANDARD_FILEIO -// Show TRACELOG() output messages -// NOTE: By default LOG_DEBUG traces not shown -#define SUPPORT_TRACELOG 1 -//#define SUPPORT_TRACELOG_DEBUG 1 - -// utils: Configuration values -//------------------------------------------------------------------------------------ -#define MAX_TRACELOG_MSG_LENGTH 128 // Max length of one trace-log message diff --git a/raylib-sys/binding/raygui.h b/raylib-sys/binding/raygui.h deleted file mode 100644 index 0ea37e90..00000000 --- a/raylib-sys/binding/raygui.h +++ /dev/null @@ -1,4783 +0,0 @@ -/******************************************************************************************* - * - * raygui v3.2 - A simple and easy-to-use immediate-mode gui library - * - * DESCRIPTION: - * - * raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also - * available as a standalone library, as long as input and drawing functions are provided. - * - * Controls provided: - * - * # Container/separators Controls - * - WindowBox --> StatusBar, Panel - * - GroupBox --> Line - * - Line - * - Panel --> StatusBar - * - ScrollPanel --> StatusBar - * - * # Basic Controls - * - Label - * - Button - * - LabelButton --> Label - * - Toggle - * - ToggleGroup --> Toggle - * - CheckBox - * - ComboBox - * - DropdownBox - * - TextBox - * - TextBoxMulti - * - ValueBox --> TextBox - * - Spinner --> Button, ValueBox - * - Slider - * - SliderBar --> Slider - * - ProgressBar - * - StatusBar - * - DummyRec - * - Grid - * - * # Advance Controls - * - ListView - * - ColorPicker --> ColorPanel, ColorBarHue - * - MessageBox --> Window, Label, Button - * - TextInputBox --> Window, Label, TextBox, Button - * - * It also provides a set of functions for styling the controls based on its properties (size, color). - * - * - * RAYGUI STYLE (guiStyle): - * - * raygui uses a global data array for all gui style properties (allocated on data segment by default), - * when a new style is loaded, it is loaded over the global style... but a default gui style could always be - * recovered with GuiLoadStyleDefault() function, that overwrites the current style to the default one - * - * The global style array size is fixed and depends on the number of controls and properties: - * - * static unsigned int guiStyle[RAYGUI_MAX_CONTROLS*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)]; - * - * guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB - * - * Note that the first set of BASE properties (by default guiStyle[0..15]) belong to the generic style - * used for all controls, when any of those base values is set, it is automatically populated to all - * controls, so, specific control values overwriting generic style should be set after base values. - * - * After the first BASE set we have the EXTENDED properties (by default guiStyle[16..23]), those - * properties are actually common to all controls and can not be overwritten individually (like BASE ones) - * Some of those properties are: TEXT_SIZE, TEXT_SPACING, LINE_COLOR, BACKGROUND_COLOR - * - * Custom control properties can be defined using the EXTENDED properties for each independent control. - * - * TOOL: rGuiStyler is a visual tool to customize raygui style. - * - * - * RAYGUI ICONS (guiIcons): - * - * raygui could use a global array containing icons data (allocated on data segment by default), - * a custom icons set could be loaded over this array using GuiLoadIcons(), but loaded icons set - * must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS will be loaded - * - * Every icon is codified in binary form, using 1 bit per pixel, so, every 16x16 icon - * requires 8 integers (16*16/32) to be stored in memory. - * - * When the icon is draw, actually one quad per pixel is drawn if the bit for that pixel is set. - * - * The global icons array size is fixed and depends on the number of icons and size: - * - * static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS]; - * - * guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB - * - * TOOL: rGuiIcons is a visual tool to customize raygui icons. - * - * - * CONFIGURATION: - * - * #define RAYGUI_IMPLEMENTATION - * Generates the implementation of the library into the included file. - * If not defined, the library is in header only mode and can be included in other headers - * or source files without problems. But only ONE file should hold the implementation. - * - * #define RAYGUI_STANDALONE - * Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined - * internally in the library and input management and drawing functions must be provided by - * the user (check library implementation for further details). - * - * #define RAYGUI_NO_ICONS - * Avoid including embedded ricons data (256 icons, 16x16 pixels, 1-bit per pixel, 2KB) - * - * #define RAYGUI_CUSTOM_ICONS - * Includes custom ricons.h header defining a set of custom icons, - * this file can be generated using rGuiIcons tool - * - * - * VERSIONS HISTORY: - * 3.2 (22-May-2022) RENAMED: Some enum values, for unification, avoiding prefixes - * REMOVED: GuiScrollBar(), only internal - * REDESIGNED: GuiPanel() to support text parameter - * REDESIGNED: GuiScrollPanel() to support text parameter - * REDESIGNED: GuiColorPicker() to support text parameter - * REDESIGNED: GuiColorPanel() to support text parameter - * REDESIGNED: GuiColorBarAlpha() to support text parameter - * REDESIGNED: GuiColorBarHue() to support text parameter - * REDESIGNED: GuiTextInputBox() to support password - * 3.1 (12-Jan-2022) REVIEWED: Default style for consistency (aligned with rGuiLayout v2.5 tool) - * REVIEWED: GuiLoadStyle() to support compressed font atlas image data and unload previous textures - * REVIEWED: External icons usage logic - * REVIEWED: GuiLine() for centered alignment when including text - * RENAMED: Multiple controls properties definitions to prepend RAYGUI_ - * RENAMED: RICON_ references to RAYGUI_ICON_ for library consistency - * Projects updated and multiple tweaks - * 3.0 (04-Nov-2021) Integrated ricons data to avoid external file - * REDESIGNED: GuiTextBoxMulti() - * REMOVED: GuiImageButton*() - * Multiple minor tweaks and bugs corrected - * 2.9 (17-Mar-2021) REMOVED: Tooltip API - * 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() - * 2.7 (20-Feb-2020) ADDED: Possible tooltips API - * 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() - * REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() - * REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() - * Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties - * ADDED: 8 new custom styles ready to use - * Multiple minor tweaks and bugs corrected - * 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() - * 2.3 (29-Apr-2019) ADDED: rIcons auxiliar library and support for it, multiple controls reviewed - * Refactor all controls drawing mechanism to use control state - * 2.2 (05-Feb-2019) ADDED: GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls - * 2.1 (26-Dec-2018) REDESIGNED: GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string - * REDESIGNED: Style system (breaking change) - * 2.0 (08-Nov-2018) ADDED: Support controls guiLock and custom fonts - * REVIEWED: GuiComboBox(), GuiListView()... - * 1.9 (09-Oct-2018) REVIEWED: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... - * 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout - * 1.5 (21-Jun-2017) Working in an improved styles system - * 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) - * 1.3 (12-Jun-2017) Complete redesign of style system - * 1.1 (01-Jun-2017) Complete review of the library - * 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. - * 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. - * 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. - * - * - * CONTRIBUTORS: - * - * Ramon Santamaria: Supervision, review, redesign, update and maintenance - * Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) - * Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) - * Adria Arranz: Testing and Implementation of additional controls (2018) - * Jordi Jorba: Testing and Implementation of additional controls (2018) - * Albert Martos: Review and testing of the library (2015) - * Ian Eito: Review and testing of the library (2015) - * Kevin Gato: Initial implementation of basic components (2014) - * Daniel Nicolas: Initial implementation of basic components (2014) - * - * - * LICENSE: zlib/libpng - * - * Copyright (c) 2014-2022 Ramon Santamaria (@raysan5) - * - * 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. - * - **********************************************************************************************/ - -#ifndef RAYGUI_H -#define RAYGUI_H - -#define RAYGUI_VERSION "3.2" - -#if !defined(RAYGUI_STANDALONE) -#include "../raylib/src/raylib.h" -#endif - -// Function specifiers in case library is build/used as a shared library (Windows) -// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll -#if defined(_WIN32) -#if defined(BUILD_LIBTYPE_SHARED) -#define RAYGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) -#elif defined(USE_LIBTYPE_SHARED) -#define RAYGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) -#endif -#endif - -// Function specifiers definition -#ifndef RAYGUIAPI -#define RAYGUIAPI // Functions defined as 'extern' by default (implicit specifiers) -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -// Allow custom memory allocators -#ifndef RAYGUI_MALLOC -#define RAYGUI_MALLOC(sz) malloc(sz) -#endif -#ifndef RAYGUI_CALLOC -#define RAYGUI_CALLOC(n, sz) calloc(n, sz) -#endif -#ifndef RAYGUI_FREE -#define RAYGUI_FREE(p) free(p) -#endif - -// Simple log system to avoid printf() calls if required -// NOTE: Avoiding those calls, also avoids const strings memory usage -#define RAYGUI_SUPPORT_LOG_INFO -#if defined(RAYGUI_SUPPORT_LOG_INFO) -#define RAYGUI_LOG(...) printf(__VA_ARGS__) -#else -#define RAYGUI_LOG(...) -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -// NOTE: Some types are required for RAYGUI_STANDALONE usage -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) -#ifndef __cplusplus -// Boolean type -#ifndef true -typedef enum -{ - false, - true -} bool; -#endif -#endif - -// Vector2 type -typedef struct Vector2 -{ - float x; - float y; -} Vector2; - -// Vector3 type // -- ConvertHSVtoRGB(), ConvertRGBtoHSV() -typedef struct Vector3 -{ - float x; - float y; - float z; -} Vector3; - -// Color type, RGBA (32bit) -typedef struct Color -{ - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; - -// Rectangle type -typedef struct Rectangle -{ - float x; - float y; - float width; - float height; -} Rectangle; - -// TODO: Texture2D type is very coupled to raylib, required by Font type -// It should be redesigned to be provided by user -typedef struct Texture2D -{ - unsigned int id; // OpenGL texture id - int width; // Texture base width - int height; // Texture base height - int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (PixelFormat type) -} Texture2D; - -// GlyphInfo, font characters glyphs info -typedef struct GlyphInfo -{ - int value; // Character value (Unicode) - int offsetX; // Character offset X when drawing - int offsetY; // Character offset Y when drawing - int advanceX; // Character advance position X - Image image; // Character image data -} GlyphInfo; - -// TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() -// It should be redesigned to be provided by user -typedef struct Font -{ - int baseSize; // Base size (default chars height) - int glyphCount; // Number of characters - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - GlyphInfo *chars; // Characters info data -} Font; -#endif - -// Style property -typedef struct GuiStyleProp -{ - unsigned short controlId; - unsigned short propertyId; - unsigned int propertyValue; -} GuiStyleProp; - -// Gui control state -typedef enum -{ - STATE_NORMAL = 0, - STATE_FOCUSED, - STATE_PRESSED, - STATE_DISABLED, -} GuiState; - -// Gui control text alignment -typedef enum -{ - TEXT_ALIGN_LEFT = 0, - TEXT_ALIGN_CENTER, - TEXT_ALIGN_RIGHT, -} GuiTextAlignment; - -// Gui controls -typedef enum -{ - // Default -> populates to all controls when set - DEFAULT = 0, - // Basic controls - LABEL, // Used also for: LABELBUTTON - BUTTON, - TOGGLE, // Used also for: TOGGLEGROUP - SLIDER, // Used also for: SLIDERBAR - PROGRESSBAR, - CHECKBOX, - COMBOBOX, - DROPDOWNBOX, - TEXTBOX, // Used also for: TEXTBOXMULTI - VALUEBOX, - SPINNER, // Uses: BUTTON, VALUEBOX - LISTVIEW, - COLORPICKER, - SCROLLBAR, - STATUSBAR -} GuiControl; - -// Gui base properties for every control -// NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties) -typedef enum -{ - BORDER_COLOR_NORMAL = 0, - BASE_COLOR_NORMAL, - TEXT_COLOR_NORMAL, - BORDER_COLOR_FOCUSED, - BASE_COLOR_FOCUSED, - TEXT_COLOR_FOCUSED, - BORDER_COLOR_PRESSED, - BASE_COLOR_PRESSED, - TEXT_COLOR_PRESSED, - BORDER_COLOR_DISABLED, - BASE_COLOR_DISABLED, - TEXT_COLOR_DISABLED, - BORDER_WIDTH, - TEXT_PADDING, - TEXT_ALIGNMENT, - RESERVED -} GuiControlProperty; - -// Gui extended properties depend on control -// NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default 8 properties) -//---------------------------------------------------------------------------------- - -// DEFAULT extended properties -// NOTE: Those properties are common to all controls or global -typedef enum -{ - TEXT_SIZE = 16, // Text size (glyphs max height) - TEXT_SPACING, // Text spacing between glyphs - LINE_COLOR, // Line control color - BACKGROUND_COLOR, // Background color -} GuiDefaultProperty; - -// Label -// typedef enum { } GuiLabelProperty; - -// Button/Spinner -// typedef enum { } GuiButtonProperty; - -// Toggle/ToggleGroup -typedef enum -{ - GROUP_PADDING = 16, // ToggleGroup separation between toggles -} GuiToggleProperty; - -// Slider/SliderBar -typedef enum -{ - SLIDER_WIDTH = 16, // Slider size of internal bar - SLIDER_PADDING // Slider/SliderBar internal bar padding -} GuiSliderProperty; - -// ProgressBar -typedef enum -{ - PROGRESS_PADDING = 16, // ProgressBar internal padding -} GuiProgressBarProperty; - -// ScrollBar -typedef enum -{ - ARROWS_SIZE = 16, - ARROWS_VISIBLE, - SCROLL_SLIDER_PADDING, // (SLIDERBAR, SLIDER_PADDING) - SCROLL_SLIDER_SIZE, - SCROLL_PADDING, - SCROLL_SPEED, -} GuiScrollBarProperty; - -// CheckBox -typedef enum -{ - CHECK_PADDING = 16 // CheckBox internal check padding -} GuiCheckBoxProperty; - -// ComboBox -typedef enum -{ - COMBO_BUTTON_WIDTH = 16, // ComboBox right button width - COMBO_BUTTON_SPACING // ComboBox button separation -} GuiComboBoxProperty; - -// DropdownBox -typedef enum -{ - ARROW_PADDING = 16, // DropdownBox arrow separation from border and items - DROPDOWN_ITEMS_SPACING // DropdownBox items separation -} GuiDropdownBoxProperty; - -// TextBox/TextBoxMulti/ValueBox/Spinner -typedef enum -{ - TEXT_INNER_PADDING = 16, // TextBox/TextBoxMulti/ValueBox/Spinner inner text padding - TEXT_LINES_SPACING, // TextBoxMulti lines separation -} GuiTextBoxProperty; - -// Spinner -typedef enum -{ - SPIN_BUTTON_WIDTH = 16, // Spinner left/right buttons width - SPIN_BUTTON_SPACING, // Spinner buttons separation -} GuiSpinnerProperty; - -// ListView -typedef enum -{ - LIST_ITEMS_HEIGHT = 16, // ListView items height - LIST_ITEMS_SPACING, // ListView items separation - SCROLLBAR_WIDTH, // ListView scrollbar size (usually width) - SCROLLBAR_SIDE, // ListView scrollbar side (0-left, 1-right) -} GuiListViewProperty; - -// ColorPicker -typedef enum -{ - COLOR_SELECTOR_SIZE = 16, - HUEBAR_WIDTH, // ColorPicker right hue bar width - HUEBAR_PADDING, // ColorPicker right hue bar separation from panel - HUEBAR_SELECTOR_HEIGHT, // ColorPicker right hue bar selector height - HUEBAR_SELECTOR_OVERFLOW // ColorPicker right hue bar selector overflow -} GuiColorPickerProperty; - -#define SCROLLBAR_LEFT_SIDE 0 -#define SCROLLBAR_RIGHT_SIDE 1 - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- - -#if defined(__cplusplus) -extern "C" -{ // Prevents name mangling of functions -#endif - - // Global gui state control functions - RAYGUIAPI void GuiEnable(void); // Enable gui controls (global state) - RAYGUIAPI void GuiDisable(void); // Disable gui controls (global state) - RAYGUIAPI void GuiLock(void); // Lock gui controls (global state) - RAYGUIAPI void GuiUnlock(void); // Unlock gui controls (global state) - RAYGUIAPI bool GuiIsLocked(void); // Check if gui is locked (global state) - RAYGUIAPI void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f - RAYGUIAPI void GuiSetState(int state); // Set gui state (global state) - RAYGUIAPI int GuiGetState(void); // Get gui state (global state) - - // Font set/get functions - RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state) - RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state) - - // Style set/get functions - RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property - RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property - - // Container/separator controls, useful for controls organization - RAYGUIAPI bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed - RAYGUIAPI void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name - RAYGUIAPI void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text - RAYGUIAPI void GuiPanel(Rectangle bounds, const char *text); // Panel control, useful to group controls - RAYGUIAPI Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll); // Scroll Panel control - - // Basic controls set - RAYGUIAPI void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text - RAYGUIAPI bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked - RAYGUIAPI bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked - RAYGUIAPI bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active - RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index - RAYGUIAPI bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active - RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index - RAYGUIAPI bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item - RAYGUIAPI bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value - RAYGUIAPI bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers - RAYGUIAPI bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text - RAYGUIAPI bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines - RAYGUIAPI float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value - RAYGUIAPI float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value - RAYGUIAPI float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value - RAYGUIAPI void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text - RAYGUIAPI void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders - RAYGUIAPI Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs); // Grid control, returns mouse cell position - - // Advance controls set - RAYGUIAPI int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index - RAYGUIAPI int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters - RAYGUIAPI int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message - RAYGUIAPI int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive); // Text Input Box control, ask for text, supports secret - RAYGUIAPI Color GuiColorPicker(Rectangle bounds, const char *text, Color color); // Color Picker control (multiple color controls) - RAYGUIAPI Color GuiColorPanel(Rectangle bounds, const char *text, Color color); // Color Panel control - RAYGUIAPI float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha); // Color Bar Alpha control - RAYGUIAPI float GuiColorBarHue(Rectangle bounds, const char *text, float value); // Color Bar Hue control - - // Styles loading functions - RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) - RAYGUIAPI void GuiLoadStyleDefault(void); // Load style default over global style - - // Icons functionality - RAYGUIAPI const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) - -#if !defined(RAYGUI_NO_ICONS) - RAYGUIAPI void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); - - RAYGUIAPI unsigned int *GuiGetIcons(void); // Get full icons data pointer - RAYGUIAPI unsigned int *GuiGetIconData(int iconId); // Get icon bit data - RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data - RAYGUIAPI void GuiSetIconScale(unsigned int scale); // Set icon scale (1 by default) - - RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value - RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value - RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value - -#if !defined(RAYGUI_CUSTOM_ICONS) - //---------------------------------------------------------------------------------- - // Icons enumeration - //---------------------------------------------------------------------------------- - typedef enum - { - ICON_NONE = 0, - ICON_FOLDER_FILE_OPEN = 1, - ICON_FILE_SAVE_CLASSIC = 2, - ICON_FOLDER_OPEN = 3, - ICON_FOLDER_SAVE = 4, - ICON_FILE_OPEN = 5, - ICON_FILE_SAVE = 6, - ICON_FILE_EXPORT = 7, - ICON_FILE_ADD = 8, - ICON_FILE_DELETE = 9, - ICON_FILETYPE_TEXT = 10, - ICON_FILETYPE_AUDIO = 11, - ICON_FILETYPE_IMAGE = 12, - ICON_FILETYPE_PLAY = 13, - ICON_FILETYPE_VIDEO = 14, - ICON_FILETYPE_INFO = 15, - ICON_FILE_COPY = 16, - ICON_FILE_CUT = 17, - ICON_FILE_PASTE = 18, - ICON_CURSOR_HAND = 19, - ICON_CURSOR_POINTER = 20, - ICON_CURSOR_CLASSIC = 21, - ICON_PENCIL = 22, - ICON_PENCIL_BIG = 23, - ICON_BRUSH_CLASSIC = 24, - ICON_BRUSH_PAINTER = 25, - ICON_WATER_DROP = 26, - ICON_COLOR_PICKER = 27, - ICON_RUBBER = 28, - ICON_COLOR_BUCKET = 29, - ICON_TEXT_T = 30, - ICON_TEXT_A = 31, - ICON_SCALE = 32, - ICON_RESIZE = 33, - ICON_FILTER_POINT = 34, - ICON_FILTER_BILINEAR = 35, - ICON_CROP = 36, - ICON_CROP_ALPHA = 37, - ICON_SQUARE_TOGGLE = 38, - ICON_SYMMETRY = 39, - ICON_SYMMETRY_HORIZONTAL = 40, - ICON_SYMMETRY_VERTICAL = 41, - ICON_LENS = 42, - ICON_LENS_BIG = 43, - ICON_EYE_ON = 44, - ICON_EYE_OFF = 45, - ICON_FILTER_TOP = 46, - ICON_FILTER = 47, - ICON_TARGET_POINT = 48, - ICON_TARGET_SMALL = 49, - ICON_TARGET_BIG = 50, - ICON_TARGET_MOVE = 51, - ICON_CURSOR_MOVE = 52, - ICON_CURSOR_SCALE = 53, - ICON_CURSOR_SCALE_RIGHT = 54, - ICON_CURSOR_SCALE_LEFT = 55, - ICON_UNDO = 56, - ICON_REDO = 57, - ICON_REREDO = 58, - ICON_MUTATE = 59, - ICON_ROTATE = 60, - ICON_REPEAT = 61, - ICON_SHUFFLE = 62, - ICON_EMPTYBOX = 63, - ICON_TARGET = 64, - ICON_TARGET_SMALL_FILL = 65, - ICON_TARGET_BIG_FILL = 66, - ICON_TARGET_MOVE_FILL = 67, - ICON_CURSOR_MOVE_FILL = 68, - ICON_CURSOR_SCALE_FILL = 69, - ICON_CURSOR_SCALE_RIGHT_FILL = 70, - ICON_CURSOR_SCALE_LEFT_FILL = 71, - ICON_UNDO_FILL = 72, - ICON_REDO_FILL = 73, - ICON_REREDO_FILL = 74, - ICON_MUTATE_FILL = 75, - ICON_ROTATE_FILL = 76, - ICON_REPEAT_FILL = 77, - ICON_SHUFFLE_FILL = 78, - ICON_EMPTYBOX_SMALL = 79, - ICON_BOX = 80, - ICON_BOX_TOP = 81, - ICON_BOX_TOP_RIGHT = 82, - ICON_BOX_RIGHT = 83, - ICON_BOX_BOTTOM_RIGHT = 84, - ICON_BOX_BOTTOM = 85, - ICON_BOX_BOTTOM_LEFT = 86, - ICON_BOX_LEFT = 87, - ICON_BOX_TOP_LEFT = 88, - ICON_BOX_CENTER = 89, - ICON_BOX_CIRCLE_MASK = 90, - ICON_POT = 91, - ICON_ALPHA_MULTIPLY = 92, - ICON_ALPHA_CLEAR = 93, - ICON_DITHERING = 94, - ICON_MIPMAPS = 95, - ICON_BOX_GRID = 96, - ICON_GRID = 97, - ICON_BOX_CORNERS_SMALL = 98, - ICON_BOX_CORNERS_BIG = 99, - ICON_FOUR_BOXES = 100, - ICON_GRID_FILL = 101, - ICON_BOX_MULTISIZE = 102, - ICON_ZOOM_SMALL = 103, - ICON_ZOOM_MEDIUM = 104, - ICON_ZOOM_BIG = 105, - ICON_ZOOM_ALL = 106, - ICON_ZOOM_CENTER = 107, - ICON_BOX_DOTS_SMALL = 108, - ICON_BOX_DOTS_BIG = 109, - ICON_BOX_CONCENTRIC = 110, - ICON_BOX_GRID_BIG = 111, - ICON_OK_TICK = 112, - ICON_CROSS = 113, - ICON_ARROW_LEFT = 114, - ICON_ARROW_RIGHT = 115, - ICON_ARROW_DOWN = 116, - ICON_ARROW_UP = 117, - ICON_ARROW_LEFT_FILL = 118, - ICON_ARROW_RIGHT_FILL = 119, - ICON_ARROW_DOWN_FILL = 120, - ICON_ARROW_UP_FILL = 121, - ICON_AUDIO = 122, - ICON_FX = 123, - ICON_WAVE = 124, - ICON_WAVE_SINUS = 125, - ICON_WAVE_SQUARE = 126, - ICON_WAVE_TRIANGULAR = 127, - ICON_CROSS_SMALL = 128, - ICON_PLAYER_PREVIOUS = 129, - ICON_PLAYER_PLAY_BACK = 130, - ICON_PLAYER_PLAY = 131, - ICON_PLAYER_PAUSE = 132, - ICON_PLAYER_STOP = 133, - ICON_PLAYER_NEXT = 134, - ICON_PLAYER_RECORD = 135, - ICON_MAGNET = 136, - ICON_LOCK_CLOSE = 137, - ICON_LOCK_OPEN = 138, - ICON_CLOCK = 139, - ICON_TOOLS = 140, - ICON_GEAR = 141, - ICON_GEAR_BIG = 142, - ICON_BIN = 143, - ICON_HAND_POINTER = 144, - ICON_LASER = 145, - ICON_COIN = 146, - ICON_EXPLOSION = 147, - ICON_1UP = 148, - ICON_PLAYER = 149, - ICON_PLAYER_JUMP = 150, - ICON_KEY = 151, - ICON_DEMON = 152, - ICON_TEXT_POPUP = 153, - ICON_GEAR_EX = 154, - ICON_CRACK = 155, - ICON_CRACK_POINTS = 156, - ICON_STAR = 157, - ICON_DOOR = 158, - ICON_EXIT = 159, - ICON_MODE_2D = 160, - ICON_MODE_3D = 161, - ICON_CUBE = 162, - ICON_CUBE_FACE_TOP = 163, - ICON_CUBE_FACE_LEFT = 164, - ICON_CUBE_FACE_FRONT = 165, - ICON_CUBE_FACE_BOTTOM = 166, - ICON_CUBE_FACE_RIGHT = 167, - ICON_CUBE_FACE_BACK = 168, - ICON_CAMERA = 169, - ICON_SPECIAL = 170, - ICON_LINK_NET = 171, - ICON_LINK_BOXES = 172, - ICON_LINK_MULTI = 173, - ICON_LINK = 174, - ICON_LINK_BROKE = 175, - ICON_TEXT_NOTES = 176, - ICON_NOTEBOOK = 177, - ICON_SUITCASE = 178, - ICON_SUITCASE_ZIP = 179, - ICON_MAILBOX = 180, - ICON_MONITOR = 181, - ICON_PRINTER = 182, - ICON_PHOTO_CAMERA = 183, - ICON_PHOTO_CAMERA_FLASH = 184, - ICON_HOUSE = 185, - ICON_HEART = 186, - ICON_CORNER = 187, - ICON_VERTICAL_BARS = 188, - ICON_VERTICAL_BARS_FILL = 189, - ICON_LIFE_BARS = 190, - ICON_INFO = 191, - ICON_CROSSLINE = 192, - ICON_HELP = 193, - ICON_FILETYPE_ALPHA = 194, - ICON_FILETYPE_HOME = 195, - ICON_LAYERS_VISIBLE = 196, - ICON_LAYERS = 197, - ICON_WINDOW = 198, - ICON_HIDPI = 199, - ICON_FILETYPE_BINARY = 200, - ICON_HEX = 201, - ICON_SHIELD = 202, - ICON_FILE_NEW = 203, - ICON_FOLDER_ADD = 204, - ICON_ALARM = 205, - ICON_206 = 206, - ICON_207 = 207, - ICON_208 = 208, - ICON_209 = 209, - ICON_210 = 210, - ICON_211 = 211, - ICON_212 = 212, - ICON_213 = 213, - ICON_214 = 214, - ICON_215 = 215, - ICON_216 = 216, - ICON_217 = 217, - ICON_218 = 218, - ICON_219 = 219, - ICON_220 = 220, - ICON_221 = 221, - ICON_222 = 222, - ICON_223 = 223, - ICON_224 = 224, - ICON_225 = 225, - ICON_226 = 226, - ICON_227 = 227, - ICON_228 = 228, - ICON_229 = 229, - ICON_230 = 230, - ICON_231 = 231, - ICON_232 = 232, - ICON_233 = 233, - ICON_234 = 234, - ICON_235 = 235, - ICON_236 = 236, - ICON_237 = 237, - ICON_238 = 238, - ICON_239 = 239, - ICON_240 = 240, - ICON_241 = 241, - ICON_242 = 242, - ICON_243 = 243, - ICON_244 = 244, - ICON_245 = 245, - ICON_246 = 246, - ICON_247 = 247, - ICON_248 = 248, - ICON_249 = 249, - ICON_250 = 250, - ICON_251 = 251, - ICON_252 = 252, - ICON_253 = 253, - ICON_254 = 254, - ICON_255 = 255, - } GuiIconName; -#endif - -#endif - -#if defined(__cplusplus) -} // Prevents name mangling of functions -#endif - -#endif // RAYGUI_H - -/*********************************************************************************** - * - * RAYGUI IMPLEMENTATION - * - ************************************************************************************/ - -#if defined(RAYGUI_IMPLEMENTATION) - -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] -#include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] -#include // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy() -#include // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()] -#include // Required for: roundf() [GuiColorPicker()] - -#ifdef __cplusplus -#define RAYGUI_CLITERAL(name) name -#else -#define RAYGUI_CLITERAL(name) (name) -#endif - -#if !defined(RAYGUI_NO_ICONS) && !defined(RAYGUI_CUSTOM_ICONS) - -// Embedded icons, no external file provided -#define RAYGUI_ICON_SIZE 16 // Size of icons in pixels (squared) -#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons -#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id - -// Icons data is defined by bit array (every bit represents one pixel) -// Those arrays are stored as unsigned int data arrays, so, -// every array element defines 32 pixels (bits) of information -// One icon is defined by 8 int, (8 int * 32 bit = 256 bit = 16*16 pixels) -// NOTE: Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels) -#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE * RAYGUI_ICON_SIZE / 32) - -//---------------------------------------------------------------------------------- -// Icons data for all gui possible icons (allocated on data segment by default) -// -// NOTE 1: Every icon is codified in binary form, using 1 bit per pixel, so, -// every 16x16 icon requires 8 integers (16*16/32) to be stored -// -// NOTE 2: A different icon set could be loaded over this array using GuiLoadIcons(), -// but loaded icons set must be same RAYGUI_ICON_SIZE and no more than RAYGUI_ICON_MAX_ICONS -// -// guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB -//---------------------------------------------------------------------------------- -static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS * RAYGUI_ICON_DATA_ELEMENTS] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_NONE - 0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // ICON_FOLDER_FILE_OPEN - 0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // ICON_FILE_SAVE_CLASSIC - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024002, 0x44424282, 0x793e4102, 0x00000100, // ICON_FOLDER_OPEN - 0x00000000, 0x0042007e, 0x40027fc2, 0x40024002, 0x41024102, 0x44424102, 0x793e4282, 0x00000000, // ICON_FOLDER_SAVE - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x24442284, 0x21042104, 0x20042104, 0x00003ffc, // ICON_FILE_OPEN - 0x3ff00000, 0x201c2010, 0x20042004, 0x21042004, 0x21042104, 0x22842444, 0x20042104, 0x00003ffc, // ICON_FILE_SAVE - 0x3ff00000, 0x201c2010, 0x00042004, 0x20041004, 0x20844784, 0x00841384, 0x20042784, 0x00003ffc, // ICON_FILE_EXPORT - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x22042204, 0x22042f84, 0x20042204, 0x00003ffc, // ICON_FILE_ADD - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042004, 0x25042884, 0x25042204, 0x20042884, 0x00003ffc, // ICON_FILE_DELETE - 0x3ff00000, 0x201c2010, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // ICON_FILETYPE_TEXT - 0x3ff00000, 0x201c2010, 0x27042004, 0x244424c4, 0x26442444, 0x20642664, 0x20042004, 0x00003ffc, // ICON_FILETYPE_AUDIO - 0x3ff00000, 0x201c2010, 0x26042604, 0x20042004, 0x35442884, 0x2414222c, 0x20042004, 0x00003ffc, // ICON_FILETYPE_IMAGE - 0x3ff00000, 0x201c2010, 0x20c42004, 0x22442144, 0x22442444, 0x20c42144, 0x20042004, 0x00003ffc, // ICON_FILETYPE_PLAY - 0x3ff00000, 0x3ffc2ff0, 0x3f3c2ff4, 0x3dbc2eb4, 0x3dbc2bb4, 0x3f3c2eb4, 0x3ffc2ff4, 0x00002ff4, // ICON_FILETYPE_VIDEO - 0x3ff00000, 0x201c2010, 0x21842184, 0x21842004, 0x21842184, 0x21842184, 0x20042184, 0x00003ffc, // ICON_FILETYPE_INFO - 0x0ff00000, 0x381c0810, 0x28042804, 0x28042804, 0x28042804, 0x28042804, 0x20102ffc, 0x00003ff0, // ICON_FILE_COPY - 0x00000000, 0x701c0000, 0x079c1e14, 0x55a000f0, 0x079c00f0, 0x701c1e14, 0x00000000, 0x00000000, // ICON_FILE_CUT - 0x01c00000, 0x13e41bec, 0x3f841004, 0x204420c4, 0x20442044, 0x20442044, 0x207c2044, 0x00003fc0, // ICON_FILE_PASTE - 0x00000000, 0x3aa00fe0, 0x2abc2aa0, 0x2aa42aa4, 0x20042aa4, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_CURSOR_HAND - 0x00000000, 0x003c000c, 0x030800c8, 0x30100c10, 0x10202020, 0x04400840, 0x01800280, 0x00000000, // ICON_CURSOR_POINTER - 0x00000000, 0x00180000, 0x01f00078, 0x03e007f0, 0x07c003e0, 0x04000e40, 0x00000000, 0x00000000, // ICON_CURSOR_CLASSIC - 0x00000000, 0x04000000, 0x11000a00, 0x04400a80, 0x01100220, 0x00580088, 0x00000038, 0x00000000, // ICON_PENCIL - 0x04000000, 0x15000a00, 0x50402880, 0x14102820, 0x05040a08, 0x015c028c, 0x007c00bc, 0x00000000, // ICON_PENCIL_BIG - 0x01c00000, 0x01400140, 0x01400140, 0x0ff80140, 0x0ff80808, 0x0aa80808, 0x0aa80aa8, 0x00000ff8, // ICON_BRUSH_CLASSIC - 0x1ffc0000, 0x5ffc7ffe, 0x40004000, 0x00807f80, 0x01c001c0, 0x01c001c0, 0x01c001c0, 0x00000080, // ICON_BRUSH_PAINTER - 0x00000000, 0x00800000, 0x01c00080, 0x03e001c0, 0x07f003e0, 0x036006f0, 0x000001c0, 0x00000000, // ICON_WATER_DROP - 0x00000000, 0x3e003800, 0x1f803f80, 0x0c201e40, 0x02080c10, 0x00840104, 0x00380044, 0x00000000, // ICON_COLOR_PICKER - 0x00000000, 0x07800300, 0x1fe00fc0, 0x3f883fd0, 0x0e021f04, 0x02040402, 0x00f00108, 0x00000000, // ICON_RUBBER - 0x00c00000, 0x02800140, 0x08200440, 0x20081010, 0x2ffe3004, 0x03f807fc, 0x00e001f0, 0x00000040, // ICON_COLOR_BUCKET - 0x00000000, 0x21843ffc, 0x01800180, 0x01800180, 0x01800180, 0x01800180, 0x03c00180, 0x00000000, // ICON_TEXT_T - 0x00800000, 0x01400180, 0x06200340, 0x0c100620, 0x1ff80c10, 0x380c1808, 0x70067004, 0x0000f80f, // ICON_TEXT_A - 0x78000000, 0x50004000, 0x00004800, 0x03c003c0, 0x03c003c0, 0x00100000, 0x0002000a, 0x0000000e, // ICON_SCALE - 0x75560000, 0x5e004002, 0x54001002, 0x41001202, 0x408200fe, 0x40820082, 0x40820082, 0x00006afe, // ICON_RESIZE - 0x00000000, 0x3f003f00, 0x3f003f00, 0x3f003f00, 0x00400080, 0x001c0020, 0x001c001c, 0x00000000, // ICON_FILTER_POINT - 0x6d800000, 0x00004080, 0x40804080, 0x40800000, 0x00406d80, 0x001c0020, 0x001c001c, 0x00000000, // ICON_FILTER_BILINEAR - 0x40080000, 0x1ffe2008, 0x14081008, 0x11081208, 0x10481088, 0x10081028, 0x10047ff8, 0x00001002, // ICON_CROP - 0x00100000, 0x3ffc0010, 0x2ab03550, 0x22b02550, 0x20b02150, 0x20302050, 0x2000fff0, 0x00002000, // ICON_CROP_ALPHA - 0x40000000, 0x1ff82000, 0x04082808, 0x01082208, 0x00482088, 0x00182028, 0x35542008, 0x00000002, // ICON_SQUARE_TOGGLE - 0x00000000, 0x02800280, 0x06c006c0, 0x0ea00ee0, 0x1e901eb0, 0x3e883e98, 0x7efc7e8c, 0x00000000, // ICON_SYMMETRY - 0x01000000, 0x05600100, 0x1d480d50, 0x7d423d44, 0x3d447d42, 0x0d501d48, 0x01000560, 0x00000100, // ICON_SYMMETRY_HORIZONTAL - 0x01800000, 0x04200240, 0x10080810, 0x00001ff8, 0x00007ffe, 0x0ff01ff8, 0x03c007e0, 0x00000180, // ICON_SYMMETRY_VERTICAL - 0x00000000, 0x010800f0, 0x02040204, 0x02040204, 0x07f00308, 0x1c000e00, 0x30003800, 0x00000000, // ICON_LENS - 0x00000000, 0x061803f0, 0x08240c0c, 0x08040814, 0x0c0c0804, 0x23f01618, 0x18002400, 0x00000000, // ICON_LENS_BIG - 0x00000000, 0x00000000, 0x1c7007c0, 0x638e3398, 0x1c703398, 0x000007c0, 0x00000000, 0x00000000, // ICON_EYE_ON - 0x00000000, 0x10002000, 0x04700fc0, 0x610e3218, 0x1c703098, 0x001007a0, 0x00000008, 0x00000000, // ICON_EYE_OFF - 0x00000000, 0x00007ffc, 0x40047ffc, 0x10102008, 0x04400820, 0x02800280, 0x02800280, 0x00000100, // ICON_FILTER_TOP - 0x00000000, 0x40027ffe, 0x10082004, 0x04200810, 0x02400240, 0x02400240, 0x01400240, 0x000000c0, // ICON_FILTER - 0x00800000, 0x00800080, 0x00000080, 0x3c9e0000, 0x00000000, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_POINT - 0x00800000, 0x00800080, 0x00800080, 0x3f7e01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_SMALL - 0x00800000, 0x00800080, 0x03e00080, 0x3e3e0220, 0x03e00220, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_BIG - 0x01000000, 0x04400280, 0x01000100, 0x43842008, 0x43849ab2, 0x01002008, 0x04400100, 0x01000280, // ICON_TARGET_MOVE - 0x01000000, 0x04400280, 0x01000100, 0x41042108, 0x41049ff2, 0x01002108, 0x04400100, 0x01000280, // ICON_CURSOR_MOVE - 0x781e0000, 0x500a4002, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x4002500a, 0x0000781e, // ICON_CURSOR_SCALE - 0x00000000, 0x20003c00, 0x24002800, 0x01000200, 0x00400080, 0x00140024, 0x003c0004, 0x00000000, // ICON_CURSOR_SCALE_RIGHT - 0x00000000, 0x0004003c, 0x00240014, 0x00800040, 0x02000100, 0x28002400, 0x3c002000, 0x00000000, // ICON_CURSOR_SCALE_LEFT - 0x00000000, 0x00100020, 0x10101fc8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // ICON_UNDO - 0x00000000, 0x08000400, 0x080813f8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // ICON_REDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3f902020, 0x00400020, 0x00000000, // ICON_REREDO - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3fc82010, 0x00200010, 0x00000000, // ICON_MUTATE - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18101020, 0x00100fc8, 0x00000020, // ICON_ROTATE - 0x00000000, 0x04000200, 0x240429fc, 0x20042204, 0x20442004, 0x3f942024, 0x00400020, 0x00000000, // ICON_REPEAT - 0x00000000, 0x20001000, 0x22104c0e, 0x00801120, 0x11200040, 0x4c0e2210, 0x10002000, 0x00000000, // ICON_SHUFFLE - 0x7ffe0000, 0x50024002, 0x44024802, 0x41024202, 0x40424082, 0x40124022, 0x4002400a, 0x00007ffe, // ICON_EMPTYBOX - 0x00800000, 0x03e00080, 0x08080490, 0x3c9e0808, 0x08080808, 0x03e00490, 0x00800080, 0x00000000, // ICON_TARGET - 0x00800000, 0x00800080, 0x00800080, 0x3ffe01c0, 0x008001c0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_SMALL_FILL - 0x00800000, 0x00800080, 0x03e00080, 0x3ffe03e0, 0x03e003e0, 0x00800080, 0x00800080, 0x00000000, // ICON_TARGET_BIG_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x638c2008, 0x638cfbbe, 0x01002008, 0x07c00100, 0x01000380, // ICON_TARGET_MOVE_FILL - 0x01000000, 0x07c00380, 0x01000100, 0x610c2108, 0x610cfffe, 0x01002108, 0x07c00100, 0x01000380, // ICON_CURSOR_MOVE_FILL - 0x781e0000, 0x6006700e, 0x04204812, 0x00000240, 0x02400000, 0x48120420, 0x700e6006, 0x0000781e, // ICON_CURSOR_SCALE_FILL - 0x00000000, 0x38003c00, 0x24003000, 0x01000200, 0x00400080, 0x000c0024, 0x003c001c, 0x00000000, // ICON_CURSOR_SCALE_RIGHT_FILL - 0x00000000, 0x001c003c, 0x0024000c, 0x00800040, 0x02000100, 0x30002400, 0x3c003800, 0x00000000, // ICON_CURSOR_SCALE_LEFT_FILL - 0x00000000, 0x00300020, 0x10301ff8, 0x10001020, 0x10001000, 0x10001000, 0x00001fc0, 0x00000000, // ICON_UNDO_FILL - 0x00000000, 0x0c000400, 0x0c081ff8, 0x00080408, 0x00080008, 0x00080008, 0x000003f8, 0x00000000, // ICON_REDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x20002000, 0x20402000, 0x3ff02060, 0x00400060, 0x00000000, // ICON_REREDO_FILL - 0x00000000, 0x3ffc0000, 0x20042004, 0x27fc2004, 0x20202000, 0x3ff82030, 0x00200030, 0x00000000, // ICON_MUTATE_FILL - 0x00000000, 0x0ff00000, 0x10081818, 0x11801008, 0x10001180, 0x18301020, 0x00300ff8, 0x00000020, // ICON_ROTATE_FILL - 0x00000000, 0x06000200, 0x26042ffc, 0x20042204, 0x20442004, 0x3ff42064, 0x00400060, 0x00000000, // ICON_REPEAT_FILL - 0x00000000, 0x30001000, 0x32107c0e, 0x00801120, 0x11200040, 0x7c0e3210, 0x10003000, 0x00000000, // ICON_SHUFFLE_FILL - 0x00000000, 0x30043ffc, 0x24042804, 0x21042204, 0x20442084, 0x20142024, 0x3ffc200c, 0x00000000, // ICON_EMPTYBOX_SMALL - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX - 0x00000000, 0x23c43ffc, 0x23c423c4, 0x200423c4, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP - 0x00000000, 0x3e043ffc, 0x3e043e04, 0x20043e04, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x3e043e04, 0x3e043e04, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x3e042004, 0x3e043e04, 0x3ffc3e04, 0x00000000, // ICON_BOX_BOTTOM_RIGHT - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x23c42004, 0x23c423c4, 0x3ffc23c4, 0x00000000, // ICON_BOX_BOTTOM - 0x00000000, 0x20043ffc, 0x20042004, 0x20042004, 0x207c2004, 0x207c207c, 0x3ffc207c, 0x00000000, // ICON_BOX_BOTTOM_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x207c207c, 0x207c207c, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_LEFT - 0x00000000, 0x207c3ffc, 0x207c207c, 0x2004207c, 0x20042004, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_TOP_LEFT - 0x00000000, 0x20043ffc, 0x20042004, 0x23c423c4, 0x23c423c4, 0x20042004, 0x3ffc2004, 0x00000000, // ICON_BOX_CENTER - 0x7ffe0000, 0x40024002, 0x47e24182, 0x4ff247e2, 0x47e24ff2, 0x418247e2, 0x40024002, 0x00007ffe, // ICON_BOX_CIRCLE_MASK - 0x7fff0000, 0x40014001, 0x40014001, 0x49555ddd, 0x4945495d, 0x400149c5, 0x40014001, 0x00007fff, // ICON_POT - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x404e40ce, 0x48125432, 0x4006540e, 0x00007ffe, // ICON_ALPHA_MULTIPLY - 0x7ffe0000, 0x53327332, 0x44ce4cce, 0x41324332, 0x5c4e40ce, 0x44124432, 0x40065c0e, 0x00007ffe, // ICON_ALPHA_CLEAR - 0x7ffe0000, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x42fe417e, 0x00007ffe, // ICON_DITHERING - 0x07fe0000, 0x1ffa0002, 0x7fea000a, 0x402a402a, 0x5b2a512a, 0x5128552a, 0x40205128, 0x00007fe0, // ICON_MIPMAPS - 0x00000000, 0x1ff80000, 0x12481248, 0x12481ff8, 0x1ff81248, 0x12481248, 0x00001ff8, 0x00000000, // ICON_BOX_GRID - 0x12480000, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x7ffe1248, 0x12481248, 0x12487ffe, 0x00001248, // ICON_GRID - 0x00000000, 0x1c380000, 0x1c3817e8, 0x08100810, 0x08100810, 0x17e81c38, 0x00001c38, 0x00000000, // ICON_BOX_CORNERS_SMALL - 0x700e0000, 0x700e5ffa, 0x20042004, 0x20042004, 0x20042004, 0x20042004, 0x5ffa700e, 0x0000700e, // ICON_BOX_CORNERS_BIG - 0x3f7e0000, 0x21422142, 0x21422142, 0x00003f7e, 0x21423f7e, 0x21422142, 0x3f7e2142, 0x00000000, // ICON_FOUR_BOXES - 0x00000000, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x3bb80000, 0x3bb83bb8, 0x00000000, // ICON_GRID_FILL - 0x7ffe0000, 0x7ffe7ffe, 0x77fe7000, 0x77fe77fe, 0x777e7700, 0x777e777e, 0x777e777e, 0x0000777e, // ICON_BOX_MULTISIZE - 0x781e0000, 0x40024002, 0x00004002, 0x01800000, 0x00000180, 0x40020000, 0x40024002, 0x0000781e, // ICON_ZOOM_SMALL - 0x781e0000, 0x40024002, 0x00004002, 0x03c003c0, 0x03c003c0, 0x40020000, 0x40024002, 0x0000781e, // ICON_ZOOM_MEDIUM - 0x781e0000, 0x40024002, 0x07e04002, 0x07e007e0, 0x07e007e0, 0x400207e0, 0x40024002, 0x0000781e, // ICON_ZOOM_BIG - 0x781e0000, 0x5ffa4002, 0x1ff85ffa, 0x1ff81ff8, 0x1ff81ff8, 0x5ffa1ff8, 0x40025ffa, 0x0000781e, // ICON_ZOOM_ALL - 0x00000000, 0x2004381c, 0x00002004, 0x00000000, 0x00000000, 0x20040000, 0x381c2004, 0x00000000, // ICON_ZOOM_CENTER - 0x00000000, 0x1db80000, 0x10081008, 0x10080000, 0x00001008, 0x10081008, 0x00001db8, 0x00000000, // ICON_BOX_DOTS_SMALL - 0x35560000, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x35562002, 0x00000000, // ICON_BOX_DOTS_BIG - 0x7ffe0000, 0x40024002, 0x48124ff2, 0x49924812, 0x48124992, 0x4ff24812, 0x40024002, 0x00007ffe, // ICON_BOX_CONCENTRIC - 0x00000000, 0x10841ffc, 0x10841084, 0x1ffc1084, 0x10841084, 0x10841084, 0x00001ffc, 0x00000000, // ICON_BOX_GRID_BIG - 0x00000000, 0x00000000, 0x10000000, 0x04000800, 0x01040200, 0x00500088, 0x00000020, 0x00000000, // ICON_OK_TICK - 0x00000000, 0x10080000, 0x04200810, 0x01800240, 0x02400180, 0x08100420, 0x00001008, 0x00000000, // ICON_CROSS - 0x00000000, 0x02000000, 0x00800100, 0x00200040, 0x00200010, 0x00800040, 0x02000100, 0x00000000, // ICON_ARROW_LEFT - 0x00000000, 0x00400000, 0x01000080, 0x04000200, 0x04000800, 0x01000200, 0x00400080, 0x00000000, // ICON_ARROW_RIGHT - 0x00000000, 0x00000000, 0x00000000, 0x08081004, 0x02200410, 0x00800140, 0x00000000, 0x00000000, // ICON_ARROW_DOWN - 0x00000000, 0x00000000, 0x01400080, 0x04100220, 0x10040808, 0x00000000, 0x00000000, 0x00000000, // ICON_ARROW_UP - 0x00000000, 0x02000000, 0x03800300, 0x03e003c0, 0x03e003f0, 0x038003c0, 0x02000300, 0x00000000, // ICON_ARROW_LEFT_FILL - 0x00000000, 0x00400000, 0x01c000c0, 0x07c003c0, 0x07c00fc0, 0x01c003c0, 0x004000c0, 0x00000000, // ICON_ARROW_RIGHT_FILL - 0x00000000, 0x00000000, 0x00000000, 0x0ff81ffc, 0x03e007f0, 0x008001c0, 0x00000000, 0x00000000, // ICON_ARROW_DOWN_FILL - 0x00000000, 0x00000000, 0x01c00080, 0x07f003e0, 0x1ffc0ff8, 0x00000000, 0x00000000, 0x00000000, // ICON_ARROW_UP_FILL - 0x00000000, 0x18a008c0, 0x32881290, 0x24822686, 0x26862482, 0x12903288, 0x08c018a0, 0x00000000, // ICON_AUDIO - 0x00000000, 0x04800780, 0x004000c0, 0x662000f0, 0x08103c30, 0x130a0e18, 0x0000318e, 0x00000000, // ICON_FX - 0x00000000, 0x00800000, 0x08880888, 0x2aaa0a8a, 0x0a8a2aaa, 0x08880888, 0x00000080, 0x00000000, // ICON_WAVE - 0x00000000, 0x00600000, 0x01080090, 0x02040108, 0x42044204, 0x24022402, 0x00001800, 0x00000000, // ICON_WAVE_SINUS - 0x00000000, 0x07f80000, 0x04080408, 0x04080408, 0x04080408, 0x7c0e0408, 0x00000000, 0x00000000, // ICON_WAVE_SQUARE - 0x00000000, 0x00000000, 0x00a00040, 0x22084110, 0x08021404, 0x00000000, 0x00000000, 0x00000000, // ICON_WAVE_TRIANGULAR - 0x00000000, 0x00000000, 0x04200000, 0x01800240, 0x02400180, 0x00000420, 0x00000000, 0x00000000, // ICON_CROSS_SMALL - 0x00000000, 0x18380000, 0x12281428, 0x10a81128, 0x112810a8, 0x14281228, 0x00001838, 0x00000000, // ICON_PLAYER_PREVIOUS - 0x00000000, 0x18000000, 0x11801600, 0x10181060, 0x10601018, 0x16001180, 0x00001800, 0x00000000, // ICON_PLAYER_PLAY_BACK - 0x00000000, 0x00180000, 0x01880068, 0x18080608, 0x06081808, 0x00680188, 0x00000018, 0x00000000, // ICON_PLAYER_PLAY - 0x00000000, 0x1e780000, 0x12481248, 0x12481248, 0x12481248, 0x12481248, 0x00001e78, 0x00000000, // ICON_PLAYER_PAUSE - 0x00000000, 0x1ff80000, 0x10081008, 0x10081008, 0x10081008, 0x10081008, 0x00001ff8, 0x00000000, // ICON_PLAYER_STOP - 0x00000000, 0x1c180000, 0x14481428, 0x15081488, 0x14881508, 0x14281448, 0x00001c18, 0x00000000, // ICON_PLAYER_NEXT - 0x00000000, 0x03c00000, 0x08100420, 0x10081008, 0x10081008, 0x04200810, 0x000003c0, 0x00000000, // ICON_PLAYER_RECORD - 0x00000000, 0x0c3007e0, 0x13c81818, 0x14281668, 0x14281428, 0x1c381c38, 0x08102244, 0x00000000, // ICON_MAGNET - 0x07c00000, 0x08200820, 0x3ff80820, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // ICON_LOCK_CLOSE - 0x07c00000, 0x08000800, 0x3ff80800, 0x23882008, 0x21082388, 0x20082108, 0x1ff02008, 0x00000000, // ICON_LOCK_OPEN - 0x01c00000, 0x0c180770, 0x3086188c, 0x60832082, 0x60034781, 0x30062002, 0x0c18180c, 0x01c00770, // ICON_CLOCK - 0x0a200000, 0x1b201b20, 0x04200e20, 0x04200420, 0x04700420, 0x0e700e70, 0x0e700e70, 0x04200e70, // ICON_TOOLS - 0x01800000, 0x3bdc318c, 0x0ff01ff8, 0x7c3e1e78, 0x1e787c3e, 0x1ff80ff0, 0x318c3bdc, 0x00000180, // ICON_GEAR - 0x01800000, 0x3ffc318c, 0x1c381ff8, 0x781e1818, 0x1818781e, 0x1ff81c38, 0x318c3ffc, 0x00000180, // ICON_GEAR_BIG - 0x00000000, 0x08080ff8, 0x08081ffc, 0x0aa80aa8, 0x0aa80aa8, 0x0aa80aa8, 0x08080aa8, 0x00000ff8, // ICON_BIN - 0x00000000, 0x00000000, 0x20043ffc, 0x08043f84, 0x04040f84, 0x04040784, 0x000007fc, 0x00000000, // ICON_HAND_POINTER - 0x00000000, 0x24400400, 0x00001480, 0x6efe0e00, 0x00000e00, 0x24401480, 0x00000400, 0x00000000, // ICON_LASER - 0x00000000, 0x03c00000, 0x08300460, 0x11181118, 0x11181118, 0x04600830, 0x000003c0, 0x00000000, // ICON_COIN - 0x00000000, 0x10880080, 0x06c00810, 0x366c07e0, 0x07e00240, 0x00001768, 0x04200240, 0x00000000, // ICON_EXPLOSION - 0x00000000, 0x3d280000, 0x2528252c, 0x3d282528, 0x05280528, 0x05e80528, 0x00000000, 0x00000000, // ICON_1UP - 0x01800000, 0x03c003c0, 0x018003c0, 0x0ff007e0, 0x0bd00bd0, 0x0a500bd0, 0x02400240, 0x02400240, // ICON_PLAYER - 0x01800000, 0x03c003c0, 0x118013c0, 0x03c81ff8, 0x07c003c8, 0x04400440, 0x0c080478, 0x00000000, // ICON_PLAYER_JUMP - 0x3ff80000, 0x30183ff8, 0x30183018, 0x3ff83ff8, 0x03000300, 0x03c003c0, 0x03e00300, 0x000003e0, // ICON_KEY - 0x3ff80000, 0x3ff83ff8, 0x33983ff8, 0x3ff83398, 0x3ff83ff8, 0x00000540, 0x0fe00aa0, 0x00000fe0, // ICON_DEMON - 0x00000000, 0x0ff00000, 0x20041008, 0x25442004, 0x10082004, 0x06000bf0, 0x00000300, 0x00000000, // ICON_TEXT_POPUP - 0x00000000, 0x11440000, 0x07f00be8, 0x1c1c0e38, 0x1c1c0c18, 0x07f00e38, 0x11440be8, 0x00000000, // ICON_GEAR_EX - 0x00000000, 0x20080000, 0x0c601010, 0x07c00fe0, 0x07c007c0, 0x0c600fe0, 0x20081010, 0x00000000, // ICON_CRACK - 0x00000000, 0x20080000, 0x0c601010, 0x04400fe0, 0x04405554, 0x0c600fe0, 0x20081010, 0x00000000, // ICON_CRACK_POINTS - 0x00000000, 0x00800080, 0x01c001c0, 0x1ffc3ffe, 0x03e007f0, 0x07f003e0, 0x0c180770, 0x00000808, // ICON_STAR - 0x0ff00000, 0x08180810, 0x08100818, 0x0a100810, 0x08180810, 0x08100818, 0x08100810, 0x00001ff8, // ICON_DOOR - 0x0ff00000, 0x08100810, 0x08100810, 0x10100010, 0x4f902010, 0x10102010, 0x08100010, 0x00000ff0, // ICON_EXIT - 0x00040000, 0x001f000e, 0x0ef40004, 0x12f41284, 0x0ef41214, 0x10040004, 0x7ffc3004, 0x10003000, // ICON_MODE_2D - 0x78040000, 0x501f600e, 0x0ef44004, 0x12f41284, 0x0ef41284, 0x10140004, 0x7ffc300c, 0x10003000, // ICON_MODE_3D - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // ICON_CUBE - 0x7fe00000, 0x5ff87ff0, 0x47fe4ffc, 0x44224402, 0x44224422, 0x241275e2, 0x0c06140a, 0x000007fe, // ICON_CUBE_FACE_TOP - 0x7fe00000, 0x50386030, 0x47fe483c, 0x443e443e, 0x443e443e, 0x241e75fe, 0x0c06140e, 0x000007fe, // ICON_CUBE_FACE_LEFT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x47fe47fe, 0x47fe47fe, 0x27fe77fe, 0x0ffe17fe, 0x000007fe, // ICON_CUBE_FACE_FRONT - 0x7fe00000, 0x50286030, 0x47fe4804, 0x44224402, 0x44224422, 0x3ff27fe2, 0x0ffe1ffa, 0x000007fe, // ICON_CUBE_FACE_BOTTOM - 0x7fe00000, 0x70286030, 0x7ffe7804, 0x7c227c02, 0x7c227c22, 0x3c127de2, 0x0c061c0a, 0x000007fe, // ICON_CUBE_FACE_RIGHT - 0x7fe00000, 0x7fe87ff0, 0x7ffe7fe4, 0x7fe27fe2, 0x7fe27fe2, 0x24127fe2, 0x0c06140a, 0x000007fe, // ICON_CUBE_FACE_BACK - 0x00000000, 0x2a0233fe, 0x22022602, 0x22022202, 0x2a022602, 0x00a033fe, 0x02080110, 0x00000000, // ICON_CAMERA - 0x00000000, 0x200c3ffc, 0x000c000c, 0x3ffc000c, 0x30003000, 0x30003000, 0x3ffc3004, 0x00000000, // ICON_SPECIAL - 0x00000000, 0x0022003e, 0x012201e2, 0x0100013e, 0x01000100, 0x79000100, 0x4f004900, 0x00007800, // ICON_LINK_NET - 0x00000000, 0x44007c00, 0x45004600, 0x00627cbe, 0x00620022, 0x45007cbe, 0x44004600, 0x00007c00, // ICON_LINK_BOXES - 0x00000000, 0x0044007c, 0x0010007c, 0x3f100010, 0x3f1021f0, 0x3f100010, 0x3f0021f0, 0x00000000, // ICON_LINK_MULTI - 0x00000000, 0x0044007c, 0x00440044, 0x0010007c, 0x00100010, 0x44107c10, 0x440047f0, 0x00007c00, // ICON_LINK - 0x00000000, 0x0044007c, 0x00440044, 0x0000007c, 0x00000010, 0x44007c10, 0x44004550, 0x00007c00, // ICON_LINK_BROKE - 0x02a00000, 0x22a43ffc, 0x20042004, 0x20042ff4, 0x20042ff4, 0x20042ff4, 0x20042004, 0x00003ffc, // ICON_TEXT_NOTES - 0x3ffc0000, 0x20042004, 0x245e27c4, 0x27c42444, 0x2004201e, 0x201e2004, 0x20042004, 0x00003ffc, // ICON_NOTEBOOK - 0x00000000, 0x07e00000, 0x04200420, 0x24243ffc, 0x24242424, 0x24242424, 0x3ffc2424, 0x00000000, // ICON_SUITCASE - 0x00000000, 0x0fe00000, 0x08200820, 0x40047ffc, 0x7ffc5554, 0x40045554, 0x7ffc4004, 0x00000000, // ICON_SUITCASE_ZIP - 0x00000000, 0x20043ffc, 0x3ffc2004, 0x13c81008, 0x100813c8, 0x10081008, 0x1ff81008, 0x00000000, // ICON_MAILBOX - 0x00000000, 0x40027ffe, 0x5ffa5ffa, 0x5ffa5ffa, 0x40025ffa, 0x03c07ffe, 0x1ff81ff8, 0x00000000, // ICON_MONITOR - 0x0ff00000, 0x6bfe7ffe, 0x7ffe7ffe, 0x68167ffe, 0x08106816, 0x08100810, 0x0ff00810, 0x00000000, // ICON_PRINTER - 0x3ff80000, 0xfffe2008, 0x870a8002, 0x904a888a, 0x904a904a, 0x870a888a, 0xfffe8002, 0x00000000, // ICON_PHOTO_CAMERA - 0x0fc00000, 0xfcfe0cd8, 0x8002fffe, 0x84428382, 0x84428442, 0x80028382, 0xfffe8002, 0x00000000, // ICON_PHOTO_CAMERA_FLASH - 0x00000000, 0x02400180, 0x08100420, 0x20041008, 0x23c42004, 0x22442244, 0x3ffc2244, 0x00000000, // ICON_HOUSE - 0x00000000, 0x1c700000, 0x3ff83ef8, 0x3ff83ff8, 0x0fe01ff0, 0x038007c0, 0x00000100, 0x00000000, // ICON_HEART - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0xe000c000, // ICON_CORNER - 0x00000000, 0x14001c00, 0x15c01400, 0x15401540, 0x155c1540, 0x15541554, 0x1ddc1554, 0x00000000, // ICON_VERTICAL_BARS - 0x00000000, 0x03000300, 0x1b001b00, 0x1b601b60, 0x1b6c1b60, 0x1b6c1b6c, 0x1b6c1b6c, 0x00000000, // ICON_VERTICAL_BARS_FILL - 0x00000000, 0x00000000, 0x403e7ffe, 0x7ffe403e, 0x7ffe0000, 0x43fe43fe, 0x00007ffe, 0x00000000, // ICON_LIFE_BARS - 0x7ffc0000, 0x43844004, 0x43844284, 0x43844004, 0x42844284, 0x42844284, 0x40044384, 0x00007ffc, // ICON_INFO - 0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // ICON_CROSSLINE - 0x00000000, 0x1ff01ff0, 0x18301830, 0x1f001830, 0x03001f00, 0x00000300, 0x03000300, 0x00000000, // ICON_HELP - 0x3ff00000, 0x2abc3550, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x2aac3554, 0x00003ffc, // ICON_FILETYPE_ALPHA - 0x3ff00000, 0x201c2010, 0x22442184, 0x28142424, 0x29942814, 0x2ff42994, 0x20042004, 0x00003ffc, // ICON_FILETYPE_HOME - 0x07fe0000, 0x04020402, 0x7fe20402, 0x44224422, 0x44224422, 0x402047fe, 0x40204020, 0x00007fe0, // ICON_LAYERS_VISIBLE - 0x07fe0000, 0x04020402, 0x7c020402, 0x44024402, 0x44024402, 0x402047fe, 0x40204020, 0x00007fe0, // ICON_LAYERS - 0x00000000, 0x40027ffe, 0x7ffe4002, 0x40024002, 0x40024002, 0x40024002, 0x7ffe4002, 0x00000000, // ICON_WINDOW - 0x09100000, 0x09f00910, 0x09100910, 0x00000910, 0x24a2779e, 0x27a224a2, 0x709e20a2, 0x00000000, // ICON_HIDPI - 0x3ff00000, 0x201c2010, 0x2a842e84, 0x2e842a84, 0x2ba42004, 0x2aa42aa4, 0x20042ba4, 0x00003ffc, // ICON_FILETYPE_BINARY - 0x00000000, 0x00000000, 0x00120012, 0x4a5e4bd2, 0x485233d2, 0x00004bd2, 0x00000000, 0x00000000, // ICON_HEX - 0x01800000, 0x381c0660, 0x23c42004, 0x23c42044, 0x13c82204, 0x08101008, 0x02400420, 0x00000180, // ICON_SHIELD - 0x007e0000, 0x20023fc2, 0x40227fe2, 0x400a403a, 0x400a400a, 0x400a400a, 0x4008400e, 0x00007ff8, // ICON_FILE_NEW - 0x00000000, 0x0042007e, 0x40027fc2, 0x44024002, 0x5f024402, 0x44024402, 0x7ffe4002, 0x00000000, // ICON_FOLDER_ADD - 0x44220000, 0x12482244, 0xf3cf0000, 0x14280420, 0x48122424, 0x08100810, 0x1ff81008, 0x03c00420, // ICON_ALARM - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_206 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_207 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_208 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_209 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_210 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_211 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_212 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_213 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_214 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_215 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_216 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_217 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_218 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_219 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_220 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_221 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_222 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_223 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_224 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_225 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_226 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_227 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_228 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_229 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_230 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_231 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_232 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_233 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_234 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_235 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_236 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_237 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_238 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_239 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_240 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_241 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_242 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_243 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_244 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_245 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_246 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_247 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_248 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_249 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_250 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_251 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_252 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_253 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_254 - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_255 -}; - -#endif // !RAYGUI_NO_ICONS && !RAYGUI_CUSTOM_ICONS - -#ifndef RAYGUI_ICON_SIZE -#define RAYGUI_ICON_SIZE 0 -#endif - -#define RAYGUI_MAX_CONTROLS 16 // Maximum number of standard controls -#define RAYGUI_MAX_PROPS_BASE 16 // Maximum number of standard properties -#define RAYGUI_MAX_PROPS_EXTENDED 8 // Maximum number of extended properties - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -// Gui control property style color element -typedef enum -{ - BORDER = 0, - BASE, - TEXT, - OTHER -} GuiPropertyElement; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -static GuiState guiState = STATE_NORMAL; // Gui global state, if !STATE_NORMAL, forces defined state - -static Font guiFont = {0}; // Gui current font (WARNING: highly coupled to raylib) -static bool guiLocked = false; // Gui lock state (no inputs processed) -static float guiAlpha = 1.0f; // Gui element transpacency on drawing - -static unsigned int guiIconScale = 1; // Gui icon default scale (if icons enabled) - -//---------------------------------------------------------------------------------- -// Style data array for all gui style properties (allocated on data segment by default) -// -// NOTE 1: First set of BASE properties are generic to all controls but could be individually -// overwritten per control, first set of EXTENDED properties are generic to all controls and -// can not be overwritten individually but custom EXTENDED properties can be used by control -// -// NOTE 2: A new style set could be loaded over this array using GuiLoadStyle(), -// but default gui style could always be recovered with GuiLoadStyleDefault() -// -// guiStyle size is by default: 16*(16 + 8) = 384*4 = 1536 bytes = 1.5 KB -//---------------------------------------------------------------------------------- -static unsigned int guiStyle[RAYGUI_MAX_CONTROLS * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED)] = {0}; - -static bool guiStyleLoaded = false; // Style loaded flag for lazy style initialization - -//---------------------------------------------------------------------------------- -// Standalone Mode Functions Declaration -// -// NOTE: raygui depend on some raylib input and drawing functions -// To use raygui as standalone library, below functions must be defined by the user -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) - -#define KEY_RIGHT 262 -#define KEY_LEFT 263 -#define KEY_DOWN 264 -#define KEY_UP 265 -#define KEY_BACKSPACE 259 -#define KEY_ENTER 257 - -#define MOUSE_LEFT_BUTTON 0 - -// Input required functions -//------------------------------------------------------------------------------- -static Vector2 GetMousePosition(void); -static float GetMouseWheelMove(void); -static bool IsMouseButtonDown(int button); -static bool IsMouseButtonPressed(int button); -static bool IsMouseButtonReleased(int button); - -static bool IsKeyDown(int key); -static bool IsKeyPressed(int key); -static int GetCharPressed(void); // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() -//------------------------------------------------------------------------------- - -// Drawing required functions -//------------------------------------------------------------------------------- -static void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle(), GuiDrawIcon() - -static void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // -- GuiColorPicker() -//------------------------------------------------------------------------------- - -// Text required functions -//------------------------------------------------------------------------------- -static Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // -- GuiLoadStyle() -static Font GetFontDefault(void); // -- GuiLoadStyleDefault() -static Texture2D LoadTextureFromImage(Image image); // -- GuiLoadStyle() -static void SetShapesTexture(Texture2D tex, Rectangle rec); // -- GuiLoadStyle() -static char *LoadFileText(const char *fileName); // -- GuiLoadStyle() -static const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle() - -static Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // -- GetTextWidth(), GuiTextBoxMulti() -static void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // -- GuiDrawText() -//------------------------------------------------------------------------------- - -// raylib functions already implemented in raygui -//------------------------------------------------------------------------------- -static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -static int ColorToInt(Color color); // Returns hexadecimal value for a Color -static Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -static const char *TextFormat(const char *text, ...); // Formatting of text with variables to 'embed' -static const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -static int TextToInteger(const char *text); // Get integer value from text -static int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded text -static const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode codepoint into UTF-8 text (char array size returned as parameter) - -static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw rectangle vertical gradient -//------------------------------------------------------------------------------- - -#endif // RAYGUI_STANDALONE - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static int GetTextWidth(const char *text); // Gui get text width using default font -static Rectangle GetTextBounds(int control, Rectangle bounds); // Get text bounds considering control bounds -static const char *GetTextIcon(const char *text, int *iconId); // Get text icon if provided and move text cursor - -static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint); // Gui draw text using default font -static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color); // Gui draw rectangle using default raygui style - -static const char **GuiTextSplit(const char *text, int *count, int *textRow); // Split controls text into multiple strings -static Vector3 ConvertHSVtoRGB(Vector3 hsv); // Convert color data from HSV to RGB -static Vector3 ConvertRGBtoHSV(Vector3 rgb); // Convert color data from RGB to HSV - -static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll bar control, used by GuiScrollPanel() - -//---------------------------------------------------------------------------------- -// Gui Setup Functions Definition -//---------------------------------------------------------------------------------- -// Enable gui global state -// NOTE: We check for STATE_DISABLED to avoid messing custom global state setups -void GuiEnable(void) -{ - if (guiState == STATE_DISABLED) - guiState = STATE_NORMAL; -} - -// Disable gui global state -// NOTE: We check for STATE_NORMAL to avoid messing custom global state setups -void GuiDisable(void) -{ - if (guiState == STATE_NORMAL) - guiState = STATE_DISABLED; -} - -// Lock gui global state -void GuiLock(void) { guiLocked = true; } - -// Unlock gui global state -void GuiUnlock(void) { guiLocked = false; } - -// Check if gui is locked (global state) -bool GuiIsLocked(void) { return guiLocked; } - -// Set gui controls alpha global state -void GuiFade(float alpha) -{ - if (alpha < 0.0f) - alpha = 0.0f; - else if (alpha > 1.0f) - alpha = 1.0f; - - guiAlpha = alpha; -} - -// Set gui state (global state) -void GuiSetState(int state) { guiState = (GuiState)state; } - -// Get gui state (global state) -int GuiGetState(void) { return guiState; } - -// Set custom gui font -// NOTE: Font loading/unloading is external to raygui -void GuiSetFont(Font font) -{ - if (font.texture.id > 0) - { - // NOTE: If we try to setup a font but default style has not been - // lazily loaded before, it will be overwritten, so we need to force - // default style loading first - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - - guiFont = font; - GuiSetStyle(DEFAULT, TEXT_SIZE, font.baseSize); - } -} - -// Get custom gui font -Font GuiGetFont(void) -{ - return guiFont; -} - -// Set control style property value -void GuiSetStyle(int control, int property, int value) -{ - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - guiStyle[control * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; - - // Default properties are propagated to all controls - if ((control == 0) && (property < RAYGUI_MAX_PROPS_BASE)) - { - for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) - guiStyle[i * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value; - } -} - -// Get control style property value -int GuiGetStyle(int control, int property) -{ - if (!guiStyleLoaded) - GuiLoadStyleDefault(); - return guiStyle[control * (RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property]; -} - -//---------------------------------------------------------------------------------- -// Gui Controls Functions Definition -//---------------------------------------------------------------------------------- - -// Window Box control -bool GuiWindowBox(Rectangle bounds, const char *title) -{ -// Window title bar height (including borders) -// NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() -#if !defined(RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT) -#define RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT 24 -#endif - - // GuiState state = guiState; - bool clicked = false; - - int statusBarHeight = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT; - - Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)statusBarHeight}; - if (bounds.height < statusBarHeight * 2.0f) - bounds.height = statusBarHeight * 2.0f; - - Rectangle windowPanel = {bounds.x, bounds.y + (float)statusBarHeight - 1, bounds.width, bounds.height - (float)statusBarHeight + 1}; - Rectangle closeButtonRec = {statusBar.x + statusBar.width - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - 20, - statusBar.y + statusBarHeight / 2.0f - 18.0f / 2.0f, 18, 18}; - - // Update control - //-------------------------------------------------------------------- - // NOTE: Logic is directly managed by button - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiStatusBar(statusBar, title); // Draw window header as status bar - GuiPanel(windowPanel, NULL); // Draw window base - - // Draw window close button - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); -#if defined(RAYGUI_NO_ICONS) - clicked = GuiButton(closeButtonRec, "x"); -#else - clicked = GuiButton(closeButtonRec, GuiIconText(ICON_CROSS_SMALL, NULL)); -#endif - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlignment); - //-------------------------------------------------------------------- - - return clicked; -} - -// Group Box control with text name -void GuiGroupBox(Rectangle bounds, const char *text) -{ -#if !defined(RAYGUI_GROUPBOX_LINE_THICK) -#define RAYGUI_GROUPBOX_LINE_THICK 1 -#endif - - GuiState state = guiState; - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height}, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha)); - - GuiLine(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2, bounds.width, (float)GuiGetStyle(DEFAULT, TEXT_SIZE)}, text); - //-------------------------------------------------------------------- -} - -// Line control -void GuiLine(Rectangle bounds, const char *text) -{ -#if !defined(RAYGUI_LINE_ORIGIN_SIZE) -#define RAYGUI_LINE_MARGIN_TEXT 12 -#endif -#if !defined(RAYGUI_LINE_TEXT_PADDING) -#define RAYGUI_LINE_TEXT_PADDING 4 -#endif - - GuiState state = guiState; - - Color color = Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha); - - // Draw control - //-------------------------------------------------------------------- - if (text == NULL) - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height / 2, bounds.width, 1}, 0, BLANK, color); - else - { - Rectangle textBounds = {0}; - textBounds.width = (float)GetTextWidth(text); - textBounds.height = bounds.height; - textBounds.x = bounds.x + RAYGUI_LINE_MARGIN_TEXT; - textBounds.y = bounds.y; - - // Draw line with embedded text label: "--- text --------------" - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x, bounds.y + bounds.height / 2, RAYGUI_LINE_MARGIN_TEXT - RAYGUI_LINE_TEXT_PADDING, 1}, 0, BLANK, color); - GuiDrawText(text, textBounds, TEXT_ALIGN_LEFT, color); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){bounds.x + 12 + textBounds.width + 4, bounds.y + bounds.height / 2, bounds.width - textBounds.width - RAYGUI_LINE_MARGIN_TEXT - RAYGUI_LINE_TEXT_PADDING, 1}, 0, BLANK, color); - } - //-------------------------------------------------------------------- -} - -// Panel control -void GuiPanel(Rectangle bounds, const char *text) -{ -#if !defined(RAYGUI_PANEL_BORDER_WIDTH) -#define RAYGUI_PANEL_BORDER_WIDTH 1 -#endif - - GuiState state = guiState; - - // Text will be drawn as a header bar (if provided) - Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}; - if ((text != NULL) && (bounds.height < RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f)) - bounds.height = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f; - - if (text != NULL) - { - // Move panel bounds after the header bar - bounds.y += (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 1; - bounds.height -= (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + 1; - } - - // Draw control - //-------------------------------------------------------------------- - if (text != NULL) - GuiStatusBar(statusBar, text); // Draw panel header as status bar - - GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BORDER_COLOR_DISABLED : LINE_COLOR)), guiAlpha), - Fade(GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED) ? BASE_COLOR_DISABLED : BACKGROUND_COLOR)), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Scroll Panel control -Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll) -{ - GuiState state = guiState; - - Vector2 scrollPos = {0.0f, 0.0f}; - if (scroll != NULL) - scrollPos = *scroll; - - // Text will be drawn as a header bar (if provided) - Rectangle statusBar = {bounds.x, bounds.y, bounds.width, (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}; - if (bounds.height < RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f) - bounds.height = RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT * 2.0f; - - if (text != NULL) - { - // Move panel bounds after the header bar - bounds.y += (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 1; - bounds.height -= (float)RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + 1; - } - - bool hasHorizontalScrollBar = (content.width > bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; - bool hasVerticalScrollBar = (content.height > bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)) ? true : false; - - // Recheck to account for the other scrollbar being visible - if (!hasHorizontalScrollBar) - hasHorizontalScrollBar = (hasVerticalScrollBar && (content.width > (bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; - if (!hasVerticalScrollBar) - hasVerticalScrollBar = (hasHorizontalScrollBar && (content.height > (bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH)))) ? true : false; - - int horizontalScrollBarWidth = hasHorizontalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - int verticalScrollBarWidth = hasVerticalScrollBar ? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0; - Rectangle horizontalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth}; - Rectangle verticalScrollBar = {(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; - - // Calculate view area (area without the scrollbars) - Rectangle view = (GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? RAYGUI_CLITERAL(Rectangle){bounds.x + verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth} : RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth, bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth}; - - // Clip view area to the actual content size - if (view.width > content.width) - view.width = content.width; - if (view.height > content.height) - view.height = content.height; - - float horizontalMin = hasHorizontalScrollBar ? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH); - float horizontalMax = hasHorizontalScrollBar ? content.width - bounds.width + (float)verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (float)verticalScrollBarWidth : 0) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); - float verticalMin = hasVerticalScrollBar ? 0 : -1; - float verticalMax = hasVerticalScrollBar ? content.height - bounds.height + (float)horizontalScrollBarWidth + (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - -#if defined(SUPPORT_SCROLLBAR_KEY_INPUT) - if (hasHorizontalScrollBar) - { - if (IsKeyDown(KEY_RIGHT)) - scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_LEFT)) - scrollPos.x += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - } - - if (hasVerticalScrollBar) - { - if (IsKeyDown(KEY_DOWN)) - scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - if (IsKeyDown(KEY_UP)) - scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - } -#endif - float wheelMove = GetMouseWheelMove(); - - // Horizontal scroll (Shift + Mouse wheel) - if (hasHorizontalScrollBar && (IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_SHIFT))) - scrollPos.x += wheelMove * 20; - else - scrollPos.y += wheelMove * 20; // Vertical scroll - } - } - - // Normalize scroll values - if (scrollPos.x > -horizontalMin) - scrollPos.x = -horizontalMin; - if (scrollPos.x < -horizontalMax) - scrollPos.x = -horizontalMax; - if (scrollPos.y > -verticalMin) - scrollPos.y = -verticalMin; - if (scrollPos.y < -verticalMax) - scrollPos.y = -verticalMax; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (text != NULL) - GuiStatusBar(statusBar, text); // Draw panel header as status bar - - GuiDrawRectangle(bounds, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background - - // Save size of the scrollbar slider - const int slider = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); - - // Draw horizontal scrollbar if visible - if (hasHorizontalScrollBar) - { - // Change scrollbar slider size to show the diff in size between the content width and the widget width - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth) / (int)content.width) * ((int)bounds.width - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - verticalScrollBarWidth))); - scrollPos.x = (float)-GuiScrollBar(horizontalScrollBar, (int)-scrollPos.x, (int)horizontalMin, (int)horizontalMax); - } - else - scrollPos.x = 0.0f; - - // Draw vertical scrollbar if visible - if (hasVerticalScrollBar) - { - // Change scrollbar slider size to show the diff in size between the content height and the widget height - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)(((bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth) / (int)content.height) * ((int)bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH) - horizontalScrollBarWidth))); - scrollPos.y = (float)-GuiScrollBar(verticalScrollBar, (int)-scrollPos.y, (int)verticalMin, (int)verticalMax); - } - else - scrollPos.y = 0.0f; - - // Draw detail corner rectangle if both scroll bars are visible - if (hasHorizontalScrollBar && hasVerticalScrollBar) - { - Rectangle corner = {(GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE) ? (bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) + 2) : (horizontalScrollBar.x + horizontalScrollBar.width + 2), verticalScrollBar.y + verticalScrollBar.height + 2, (float)horizontalScrollBarWidth - 4, (float)verticalScrollBarWidth - 4}; - GuiDrawRectangle(corner, 0, BLANK, Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT + (state * 3))), guiAlpha)); - } - - // Draw scrollbar lines depending on current state - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + (state * 3))), guiAlpha), BLANK); - - // Set scrollbar slider size back to the way it was before - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, slider); - //-------------------------------------------------------------------- - - if (scroll != NULL) - *scroll = scrollPos; - - return view; -} - -// Label control -void GuiLabel(Rectangle bounds, const char *text) -{ - GuiState state = guiState; - - // Update control - //-------------------------------------------------------------------- - // ... - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Button control, returns true when clicked -bool GuiButton(Rectangle bounds, const char *text) -{ - GuiState state = guiState; - bool pressed = false; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(BUTTON, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(BUTTON, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(BUTTON, BASE + (state * 3))), guiAlpha)); - GuiDrawText(text, GetTextBounds(BUTTON, bounds), GuiGetStyle(BUTTON, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(BUTTON, TEXT + (state * 3))), guiAlpha)); - //------------------------------------------------------------------ - - return pressed; -} - -// Label button control -bool GuiLabelButton(Rectangle bounds, const char *text) -{ - GuiState state = guiState; - bool pressed = false; - - // NOTE: We force bounds.width to be all text - float textWidth = MeasureTextEx(guiFont, text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)).x; - if (bounds.width < textWidth) - bounds.width = textWidth; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check checkbox state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawText(text, GetTextBounds(LABEL, bounds), GuiGetStyle(LABEL, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Toggle Button control, returns true when active -bool GuiToggle(Rectangle bounds, const char *text, bool active) -{ - GuiState state = guiState; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check toggle button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - state = STATE_NORMAL; - active = !active; - } - else - state = STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == STATE_NORMAL) - { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BORDER_COLOR_PRESSED : (BORDER + state * 3)))), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? BASE_COLOR_PRESSED : (BASE + state * 3)))), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, (active ? TEXT_COLOR_PRESSED : (TEXT + state * 3)))), guiAlpha)); - } - else - { - GuiDrawRectangle(bounds, GuiGetStyle(TOGGLE, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TOGGLE, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(TOGGLE, BASE + state * 3)), guiAlpha)); - GuiDrawText(text, GetTextBounds(TOGGLE, bounds), GuiGetStyle(TOGGLE, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(TOGGLE, TEXT + state * 3)), guiAlpha)); - } - //-------------------------------------------------------------------- - - return active; -} - -// Toggle Group control, returns toggled button index -int GuiToggleGroup(Rectangle bounds, const char *text, int active) -{ -#if !defined(RAYGUI_TOGGLEGROUP_MAX_ITEMS) -#define RAYGUI_TOGGLEGROUP_MAX_ITEMS 32 -#endif - - float initBoundsX = bounds.x; - - // Get substrings items from text (items pointers) - int rows[RAYGUI_TOGGLEGROUP_MAX_ITEMS] = {0}; - int itemCount = 0; - const char **items = GuiTextSplit(text, &itemCount, rows); - - int prevRow = rows[0]; - - for (int i = 0; i < itemCount; i++) - { - if (prevRow != rows[i]) - { - bounds.x = initBoundsX; - bounds.y += (bounds.height + GuiGetStyle(TOGGLE, GROUP_PADDING)); - prevRow = rows[i]; - } - - if (i == active) - GuiToggle(bounds, items[i], true); - else if (GuiToggle(bounds, items[i], false) == true) - active = i; - - bounds.x += (bounds.width + GuiGetStyle(TOGGLE, GROUP_PADDING)); - } - - return active; -} - -// Check Box control, returns true when active -bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) -{ - GuiState state = guiState; - - Rectangle textBounds = {0}; - - if (text != NULL) - { - textBounds.width = (float)GetTextWidth(text); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(CHECKBOX, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - Rectangle totalBounds = { - (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) ? textBounds.x : bounds.x, - bounds.y, - bounds.width + textBounds.width + GuiGetStyle(CHECKBOX, TEXT_PADDING), - bounds.height, - }; - - // Check checkbox state - if (CheckCollisionPointRec(mousePoint, totalBounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - checked = !checked; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(CHECKBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(CHECKBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - if (checked) - { - Rectangle check = {bounds.x + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.y + GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING), - bounds.width - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING)), - bounds.height - 2 * (GuiGetStyle(CHECKBOX, BORDER_WIDTH) + GuiGetStyle(CHECKBOX, CHECK_PADDING))}; - GuiDrawRectangle(check, 0, BLANK, Fade(GetColor(GuiGetStyle(CHECKBOX, TEXT + state * 3)), guiAlpha)); - } - - GuiDrawText(text, textBounds, (GuiGetStyle(CHECKBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return checked; -} - -// Combo Box control, returns selected item index -int GuiComboBox(Rectangle bounds, const char *text, int active) -{ - GuiState state = guiState; - - bounds.width -= (GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH) + GuiGetStyle(COMBOBOX, COMBO_BUTTON_SPACING)); - - Rectangle selector = {(float)bounds.x + bounds.width + GuiGetStyle(COMBOBOX, COMBO_BUTTON_SPACING), - (float)bounds.y, (float)GuiGetStyle(COMBOBOX, COMBO_BUTTON_WIDTH), (float)bounds.height}; - - // Get substrings items from text (items pointers, lengths and count) - int itemCount = 0; - const char **items = GuiTextSplit(text, &itemCount, NULL); - - if (active < 0) - active = 0; - else if (active > itemCount - 1) - active = itemCount - 1; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked && (itemCount > 1)) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - active += 1; - if (active >= itemCount) - active = 0; - } - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - // Draw combo box main - GuiDrawRectangle(bounds, GuiGetStyle(COMBOBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COMBOBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(COMBOBOX, BASE + (state * 3))), guiAlpha)); - GuiDrawText(items[active], GetTextBounds(COMBOBOX, bounds), GuiGetStyle(COMBOBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(COMBOBOX, TEXT + (state * 3))), guiAlpha)); - - // Draw selector using a custom button - // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 1); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - - GuiButton(selector, TextFormat("%i/%i", active + 1, itemCount)); - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - //-------------------------------------------------------------------- - - return active; -} - -// Dropdown Box control -// NOTE: Returns mouse click -bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode) -{ - GuiState state = guiState; - int itemSelected = *active; - int itemFocused = -1; - - // Get substrings items from text (items pointers, lengths and count) - int itemCount = 0; - const char **items = GuiTextSplit(text, &itemCount, NULL); - - Rectangle boundsOpen = bounds; - boundsOpen.height = (itemCount + 1) * (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); - - Rectangle itemBounds = bounds; - - bool pressed = false; // Check mouse button pressed - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && (editMode || !guiLocked) && (itemCount > 1)) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = STATE_PRESSED; - - // Check if mouse has been pressed or released outside limits - if (!CheckCollisionPointRec(mousePoint, boundsOpen)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - pressed = true; - } - - // Check if already selected item has been pressed again - if (CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - - // Check focused and selected item - for (int i = 0; i < itemCount; i++) - { - // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); - - if (CheckCollisionPointRec(mousePoint, itemBounds)) - { - itemFocused = i; - if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - itemSelected = i; - pressed = true; // Item selected, change to editMode = false - } - break; - } - } - - itemBounds = bounds; - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - pressed = true; - state = STATE_PRESSED; - } - else - state = STATE_FOCUSED; - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (editMode) - GuiPanel(boundsOpen, NULL); - - GuiDrawRectangle(bounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE + state * 3)), guiAlpha)); - GuiDrawText(items[itemSelected], GetTextBounds(DEFAULT, bounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + state * 3)), guiAlpha)); - - if (editMode) - { - // Draw visible items - for (int i = 0; i < itemCount; i++) - { - // Update item rectangle y position for next item - itemBounds.y += (bounds.height + GuiGetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING)); - - if (i == itemSelected) - { - GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_PRESSED)), guiAlpha)); - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_PRESSED)), guiAlpha)); - } - else if (i == itemFocused) - { - GuiDrawRectangle(itemBounds, GuiGetStyle(DROPDOWNBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, BASE_COLOR_FOCUSED)), guiAlpha)); - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_FOCUSED)), guiAlpha)); - } - else - GuiDrawText(items[i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(DROPDOWNBOX, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT_COLOR_NORMAL)), guiAlpha)); - } - } - - // Draw arrows (using icon if available) -#if defined(RAYGUI_NO_ICONS) - GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height / 2 - 2, 10, 10}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); -#else - GuiDrawText("#120#", RAYGUI_CLITERAL(Rectangle){bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height / 2 - 6, 10, 10}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); // ICON_ARROW_DOWN_FILL -#endif - //-------------------------------------------------------------------- - - *active = itemSelected; - return pressed; -} - -// Text Box control, updates input text -// NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) -bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) -{ - GuiState state = guiState; - bool pressed = false; - int textWidth = GetTextWidth(text); - Rectangle textBounds = GetTextBounds(TEXTBOX, bounds); - int textAlignment = editMode && textWidth >= textBounds.width ? TEXT_ALIGN_RIGHT : GuiGetStyle(TEXTBOX, TEXT_ALIGNMENT); - - Rectangle cursor = { - bounds.x + GuiGetStyle(TEXTBOX, TEXT_PADDING) + GetTextWidth(text) + 2, - bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE), - 4, - (float)GuiGetStyle(DEFAULT, TEXT_SIZE) * 2}; - - if (cursor.height >= bounds.height) - cursor.height = bounds.height - GuiGetStyle(TEXTBOX, BORDER_WIDTH) * 2; - if (cursor.y < (bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH))) - cursor.y = bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH); - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = STATE_PRESSED; - - int key = GetCharPressed(); // Returns codepoint as Unicode - int keyCount = (int)strlen(text); - int byteSize = 0; - const char *textUTF8 = CodepointToUTF8(key, &byteSize); - - // Only allow keys in range [32..125] - if ((keyCount + byteSize) < textSize) - { - float maxWidth = (bounds.width - (GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) * 2)); - - if (key >= 32) - { - for (int i = 0; i < byteSize; i++) - { - text[keyCount] = textUTF8[i]; - keyCount++; - } - - text[keyCount] = '\0'; - } - } - - // Delete text - if (keyCount > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - while ((keyCount > 0) && ((text[--keyCount] & 0xc0) == 0x80)) - ; - text[keyCount] = '\0'; - } - } - - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) - pressed = true; - - // Check text alignment to position cursor properly - if (textAlignment == TEXT_ALIGN_CENTER) - cursor.x = bounds.x + GetTextWidth(text) / 2 + bounds.width / 2 + 1; - else if (textAlignment == TEXT_ALIGN_RIGHT) - cursor.x = bounds.x + bounds.width - GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING) - GuiGetStyle(TEXTBOX, BORDER_WIDTH); - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == STATE_PRESSED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); - } - else if (state == STATE_DISABLED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); - } - else - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - // in case we edit and text does not fit in the textbox show right aligned and character clipped, slower but working - while (editMode && textWidth >= textBounds.width && *text) - { - int bytes = 0; - GetCodepoint(text, &bytes); - text += bytes; - textWidth = GetTextWidth(text); - } - GuiDrawText(text, textBounds, textAlignment, Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); - - // Draw cursor - if (editMode) - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Spinner control, returns selected value -bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) -{ - GuiState state = guiState; - - bool pressed = false; - int tempValue = *value; - - Rectangle spinner = {bounds.x + GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_SPACING), bounds.y, - bounds.width - 2 * (GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH) + GuiGetStyle(SPINNER, SPIN_BUTTON_SPACING)), bounds.height}; - Rectangle leftButtonBound = {(float)bounds.x, (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; - Rectangle rightButtonBound = {(float)bounds.x + bounds.width - GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.y, (float)GuiGetStyle(SPINNER, SPIN_BUTTON_WIDTH), (float)bounds.height}; - - Rectangle textBounds = {0}; - if (text != NULL) - { - textBounds.width = (float)GetTextWidth(text); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(SPINNER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SPINNER, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check spinner state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - } - } - -#if defined(RAYGUI_NO_ICONS) - if (GuiButton(leftButtonBound, "<")) - tempValue--; - if (GuiButton(rightButtonBound, ">")) - tempValue++; -#else - if (GuiButton(leftButtonBound, GuiIconText(ICON_ARROW_LEFT_FILL, NULL))) - tempValue--; - if (GuiButton(rightButtonBound, GuiIconText(ICON_ARROW_RIGHT_FILL, NULL))) - tempValue++; -#endif - - if (!editMode) - { - if (tempValue < minValue) - tempValue = minValue; - if (tempValue > maxValue) - tempValue = maxValue; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - // TODO: Set Spinner properties for ValueBox - pressed = GuiValueBox(spinner, NULL, &tempValue, minValue, maxValue, editMode); - - // Draw value selector custom buttons - // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values - int tempBorderWidth = GuiGetStyle(BUTTON, BORDER_WIDTH); - int tempTextAlign = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH)); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); - GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); - - // Draw text label if provided - GuiDrawText(text, textBounds, (GuiGetStyle(SPINNER, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - *value = tempValue; - return pressed; -} - -// Value Box control, updates input text with numbers -// NOTE: Requires static variables: frameCounter -bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode) -{ -#if !defined(RAYGUI_VALUEBOX_MAX_CHARS) -#define RAYGUI_VALUEBOX_MAX_CHARS 32 -#endif - - GuiState state = guiState; - bool pressed = false; - - char textValue[RAYGUI_VALUEBOX_MAX_CHARS + 1] = "\0"; - sprintf(textValue, "%i", *value); - - Rectangle textBounds = {0}; - if (text != NULL) - { - textBounds.width = (float)GetTextWidth(text); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(VALUEBOX, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - if (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_LEFT) - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(VALUEBOX, TEXT_PADDING); - } - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - bool valueHasChanged = false; - - if (editMode) - { - state = STATE_PRESSED; - - int keyCount = (int)strlen(textValue); - - // Only allow keys in range [48..57] - if (keyCount < RAYGUI_VALUEBOX_MAX_CHARS) - { - if (GetTextWidth(textValue) < bounds.width) - { - int key = GetCharPressed(); - if ((key >= 48) && (key <= 57)) - { - textValue[keyCount] = (char)key; - keyCount++; - valueHasChanged = true; - } - } - } - - // Delete text - if (keyCount > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - keyCount--; - textValue[keyCount] = '\0'; - valueHasChanged = true; - } - } - - if (valueHasChanged) - *value = TextToInteger(textValue); - - // NOTE: We are not clamp values until user input finishes - // if (*value > maxValue) *value = maxValue; - // else if (*value < minValue) *value = minValue; - - if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) - pressed = true; - } - else - { - if (*value > maxValue) - *value = maxValue; - else if (*value < minValue) - *value = minValue; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - Color baseColor = BLANK; - if (state == STATE_PRESSED) - baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_PRESSED)); - else if (state == STATE_DISABLED) - baseColor = GetColor(GuiGetStyle(VALUEBOX, BASE_COLOR_DISABLED)); - - // WARNING: BLANK color does not work properly with Fade() - GuiDrawRectangle(bounds, GuiGetStyle(VALUEBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER + (state * 3))), guiAlpha), baseColor); - GuiDrawText(textValue, GetTextBounds(VALUEBOX, bounds), TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(VALUEBOX, TEXT + (state * 3))), guiAlpha)); - - // Draw cursor - if (editMode) - { - // NOTE: ValueBox internal text is always centered - Rectangle cursor = {bounds.x + GetTextWidth(textValue) / 2 + bounds.width / 2 + 2, bounds.y + 2 * GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4 * GuiGetStyle(VALUEBOX, BORDER_WIDTH)}; - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - } - - // Draw text label if provided - GuiDrawText(text, textBounds, (GuiGetStyle(VALUEBOX, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) ? TEXT_ALIGN_LEFT : TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(LABEL, TEXT + (state * 3))), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Text Box control with multiple lines -bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) -{ - GuiState state = guiState; - bool pressed = false; - - Rectangle textAreaBounds = { - bounds.x + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.y + GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING), - bounds.width - 2 * (GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING)), - bounds.height - 2 * (GuiGetStyle(TEXTBOX, BORDER_WIDTH) + GuiGetStyle(TEXTBOX, TEXT_INNER_PADDING))}; - - // Cursor position, [x, y] values should be updated - Rectangle cursor = {0, -1, 4, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) + 2}; - - float scaleFactor = (float)GuiGetStyle(DEFAULT, TEXT_SIZE) / (float)guiFont.baseSize; // Character rectangle scaling factor - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (editMode) - { - state = STATE_PRESSED; - - // We get an Unicode codepoint - int codepoint = GetCharPressed(); - int textLength = (int)strlen(text); // Length in bytes (UTF-8 string) - int byteSize = 0; - const char *textUTF8 = CodepointToUTF8(codepoint, &byteSize); - - // Introduce characters - if ((textLength + byteSize) < textSize) - { - if (IsKeyPressed(KEY_ENTER)) - { - text[textLength] = '\n'; - textLength++; - } - else if (codepoint >= 32) - { - // Supports Unicode inputs -> Encoded to UTF-8 - int charUTF8Length = 0; - const char *charEncoded = CodepointToUTF8(codepoint, &charUTF8Length); - memcpy(text + textLength, charEncoded, charUTF8Length); - textLength += charUTF8Length; - } - } - - // Delete characters - if (textLength > 0) - { - if (IsKeyPressed(KEY_BACKSPACE)) - { - if ((unsigned char)text[textLength - 1] < 127) - { - // Remove ASCII equivalent character (1 byte) - textLength--; - text[textLength] = '\0'; - } - else - { - // Remove latest UTF-8 unicode character introduced (n bytes) - int charUTF8Length = 0; - while ((charUTF8Length < textLength) && ((unsigned char)text[textLength - 1 - charUTF8Length] & 0b01000000) == 0) - charUTF8Length++; - - textLength -= (charUTF8Length + 1); - text[textLength] = '\0'; - } - } - } - - // Exit edit mode - if (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - else - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = STATE_FOCUSED; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - pressed = true; - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state == STATE_PRESSED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_PRESSED)), guiAlpha)); - } - else if (state == STATE_DISABLED) - { - GuiDrawRectangle(bounds, GuiGetStyle(TEXTBOX, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(TEXTBOX, BASE_COLOR_DISABLED)), guiAlpha)); - } - else - GuiDrawRectangle(bounds, 1, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER + (state * 3))), guiAlpha), BLANK); - - int wrapMode = 1; // 0-No wrap, 1-Char wrap, 2-Word wrap - Vector2 cursorPos = {textAreaBounds.x, textAreaBounds.y}; - - // int lastSpacePos = 0; - // int lastSpaceWidth = 0; - // int lastSpaceCursorPos = 0; - - for (int i = 0, codepointLength = 0; text[i] != '\0'; i += codepointLength) - { - int codepoint = GetCodepoint(text + i, &codepointLength); - int index = GetGlyphIndex(guiFont, codepoint); // If requested codepoint is not found, we get '?' (0x3f) - Rectangle atlasRec = guiFont.recs[index]; - GlyphInfo glyphInfo = guiFont.glyphs[index]; // Glyph measures - - if ((codepointLength == 1) && (codepoint == '\n')) - { - cursorPos.y += (guiFont.baseSize * scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_SPACING)); // Line feed - cursorPos.x = textAreaBounds.x; // Carriage return - } - else - { - if (wrapMode == 1) - { - int glyphWidth = 0; - if (glyphInfo.advanceX != 0) - glyphWidth += glyphInfo.advanceX; - else - glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); - - // Jump line if the end of the text box area has been reached - if ((cursorPos.x + (glyphWidth * scaleFactor)) > (textAreaBounds.x + textAreaBounds.width)) - { - cursorPos.y += (guiFont.baseSize * scaleFactor + GuiGetStyle(TEXTBOX, TEXT_LINES_SPACING)); // Line feed - cursorPos.x = textAreaBounds.x; // Carriage return - } - } - else if (wrapMode == 2) - { - /* - if ((codepointLength == 1) && (codepoint == ' ')) - { - lastSpacePos = i; - lastSpaceWidth = 0; - lastSpaceCursorPos = cursorPos.x; - } - - // Jump line if last word reaches end of text box area - if ((lastSpaceCursorPos + lastSpaceWidth) > (textAreaBounds.x + textAreaBounds.width)) - { - cursorPos.y += 12; // Line feed - cursorPos.x = textAreaBounds.x; // Carriage return - } - */ - } - - // Draw current character glyph - DrawTextCodepoint(guiFont, codepoint, cursorPos, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), Fade(GetColor(GuiGetStyle(TEXTBOX, TEXT + (state * 3))), guiAlpha)); - - int glyphWidth = 0; - if (glyphInfo.advanceX != 0) - glyphWidth += glyphInfo.advanceX; - else - glyphWidth += (int)(atlasRec.width + glyphInfo.offsetX); - - cursorPos.x += (glyphWidth * scaleFactor + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); - // if (i > lastSpacePos) lastSpaceWidth += (atlasRec.width + (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); - } - } - - cursor.x = cursorPos.x; - cursor.y = cursorPos.y; - - // Draw cursor position considering text glyphs - if (editMode) - GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(TEXTBOX, BORDER_COLOR_PRESSED)), guiAlpha)); - //-------------------------------------------------------------------- - - return pressed; -} - -// Slider control with pro parameters -// NOTE: Other GuiSlider*() controls use this one -float GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue, int sliderWidth) -{ - GuiState state = guiState; - - int sliderValue = (int)(((value - minValue) / (maxValue - minValue)) * (bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH))); - - Rectangle slider = {bounds.x, bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING), - 0, bounds.height - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH) - 2 * GuiGetStyle(SLIDER, SLIDER_PADDING)}; - - if (sliderWidth > 0) // Slider - { - slider.x += (sliderValue - sliderWidth / 2); - slider.width = (float)sliderWidth; - } - else if (sliderWidth == 0) // SliderBar - { - slider.x += GuiGetStyle(SLIDER, BORDER_WIDTH); - slider.width = (float)sliderValue; - } - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = STATE_PRESSED; - - // Get equivalent value and slider position from mousePoint.x - value = ((maxValue - minValue) * (mousePoint.x - (float)(bounds.x + sliderWidth / 2))) / (float)(bounds.width - sliderWidth) + minValue; - - if (sliderWidth > 0) - slider.x = mousePoint.x - slider.width / 2; // Slider - else if (sliderWidth == 0) - slider.width = (float)sliderValue; // SliderBar - } - else - state = STATE_FOCUSED; - } - - if (value > maxValue) - value = maxValue; - else if (value < minValue) - value = minValue; - } - - // Bar limits check - if (sliderWidth > 0) // Slider - { - if (slider.x <= (bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH))) - slider.x = bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH); - else if ((slider.x + slider.width) >= (bounds.x + bounds.width)) - slider.x = bounds.x + bounds.width - slider.width - GuiGetStyle(SLIDER, BORDER_WIDTH); - } - else if (sliderWidth == 0) // SliderBar - { - if (slider.width > bounds.width) - slider.width = bounds.width - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH); - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state * 3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - - // Draw slider internal bar (depends on state) - if ((state == STATE_NORMAL) || (state == STATE_PRESSED)) - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == STATE_FOCUSED) - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha)); - - // Draw left/right text if provided - if (textLeft != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = (float)GetTextWidth(textLeft); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textLeft, textBounds, TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); - } - - if (textRight != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = (float)GetTextWidth(textRight); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(SLIDER, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textRight, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state * 3))), guiAlpha)); - } - //-------------------------------------------------------------------- - - return value; -} - -// Slider control extended, returns selected value and has text -float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, GuiGetStyle(SLIDER, SLIDER_WIDTH)); -} - -// Slider Bar control extended, returns selected value -float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - return GuiSliderPro(bounds, textLeft, textRight, value, minValue, maxValue, 0); -} - -// Progress Bar control extended, shows current progress value -float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) -{ - GuiState state = guiState; - - Rectangle progress = {bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), - bounds.y + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) + GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING), 0, - bounds.height - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH) - 2 * GuiGetStyle(PROGRESSBAR, PROGRESS_PADDING)}; - - // Update control - //-------------------------------------------------------------------- - if (value > maxValue) - value = maxValue; - - if (state != STATE_DISABLED) - progress.width = ((float)(value / (maxValue - minValue)) * (float)(bounds.width - 2 * GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(PROGRESSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(PROGRESSBAR, BORDER + (state * 3))), guiAlpha), BLANK); - - // Draw slider internal progress bar (depends on state) - if ((state == STATE_NORMAL) || (state == STATE_PRESSED)) - GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)), guiAlpha)); - else if (state == STATE_FOCUSED) - GuiDrawRectangle(progress, 0, BLANK, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT_COLOR_FOCUSED)), guiAlpha)); - - // Draw left/right text if provided - if (textLeft != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = (float)GetTextWidth(textLeft); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x - textBounds.width - GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textLeft, textBounds, TEXT_ALIGN_RIGHT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); - } - - if (textRight != NULL) - { - Rectangle textBounds = {0}; - textBounds.width = (float)GetTextWidth(textRight); - textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - textBounds.x = bounds.x + bounds.width + GuiGetStyle(PROGRESSBAR, TEXT_PADDING); - textBounds.y = bounds.y + bounds.height / 2 - GuiGetStyle(DEFAULT, TEXT_SIZE) / 2; - - GuiDrawText(textRight, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(PROGRESSBAR, TEXT + (state * 3))), guiAlpha)); - } - //-------------------------------------------------------------------- - - return value; -} - -// Status Bar control -void GuiStatusBar(Rectangle bounds, const char *text) -{ - GuiState state = guiState; - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(STATUSBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? BORDER_COLOR_NORMAL : BORDER_COLOR_DISABLED)), guiAlpha), - Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(STATUSBAR, bounds), GuiGetStyle(STATUSBAR, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(STATUSBAR, (state != STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); - //-------------------------------------------------------------------- -} - -// Dummy rectangle control, intended for placeholding -void GuiDummyRec(Rectangle bounds, const char *text) -{ - GuiState state = guiState; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check button state - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - state = STATE_PRESSED; - else - state = STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, 0, BLANK, Fade(GetColor(GuiGetStyle(DEFAULT, (state != STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha)); - GuiDrawText(text, GetTextBounds(DEFAULT, bounds), TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(BUTTON, (state != STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha)); - //------------------------------------------------------------------ -} - -// List View control -int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active) -{ - int itemCount = 0; - const char **items = NULL; - - if (text != NULL) - items = GuiTextSplit(text, &itemCount, NULL); - - return GuiListViewEx(bounds, items, itemCount, NULL, scrollIndex, active); -} - -// List View control with extended parameters -int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active) -{ - GuiState state = guiState; - int itemFocused = (focus == NULL) ? -1 : *focus; - int itemSelected = active; - - // Check if we need a scroll bar - bool useScrollBar = false; - if ((GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)) * count > bounds.height) - useScrollBar = true; - - // Define base item rectangle [0] - Rectangle itemBounds = {0}; - itemBounds.x = bounds.x + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING); - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); - itemBounds.width = bounds.width - 2 * GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) - GuiGetStyle(DEFAULT, BORDER_WIDTH); - itemBounds.height = (float)GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT); - if (useScrollBar) - itemBounds.width -= GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH); - - // Get items on the list - int visibleItems = (int)bounds.height / (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); - if (visibleItems > count) - visibleItems = count; - - int startIndex = (scrollIndex == NULL) ? 0 : *scrollIndex; - if ((startIndex < 0) || (startIndex > (count - visibleItems))) - startIndex = 0; - int endIndex = startIndex + visibleItems; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - // Check mouse inside list view - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = STATE_FOCUSED; - - // Check focused and selected item - for (int i = 0; i < visibleItems; i++) - { - if (CheckCollisionPointRec(mousePoint, itemBounds)) - { - itemFocused = startIndex + i; - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - if (itemSelected == (startIndex + i)) - itemSelected = -1; - else - itemSelected = startIndex + i; - } - break; - } - - // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); - } - - if (useScrollBar) - { - int wheelMove = (int)GetMouseWheelMove(); - startIndex -= wheelMove; - - if (startIndex < 0) - startIndex = 0; - else if (startIndex > (count - visibleItems)) - startIndex = count - visibleItems; - - endIndex = startIndex + visibleItems; - if (endIndex > count) - endIndex = count; - } - } - else - itemFocused = -1; - - // Reset item rectangle y to [0] - itemBounds.y = bounds.y + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING) + GuiGetStyle(DEFAULT, BORDER_WIDTH); - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background - - // Draw visible items - for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) - { - if (state == STATE_DISABLED) - { - if ((startIndex + i) == itemSelected) - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_DISABLED)), guiAlpha)); - - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_DISABLED)), guiAlpha)); - } - else - { - if ((startIndex + i) == itemSelected) - { - // Draw item selected - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_PRESSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_PRESSED)), guiAlpha)); - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_PRESSED)), guiAlpha)); - } - else if ((startIndex + i) == itemFocused) - { - // Draw item focused - GuiDrawRectangle(itemBounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER_COLOR_FOCUSED)), guiAlpha), Fade(GetColor(GuiGetStyle(LISTVIEW, BASE_COLOR_FOCUSED)), guiAlpha)); - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_FOCUSED)), guiAlpha)); - } - else - { - // Draw item normal - GuiDrawText(text[startIndex + i], GetTextBounds(DEFAULT, itemBounds), GuiGetStyle(LISTVIEW, TEXT_ALIGNMENT), Fade(GetColor(GuiGetStyle(LISTVIEW, TEXT_COLOR_NORMAL)), guiAlpha)); - } - } - - // Update item rectangle y position for next item - itemBounds.y += (GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) + GuiGetStyle(LISTVIEW, LIST_ITEMS_SPACING)); - } - - if (useScrollBar) - { - Rectangle scrollBarBounds = { - bounds.x + bounds.width - GuiGetStyle(LISTVIEW, BORDER_WIDTH) - GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), - bounds.y + GuiGetStyle(LISTVIEW, BORDER_WIDTH), (float)GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH), - bounds.height - 2 * GuiGetStyle(DEFAULT, BORDER_WIDTH)}; - - // Calculate percentage of visible items and apply same percentage to scrollbar - float percentVisible = (float)(endIndex - startIndex) / count; - float sliderSize = bounds.height * percentVisible; - - int prevSliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); // Save default slider size - int prevScrollSpeed = GuiGetStyle(SCROLLBAR, SCROLL_SPEED); // Save default scroll speed - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, (int)sliderSize); // Change slider size - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, count - visibleItems); // Change scroll speed - - startIndex = GuiScrollBar(scrollBarBounds, startIndex, 0, count - visibleItems); - - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, prevScrollSpeed); // Reset scroll speed to default - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, prevSliderSize); // Reset slider size to default - } - //-------------------------------------------------------------------- - - if (focus != NULL) - *focus = itemFocused; - if (scrollIndex != NULL) - *scrollIndex = startIndex; - - return itemSelected; -} - -// Color Panel control -Color GuiColorPanel(Rectangle bounds, const char *text, Color color) -{ - const Color colWhite = {255, 255, 255, 255}; - const Color colBlack = {0, 0, 0, 255}; - - GuiState state = guiState; - Vector2 pickerSelector = {0}; - - Vector3 vcolor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f}; - Vector3 hsv = ConvertRGBtoHSV(vcolor); - - pickerSelector.x = bounds.x + (float)hsv.y * bounds.width; // HSV: Saturation - pickerSelector.y = bounds.y + (1.0f - (float)hsv.z) * bounds.height; // HSV: Value - - float hue = -1.0f; - Vector3 maxHue = {hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f}; - Vector3 rgbHue = ConvertHSVtoRGB(maxHue); - Color maxHueCol = {(unsigned char)(255.0f * rgbHue.x), - (unsigned char)(255.0f * rgbHue.y), - (unsigned char)(255.0f * rgbHue.z), 255}; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = STATE_PRESSED; - pickerSelector = mousePoint; - - // Calculate color from picker - Vector2 colorPick = {pickerSelector.x - bounds.x, pickerSelector.y - bounds.y}; - - colorPick.x /= (float)bounds.width; // Get normalized value on x - colorPick.y /= (float)bounds.height; // Get normalized value on y - - hsv.y = colorPick.x; - hsv.z = 1.0f - colorPick.y; - - Vector3 rgb = ConvertHSVtoRGB(hsv); - - // NOTE: Vector3ToColor() only available on raylib 1.8.1 - color = RAYGUI_CLITERAL(Color){(unsigned char)(255.0f * rgb.x), - (unsigned char)(255.0f * rgb.y), - (unsigned char)(255.0f * rgb.z), - (unsigned char)(255.0f * (float)color.a / 255.0f)}; - } - else - state = STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state != STATE_DISABLED) - { - DrawRectangleGradientEx(bounds, Fade(colWhite, guiAlpha), Fade(colWhite, guiAlpha), Fade(maxHueCol, guiAlpha), Fade(maxHueCol, guiAlpha)); - DrawRectangleGradientEx(bounds, Fade(colBlack, 0), Fade(colBlack, guiAlpha), Fade(colBlack, guiAlpha), Fade(colBlack, 0)); - - // Draw color picker: selector - Rectangle selector = {pickerSelector.x - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, pickerSelector.y - GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE) / 2, (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE), (float)GuiGetStyle(COLORPICKER, COLOR_SELECTOR_SIZE)}; - GuiDrawRectangle(selector, 0, BLANK, Fade(colWhite, guiAlpha)); - } - else - { - DrawRectangleGradientEx(bounds, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(colBlack, 0.6f), guiAlpha), Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.6f), guiAlpha)); - } - - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - //-------------------------------------------------------------------- - - return color; -} - -// Color Bar Alpha control -// NOTE: Returns alpha value normalized [0..1] -float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha) -{ -#if !defined(RAYGUI_COLORBARALPHA_CHECKED_SIZE) -#define RAYGUI_COLORBARALPHA_CHECKED_SIZE 10 -#endif - - GuiState state = guiState; - Rectangle selector = {(float)bounds.x + alpha * bounds.width - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) / 2, (float)bounds.y - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT), (float)bounds.height + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2}; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = STATE_PRESSED; - - alpha = (mousePoint.x - bounds.x) / bounds.width; - if (alpha <= 0.0f) - alpha = 0.0f; - if (alpha >= 1.0f) - alpha = 1.0f; - // selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; - } - else - state = STATE_FOCUSED; - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - - // Draw alpha bar: checked background - if (state != STATE_DISABLED) - { - int checksX = (int)bounds.width / RAYGUI_COLORBARALPHA_CHECKED_SIZE; - int checksY = (int)bounds.height / RAYGUI_COLORBARALPHA_CHECKED_SIZE; - - for (int x = 0; x < checksX; x++) - { - for (int y = 0; y < checksY; y++) - { - Rectangle check = {bounds.x + x * RAYGUI_COLORBARALPHA_CHECKED_SIZE, bounds.y + y * RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE, RAYGUI_COLORBARALPHA_CHECKED_SIZE}; - GuiDrawRectangle(check, 0, BLANK, ((x + y) % 2) ? Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), 0.4f), guiAlpha) : Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.4f), guiAlpha)); - } - } - - DrawRectangleGradientEx(bounds, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, RAYGUI_CLITERAL(Color){255, 255, 255, 0}, Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 0, 255}, guiAlpha)); - } - else - DrawRectangleGradientEx(bounds, Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - - // Draw alpha bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); - //-------------------------------------------------------------------- - - return alpha; -} - -// Color Bar Hue control -// Returns hue value normalized [0..1] -// NOTE: Other similar bars (for reference): -// Color GuiColorBarSat() [WHITE->color] -// Color GuiColorBarValue() [BLACK->color], HSV/HSL -// float GuiColorBarLuminance() [BLACK->WHITE] -float GuiColorBarHue(Rectangle bounds, const char *text, float hue) -{ - GuiState state = guiState; - Rectangle selector = {(float)bounds.x - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW), (float)bounds.y + hue / 360.0f * bounds.height - GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT) / 2, (float)bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW) * 2, (float)GuiGetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT)}; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds) || - CheckCollisionPointRec(mousePoint, selector)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - state = STATE_PRESSED; - - hue = (mousePoint.y - bounds.y) * 360 / bounds.height; - if (hue <= 0.0f) - hue = 0.0f; - if (hue >= 359.0f) - hue = 359.0f; - } - else - state = STATE_FOCUSED; - - /*if (IsKeyDown(KEY_UP)) - { - hue -= 2.0f; - if (hue <= 0.0f) hue = 0.0f; - } - else if (IsKeyDown(KEY_DOWN)) - { - hue += 2.0f; - if (hue >= 360.0f) hue = 360.0f; - }*/ - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (state != STATE_DISABLED) - { - // Draw hue bar:color bars - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + bounds.height / 6), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 2 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 255, 0, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 3 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 255, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 4 * (bounds.height / 6)), (int)bounds.width, (int)ceilf(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){0, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha)); - DrawRectangleGradientV((int)bounds.x, (int)(bounds.y + 5 * (bounds.height / 6)), (int)bounds.width, (int)(bounds.height / 6), Fade(RAYGUI_CLITERAL(Color){255, 0, 255, 255}, guiAlpha), Fade(RAYGUI_CLITERAL(Color){255, 0, 0, 255}, guiAlpha)); - } - else - DrawRectangleGradientV((int)bounds.x, (int)bounds.y, (int)bounds.width, (int)bounds.height, Fade(Fade(GetColor(GuiGetStyle(COLORPICKER, BASE_COLOR_DISABLED)), 0.1f), guiAlpha), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER_COLOR_DISABLED)), guiAlpha)); - - GuiDrawRectangle(bounds, GuiGetStyle(COLORPICKER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha), BLANK); - - // Draw hue bar: selector - GuiDrawRectangle(selector, 0, BLANK, Fade(GetColor(GuiGetStyle(COLORPICKER, BORDER + state * 3)), guiAlpha)); - //-------------------------------------------------------------------- - - return hue; -} - -// Color Picker control -// NOTE: It's divided in multiple controls: -// Color GuiColorPanel(Rectangle bounds, Color color) -// float GuiColorBarAlpha(Rectangle bounds, float alpha) -// float GuiColorBarHue(Rectangle bounds, float value) -// NOTE: bounds define GuiColorPanel() size -Color GuiColorPicker(Rectangle bounds, const char *text, Color color) -{ - color = GuiColorPanel(bounds, NULL, color); - - Rectangle boundsHue = {(float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height}; - // Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; - - Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}); - hsv.x = GuiColorBarHue(boundsHue, NULL, hsv.x); - // color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); - Vector3 rgb = ConvertHSVtoRGB(hsv); - - color = RAYGUI_CLITERAL(Color){(unsigned char)roundf(rgb.x * 255.0f), (unsigned char)roundf(rgb.y * 255.0f), (unsigned char)roundf(rgb.z * 255.0f), color.a}; - - return color; -} - -// Message Box control -int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons) -{ -#if !defined(RAYGUI_MESSAGEBOX_BUTTON_HEIGHT) -#define RAYGUI_MESSAGEBOX_BUTTON_HEIGHT 24 -#endif -#if !defined(RAYGUI_MESSAGEBOX_BUTTON_PADDING) -#define RAYGUI_MESSAGEBOX_BUTTON_PADDING 12 -#endif - - int clicked = -1; // Returns clicked button from buttons list, 0 refers to closed window button - - int buttonCount = 0; - const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); - Rectangle buttonBounds = {0}; - buttonBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING; - buttonBounds.y = bounds.y + bounds.height - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT - RAYGUI_MESSAGEBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING * (buttonCount + 1)) / buttonCount; - buttonBounds.height = RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; - - Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - - Rectangle textBounds = {0}; - textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; - textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + RAYGUI_MESSAGEBOX_BUTTON_PADDING; - textBounds.width = textSize.x; - textBounds.height = bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - 3 * RAYGUI_MESSAGEBOX_BUTTON_PADDING - RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; - - // Draw control - //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) - clicked = 0; - - int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - GuiLabel(textBounds, message); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); - - prevTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - - for (int i = 0; i < buttonCount; i++) - { - if (GuiButton(buttonBounds, buttonsText[i])) - clicked = i + 1; - buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); - } - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevTextAlignment); - //-------------------------------------------------------------------- - - return clicked; -} - -// Text Input Box control, ask for text -int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive) -{ -#if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT) -#define RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT 28 -#endif -#if !defined(RAYGUI_TEXTINPUTBOX_BUTTON_PADDING) -#define RAYGUI_TEXTINPUTBOX_BUTTON_PADDING 12 -#endif -#if !defined(RAYGUI_TEXTINPUTBOX_HEIGHT) -#define RAYGUI_TEXTINPUTBOX_HEIGHT 28 -#endif - - // Used to enable text edit mode - // WARNING: No more than one GuiTextInputBox() should be open at the same time - static bool textEditMode = false; - - int btnIndex = -1; - - int buttonCount = 0; - const char **buttonsText = GuiTextSplit(buttons, &buttonCount, NULL); - Rectangle buttonBounds = {0}; - buttonBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - buttonBounds.y = bounds.y + bounds.height - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - buttonBounds.width = (bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING * (buttonCount + 1)) / buttonCount; - buttonBounds.height = RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT; - - int messageInputHeight = (int)bounds.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - GuiGetStyle(STATUSBAR, BORDER_WIDTH) - RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT - 2 * RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - - Rectangle textBounds = {0}; - if (message != NULL) - { - Vector2 textSize = MeasureTextEx(guiFont, message, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), 1); - - textBounds.x = bounds.x + bounds.width / 2 - textSize.x / 2; - textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight / 4 - textSize.y / 2; - textBounds.width = textSize.x; - textBounds.height = textSize.y; - } - - Rectangle textBoxBounds = {0}; - textBoxBounds.x = bounds.x + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - textBoxBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT - RAYGUI_TEXTINPUTBOX_HEIGHT / 2; - if (message == NULL) - textBoxBounds.y = bounds.y + 24 + RAYGUI_TEXTINPUTBOX_BUTTON_PADDING; - else - textBoxBounds.y += (messageInputHeight / 2 + messageInputHeight / 4); - textBoxBounds.width = bounds.width - RAYGUI_TEXTINPUTBOX_BUTTON_PADDING * 2; - textBoxBounds.height = RAYGUI_TEXTINPUTBOX_HEIGHT; - - // Draw control - //-------------------------------------------------------------------- - if (GuiWindowBox(bounds, title)) - btnIndex = 0; - - // Draw message if available - if (message != NULL) - { - int prevTextAlignment = GuiGetStyle(LABEL, TEXT_ALIGNMENT); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - GuiLabel(textBounds, message); - GuiSetStyle(LABEL, TEXT_ALIGNMENT, prevTextAlignment); - } - - if (secretViewActive != NULL) - { - static char stars[] = "****************"; - if (GuiTextBox(RAYGUI_CLITERAL(Rectangle){textBoxBounds.x, textBoxBounds.y, textBoxBounds.width - 4 - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.height}, - ((*secretViewActive == 1) || textEditMode) ? text : stars, textMaxSize, textEditMode)) - textEditMode = !textEditMode; - - *secretViewActive = GuiToggle(RAYGUI_CLITERAL(Rectangle){textBoxBounds.x + textBoxBounds.width - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.y, RAYGUI_TEXTINPUTBOX_HEIGHT, RAYGUI_TEXTINPUTBOX_HEIGHT}, (*secretViewActive == 1) ? "#44#" : "#45#", *secretViewActive); - } - else - { - if (GuiTextBox(textBoxBounds, text, textMaxSize, textEditMode)) - textEditMode = !textEditMode; - } - - int prevBtnTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); - - for (int i = 0; i < buttonCount; i++) - { - if (GuiButton(buttonBounds, buttonsText[i])) - btnIndex = i + 1; - buttonBounds.x += (buttonBounds.width + RAYGUI_MESSAGEBOX_BUTTON_PADDING); - } - - GuiSetStyle(BUTTON, TEXT_ALIGNMENT, prevBtnTextAlignment); - //-------------------------------------------------------------------- - - return btnIndex; -} - -// Grid control -// NOTE: Returns grid mouse-hover selected cell -// About drawing lines at subpixel spacing, simple put, not easy solution: -// https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster -Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs) -{ -// Grid lines alpha amount -#if !defined(RAYGUI_GRID_ALPHA) -#define RAYGUI_GRID_ALPHA 0.15f -#endif - - GuiState state = guiState; - Vector2 mousePoint = GetMousePosition(); - Vector2 currentCell = {-1, -1}; - - int linesV = ((int)(bounds.width / spacing)) * subdivs + 1; - int linesH = ((int)(bounds.height / spacing)) * subdivs + 1; - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - if (CheckCollisionPointRec(mousePoint, bounds)) - { - // NOTE: Cell values must be rounded to int - currentCell.x = (int)((mousePoint.x - bounds.x) / spacing); - currentCell.y = (int)((mousePoint.y - bounds.y) / spacing); - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - - // TODO: Draw background panel? - - switch (state) - { - case STATE_NORMAL: - { - if (subdivs > 0) - { - // Draw vertical grid lines - for (int i = 0; i < linesV; i++) - { - Rectangle lineV = {bounds.x + spacing * i / subdivs, bounds.y, 1, bounds.height}; - GuiDrawRectangle(lineV, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); - } - - // Draw horizontal grid lines - for (int i = 0; i < linesH; i++) - { - Rectangle lineH = {bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1}; - GuiDrawRectangle(lineH, 0, BLANK, ((i % subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), RAYGUI_GRID_ALPHA)); - } - } - } - break; - default: - break; - } - - return currentCell; -} - -//---------------------------------------------------------------------------------- -// Styles loading functions -//---------------------------------------------------------------------------------- - -// Load raygui style file (.rgs) -// NOTE: By default a binary file is expected, that file could contain a custom font, -// in that case, custom font image atlas is GRAY+ALPHA and pixel data can be compressed (DEFLATE) -void GuiLoadStyle(const char *fileName) -{ -#define MAX_LINE_BUFFER_SIZE 256 - - bool tryBinary = false; - - // Try reading the files as text file first - FILE *rgsFile = fopen(fileName, "rt"); - - if (rgsFile != NULL) - { - char buffer[MAX_LINE_BUFFER_SIZE] = {0}; - fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); - - if (buffer[0] == '#') - { - int controlId = 0; - int propertyId = 0; - unsigned int propertyValue = 0; - - while (!feof(rgsFile)) - { - switch (buffer[0]) - { - case 'p': - { - // Style property: p - - sscanf(buffer, "p %d %d 0x%x", &controlId, &propertyId, &propertyValue); - GuiSetStyle(controlId, propertyId, (int)propertyValue); - } - break; - case 'f': - { - // Style font: f - - int fontSize = 0; - char charmapFileName[256] = {0}; - char fontFileName[256] = {0}; - sscanf(buffer, "f %d %s %[^\r\n]s", &fontSize, charmapFileName, fontFileName); - - Font font = {0}; - - if (charmapFileName[0] != '0') - { - // Load characters from charmap file, - // expected '\n' separated list of integer values - char *charValues = LoadFileText(charmapFileName); - if (charValues != NULL) - { - int glyphCount = 0; - const char **chars = TextSplit(charValues, '\n', &glyphCount); - - int *values = (int *)RAYGUI_MALLOC(glyphCount * sizeof(int)); - for (int i = 0; i < glyphCount; i++) - values[i] = TextToInteger(chars[i]); - - if (font.texture.id != GetFontDefault().texture.id) - UnloadTexture(font.texture); - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, values, glyphCount); - if (font.texture.id == 0) - font = GetFontDefault(); - - RAYGUI_FREE(values); - } - } - else - { - if (font.texture.id != GetFontDefault().texture.id) - UnloadTexture(font.texture); - font = LoadFontEx(TextFormat("%s/%s", GetDirectoryPath(fileName), fontFileName), fontSize, NULL, 0); - if (font.texture.id == 0) - font = GetFontDefault(); - } - - if ((font.texture.id > 0) && (font.glyphCount > 0)) - GuiSetFont(font); - } - break; - default: - break; - } - - fgets(buffer, MAX_LINE_BUFFER_SIZE, rgsFile); - } - } - else - tryBinary = true; - - fclose(rgsFile); - } - - if (tryBinary) - { - rgsFile = fopen(fileName, "rb"); - - if (rgsFile == NULL) - return; - - char signature[5] = {0}; - short version = 0; - short reserved = 0; - int propertyCount = 0; - - fread(signature, 1, 4, rgsFile); - fread(&version, 1, sizeof(short), rgsFile); - fread(&reserved, 1, sizeof(short), rgsFile); - fread(&propertyCount, 1, sizeof(int), rgsFile); - - if ((signature[0] == 'r') && - (signature[1] == 'G') && - (signature[2] == 'S') && - (signature[3] == ' ')) - { - short controlId = 0; - short propertyId = 0; - unsigned int propertyValue = 0; - - for (int i = 0; i < propertyCount; i++) - { - fread(&controlId, 1, sizeof(short), rgsFile); - fread(&propertyId, 1, sizeof(short), rgsFile); - fread(&propertyValue, 1, sizeof(unsigned int), rgsFile); - - if (controlId == 0) // DEFAULT control - { - // If a DEFAULT property is loaded, it is propagated to all controls - // NOTE: All DEFAULT properties should be defined first in the file - GuiSetStyle(0, (int)propertyId, propertyValue); - - if (propertyId < RAYGUI_MAX_PROPS_BASE) - for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) - GuiSetStyle(i, (int)propertyId, propertyValue); - } - else - GuiSetStyle((int)controlId, (int)propertyId, propertyValue); - } - - // Font loading is highly dependant on raylib API to load font data and image -#if !defined(RAYGUI_STANDALONE) - // Load custom font if available - int fontDataSize = 0; - fread(&fontDataSize, 1, sizeof(int), rgsFile); - - if (fontDataSize > 0) - { - Font font = {0}; - int fontType = 0; // 0-Normal, 1-SDF - Rectangle whiteRec = {0}; - - fread(&font.baseSize, 1, sizeof(int), rgsFile); - fread(&font.glyphCount, 1, sizeof(int), rgsFile); - fread(&fontType, 1, sizeof(int), rgsFile); - - // Load font white rectangle - fread(&whiteRec, 1, sizeof(Rectangle), rgsFile); - - // Load font image parameters - int fontImageUncompSize = 0; - int fontImageCompSize = 0; - fread(&fontImageUncompSize, 1, sizeof(int), rgsFile); - fread(&fontImageCompSize, 1, sizeof(int), rgsFile); - - Image imFont = {0}; - imFont.mipmaps = 1; - fread(&imFont.width, 1, sizeof(int), rgsFile); - fread(&imFont.height, 1, sizeof(int), rgsFile); - fread(&imFont.format, 1, sizeof(int), rgsFile); - - if (fontImageCompSize < fontImageUncompSize) - { - // Compressed font atlas image data (DEFLATE), it requires DecompressData() - int dataUncompSize = 0; - unsigned char *compData = (unsigned char *)RAYGUI_MALLOC(fontImageCompSize); - fread(compData, 1, fontImageCompSize, rgsFile); - imFont.data = DecompressData(compData, fontImageCompSize, &dataUncompSize); - - // Security check, dataUncompSize must match the provided fontImageUncompSize - if (dataUncompSize != fontImageUncompSize) - RAYGUI_LOG("WARNING: Uncompressed font atlas image data could be corrupted"); - - RAYGUI_FREE(compData); - } - else - { - // Font atlas image data is not compressed - imFont.data = (unsigned char *)RAYGUI_MALLOC(fontImageUncompSize); - fread(imFont.data, 1, fontImageUncompSize, rgsFile); - } - - if (font.texture.id != GetFontDefault().texture.id) - UnloadTexture(font.texture); - font.texture = LoadTextureFromImage(imFont); - if (font.texture.id == 0) - font = GetFontDefault(); - - RAYGUI_FREE(imFont.data); - - // Load font recs data - font.recs = (Rectangle *)RAYGUI_CALLOC(font.glyphCount, sizeof(Rectangle)); - for (int i = 0; i < font.glyphCount; i++) - fread(&font.recs[i], 1, sizeof(Rectangle), rgsFile); - - // Load font chars info data - font.glyphs = (GlyphInfo *)RAYGUI_CALLOC(font.glyphCount, sizeof(GlyphInfo)); - for (int i = 0; i < font.glyphCount; i++) - { - fread(&font.glyphs[i].value, 1, sizeof(int), rgsFile); - fread(&font.glyphs[i].offsetX, 1, sizeof(int), rgsFile); - fread(&font.glyphs[i].offsetY, 1, sizeof(int), rgsFile); - fread(&font.glyphs[i].advanceX, 1, sizeof(int), rgsFile); - } - - GuiSetFont(font); - - // Set font texture source rectangle to be used as white texture to draw shapes - // NOTE: This way, all gui can be draw using a single draw call - if ((whiteRec.width != 0) && (whiteRec.height != 0)) - SetShapesTexture(font.texture, whiteRec); - } -#endif - } - - fclose(rgsFile); - } -} - -// Load style default over global style -void GuiLoadStyleDefault(void) -{ - // We set this variable first to avoid cyclic function calls - // when calling GuiSetStyle() and GuiGetStyle() - guiStyleLoaded = true; - - // Initialize default LIGHT style property values - GuiSetStyle(DEFAULT, BORDER_COLOR_NORMAL, 0x838383ff); - GuiSetStyle(DEFAULT, BASE_COLOR_NORMAL, 0xc9c9c9ff); - GuiSetStyle(DEFAULT, TEXT_COLOR_NORMAL, 0x686868ff); - GuiSetStyle(DEFAULT, BORDER_COLOR_FOCUSED, 0x5bb2d9ff); - GuiSetStyle(DEFAULT, BASE_COLOR_FOCUSED, 0xc9effeff); - GuiSetStyle(DEFAULT, TEXT_COLOR_FOCUSED, 0x6c9bbcff); - GuiSetStyle(DEFAULT, BORDER_COLOR_PRESSED, 0x0492c7ff); - GuiSetStyle(DEFAULT, BASE_COLOR_PRESSED, 0x97e8ffff); - GuiSetStyle(DEFAULT, TEXT_COLOR_PRESSED, 0x368bafff); - GuiSetStyle(DEFAULT, BORDER_COLOR_DISABLED, 0xb5c1c2ff); - GuiSetStyle(DEFAULT, BASE_COLOR_DISABLED, 0xe6e9e9ff); - GuiSetStyle(DEFAULT, TEXT_COLOR_DISABLED, 0xaeb7b8ff); - GuiSetStyle(DEFAULT, BORDER_WIDTH, 1); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_PADDING, 0); // WARNING: Some controls use other values - GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER); // WARNING: Some controls use other values - - // Initialize control-specific property values - // NOTE: Those properties are in default list but require specific values by control type - GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); - GuiSetStyle(BUTTON, BORDER_WIDTH, 2); - GuiSetStyle(SLIDER, TEXT_PADDING, 4); - GuiSetStyle(CHECKBOX, TEXT_PADDING, 4); - GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT); - GuiSetStyle(TEXTBOX, TEXT_PADDING, 4); - GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); - GuiSetStyle(VALUEBOX, TEXT_PADDING, 4); - GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); - GuiSetStyle(SPINNER, TEXT_PADDING, 4); - GuiSetStyle(SPINNER, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); - GuiSetStyle(STATUSBAR, TEXT_PADDING, 8); - GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT); - - // Initialize extended property values - // NOTE: By default, extended property values are initialized to 0 - GuiSetStyle(DEFAULT, TEXT_SIZE, 10); // DEFAULT, shared by all controls - GuiSetStyle(DEFAULT, TEXT_SPACING, 1); // DEFAULT, shared by all controls - GuiSetStyle(DEFAULT, LINE_COLOR, 0x90abb5ff); // DEFAULT specific property - GuiSetStyle(DEFAULT, BACKGROUND_COLOR, 0xf5f5f5ff); // DEFAULT specific property - GuiSetStyle(TOGGLE, GROUP_PADDING, 2); - GuiSetStyle(SLIDER, SLIDER_WIDTH, 16); - GuiSetStyle(SLIDER, SLIDER_PADDING, 1); - GuiSetStyle(PROGRESSBAR, PROGRESS_PADDING, 1); - GuiSetStyle(CHECKBOX, CHECK_PADDING, 1); - GuiSetStyle(COMBOBOX, COMBO_BUTTON_WIDTH, 32); - GuiSetStyle(COMBOBOX, COMBO_BUTTON_SPACING, 2); - GuiSetStyle(DROPDOWNBOX, ARROW_PADDING, 16); - GuiSetStyle(DROPDOWNBOX, DROPDOWN_ITEMS_SPACING, 2); - GuiSetStyle(TEXTBOX, TEXT_LINES_SPACING, 4); - GuiSetStyle(TEXTBOX, TEXT_INNER_PADDING, 4); - GuiSetStyle(SPINNER, SPIN_BUTTON_WIDTH, 24); - GuiSetStyle(SPINNER, SPIN_BUTTON_SPACING, 2); - GuiSetStyle(SCROLLBAR, BORDER_WIDTH, 0); - GuiSetStyle(SCROLLBAR, ARROWS_VISIBLE, 0); - GuiSetStyle(SCROLLBAR, ARROWS_SIZE, 6); - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING, 0); - GuiSetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE, 16); - GuiSetStyle(SCROLLBAR, SCROLL_PADDING, 0); - GuiSetStyle(SCROLLBAR, SCROLL_SPEED, 12); - GuiSetStyle(LISTVIEW, LIST_ITEMS_HEIGHT, 24); - GuiSetStyle(LISTVIEW, LIST_ITEMS_SPACING, 2); - GuiSetStyle(LISTVIEW, SCROLLBAR_WIDTH, 12); - GuiSetStyle(LISTVIEW, SCROLLBAR_SIDE, SCROLLBAR_RIGHT_SIDE); - GuiSetStyle(COLORPICKER, COLOR_SELECTOR_SIZE, 8); - GuiSetStyle(COLORPICKER, HUEBAR_WIDTH, 16); - GuiSetStyle(COLORPICKER, HUEBAR_PADDING, 8); - GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT, 8); - GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW, 2); - - guiFont = GetFontDefault(); // Initialize default font -} - -// Get text with icon id prepended -// NOTE: Useful to add icons by name id (enum) instead of -// a number that can change between ricon versions -const char *GuiIconText(int iconId, const char *text) -{ -#if defined(RAYGUI_NO_ICONS) - return NULL; -#else - static char buffer[1024] = {0}; - static char iconBuffer[6] = {0}; - - if (text != NULL) - { - memset(buffer, 0, 1024); - sprintf(buffer, "#%03i#", iconId); - - for (int i = 5; i < 1024; i++) - { - buffer[i] = text[i - 5]; - if (text[i - 5] == '\0') - break; - } - - return buffer; - } - else - { - sprintf(iconBuffer, "#%03i#", iconId & 0x1ff); - - return iconBuffer; - } -#endif -} - -#if !defined(RAYGUI_NO_ICONS) - -// Get full icons data pointer -unsigned int *GuiGetIcons(void) { return guiIcons; } - -// Load raygui icons file (.rgi) -// NOTE: In case nameIds are required, they can be requested with loadIconsName, -// they are returned as a guiIconsName[iconCount][RAYGUI_ICON_MAX_NAME_LENGTH], -// WARNING: guiIconsName[]][] memory should be manually freed! -char **GuiLoadIcons(const char *fileName, bool loadIconsName) -{ - // Style File Structure (.rgi) - // ------------------------------------------------------ - // Offset | Size | Type | Description - // ------------------------------------------------------ - // 0 | 4 | char | Signature: "rGI " - // 4 | 2 | short | Version: 100 - // 6 | 2 | short | reserved - - // 8 | 2 | short | Num icons (N) - // 10 | 2 | short | Icons size (Options: 16, 32, 64) (S) - - // Icons name id (32 bytes per name id) - // foreach (icon) - // { - // 12+32*i | 32 | char | Icon NameId - // } - - // Icons data: One bit per pixel, stored as unsigned int array (depends on icon size) - // S*S pixels/32bit per unsigned int = K unsigned int per icon - // foreach (icon) - // { - // ... | K | unsigned int | Icon Data - // } - - FILE *rgiFile = fopen(fileName, "rb"); - - char **guiIconsName = NULL; - - if (rgiFile != NULL) - { - char signature[5] = {0}; - short version = 0; - short reserved = 0; - short iconCount = 0; - short iconSize = 0; - - fread(signature, 1, 4, rgiFile); - fread(&version, 1, sizeof(short), rgiFile); - fread(&reserved, 1, sizeof(short), rgiFile); - fread(&iconCount, 1, sizeof(short), rgiFile); - fread(&iconSize, 1, sizeof(short), rgiFile); - - if ((signature[0] == 'r') && - (signature[1] == 'G') && - (signature[2] == 'I') && - (signature[3] == ' ')) - { - if (loadIconsName) - { - guiIconsName = (char **)RAYGUI_MALLOC(iconCount * sizeof(char **)); - for (int i = 0; i < iconCount; i++) - { - guiIconsName[i] = (char *)RAYGUI_MALLOC(RAYGUI_ICON_MAX_NAME_LENGTH); - fread(guiIconsName[i], RAYGUI_ICON_MAX_NAME_LENGTH, 1, rgiFile); - } - } - else - fseek(rgiFile, iconCount * RAYGUI_ICON_MAX_NAME_LENGTH, SEEK_CUR); - - // Read icons data directly over guiIcons data array - fread(guiIcons, iconCount * (iconSize * iconSize / 32), sizeof(unsigned int), rgiFile); - } - - fclose(rgiFile); - } - - return guiIconsName; -} - -// Draw selected icon using rectangles pixel-by-pixel -void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color) -{ -#define BIT_CHECK(a, b) ((a) & (1u << (b))) - - for (int i = 0, y = 0; i < RAYGUI_ICON_SIZE * RAYGUI_ICON_SIZE / 32; i++) - { - for (int k = 0; k < 32; k++) - { - if (BIT_CHECK(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + i], k)) - { -#if !defined(RAYGUI_STANDALONE) - DrawRectangle(posX + (k % RAYGUI_ICON_SIZE) * pixelSize, posY + y * pixelSize, pixelSize, pixelSize, color); -#endif - } - - if ((k == 15) || (k == 31)) - y++; - } - } -} - -// Get icon bit data -// NOTE: Bit data array grouped as unsigned int (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32 elements) -unsigned int *GuiGetIconData(int iconId) -{ - static unsigned int iconData[RAYGUI_ICON_DATA_ELEMENTS] = {0}; - memset(iconData, 0, RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); - - if (iconId < RAYGUI_ICON_MAX_ICONS) - memcpy(iconData, &guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS], RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); - - return iconData; -} - -// Set icon bit data -// NOTE: Data must be provided as unsigned int array (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32 elements) -void GuiSetIconData(int iconId, unsigned int *data) -{ - if (iconId < RAYGUI_ICON_MAX_ICONS) - memcpy(&guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS], data, RAYGUI_ICON_DATA_ELEMENTS * sizeof(unsigned int)); -} - -// Set icon scale (1 by default) -void GuiSetIconScale(unsigned int scale) -{ - guiIconScale = (scale < 1) ? 1 : scale; -} - -// Set icon pixel value -void GuiSetIconPixel(int iconId, int x, int y) -{ -#define BIT_SET(a, b) ((a) |= (1u << (b))) - - // This logic works for any RAYGUI_ICON_SIZE pixels icons, - // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_SET(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE) * RAYGUI_ICON_SIZE)); -} - -// Clear icon pixel value -void GuiClearIconPixel(int iconId, int x, int y) -{ -#define BIT_CLEAR(a, b) ((a) &= ~((1u) << (b))) - - // This logic works for any RAYGUI_ICON_SIZE pixels icons, - // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element - BIT_CLEAR(guiIcons[iconId * RAYGUI_ICON_DATA_ELEMENTS + y / (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE)], x + (y % (sizeof(unsigned int) * 8 / RAYGUI_ICON_SIZE) * RAYGUI_ICON_SIZE)); -} - -// Check icon pixel value -bool GuiCheckIconPixel(int iconId, int x, int y) -{ -#define BIT_CHECK(a, b) ((a) & (1u << (b))) - - return (BIT_CHECK(guiIcons[iconId * 8 + y / 2], x + (y % 2 * 16))); -} -#endif // !RAYGUI_NO_ICONS - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- -// Gui get text width considering icon -static int GetTextWidth(const char *text) -{ -#if !defined(ICON_TEXT_PADDING) -#define ICON_TEXT_PADDING 4 -#endif - - Vector2 size = {0}; - int textIconOffset = 0; - - if ((text != NULL) && (text[0] != '\0')) - { - if (text[0] == '#') - { - for (int i = 1; (text[i] != '\0') && (i < 5); i++) - { - if (text[i] == '#') - { - textIconOffset = i; - break; - } - } - } - - // Make sure guiFont is set, GuiGetStyle() initializes it lazynessly - float fontSize = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); - - size = MeasureTextEx(guiFont, text + textIconOffset, fontSize, (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); - if (textIconOffset > 0) - size.x += (RAYGUI_ICON_SIZE - ICON_TEXT_PADDING); - } - - return (int)size.x; -} - -// Get text bounds considering control bounds -static Rectangle GetTextBounds(int control, Rectangle bounds) -{ - Rectangle textBounds = bounds; - - textBounds.x = bounds.x + GuiGetStyle(control, BORDER_WIDTH); - textBounds.y = bounds.y + GuiGetStyle(control, BORDER_WIDTH); - textBounds.width = bounds.width - 2 * GuiGetStyle(control, BORDER_WIDTH); - textBounds.height = bounds.height - 2 * GuiGetStyle(control, BORDER_WIDTH); - - // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT - switch (control) - { - case COMBOBOX: - bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_SPACING)); - break; - case VALUEBOX: - break; // NOTE: ValueBox text value always centered, text padding applies to label - default: - { - if (GuiGetStyle(control, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) - textBounds.x -= GuiGetStyle(control, TEXT_PADDING); - else - textBounds.x += GuiGetStyle(control, TEXT_PADDING); - textBounds.width -= 2 * GuiGetStyle(control, TEXT_PADDING); - } - break; - } - - // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?) - // More special cases (label on side): CHECKBOX, SLIDER, VALUEBOX, SPINNER - - return textBounds; -} - -// Get text icon if provided and move text cursor -// NOTE: We support up to 999 values for iconId -static const char *GetTextIcon(const char *text, int *iconId) -{ -#if !defined(RAYGUI_NO_ICONS) - *iconId = -1; - if (text[0] == '#') // Maybe we have an icon! - { - char iconValue[4] = {0}; // Maximum length for icon value: 3 digits + '\0' - - int pos = 1; - while ((pos < 4) && (text[pos] >= '0') && (text[pos] <= '9')) - { - iconValue[pos - 1] = text[pos]; - pos++; - } - - if (text[pos] == '#') - { - *iconId = TextToInteger(iconValue); - - // Move text pointer after icon - // WARNING: If only icon provided, it could point to EOL character: '\0' - if (*iconId >= 0) - text += (pos + 1); - } - } -#endif - - return text; -} - -// Gui draw text using default font -static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color tint) -{ -#define TEXT_VALIGN_PIXEL_OFFSET(h) ((int)h % 2) // Vertical alignment for pixel perfect - -#if !defined(ICON_TEXT_PADDING) -#define ICON_TEXT_PADDING 4 -#endif - - if ((text != NULL) && (text[0] != '\0')) - { - int iconId = 0; - text = GetTextIcon(text, &iconId); // Check text for icon and move cursor - - // Get text position depending on alignment and iconId - //--------------------------------------------------------------------------------- - Vector2 position = {bounds.x, bounds.y}; - - // NOTE: We get text size after icon has been processed - // TODO: REVIEW: We consider text size in case of line breaks! -> MeasureTextEx() depends on raylib! - Vector2 textSize = MeasureTextEx(GuiGetFont(), text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); - // int textWidth = GetTextWidth(text); - // int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); - - // If text requires an icon, add size to measure - if (iconId >= 0) - { - textSize.x += RAYGUI_ICON_SIZE * guiIconScale; - - // WARNING: If only icon provided, text could be pointing to EOF character: '\0' - if ((text != NULL) && (text[0] != '\0')) - textSize.x += ICON_TEXT_PADDING; - } - - // Check guiTextAlign global variables - switch (alignment) - { - case TEXT_ALIGN_LEFT: - { - position.x = bounds.x; - position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - case TEXT_ALIGN_CENTER: - { - position.x = bounds.x + bounds.width / 2 - textSize.x / 2; - position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - case TEXT_ALIGN_RIGHT: - { - position.x = bounds.x + bounds.width - textSize.x; - position.y = bounds.y + bounds.height / 2 - textSize.y / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height); - } - break; - default: - break; - } - - // NOTE: Make sure we get pixel-perfect coordinates, - // In case of decimals we got weird text positioning - position.x = (float)((int)position.x); - position.y = (float)((int)position.y); - //--------------------------------------------------------------------------------- - - // Draw text (with icon if available) - //--------------------------------------------------------------------------------- -#if !defined(RAYGUI_NO_ICONS) - if (iconId >= 0) - { - // NOTE: We consider icon height, probably different than text size - GuiDrawIcon(iconId, (int)position.x, (int)(bounds.y + bounds.height / 2 - RAYGUI_ICON_SIZE * guiIconScale / 2 + TEXT_VALIGN_PIXEL_OFFSET(bounds.height)), guiIconScale, tint); - position.x += (RAYGUI_ICON_SIZE * guiIconScale + ICON_TEXT_PADDING); - } -#endif - DrawTextEx(guiFont, text, position, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING), tint); - //--------------------------------------------------------------------------------- - } -} - -// Gui draw rectangle using default raygui plain style with borders -static void GuiDrawRectangle(Rectangle rec, int borderWidth, Color borderColor, Color color) -{ - if (color.a > 0) - { - // Draw rectangle filled with color - DrawRectangle((int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, color); - } - - if (borderWidth > 0) - { - // Draw rectangle border lines with color - DrawRectangle((int)rec.x, (int)rec.y, (int)rec.width, borderWidth, borderColor); - DrawRectangle((int)rec.x, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2 * borderWidth, borderColor); - DrawRectangle((int)rec.x + (int)rec.width - borderWidth, (int)rec.y + borderWidth, borderWidth, (int)rec.height - 2 * borderWidth, borderColor); - DrawRectangle((int)rec.x, (int)rec.y + (int)rec.height - borderWidth, (int)rec.width, borderWidth, borderColor); - } -} - -// Split controls text into multiple strings -// Also check for multiple columns (required by GuiToggleGroup()) -static const char **GuiTextSplit(const char *text, int *count, int *textRow) -{ - // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) - // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, - // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ITEMS - // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE - // NOTE: Those definitions could be externally provided if required - -#if !defined(RAYGUI_TEXTSPLIT_MAX_ITEMS) -#define RAYGUI_TEXTSPLIT_MAX_ITEMS 128 -#endif -#if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) -#define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 -#endif - - static const char *result[RAYGUI_TEXTSPLIT_MAX_ITEMS] = {NULL}; - static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = {0}; - memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); - - result[0] = buffer; - int counter = 1; - - if (textRow != NULL) - textRow[0] = 0; - - // Count how many substrings we have on text and point to every one - for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) - { - buffer[i] = text[i]; - if (buffer[i] == '\0') - break; - else if ((buffer[i] == ';') || (buffer[i] == '\n')) - { - result[counter] = buffer + i + 1; - - if (textRow != NULL) - { - if (buffer[i] == '\n') - textRow[counter] = textRow[counter - 1] + 1; - else - textRow[counter] = textRow[counter - 1]; - } - - buffer[i] = '\0'; // Set an end of string at this point - - counter++; - if (counter == RAYGUI_TEXTSPLIT_MAX_ITEMS) - break; - } - } - - *count = counter; - - return result; -} - -// Convert color data from RGB to HSV -// NOTE: Color data should be passed normalized -static Vector3 ConvertRGBtoHSV(Vector3 rgb) -{ - Vector3 hsv = {0}; - float min = 0.0f; - float max = 0.0f; - float delta = 0.0f; - - min = (rgb.x < rgb.y) ? rgb.x : rgb.y; - min = (min < rgb.z) ? min : rgb.z; - - max = (rgb.x > rgb.y) ? rgb.x : rgb.y; - max = (max > rgb.z) ? max : rgb.z; - - hsv.z = max; // Value - delta = max - min; - - if (delta < 0.00001f) - { - hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? - return hsv; - } - - if (max > 0.0f) - { - // NOTE: If max is 0, this divide would cause a crash - hsv.y = (delta / max); // Saturation - } - else - { - // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined - hsv.y = 0.0f; - hsv.x = 0.0f; // Undefined, maybe NAN? - return hsv; - } - - // NOTE: Comparing float values could not work properly - if (rgb.x >= max) - hsv.x = (rgb.y - rgb.z) / delta; // Between yellow & magenta - else - { - if (rgb.y >= max) - hsv.x = 2.0f + (rgb.z - rgb.x) / delta; // Between cyan & yellow - else - hsv.x = 4.0f + (rgb.x - rgb.y) / delta; // Between magenta & cyan - } - - hsv.x *= 60.0f; // Convert to degrees - - if (hsv.x < 0.0f) - hsv.x += 360.0f; - - return hsv; -} - -// Convert color data from HSV to RGB -// NOTE: Color data should be passed normalized -static Vector3 ConvertHSVtoRGB(Vector3 hsv) -{ - Vector3 rgb = {0}; - float hh = 0.0f, p = 0.0f, q = 0.0f, t = 0.0f, ff = 0.0f; - long i = 0; - - // NOTE: Comparing float values could not work properly - if (hsv.y <= 0.0f) - { - rgb.x = hsv.z; - rgb.y = hsv.z; - rgb.z = hsv.z; - return rgb; - } - - hh = hsv.x; - if (hh >= 360.0f) - hh = 0.0f; - hh /= 60.0f; - - i = (long)hh; - ff = hh - i; - p = hsv.z * (1.0f - hsv.y); - q = hsv.z * (1.0f - (hsv.y * ff)); - t = hsv.z * (1.0f - (hsv.y * (1.0f - ff))); - - switch (i) - { - case 0: - { - rgb.x = hsv.z; - rgb.y = t; - rgb.z = p; - } - break; - case 1: - { - rgb.x = q; - rgb.y = hsv.z; - rgb.z = p; - } - break; - case 2: - { - rgb.x = p; - rgb.y = hsv.z; - rgb.z = t; - } - break; - case 3: - { - rgb.x = p; - rgb.y = q; - rgb.z = hsv.z; - } - break; - case 4: - { - rgb.x = t; - rgb.y = p; - rgb.z = hsv.z; - } - break; - case 5: - default: - { - rgb.x = hsv.z; - rgb.y = p; - rgb.z = q; - } - break; - } - - return rgb; -} - -// Scroll bar control (used by GuiScrollPanel()) -static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) -{ - GuiState state = guiState; - - // Is the scrollbar horizontal or vertical? - bool isVertical = (bounds.width > bounds.height) ? false : true; - - // The size (width or height depending on scrollbar type) of the spinner buttons - const int spinnerSize = GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE) ? (isVertical ? (int)bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH) : (int)bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)) : 0; - - // Arrow buttons [<] [>] [∧] [∨] - Rectangle arrowUpLeft = {0}; - Rectangle arrowDownRight = {0}; - - // Actual area of the scrollbar excluding the arrow buttons - Rectangle scrollbar = {0}; - - // Slider bar that moves --[///]----- - Rectangle slider = {0}; - - // Normalize value - if (value > maxValue) - value = maxValue; - if (value < minValue) - value = minValue; - - const int range = maxValue - minValue; - int sliderSize = GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_SIZE); - - // Calculate rectangles for all of the components - arrowUpLeft = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - - if (isVertical) - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + bounds.height - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING)), bounds.height - arrowUpLeft.height - arrowDownRight.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; - sliderSize = (sliderSize >= scrollbar.height) ? ((int)scrollbar.height - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)scrollbar.y + (int)(((float)(value - minValue) / range) * (scrollbar.height - sliderSize)), (float)bounds.width - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING)), (float)sliderSize}; - } - else - { - arrowDownRight = RAYGUI_CLITERAL(Rectangle){(float)bounds.x + bounds.width - spinnerSize - GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH), (float)spinnerSize, (float)spinnerSize}; - scrollbar = RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x + arrowUpLeft.width, bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING), bounds.width - arrowUpLeft.width - arrowDownRight.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_PADDING))}; - sliderSize = (sliderSize >= scrollbar.width) ? ((int)scrollbar.width - 2) : sliderSize; // Make sure the slider won't get outside of the scrollbar - slider = RAYGUI_CLITERAL(Rectangle){(float)scrollbar.x + (int)(((float)(value - minValue) / range) * (scrollbar.width - sliderSize)), (float)bounds.y + GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING), (float)sliderSize, (float)bounds.height - 2 * (GuiGetStyle(SCROLLBAR, BORDER_WIDTH) + GuiGetStyle(SCROLLBAR, SCROLL_SLIDER_PADDING))}; - } - - // Update control - //-------------------------------------------------------------------- - if ((state != STATE_DISABLED) && !guiLocked) - { - Vector2 mousePoint = GetMousePosition(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - state = STATE_FOCUSED; - - // Handle mouse wheel - int wheel = (int)GetMouseWheelMove(); - if (wheel != 0) - value += wheel; - - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - if (CheckCollisionPointRec(mousePoint, arrowUpLeft)) - value -= range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - else if (CheckCollisionPointRec(mousePoint, arrowDownRight)) - value += range / GuiGetStyle(SCROLLBAR, SCROLL_SPEED); - - state = STATE_PRESSED; - } - else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!isVertical) - { - Rectangle scrollArea = {arrowUpLeft.x + arrowUpLeft.width, arrowUpLeft.y, scrollbar.width, bounds.height - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH)}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) - value = (int)(((float)(mousePoint.x - scrollArea.x - slider.width / 2) * range) / (scrollArea.width - slider.width) + minValue); - } - else - { - Rectangle scrollArea = {arrowUpLeft.x, arrowUpLeft.y + arrowUpLeft.height, bounds.width - 2 * GuiGetStyle(SCROLLBAR, BORDER_WIDTH), scrollbar.height}; - if (CheckCollisionPointRec(mousePoint, scrollArea)) - value = (int)(((float)(mousePoint.y - scrollArea.y - slider.height / 2) * range) / (scrollArea.height - slider.height) + minValue); - } - } - } - - // Normalize value - if (value > maxValue) - value = maxValue; - if (value < minValue) - value = minValue; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(SCROLLBAR, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(LISTVIEW, BORDER + state * 3)), guiAlpha), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha)); // Draw the background - - GuiDrawRectangle(scrollbar, 0, BLANK, Fade(GetColor(GuiGetStyle(BUTTON, BASE_COLOR_NORMAL)), guiAlpha)); // Draw the scrollbar active area background - GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BORDER + state * 3)), guiAlpha)); // Draw the slider bar - - // Draw arrows (using icon if available) - if (GuiGetStyle(SCROLLBAR, ARROWS_VISIBLE)) - { -#if defined(RAYGUI_NO_ICONS) - GuiDrawText(isVertical ? "^" : "<", RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x, arrowUpLeft.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); - GuiDrawText(isVertical ? "v" : ">", RAYGUI_CLITERAL(Rectangle){arrowDownRight.x, arrowDownRight.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state * 3))), guiAlpha)); -#else - GuiDrawText(isVertical ? "#121#" : "#118#", RAYGUI_CLITERAL(Rectangle){arrowUpLeft.x, arrowUpLeft.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state * 3)), guiAlpha)); // ICON_ARROW_UP_FILL / ICON_ARROW_LEFT_FILL - GuiDrawText(isVertical ? "#120#" : "#119#", RAYGUI_CLITERAL(Rectangle){arrowDownRight.x, arrowDownRight.y, isVertical ? bounds.width : bounds.height, isVertical ? bounds.width : bounds.height}, - TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(SCROLLBAR, TEXT + state * 3)), guiAlpha)); // ICON_ARROW_DOWN_FILL / ICON_ARROW_RIGHT_FILL -#endif - } - //-------------------------------------------------------------------- - - return value; -} - -#if defined(RAYGUI_STANDALONE) -// Returns a Color struct from hexadecimal value -static Color GetColor(int hexValue) -{ - Color color; - - color.r = (unsigned char)(hexValue >> 24) & 0xFF; - color.g = (unsigned char)(hexValue >> 16) & 0xFF; - color.b = (unsigned char)(hexValue >> 8) & 0xFF; - color.a = (unsigned char)hexValue & 0xFF; - - return color; -} - -// Returns hexadecimal value for a Color -static int ColorToInt(Color color) -{ - return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); -} - -// Check if point is inside rectangle -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) -{ - bool collision = false; - - if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && - (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) - collision = true; - - return collision; -} - -// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f -static Color Fade(Color color, float alpha) -{ - if (alpha < 0.0f) - alpha = 0.0f; - else if (alpha > 1.0f) - alpha = 1.0f; - - Color result = {color.r, color.g, color.b, (unsigned char)(255.0f * alpha)}; - - return result; -} - -// Formatting of text with variables to 'embed' -static const char *TextFormat(const char *text, ...) -{ -#if !defined(RAYGUI_TEXTFORMAT_MAX_SIZE) -#define RAYGUI_TEXTFORMAT_MAX_SIZE 256 -#endif - - static char buffer[RAYGUI_TEXTFORMAT_MAX_SIZE]; - - va_list args; - va_start(args, text); - vsprintf(buffer, text, args); - va_end(args); - - return buffer; -} - -// Draw rectangle with vertical gradient fill color -// NOTE: This function is only used by GuiColorPicker() -static void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2) -{ - Rectangle bounds = {(float)posX, (float)posY, (float)width, (float)height}; - DrawRectangleGradientEx(bounds, color1, color2, color2, color1); -} - -// Split string into multiple strings -const char **TextSplit(const char *text, char delimiter, int *count) -{ - // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) - // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, - // all used memory is static... it has some limitations: - // 1. Maximum number of possible split strings is set by RAYGUI_TEXTSPLIT_MAX_ITEMS - // 2. Maximum size of text to split is RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE - -#if !defined(RAYGUI_TEXTSPLIT_MAX_ITEMS) -#define RAYGUI_TEXTSPLIT_MAX_ITEMS 128 -#endif -#if !defined(RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE) -#define RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE 1024 -#endif - - static const char *result[RAYGUI_TEXTSPLIT_MAX_ITEMS] = {NULL}; - static char buffer[RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE] = {0}; - memset(buffer, 0, RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE); - - result[0] = buffer; - int counter = 0; - - if (text != NULL) - { - counter = 1; - - // Count how many substrings we have on text and point to every one - for (int i = 0; i < RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE; i++) - { - buffer[i] = text[i]; - if (buffer[i] == '\0') - break; - else if (buffer[i] == delimiter) - { - buffer[i] = '\0'; // Set an end of string at this point - result[counter] = buffer + i + 1; - counter++; - - if (counter == RAYGUI_TEXTSPLIT_MAX_ITEMS) - break; - } - } - } - - *count = counter; - return result; -} - -// Get integer value from text -// NOTE: This function replaces atoi() [stdlib.h] -static int TextToInteger(const char *text) -{ - int value = 0; - int sign = 1; - - if ((text[0] == '+') || (text[0] == '-')) - { - if (text[0] == '-') - sign = -1; - text++; - } - - for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) - value = value * 10 + (int)(text[i] - '0'); - - return value * sign; -} - -// Encode codepoint into UTF-8 text (char array size returned as parameter) -static const char *CodepointToUTF8(int codepoint, int *byteSize) -{ - static char utf8[6] = {0}; - int size = 0; - - if (codepoint <= 0x7f) - { - utf8[0] = (char)codepoint; - size = 1; - } - else if (codepoint <= 0x7ff) - { - utf8[0] = (char)(((codepoint >> 6) & 0x1f) | 0xc0); - utf8[1] = (char)((codepoint & 0x3f) | 0x80); - size = 2; - } - else if (codepoint <= 0xffff) - { - utf8[0] = (char)(((codepoint >> 12) & 0x0f) | 0xe0); - utf8[1] = (char)(((codepoint >> 6) & 0x3f) | 0x80); - utf8[2] = (char)((codepoint & 0x3f) | 0x80); - size = 3; - } - else if (codepoint <= 0x10ffff) - { - utf8[0] = (char)(((codepoint >> 18) & 0x07) | 0xf0); - utf8[1] = (char)(((codepoint >> 12) & 0x3f) | 0x80); - utf8[2] = (char)(((codepoint >> 6) & 0x3f) | 0x80); - utf8[3] = (char)((codepoint & 0x3f) | 0x80); - size = 4; - } - - *byteSize = size; - - return utf8; -} - -// Get next codepoint in a UTF-8 encoded text, scanning until '\0' is found -// When a invalid UTF-8 byte is encountered we exit as soon as possible and a '?'(0x3f) codepoint is returned -// Total number of bytes processed are returned as a parameter -// NOTE: the standard says U+FFFD should be returned in case of errors -// but that character is not supported by the default font in raylib -static int GetCodepoint(const char *text, int *bytesProcessed) -{ - /* - UTF-8 specs from https://www.ietf.org/rfc/rfc3629.txt - - Char. number range | UTF-8 octet sequence - (hexadecimal) | (binary) - --------------------+--------------------------------------------- - 0000 0000-0000 007F | 0xxxxxxx - 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - */ - // NOTE: on decode errors we return as soon as possible - - int code = 0x3f; // Codepoint (defaults to '?') - int octet = (unsigned char)(text[0]); // The first UTF8 octet - *bytesProcessed = 1; - - if (octet <= 0x7f) - { - // Only one octet (ASCII range x00-7F) - code = text[0]; - } - else if ((octet & 0xe0) == 0xc0) - { - // Two octets - - // [0]xC2-DF [1]UTF8-tail(x80-BF) - unsigned char octet1 = text[1]; - - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) - { - *bytesProcessed = 2; - return code; - } // Unexpected sequence - - if ((octet >= 0xc2) && (octet <= 0xdf)) - { - code = ((octet & 0x1f) << 6) | (octet1 & 0x3f); - *bytesProcessed = 2; - } - } - else if ((octet & 0xf0) == 0xe0) - { - // Three octets - unsigned char octet1 = text[1]; - unsigned char octet2 = '\0'; - - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) - { - *bytesProcessed = 2; - return code; - } // Unexpected sequence - - octet2 = text[2]; - - if ((octet2 == '\0') || ((octet2 >> 6) != 2)) - { - *bytesProcessed = 3; - return code; - } // Unexpected sequence - - // [0]xE0 [1]xA0-BF [2]UTF8-tail(x80-BF) - // [0]xE1-EC [1]UTF8-tail [2]UTF8-tail(x80-BF) - // [0]xED [1]x80-9F [2]UTF8-tail(x80-BF) - // [0]xEE-EF [1]UTF8-tail [2]UTF8-tail(x80-BF) - - if (((octet == 0xe0) && !((octet1 >= 0xa0) && (octet1 <= 0xbf))) || - ((octet == 0xed) && !((octet1 >= 0x80) && (octet1 <= 0x9f)))) - { - *bytesProcessed = 2; - return code; - } - - if ((octet >= 0xe0) && (0 <= 0xef)) - { - code = ((octet & 0xf) << 12) | ((octet1 & 0x3f) << 6) | (octet2 & 0x3f); - *bytesProcessed = 3; - } - } - else if ((octet & 0xf8) == 0xf0) - { - // Four octets - if (octet > 0xf4) - return code; - - unsigned char octet1 = text[1]; - unsigned char octet2 = '\0'; - unsigned char octet3 = '\0'; - - if ((octet1 == '\0') || ((octet1 >> 6) != 2)) - { - *bytesProcessed = 2; - return code; - } // Unexpected sequence - - octet2 = text[2]; - - if ((octet2 == '\0') || ((octet2 >> 6) != 2)) - { - *bytesProcessed = 3; - return code; - } // Unexpected sequence - - octet3 = text[3]; - - if ((octet3 == '\0') || ((octet3 >> 6) != 2)) - { - *bytesProcessed = 4; - return code; - } // Unexpected sequence - - // [0]xF0 [1]x90-BF [2]UTF8-tail [3]UTF8-tail - // [0]xF1-F3 [1]UTF8-tail [2]UTF8-tail [3]UTF8-tail - // [0]xF4 [1]x80-8F [2]UTF8-tail [3]UTF8-tail - - if (((octet == 0xf0) && !((octet1 >= 0x90) && (octet1 <= 0xbf))) || - ((octet == 0xf4) && !((octet1 >= 0x80) && (octet1 <= 0x8f)))) - { - *bytesProcessed = 2; - return code; - } // Unexpected sequence - - if (octet >= 0xf0) - { - code = ((octet & 0x7) << 18) | ((octet1 & 0x3f) << 12) | ((octet2 & 0x3f) << 6) | (octet3 & 0x3f); - *bytesProcessed = 4; - } - } - - if (code > 0x10ffff) - code = 0x3f; // Codepoints after U+10ffff are invalid - - return code; -} -#endif // RAYGUI_STANDALONE - -#endif // RAYGUI_IMPLEMENTATION diff --git a/raylib-sys/binding/rgui_wrapper.cpp b/raylib-sys/binding/rgui_wrapper.cpp deleted file mode 100644 index 57b76db6..00000000 --- a/raylib-sys/binding/rgui_wrapper.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "../raylib/src/raylib.h" -#define RAYGUI_IMPLEMENTATION -#define RAYGUI_SUPPORT_ICONS -#define RLGL_IMPLEMENTATION -#define RLGL_SUPPORT_TRACELOG -// // Support TRACELOG macros -// #if !defined(TRACELOG) -// #define TRACELOG(level, ...) (void)0 -// #define TRACELOGD(...) (void)0 -// #endif -// #include "rlgl.h" // Don't include rlgl since it's in raylib -#include "raygui.h" -#undef RAYGUI_IMPLEMENTATION \ No newline at end of file diff --git a/raylib-sys/binding/rgui_wrapper.h b/raylib-sys/binding/rgui_wrapper.h deleted file mode 100644 index b07ed3ed..00000000 --- a/raylib-sys/binding/rgui_wrapper.h +++ /dev/null @@ -1,9 +0,0 @@ -#define RICONS_IMPLEMENTATION -#define RAYGUI_IMPLEMENTATION -#define RAYGUI_SUPPORT_ICONS -#define RLGL_IMPLEMENTATION -#define RLGL_SUPPORT_TRACELOG -#if defined(_WIN32) - #include "rlgl.h" -#endif -#include "raygui.h" \ No newline at end of file diff --git a/raylib-sys/binding/wrapper.c b/raylib-sys/binding/wrapper.c new file mode 100644 index 00000000..058adada --- /dev/null +++ b/raylib-sys/binding/wrapper.c @@ -0,0 +1,4 @@ +#include "raylib.h" +#define RAYGUI_IMPLEMENTATION +#define RAYGUI_SUPPORT_ICONS +#include "../raygui/src/raygui.h" \ No newline at end of file diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index 2a20ed8d..a8138422 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -21,7 +21,7 @@ use std::env; use std::path::{Path, PathBuf}; /// latest version on github's release page as of time or writing -const LATEST_RAYLIB_VERSION: &str = "4.2.0"; +const LATEST_RAYLIB_VERSION: &str = "4.5.0"; const LATEST_RAYLIB_API_VERSION: &str = "4"; #[cfg(feature = "nobuild")] @@ -137,11 +137,9 @@ fn build_with_cmake(src_path: &str) { panic!("failed to create windows library"); } } // on web copy libraylib.bc to libraylib.a - if platform == Platform::Web { - if !Path::new(&dst_lib.join("libraylib.a")).exists() { - std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a")) - .expect("failed to create wasm library"); - } + if platform == Platform::Web && !Path::new(&dst_lib.join("libraylib.a")).exists() { + std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a")) + .expect("failed to create wasm library"); } // println!("cmake build {}", c.display()); println!("cargo:rustc-link-search=native={}", dst_lib.display()); @@ -160,6 +158,7 @@ fn gen_bindings() { let mut builder = bindgen::Builder::default() .header("binding/binding.h") .rustified_enum(".+") + .clang_arg("-I../raylib/src") .clang_arg("-std=c99") .clang_arg(plat) .parse_callbacks(Box::new(bindgen::CargoCallbacks)); @@ -186,26 +185,13 @@ fn gen_bindings() { fn gen_rgui() { // Compile the code and link with cc crate - #[cfg(target_os = "windows")] - { - cc::Build::new() - .file("binding/rgui_wrapper.cpp") - .include("binding") - .warnings(false) - // .flag("-std=c99") - .extra_warnings(false) - .compile("rgui"); - } - #[cfg(not(target_os = "windows"))] - { - cc::Build::new() - .file("binding/rgui_wrapper.c") - .include("binding") - .warnings(false) - // .flag("-std=c99") - .extra_warnings(false) - .compile("rgui"); - } + cc::Build::new() + .file("binding/wrapper.c") + .include("binding") + .warnings(false) + // .flag("-std=c99") + .extra_warnings(false) + .compile("rgui"); } #[cfg(feature = "nobuild")] @@ -247,6 +233,7 @@ fn link(platform: Platform, platform_os: PlatformOS) { _ => (), } if platform == Platform::Web { + env::set_var("EMCC_CFLAGS", "-sUSE_GLFW=3 -sERROR_ON_UNDEFINED_SYMBOLS=0"); println!("cargo:rustc-link-lib=glfw"); } else if platform == Platform::RPI { println!("cargo:rustc-link-search=/opt/vc/lib"); @@ -281,14 +268,24 @@ fn cp_raylib() -> String { let mut options = fs_extra::dir::CopyOptions::new(); options.skip_exist = true; - fs_extra::dir::copy("raylib", &out, &options).expect(&format!( - "failed to copy raylib source to {}", - &out.to_string_lossy() - )); + fs_extra::dir::copy("raylib", &out, &options) + .unwrap_or_else(|_| panic!("failed to copy raylib source to {}", out.to_string_lossy())); out.join("raylib").to_string_lossy().to_string() } +fn cp_raygui() -> String { + let out = env::var("OUT_DIR").unwrap(); + let out = Path::new(&out); //.join("raylib_source"); + + let mut options = fs_extra::dir::CopyOptions::new(); + options.skip_exist = true; + fs_extra::dir::copy("raygui", &out, &options) + .unwrap_or_else(|_| panic!("failed to copy raygui source to {}", out.to_string_lossy())); + + out.join("raygui").to_string_lossy().to_string() +} + // run_command runs a command to completion or panics. Used for running curl and powershell. fn run_command(cmd: &str, args: &[&str]) { use std::process::Command; @@ -309,7 +306,6 @@ fn platform_from_target(target: &str) -> (Platform, PlatformOS) { let platform = if target.contains("wasm32") { // make sure cmake knows that it should bundle glfw in // Cargo web takes care of this but better safe than sorry - env::set_var("EMMAKEN_CFLAGS", "-s USE_GLFW=3"); Platform::Web } else if target.contains("armv7-unknown-linux") { Platform::RPI diff --git a/raylib-sys/src/camera.rs b/raylib-sys/src/camera.rs new file mode 100644 index 00000000..23294756 --- /dev/null +++ b/raylib-sys/src/camera.rs @@ -0,0 +1,62 @@ +use std::mem::transmute; + +use super::{Camera3D, CameraProjection}; +use mint::Vector3; + +impl Camera3D { + pub fn camera_type(&self) -> CameraProjection { + unsafe { transmute(self.projection as u32) } + } + /// Create a perspective camera. + /// fovy is in degrees + pub fn perspective( + position: Vector3, + target: Vector3, + up: Vector3, + fovy: f32, + ) -> Camera3D { + Camera3D { + position: position.into(), + target: target.into(), + up: up.into(), + fovy, + projection: CameraProjection::CAMERA_PERSPECTIVE as i32, + } + } + /// Create a orthographic camera. + /// fovy is in degrees + pub fn orthographic( + position: Vector3, + target: Vector3, + up: Vector3, + fovy: f32, + ) -> Camera3D { + let mut c = Self::perspective(position, target, up, fovy); + c.projection = CameraProjection::CAMERA_ORTHOGRAPHIC as i32; + c + } + + /* + RLAPI Vector3 GetCameraForward(Camera *camera); + RLAPI Vector3 GetCameraUp(Camera *camera); + RLAPI Vector3 GetCameraRight(Camera *camera); + + // Camera movement + RLAPI void CameraMoveForward(Camera *camera, float distance, bool moveInWorldPlane); + RLAPI void CameraMoveUp(Camera *camera, float distance); + RLAPI void CameraMoveRight(Camera *camera, float distance, bool moveInWorldPlane); + RLAPI void CameraMoveToTarget(Camera *camera, float delta); + + // Camera rotation + RLAPI void CameraYaw(Camera *camera, float angle, bool rotateAroundTarget); + RLAPI void CameraPitch(Camera *camera, float angle, bool lockView, bool rotateAroundTarget, bool rotateUp); + RLAPI void CameraRoll(Camera *camera, float angle); + + RLAPI Matrix GetCameraViewMatrix(Camera *camera); + RLAPI Matrix GetCameraProjectionMatrix(Camera* camera, float aspect); + */ + + pub fn forward(&self) -> Vector3 { + unsafe { super::GetCameraForward(self as *const _ as *mut _).into() } + } +} diff --git a/raylib/src/core/color.rs b/raylib-sys/src/color.rs similarity index 83% rename from raylib/src/core/color.rs rename to raylib-sys/src/color.rs index bfbadc21..4aea3126 100644 --- a/raylib/src/core/color.rs +++ b/raylib-sys/src/color.rs @@ -1,299 +1,263 @@ -//! [`Color`] manipulation helpers -use crate::core::math::{Vector3, Vector4}; -use crate::ffi; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; - -#[cfg(feature = "with_serde")] -use serde::{Deserialize, Serialize}; - -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub struct Color { - pub r: u8, - pub g: u8, - pub b: u8, - pub a: u8, -} - -// A convenience function for making a new `Color`. -pub fn rcolor(r: u8, g: u8, b: u8, a: u8) -> Color { - Color::new(r, g, b, a) -} - -impl From for Color { - fn from(v: ffi::Color) -> Color { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for Color { - fn into(self) -> ffi::Color { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Color { - fn into(self) -> ffi::Color { - ffi::Color { - r: self.r, - g: self.g, - b: self.b, - a: self.a, - } - } -} - -impl Into for Color { - fn into(self) -> Vector4 { - Vector4::new( - self.r as f32 / 255.0, - self.g as f32 / 255.0, - self.b as f32 / 255.0, - self.a as f32 / 255.0, - ) - } -} - -impl From<(u8, u8, u8, u8)> for Color { - fn from(col: (u8, u8, u8, u8)) -> Color { - Color::new(col.0, col.1, col.2, col.3) - } -} - -impl Color { - /// Get color from HEX RGB string - /// # Arguments - /// * `color_hex_str` - A string slice, 6 characters long - /// # Example - /// ``` - /// use raylib::prelude::*; - /// let color_white = Color::from_hex("FFFFFF").unwrap(); - /// let color_black = Color::from_hex("000000").unwrap(); - /// - /// assert_eq!(color_black, Color::BLACK); - /// assert_eq!(color_white, Color::WHITE); - /// ``` - pub fn from_hex(color_hex_str: &str) -> Result { - let color = i32::from_str_radix(color_hex_str, 16)?; - let b = color % 0x100; - let g = (color - b) / 0x100 % 0x100; - let r = (color - g) / 0x10000; - - Ok(Color { - r: r as u8, - g: g as u8, - b: b as u8, - a: 255, - }) - } - - #[inline] - pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Color { - Color { r, g, b, a } - } - - /// Returns hexadecimal value for a Color - #[inline] - pub fn color_to_int(&self) -> i32 { - unsafe { ffi::ColorToInt(self.into()) } - } - - /// Returns color normalized as float [0..1] - #[inline] - pub fn color_normalize(&self) -> Vector4 { - unsafe { ffi::ColorNormalize(self.into()).into() } - } - - /// Returns HSV values for a Color - #[inline] - pub fn color_to_hsv(&self) -> Vector3 { - unsafe { ffi::ColorToHSV(self.into()).into() } - } - - /// Returns a Color from HSV values - #[inline] - pub fn color_from_hsv(hue: f32, saturation: f32, value: f32) -> Color { - unsafe { ffi::ColorFromHSV(hue, saturation, value).into() } - } - - /// Returns color from normalized values [0..1] - /// ```rust - /// use raylib::prelude::*; - /// fn main() { - /// assert_eq!(Color::color_from_normalized(Vector4::new(1.0, 1.0, 1.0, 1.0)), Color::new(255, 255, 255, 255)); - /// } - /// ``` - #[inline] - pub fn color_from_normalized(normalized: Vector4) -> Color { - unsafe { ffi::ColorFromNormalized(normalized.into()).into() } - } - - /// Returns a Color struct from hexadecimal value - #[inline] - pub fn get_color(hex_value: u32) -> Color { - unsafe { ffi::GetColor(hex_value).into() } - } - - /// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f - #[inline] - pub fn fade(&self, alpha: f32) -> Color { - unsafe { ffi::Fade(self.into(), alpha).into() } - } - - /// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f - #[inline] - pub fn color_alpha_blend(dst: &Color, src: &Color, tint: &Color) -> Color { - unsafe { ffi::ColorAlphaBlend(dst.into(), src.into(), tint.into()).into() } - } -} - -/// Color constants -impl Color { - pub const INDIANRED: Color = Color::new(205, 92, 92, 255); - pub const LIGHTCORAL: Color = Color::new(240, 128, 128, 255); - pub const SALMON: Color = Color::new(250, 128, 114, 255); - pub const DARKSALMON: Color = Color::new(233, 150, 122, 255); - pub const LIGHTSALMON: Color = Color::new(255, 160, 122, 255); - pub const CRIMSON: Color = Color::new(220, 20, 60, 255); - pub const RED: Color = Color::new(255, 0, 0, 255); - pub const FIREBRICK: Color = Color::new(178, 34, 34, 255); - pub const DARKRED: Color = Color::new(139, 0, 0, 255); - pub const PINK: Color = Color::new(255, 192, 203, 255); - pub const LIGHTPINK: Color = Color::new(255, 182, 193, 255); - pub const HOTPINK: Color = Color::new(255, 105, 180, 255); - pub const DEEPPINK: Color = Color::new(255, 20, 147, 255); - pub const MEDIUMVIOLETRED: Color = Color::new(199, 21, 133, 255); - pub const PALEVIOLETRED: Color = Color::new(219, 112, 147, 255); - pub const CORAL: Color = Color::new(255, 127, 80, 255); - pub const TOMATO: Color = Color::new(255, 99, 71, 255); - pub const ORANGERED: Color = Color::new(255, 69, 0, 255); - pub const DARKORANGE: Color = Color::new(255, 140, 0, 255); - pub const ORANGE: Color = Color::new(255, 165, 0, 255); - pub const GOLD: Color = Color::new(255, 215, 0, 255); - pub const YELLOW: Color = Color::new(255, 255, 0, 255); - pub const LIGHTYELLOW: Color = Color::new(255, 255, 224, 255); - pub const LEMONCHIFFON: Color = Color::new(255, 250, 205, 255); - pub const LIGHTGOLDENRODYELLOW: Color = Color::new(250, 250, 210, 255); - pub const PAPAYAWHIP: Color = Color::new(255, 239, 213, 255); - pub const MOCCASIN: Color = Color::new(255, 228, 181, 255); - pub const PEACHPUFF: Color = Color::new(255, 218, 185, 255); - pub const PALEGOLDENROD: Color = Color::new(238, 232, 170, 255); - pub const KHAKI: Color = Color::new(240, 230, 140, 255); - pub const DARKKHAKI: Color = Color::new(189, 183, 107, 255); - pub const LAVENDER: Color = Color::new(230, 230, 250, 255); - pub const THISTLE: Color = Color::new(216, 191, 216, 255); - pub const PLUM: Color = Color::new(221, 160, 221, 255); - pub const VIOLET: Color = Color::new(238, 130, 238, 255); - pub const ORCHID: Color = Color::new(218, 112, 214, 255); - pub const FUCHSIA: Color = Color::new(255, 0, 255, 255); - pub const MAGENTA: Color = Color::new(255, 0, 255, 255); - pub const MEDIUMORCHID: Color = Color::new(186, 85, 211, 255); - pub const MEDIUMPURPLE: Color = Color::new(147, 112, 219, 255); - pub const REBECCAPURPLE: Color = Color::new(102, 51, 153, 255); - pub const BLUEVIOLET: Color = Color::new(138, 43, 226, 255); - pub const DARKVIOLET: Color = Color::new(148, 0, 211, 255); - pub const DARKORCHID: Color = Color::new(153, 50, 204, 255); - pub const DARKMAGENTA: Color = Color::new(139, 0, 139, 255); - pub const PURPLE: Color = Color::new(128, 0, 128, 255); - pub const DARKPURPLE: Color = Color::new(112, 31, 126, 255); - pub const INDIGO: Color = Color::new(75, 0, 130, 255); - pub const SLATEBLUE: Color = Color::new(106, 90, 205, 255); - pub const DARKSLATEBLUE: Color = Color::new(72, 61, 139, 255); - pub const MEDIUMSLATEBLUE: Color = Color::new(123, 104, 238, 255); - pub const GREENYELLOW: Color = Color::new(173, 255, 47, 255); - pub const CHARTREUSE: Color = Color::new(127, 255, 0, 255); - pub const LAWNGREEN: Color = Color::new(124, 252, 0, 255); - pub const LIME: Color = Color::new(0, 255, 0, 255); - pub const LIMEGREEN: Color = Color::new(50, 205, 50, 255); - pub const PALEGREEN: Color = Color::new(152, 251, 152, 255); - pub const LIGHTGREEN: Color = Color::new(144, 238, 144, 255); - pub const MEDIUMSPRINGGREEN: Color = Color::new(0, 250, 154, 255); - pub const SPRINGGREEN: Color = Color::new(0, 255, 127, 255); - pub const MEDIUMSEAGREEN: Color = Color::new(60, 179, 113, 255); - pub const SEAGREEN: Color = Color::new(46, 139, 87, 255); - pub const FORESTGREEN: Color = Color::new(34, 139, 34, 255); - pub const GREEN: Color = Color::new(0, 128, 0, 255); - pub const DARKGREEN: Color = Color::new(0, 100, 0, 255); - pub const YELLOWGREEN: Color = Color::new(154, 205, 50, 255); - pub const OLIVEDRAB: Color = Color::new(107, 142, 35, 255); - pub const OLIVE: Color = Color::new(128, 128, 0, 255); - pub const DARKOLIVEGREEN: Color = Color::new(85, 107, 47, 255); - pub const MEDIUMAQUAMARINE: Color = Color::new(102, 205, 170, 255); - pub const DARKSEAGREEN: Color = Color::new(143, 188, 139, 255); - pub const LIGHTSEAGREEN: Color = Color::new(32, 178, 170, 255); - pub const DARKCYAN: Color = Color::new(0, 139, 139, 255); - pub const TEAL: Color = Color::new(0, 128, 128, 255); - pub const AQUA: Color = Color::new(0, 255, 255, 255); - pub const CYAN: Color = Color::new(0, 255, 255, 255); - pub const LIGHTCYAN: Color = Color::new(224, 255, 255, 255); - pub const PALETURQUOISE: Color = Color::new(175, 238, 238, 255); - pub const AQUAMARINE: Color = Color::new(127, 255, 212, 255); - pub const TURQUOISE: Color = Color::new(64, 224, 208, 255); - pub const MEDIUMTURQUOISE: Color = Color::new(72, 209, 204, 255); - pub const DARKTURQUOISE: Color = Color::new(0, 206, 209, 255); - pub const CADETBLUE: Color = Color::new(95, 158, 160, 255); - pub const STEELBLUE: Color = Color::new(70, 130, 180, 255); - pub const LIGHTSTEELBLUE: Color = Color::new(176, 196, 222, 255); - pub const POWDERBLUE: Color = Color::new(176, 224, 230, 255); - pub const LIGHTBLUE: Color = Color::new(173, 216, 230, 255); - pub const SKYBLUE: Color = Color::new(135, 206, 235, 255); - pub const LIGHTSKYBLUE: Color = Color::new(135, 206, 250, 255); - pub const DEEPSKYBLUE: Color = Color::new(0, 191, 255, 255); - pub const DODGERBLUE: Color = Color::new(30, 144, 255, 255); - pub const CORNFLOWERBLUE: Color = Color::new(100, 149, 237, 255); - pub const ROYALBLUE: Color = Color::new(65, 105, 225, 255); - pub const BLUE: Color = Color::new(0, 0, 255, 255); - pub const MEDIUMBLUE: Color = Color::new(0, 0, 205, 255); - pub const DARKBLUE: Color = Color::new(0, 0, 139, 255); - pub const NAVY: Color = Color::new(0, 0, 128, 255); - pub const MIDNIGHTBLUE: Color = Color::new(25, 25, 112, 255); - pub const CORNSILK: Color = Color::new(255, 248, 220, 255); - pub const BLANCHEDALMOND: Color = Color::new(255, 235, 205, 255); - pub const BISQUE: Color = Color::new(255, 228, 196, 255); - pub const NAVAJOWHITE: Color = Color::new(255, 222, 173, 255); - pub const WHEAT: Color = Color::new(245, 222, 179, 255); - pub const BURLYWOOD: Color = Color::new(222, 184, 135, 255); - pub const TAN: Color = Color::new(210, 180, 140, 255); - pub const ROSYBROWN: Color = Color::new(188, 143, 143, 255); - pub const SANDYBROWN: Color = Color::new(244, 164, 96, 255); - pub const GOLDENROD: Color = Color::new(218, 165, 32, 255); - pub const DARKGOLDENROD: Color = Color::new(184, 134, 11, 255); - pub const PERU: Color = Color::new(205, 133, 63, 255); - pub const CHOCOLATE: Color = Color::new(210, 105, 30, 255); - pub const SADDLEBROWN: Color = Color::new(139, 69, 19, 255); - pub const SIENNA: Color = Color::new(160, 82, 45, 255); - pub const BROWN: Color = Color::new(165, 42, 42, 255); - pub const DARKBROWN: Color = Color::new(76, 63, 47, 255); - pub const MAROON: Color = Color::new(128, 0, 0, 255); - pub const WHITE: Color = Color::new(255, 255, 255, 255); - pub const SNOW: Color = Color::new(255, 250, 250, 255); - pub const HONEYDEW: Color = Color::new(240, 255, 240, 255); - pub const MINTCREAM: Color = Color::new(245, 255, 250, 255); - pub const AZURE: Color = Color::new(240, 255, 255, 255); - pub const ALICEBLUE: Color = Color::new(240, 248, 255, 255); - pub const GHOSTWHITE: Color = Color::new(248, 248, 255, 255); - pub const WHITESMOKE: Color = Color::new(245, 245, 245, 255); - pub const SEASHELL: Color = Color::new(255, 245, 238, 255); - pub const BEIGE: Color = Color::new(245, 245, 220, 255); - pub const OLDLACE: Color = Color::new(253, 245, 230, 255); - pub const FLORALWHITE: Color = Color::new(255, 250, 240, 255); - pub const IVORY: Color = Color::new(255, 255, 240, 255); - pub const ANTIQUEWHITE: Color = Color::new(250, 235, 215, 255); - pub const LINEN: Color = Color::new(250, 240, 230, 255); - pub const LAVENDERBLUSH: Color = Color::new(255, 240, 245, 255); - pub const MISTYROSE: Color = Color::new(255, 228, 225, 255); - pub const GAINSBORO: Color = Color::new(220, 220, 220, 255); - pub const LIGHTGRAY: Color = Color::new(211, 211, 211, 255); - pub const SILVER: Color = Color::new(192, 192, 192, 255); - pub const DARKGRAY: Color = Color::new(169, 169, 169, 255); - pub const GRAY: Color = Color::new(128, 128, 128, 255); - pub const DIMGRAY: Color = Color::new(105, 105, 105, 255); - pub const LIGHTSLATEGRAY: Color = Color::new(119, 136, 153, 255); - pub const SLATEGRAY: Color = Color::new(112, 128, 144, 255); - pub const DARKSLATEGRAY: Color = Color::new(47, 79, 79, 255); - pub const BLACK: Color = Color::new(0, 0, 0, 255); - pub const BLANK: Color = Color::new(0, 0, 0, 0); - pub const RAYWHITE: Color = Color::new(245, 245, 245, 255); -} +use crate::Color; +use mint::{Vector3, Vector4}; + +impl From for Vector4 { + fn from(val: Color) -> Self { + Vector4:: { + x: val.r as f32 / 255.0, + y: val.g as f32 / 255.0, + z: val.b as f32 / 255.0, + w: val.a as f32 / 255.0, + } + } +} + +impl From<(u8, u8, u8, u8)> for Color { + fn from(col: (u8, u8, u8, u8)) -> Color { + Color::new(col.0, col.1, col.2, col.3) + } +} + +impl Default for Color { + fn default() -> Self { + Self { + r: 0, + g: 0, + b: 0, + a: 0, + } + } +} + +impl Color { + /// Get color from HEX RGB string + /// # Arguments + /// * `color_hex_str` - A string slice, 6 characters long + /// # Example + /// ``` + /// use raylib::prelude::*; + /// let color_white = Color::from_hex("FFFFFF").unwrap(); + /// let color_black = Color::from_hex("000000").unwrap(); + /// + /// assert_eq!(color_black, Color::BLACK); + /// assert_eq!(color_white, Color::WHITE); + /// ``` + pub fn from_hex(color_hex_str: &str) -> Result { + let color = i32::from_str_radix(color_hex_str, 16)?; + let b = color % 0x100; + let g = (color - b) / 0x100 % 0x100; + let r = (color - g) / 0x10000; + + Ok(Color { + r: r as u8, + g: g as u8, + b: b as u8, + a: 255, + }) + } + + #[inline] + pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Color { + Color { r, g, b, a } + } + + /// Returns hexadecimal value for a Color + #[inline] + pub fn color_to_int(&self) -> i32 { + unsafe { crate::ColorToInt(*self) } + } + + /// Returns color normalized as float [0..1] + #[inline] + pub fn color_normalize(&self) -> Vector4 { + unsafe { crate::ColorNormalize(*self).into() } + } + + /// Returns HSV values for a Color + #[inline] + pub fn color_to_hsv(&self) -> Vector3 { + unsafe { crate::ColorToHSV(*self).into() } + } + + /// Returns a Color from HSV values + #[inline] + pub fn color_from_hsv(hue: f32, saturation: f32, value: f32) -> Color { + unsafe { crate::ColorFromHSV(hue, saturation, value) } + } + + /// Returns color from normalized values [0..1] + /// ```rust + /// assert_eq!(Color::color_from_normalized(Vector4 { x: 1.0, y: 1.0, z: 1.0, w: 1.0 }), Color::new(255, 255, 255, 255)); + /// ``` + #[inline] + pub fn color_from_normalized(normalized: Vector4) -> Color { + unsafe { crate::ColorFromNormalized(normalized.into()) } + } + + /// Returns a Color struct from hexadecimal value + #[inline] + pub fn get_color(hex_value: u32) -> Color { + unsafe { crate::GetColor(hex_value) } + } + + /// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f + #[inline] + pub fn fade(&self, alpha: f32) -> Color { + unsafe { crate::Fade(*self, alpha) } + } + + /// Color fade-in or fade-out, alpha goes from 0.0f to 1.0f + #[inline] + pub fn color_alpha_blend(dst: Color, src: Color, tint: Color) -> Color { + unsafe { crate::ColorAlphaBlend(dst, src, tint) } + } +} + +/// Color constants +impl Color { + pub const INDIANRED: Color = Color::new(205, 92, 92, 255); + pub const LIGHTCORAL: Color = Color::new(240, 128, 128, 255); + pub const SALMON: Color = Color::new(250, 128, 114, 255); + pub const DARKSALMON: Color = Color::new(233, 150, 122, 255); + pub const LIGHTSALMON: Color = Color::new(255, 160, 122, 255); + pub const CRIMSON: Color = Color::new(220, 20, 60, 255); + pub const RED: Color = Color::new(255, 0, 0, 255); + pub const FIREBRICK: Color = Color::new(178, 34, 34, 255); + pub const DARKRED: Color = Color::new(139, 0, 0, 255); + pub const PINK: Color = Color::new(255, 192, 203, 255); + pub const LIGHTPINK: Color = Color::new(255, 182, 193, 255); + pub const HOTPINK: Color = Color::new(255, 105, 180, 255); + pub const DEEPPINK: Color = Color::new(255, 20, 147, 255); + pub const MEDIUMVIOLETRED: Color = Color::new(199, 21, 133, 255); + pub const PALEVIOLETRED: Color = Color::new(219, 112, 147, 255); + pub const CORAL: Color = Color::new(255, 127, 80, 255); + pub const TOMATO: Color = Color::new(255, 99, 71, 255); + pub const ORANGERED: Color = Color::new(255, 69, 0, 255); + pub const DARKORANGE: Color = Color::new(255, 140, 0, 255); + pub const ORANGE: Color = Color::new(255, 165, 0, 255); + pub const GOLD: Color = Color::new(255, 215, 0, 255); + pub const YELLOW: Color = Color::new(255, 255, 0, 255); + pub const LIGHTYELLOW: Color = Color::new(255, 255, 224, 255); + pub const LEMONCHIFFON: Color = Color::new(255, 250, 205, 255); + pub const LIGHTGOLDENRODYELLOW: Color = Color::new(250, 250, 210, 255); + pub const PAPAYAWHIP: Color = Color::new(255, 239, 213, 255); + pub const MOCCASIN: Color = Color::new(255, 228, 181, 255); + pub const PEACHPUFF: Color = Color::new(255, 218, 185, 255); + pub const PALEGOLDENROD: Color = Color::new(238, 232, 170, 255); + pub const KHAKI: Color = Color::new(240, 230, 140, 255); + pub const DARKKHAKI: Color = Color::new(189, 183, 107, 255); + pub const LAVENDER: Color = Color::new(230, 230, 250, 255); + pub const THISTLE: Color = Color::new(216, 191, 216, 255); + pub const PLUM: Color = Color::new(221, 160, 221, 255); + pub const VIOLET: Color = Color::new(238, 130, 238, 255); + pub const ORCHID: Color = Color::new(218, 112, 214, 255); + pub const FUCHSIA: Color = Color::new(255, 0, 255, 255); + pub const MAGENTA: Color = Color::new(255, 0, 255, 255); + pub const MEDIUMORCHID: Color = Color::new(186, 85, 211, 255); + pub const MEDIUMPURPLE: Color = Color::new(147, 112, 219, 255); + pub const REBECCAPURPLE: Color = Color::new(102, 51, 153, 255); + pub const BLUEVIOLET: Color = Color::new(138, 43, 226, 255); + pub const DARKVIOLET: Color = Color::new(148, 0, 211, 255); + pub const DARKORCHID: Color = Color::new(153, 50, 204, 255); + pub const DARKMAGENTA: Color = Color::new(139, 0, 139, 255); + pub const PURPLE: Color = Color::new(128, 0, 128, 255); + pub const DARKPURPLE: Color = Color::new(112, 31, 126, 255); + pub const INDIGO: Color = Color::new(75, 0, 130, 255); + pub const SLATEBLUE: Color = Color::new(106, 90, 205, 255); + pub const DARKSLATEBLUE: Color = Color::new(72, 61, 139, 255); + pub const MEDIUMSLATEBLUE: Color = Color::new(123, 104, 238, 255); + pub const GREENYELLOW: Color = Color::new(173, 255, 47, 255); + pub const CHARTREUSE: Color = Color::new(127, 255, 0, 255); + pub const LAWNGREEN: Color = Color::new(124, 252, 0, 255); + pub const LIME: Color = Color::new(0, 255, 0, 255); + pub const LIMEGREEN: Color = Color::new(50, 205, 50, 255); + pub const PALEGREEN: Color = Color::new(152, 251, 152, 255); + pub const LIGHTGREEN: Color = Color::new(144, 238, 144, 255); + pub const MEDIUMSPRINGGREEN: Color = Color::new(0, 250, 154, 255); + pub const SPRINGGREEN: Color = Color::new(0, 255, 127, 255); + pub const MEDIUMSEAGREEN: Color = Color::new(60, 179, 113, 255); + pub const SEAGREEN: Color = Color::new(46, 139, 87, 255); + pub const FORESTGREEN: Color = Color::new(34, 139, 34, 255); + pub const GREEN: Color = Color::new(0, 128, 0, 255); + pub const DARKGREEN: Color = Color::new(0, 100, 0, 255); + pub const YELLOWGREEN: Color = Color::new(154, 205, 50, 255); + pub const OLIVEDRAB: Color = Color::new(107, 142, 35, 255); + pub const OLIVE: Color = Color::new(128, 128, 0, 255); + pub const DARKOLIVEGREEN: Color = Color::new(85, 107, 47, 255); + pub const MEDIUMAQUAMARINE: Color = Color::new(102, 205, 170, 255); + pub const DARKSEAGREEN: Color = Color::new(143, 188, 139, 255); + pub const LIGHTSEAGREEN: Color = Color::new(32, 178, 170, 255); + pub const DARKCYAN: Color = Color::new(0, 139, 139, 255); + pub const TEAL: Color = Color::new(0, 128, 128, 255); + pub const AQUA: Color = Color::new(0, 255, 255, 255); + pub const CYAN: Color = Color::new(0, 255, 255, 255); + pub const LIGHTCYAN: Color = Color::new(224, 255, 255, 255); + pub const PALETURQUOISE: Color = Color::new(175, 238, 238, 255); + pub const AQUAMARINE: Color = Color::new(127, 255, 212, 255); + pub const TURQUOISE: Color = Color::new(64, 224, 208, 255); + pub const MEDIUMTURQUOISE: Color = Color::new(72, 209, 204, 255); + pub const DARKTURQUOISE: Color = Color::new(0, 206, 209, 255); + pub const CADETBLUE: Color = Color::new(95, 158, 160, 255); + pub const STEELBLUE: Color = Color::new(70, 130, 180, 255); + pub const LIGHTSTEELBLUE: Color = Color::new(176, 196, 222, 255); + pub const POWDERBLUE: Color = Color::new(176, 224, 230, 255); + pub const LIGHTBLUE: Color = Color::new(173, 216, 230, 255); + pub const SKYBLUE: Color = Color::new(135, 206, 235, 255); + pub const LIGHTSKYBLUE: Color = Color::new(135, 206, 250, 255); + pub const DEEPSKYBLUE: Color = Color::new(0, 191, 255, 255); + pub const DODGERBLUE: Color = Color::new(30, 144, 255, 255); + pub const CORNFLOWERBLUE: Color = Color::new(100, 149, 237, 255); + pub const ROYALBLUE: Color = Color::new(65, 105, 225, 255); + pub const BLUE: Color = Color::new(0, 0, 255, 255); + pub const MEDIUMBLUE: Color = Color::new(0, 0, 205, 255); + pub const DARKBLUE: Color = Color::new(0, 0, 139, 255); + pub const NAVY: Color = Color::new(0, 0, 128, 255); + pub const MIDNIGHTBLUE: Color = Color::new(25, 25, 112, 255); + pub const CORNSILK: Color = Color::new(255, 248, 220, 255); + pub const BLANCHEDALMOND: Color = Color::new(255, 235, 205, 255); + pub const BISQUE: Color = Color::new(255, 228, 196, 255); + pub const NAVAJOWHITE: Color = Color::new(255, 222, 173, 255); + pub const WHEAT: Color = Color::new(245, 222, 179, 255); + pub const BURLYWOOD: Color = Color::new(222, 184, 135, 255); + pub const TAN: Color = Color::new(210, 180, 140, 255); + pub const ROSYBROWN: Color = Color::new(188, 143, 143, 255); + pub const SANDYBROWN: Color = Color::new(244, 164, 96, 255); + pub const GOLDENROD: Color = Color::new(218, 165, 32, 255); + pub const DARKGOLDENROD: Color = Color::new(184, 134, 11, 255); + pub const PERU: Color = Color::new(205, 133, 63, 255); + pub const CHOCOLATE: Color = Color::new(210, 105, 30, 255); + pub const SADDLEBROWN: Color = Color::new(139, 69, 19, 255); + pub const SIENNA: Color = Color::new(160, 82, 45, 255); + pub const BROWN: Color = Color::new(165, 42, 42, 255); + pub const DARKBROWN: Color = Color::new(76, 63, 47, 255); + pub const MAROON: Color = Color::new(128, 0, 0, 255); + pub const WHITE: Color = Color::new(255, 255, 255, 255); + pub const SNOW: Color = Color::new(255, 250, 250, 255); + pub const HONEYDEW: Color = Color::new(240, 255, 240, 255); + pub const MINTCREAM: Color = Color::new(245, 255, 250, 255); + pub const AZURE: Color = Color::new(240, 255, 255, 255); + pub const ALICEBLUE: Color = Color::new(240, 248, 255, 255); + pub const GHOSTWHITE: Color = Color::new(248, 248, 255, 255); + pub const WHITESMOKE: Color = Color::new(245, 245, 245, 255); + pub const SEASHELL: Color = Color::new(255, 245, 238, 255); + pub const BEIGE: Color = Color::new(245, 245, 220, 255); + pub const OLDLACE: Color = Color::new(253, 245, 230, 255); + pub const FLORALWHITE: Color = Color::new(255, 250, 240, 255); + pub const IVORY: Color = Color::new(255, 255, 240, 255); + pub const ANTIQUEWHITE: Color = Color::new(250, 235, 215, 255); + pub const LINEN: Color = Color::new(250, 240, 230, 255); + pub const LAVENDERBLUSH: Color = Color::new(255, 240, 245, 255); + pub const MISTYROSE: Color = Color::new(255, 228, 225, 255); + pub const GAINSBORO: Color = Color::new(220, 220, 220, 255); + pub const LIGHTGRAY: Color = Color::new(211, 211, 211, 255); + pub const SILVER: Color = Color::new(192, 192, 192, 255); + pub const DARKGRAY: Color = Color::new(169, 169, 169, 255); + pub const GRAY: Color = Color::new(128, 128, 128, 255); + pub const DIMGRAY: Color = Color::new(105, 105, 105, 255); + pub const LIGHTSLATEGRAY: Color = Color::new(119, 136, 153, 255); + pub const SLATEGRAY: Color = Color::new(112, 128, 144, 255); + pub const DARKSLATEGRAY: Color = Color::new(47, 79, 79, 255); + pub const BLACK: Color = Color::new(0, 0, 0, 255); + pub const BLANK: Color = Color::new(0, 0, 0, 0); + pub const RAYWHITE: Color = Color::new(245, 245, 245, 255); +} diff --git a/raylib-sys/src/lib.rs b/raylib-sys/src/lib.rs index 3353b64d..4bc39def 100644 --- a/raylib-sys/src/lib.rs +++ b/raylib-sys/src/lib.rs @@ -4,5 +4,12 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -pub mod math; +pub use mint; + +mod color; +mod camera; +mod math; + +pub use color::*; pub use math::*; +pub use camera::*; \ No newline at end of file diff --git a/raylib-sys/src/math.rs b/raylib-sys/src/math.rs index 7576cab7..84039175 100644 --- a/raylib-sys/src/math.rs +++ b/raylib-sys/src/math.rs @@ -1,5 +1,5 @@ -use crate::{Matrix, Quaternion, Vector2, Vector3, Vector4}; -use mint; +use crate::{BoundingBox, Ray, RayCollision, Rectangle}; +use mint::{Vector2, Vector3}; use std::mem; macro_rules! mint_transmutable { @@ -10,22 +10,91 @@ macro_rules! mint_transmutable { } } - impl Into<$mt> for $ffit { - fn into(self) -> $mt { - unsafe { mem::transmute(self) } + impl From<$ffit> for $mt { + fn from(value: $ffit) -> Self { + unsafe { mem::transmute(value) } } } }; } -mint_transmutable!(Vector2, mint::Vector2); -mint_transmutable!(Vector3, mint::Vector3); -mint_transmutable!(Vector4, mint::Vector4); +mint_transmutable!(crate::Vector2, mint::Vector2); +mint_transmutable!(crate::Vector3, mint::Vector3); +mint_transmutable!(crate::Vector4, mint::Vector4); + +mint_transmutable!(crate::Matrix, mint::ColumnMatrix4); +mint_transmutable!(crate::Quaternion, mint::Quaternion); + +impl Rectangle { + pub fn new(x: f32, y: f32, width: f32, height: f32) -> Self { + Self { + x, + y, + width, + height, + } + } -mint_transmutable!(Matrix, mint::ColumnMatrix4); -mint_transmutable!(Quaternion, mint::Quaternion); + /// Check collision between two rectangles + #[inline] + pub fn check_collision_recs(&self, other: Rectangle) -> bool { + unsafe { crate::CheckCollisionRecs(*self, other) } + } + + /// Checks collision between circle and rectangle. + #[inline] + pub fn check_collision_circle_rec(&self, center: Vector2, radius: f32) -> bool { + unsafe { crate::CheckCollisionCircleRec(center.into(), radius, *self) } + } + + /// Gets the overlap between two colliding rectangles. + /// ```rust + /// use raylib::prelude::*; + /// fn main() { + /// let r1 = Rectangle::new(0.0, 0.0, 10.0, 10.0); + /// let r2 = Rectangle::new(20.0, 20.0, 10.0, 10.0); + /// assert_eq!(None, r1.get_collision_rec(&r2)); + /// assert_eq!(Some(r1), r1.get_collision_rec(&r1)); + /// } + /// ``` + #[inline] + pub fn get_collision_rec(&self, other: Rectangle) -> Option { + self.check_collision_recs(other) + .then(|| unsafe { crate::GetCollisionRec(*self, other) }) + } + + /// Checks if point is inside rectangle. + #[inline] + pub fn check_collision_point_rec(&self, point: Vector2) -> bool { + unsafe { crate::CheckCollisionPointRec(point.into(), *self) } + } +} + +impl BoundingBox { + /// Detects collision between two boxes. + #[inline] + pub fn check_collision_boxes(&self, box2: BoundingBox) -> bool { + unsafe { crate::CheckCollisionBoxes(*self, box2) } + } + + /// Detects collision between box and sphere. + #[inline] + pub fn check_collision_box_sphere( + &self, + center_sphere: Vector3, + radius_sphere: f32, + ) -> bool { + unsafe { crate::CheckCollisionBoxSphere(*self, center_sphere.into(), radius_sphere) } + } + + /// Detects collision between ray and box. + #[inline] + pub fn get_ray_collision_box(&self, ray: Ray) -> RayCollision { + unsafe { crate::GetRayCollisionBox(ray, *self) } + } +} #[test] fn math_test() { - // Do some transmutation tests. -} \ No newline at end of file + // TODO: Do some transmutation tests. +} diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index cc45ca97..31a40def 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -18,6 +18,7 @@ lazy_static = "1.2.0" cfg-if = "1.0.0" serde = { version = "1.0.125", features = ["derive"], optional = true } serde_json = { version = "1.0.64", optional = true } +mint = "0.5" nalgebra = { version = "0.32" } [features] diff --git a/raylib/src/core/audio.rs b/raylib/src/core/audio.rs index 5f23abdb..dadf309f 100644 --- a/raylib/src/core/audio.rs +++ b/raylib/src/core/audio.rs @@ -1,11 +1,9 @@ //! Contains code related to audio. [`RaylibAudio`] plays sounds and music. -use crate::core::RaylibThread; +use super::{buffer::RaylibBuffer, RaylibThread}; use crate::ffi; use std::ffi::CString; -use super::buffer::RaylibBuffer; - make_thin_wrapper!(Wave, ffi::Wave, ffi::UnloadWave); make_bound_thin_wrapper!(Sound, ffi::Sound, ffi::UnloadSound, RaylibAudio); make_bound_thin_wrapper!(Music, ffi::Music, ffi::UnloadMusicStream, RaylibAudio); @@ -50,12 +48,6 @@ impl RaylibAudio { } } - /// Get number of sounds playing in the multichannel - #[inline] - pub fn get_sounds_playing(&self) -> i32 { - unsafe { ffi::GetSoundsPlaying() } - } - /// Plays a sound. #[inline] pub fn play_sound(&self, sound: &Sound) { @@ -64,14 +56,6 @@ impl RaylibAudio { } } - /// Play a sound (using multichannel buffer pool) - #[inline] - pub fn play_sound_multi(&self, sound: &Sound) { - unsafe { - ffi::PlaySoundMulti(sound.0); - } - } - /// Pauses a sound. #[inline] pub fn pause_sound(&self, sound: &Sound) { @@ -96,14 +80,6 @@ impl RaylibAudio { } } - /// Stops playing a sound. - #[inline] - pub fn stop_sound_multi(&self) { - unsafe { - ffi::StopSoundMulti(); - } - } - /// Checks if a sound is currently playing. #[inline] pub fn is_sound_playing(&self, sound: &Sound) -> bool { @@ -264,7 +240,6 @@ impl RaylibAudio { impl Drop for RaylibAudio { fn drop(&mut self) { unsafe { - ffi::StopSoundMulti(); ffi::CloseAudioDevice(); } } @@ -384,7 +359,7 @@ impl<'bind, 'a> Sound<'bind, 'a> { ) -> Result, String> { let s = unsafe { ffi::LoadSoundFromWave(wave.0) }; if s.stream.buffer.is_null() { - return Err(format!("failed to load sound from wave")); + return Err("failed to load sound from wave".to_string()); } Ok(unsafe { Sound::from_raw(s) }) } diff --git a/raylib/src/core/buffer.rs b/raylib/src/core/buffer.rs index 911b8a02..c912e0ef 100644 --- a/raylib/src/core/buffer.rs +++ b/raylib/src/core/buffer.rs @@ -7,9 +7,7 @@ pub(crate) struct ContigousBuffer<'a, T>(NonNull, PhantomData<&'a T>); impl<'a, T> ContigousBuffer<'a, T> { pub fn new(buffer: *mut T) -> Option { - NonNull::new(buffer) - .map(|p| Some(ContigousBuffer(p, PhantomData))) - .flatten() + NonNull::new(buffer).and_then(|p| Some(ContigousBuffer(p, PhantomData))) } pub unsafe fn get_slice(&'a self, len: usize) -> &'a [T] { @@ -52,7 +50,7 @@ impl<'a, T> Index for RaylibBuffer<'a, T> { type Output = T; fn index(&self, index: usize) -> &Self::Output { - unsafe { &*self.get_ptr().offset(index as isize) } + unsafe { &*self.get_ptr().add(index) } } } diff --git a/raylib/src/core/camera.rs b/raylib/src/core/camera.rs index 50a53d51..81df95de 100644 --- a/raylib/src/core/camera.rs +++ b/raylib/src/core/camera.rs @@ -1,166 +1,24 @@ //! Utility code for using Raylib [`Camera3D`] and [`Camera2D`] -use crate::core::math::{Vector2, Vector3}; -use crate::core::RaylibHandle; -use crate::ffi; - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Camera3D { - pub position: Vector3, - pub target: Vector3, - pub up: Vector3, - pub fovy: f32, - projection_: ffi::CameraProjection, -} -pub type Camera = Camera3D; - -impl From for Camera3D { - fn from(v: ffi::Camera3D) -> Camera3D { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for Camera3D { - fn into(self) -> ffi::Camera3D { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Camera3D { - fn into(self) -> ffi::Camera3D { - ffi::Camera3D { - position: self.position.into(), - target: self.target.into(), - up: self.up.into(), - fovy: self.fovy, - projection: (self.projection_ as u32) as i32, - } - } -} - -#[repr(C)] -#[derive(Debug, Copy, Clone, Default)] -pub struct Camera2D { - pub offset: Vector2, - pub target: Vector2, - pub rotation: f32, - pub zoom: f32, -} - -impl From for Camera2D { - fn from(v: ffi::Camera2D) -> Camera2D { - unsafe { std::mem::transmute(v) } - } -} +use mint::Vector3; +use raylib_sys::{Camera3D, CameraMode}; -impl Into for Camera2D { - fn into(self) -> ffi::Camera2D { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &Camera2D { - fn into(self) -> ffi::Camera2D { - ffi::Camera2D { - offset: self.offset.into(), - target: self.target.into(), - rotation: self.rotation, - zoom: self.zoom, - } - } -} - -impl Camera3D { - pub fn camera_type(&self) -> crate::consts::CameraProjection { - unsafe { std::mem::transmute(self.projection_.clone()) } - } - /// Create a perspective camera. - /// fovy is in degrees - pub fn perspective(position: Vector3, target: Vector3, up: Vector3, fovy: f32) -> Camera3D { - Camera3D { - position, - target, - up, - fovy, - projection_: ffi::CameraProjection::CAMERA_PERSPECTIVE, - } - } - /// Create a orthographic camera. - /// fovy is in degrees - pub fn orthographic(position: Vector3, target: Vector3, up: Vector3, fovy: f32) -> Camera3D { - let mut c = Self::perspective(position, target, up, fovy); - c.projection_ = ffi::CameraProjection::CAMERA_ORTHOGRAPHIC; - c - } -} +use super::RaylibHandle; +use crate::ffi; impl RaylibHandle<'_> { - /// Sets camera mode. - #[inline] - pub fn set_camera_mode( - &self, - camera: impl Into, - mode: crate::consts::CameraMode, - ) { - unsafe { - ffi::SetCameraMode(camera.into(), mode as i32); - } - } - /// Updates camera position for selected mode. #[inline] - pub fn update_camera(&self, camera: &mut Camera3D) { - unsafe { - let mut fficam: ffi::Camera3D = (*camera).into(); - ffi::UpdateCamera(&mut fficam); - *camera = fficam.into(); - } + pub fn update_camera(&self, camera: &mut Camera3D, mode: CameraMode) { + unsafe { ffi::UpdateCamera(camera, mode as i32) } } - /// Sets camera pan key to combine with mouse movement (free camera). - #[inline] - pub fn set_camera_pan_control(&self, pan_key: crate::consts::KeyboardKey) { - unsafe { - ffi::SetCameraPanControl(pan_key as i32); - } - } - - /// Sets camera alt key to combine with mouse movement (free camera). - #[inline] - pub fn set_camera_alt_control(&self, alt_key: crate::consts::KeyboardKey) { - unsafe { - ffi::SetCameraAltControl(alt_key as i32); - } - } - - /// Sets camera smooth zoom key to combine with mouse (free camera). - #[inline] - pub fn set_camera_smooth_zoom_control(&self, sz_key: crate::consts::KeyboardKey) { - unsafe { - ffi::SetCameraSmoothZoomControl(sz_key as i32); - } - } - - /// Sets camera move controls (1st person and 3rd person cameras). - #[inline] - pub fn set_camera_move_controls( + pub fn update_camera_pro( &self, - front_key: crate::consts::KeyboardKey, - back_key: crate::consts::KeyboardKey, - right_key: crate::consts::KeyboardKey, - left_key: crate::consts::KeyboardKey, - up_key: crate::consts::KeyboardKey, - down_key: crate::consts::KeyboardKey, + camera: &mut Camera3D, + movement: Vector3, + rotation: Vector3, + zoom: f32, ) { - unsafe { - ffi::SetCameraMoveControls( - front_key as i32, - back_key as i32, - right_key as i32, - left_key as i32, - up_key as i32, - down_key as i32, - ); - } + unsafe { ffi::UpdateCameraPro(camera, movement.into(), rotation.into(), zoom) } } } diff --git a/raylib/src/core/collision.rs b/raylib/src/core/collision.rs index 35423277..9b671854 100644 --- a/raylib/src/core/collision.rs +++ b/raylib/src/core/collision.rs @@ -1,56 +1,17 @@ //! Common collision handling code -use crate::{ - core::math::{BoundingBox, Ray, Rectangle, Vector2}, - ffi, - math::{Matrix, RayCollision}, - models::Mesh, -}; +use mint::{ColumnMatrix4, Vector2, Vector3}; +use raylib_sys::{Ray, RayCollision}; -impl Rectangle { - /// Check collision between two rectangles - #[inline] - pub fn check_collision_recs(&self, other: &Rectangle) -> bool { - unsafe { ffi::CheckCollisionRecs(self.into(), other.into()) } - } - - /// Checks collision between circle and rectangle. - #[inline] - pub fn check_collision_circle_rec(&self, center: impl Into, radius: f32) -> bool { - unsafe { ffi::CheckCollisionCircleRec(center.into(), radius, self.into()) } - } - - /// Gets the overlap between two colliding rectangles. - /// ```rust - /// use raylib::prelude::*; - /// fn main() { - /// let r1 = Rectangle::new(0.0, 0.0, 10.0, 10.0); - /// let r2 = Rectangle::new(20.0, 20.0, 10.0, 10.0); - /// assert_eq!(None, r1.get_collision_rec(&r2)); - /// assert_eq!(Some(r1), r1.get_collision_rec(&r1)); - /// } - /// ``` - #[inline] - pub fn get_collision_rec(&self, other: &Rectangle) -> Option { - if self.check_collision_recs(other) { - return Some(unsafe { ffi::GetCollisionRec(self.into(), other.into()).into() }); - } - return None; - } - - /// Checks if point is inside rectangle. - #[inline] - pub fn check_collision_point_rec(&self, point: impl Into) -> bool { - unsafe { ffi::CheckCollisionPointRec(point.into(), self.into()) } - } -} +use super::models::Mesh; +use crate::ffi; // Collision Handling /// Checks collision between two circles. #[inline] pub fn check_collision_circles( - center1: impl Into, + center1: Vector2, radius1: f32, - center2: impl Into, + center2: Vector2, radius2: f32, ) -> bool { unsafe { ffi::CheckCollisionCircles(center1.into(), radius1, center2.into(), radius2) } @@ -59,8 +20,8 @@ pub fn check_collision_circles( /// Checks if point is inside circle. #[inline] pub fn check_collision_point_circle( - point: impl Into, - center: impl Into, + point: Vector2, + center: Vector2, radius: f32, ) -> bool { unsafe { ffi::CheckCollisionPointCircle(point.into(), center.into(), radius) } @@ -69,27 +30,27 @@ pub fn check_collision_point_circle( /// Checks if point is inside a triangle. #[inline] pub fn check_collision_point_triangle( - point: impl Into, - p1: impl Into, - p2: impl Into, - p3: impl Into, + point: Vector2, + p1: Vector2, + p2: Vector2, + p3: Vector2, ) -> bool { unsafe { ffi::CheckCollisionPointTriangle(point.into(), p1.into(), p2.into(), p3.into()) } } #[inline] -pub fn check_collision_point_poly(point: Vector2, points: &[Vector2]) -> bool { +pub fn check_collision_point_poly(point: Vector2, points: &[Vector2]) -> bool { unsafe { ffi::CheckCollisionPointPoly(point.into(), points.as_ptr() as _, points.len() as _) } } /// Check the collision between two lines defined by two points each, returns collision point by reference #[inline] pub fn check_collision_lines( - start_pos1: impl Into, - end_pos1: impl Into, - start_pos2: impl Into, - end_pos2: impl Into, -) -> Option { + start_pos1: Vector2, + end_pos1: Vector2, + start_pos2: Vector2, + end_pos2: Vector2, +) -> Option> { let mut out = ffi::Vector2 { x: 0.0, y: 0.0 }; let collision = unsafe { @@ -101,18 +62,15 @@ pub fn check_collision_lines( &mut out, ) }; - if collision { - return Some(out.into()); - } else { - return None; - } + + collision.then_some(out.into()) } #[inline] pub fn check_collision_point_line( - point: Vector2, - p1: Vector2, - p2: Vector2, + point: Vector2, + p1: Vector2, + p2: Vector2, threshold: i32, ) -> bool { unsafe { ffi::CheckCollisionPointLine(point.into(), p1.into(), p2.into(), threshold) } @@ -121,75 +79,53 @@ pub fn check_collision_point_line( /// Detects collision between two spheres. #[inline] pub fn check_collision_spheres( - center_a: impl Into, + center_a: Vector3, radius_a: f32, - center_b: impl Into, + center_b: Vector3, radius_b: f32, ) -> bool { unsafe { ffi::CheckCollisionSpheres(center_a.into(), radius_a, center_b.into(), radius_b) } } -impl BoundingBox { - /// Detects collision between two boxes. - #[inline] - pub fn check_collision_boxes(&self, box2: BoundingBox) -> bool { - unsafe { ffi::CheckCollisionBoxes(self.into(), box2.into()) } - } - - /// Detects collision between box and sphere. - #[inline] - pub fn check_collision_box_sphere( - &self, - center_sphere: impl Into, - radius_sphere: f32, - ) -> bool { - unsafe { ffi::CheckCollisionBoxSphere(self.into(), center_sphere.into(), radius_sphere) } - } - - /// Detects collision between ray and box. - #[inline] - pub fn get_ray_collision_box(&self, ray: Ray) -> RayCollision { - unsafe { ffi::GetRayCollisionBox(ray.into(), self.into()).into() } - } -} - /// Detects collision between ray and sphere. #[inline] pub fn get_ray_collision_sphere( ray: Ray, - sphere_position: impl Into, + sphere_position: Vector3, sphere_radius: f32, ) -> RayCollision { - unsafe { ffi::GetRayCollisionSphere(ray.into(), sphere_position.into(), sphere_radius).into() } + unsafe { ffi::GetRayCollisionSphere(ray, sphere_position.into(), sphere_radius) } } /// Gets collision info between ray and model. #[inline] -pub fn get_ray_collision_mesh(ray: Ray, model: &Mesh, transform: &Matrix) -> RayCollision { - unsafe { ffi::GetRayCollisionMesh(ray.into(), model.0, transform.into()).into() } +pub fn get_ray_collision_mesh( + ray: Ray, + model: &Mesh, + transform: ColumnMatrix4, +) -> RayCollision { + unsafe { ffi::GetRayCollisionMesh(ray, model.0, transform.into()) } } /// Gets collision info between ray and triangle. #[inline] pub fn get_ray_collision_triangle( ray: Ray, - p1: impl Into, - p2: impl Into, - p3: impl Into, + p1: Vector3, + p2: Vector3, + p3: Vector3, ) -> RayCollision { - unsafe { ffi::GetRayCollisionTriangle(ray.into(), p1.into(), p2.into(), p3.into()).into() } + unsafe { ffi::GetRayCollisionTriangle(ray, p1.into(), p2.into(), p3.into()) } } /// Gets collision info between ray and model. #[inline] pub fn get_ray_collision_quad( ray: Ray, - p1: impl Into, - p2: impl Into, - p3: impl Into, - p4: impl Into, + p1: Vector3, + p2: Vector3, + p3: Vector3, + p4: Vector3, ) -> RayCollision { - unsafe { - ffi::GetRayCollisionQuad(ray.into(), p1.into(), p2.into(), p3.into(), p4.into()).into() - } + unsafe { ffi::GetRayCollisionQuad(ray, p1.into(), p2.into(), p3.into(), p4.into()) } } diff --git a/raylib/src/core/data.rs b/raylib/src/core/data.rs index f638aeef..54546a26 100644 --- a/raylib/src/core/data.rs +++ b/raylib/src/core/data.rs @@ -1,6 +1,6 @@ //! Data manipulation functions. Compress and Decompress with DEFLATE use crate::ffi; -use crate::core::buffer::RaylibBuffer; +use super::buffer::RaylibBuffer; /// Compress data (DEFLATE algorythm) /// ```rust diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index 4185d7ed..666a36b9 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -1,15 +1,10 @@ //! Contains code related to drawing. Types that can be set as a surface to draw will implement the [`RaylibDraw`] trait -use crate::core::camera::Camera3D; -use crate::core::math::Ray; -use crate::core::math::{Vector2, Vector3}; - -use crate::core::texture::Texture2D; -use crate::core::vr::VrStereoConfig; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::{ffi, RaylibRenderLoop}; -use std::convert::AsRef; -use std::ffi::CString; -use std::marker::PhantomData; +use mint::{Vector2, Vector3}; + +use super::{texture::Texture2D, vr::VrStereoConfig, RaylibHandle, RaylibRenderLoop, RaylibThread}; +use crate::ffi::{self, BoundingBox, Camera2D, Camera3D, Color, NPatchInfo, Rectangle}; + +use std::{convert::AsRef, ffi::CString, marker::PhantomData}; #[derive(Debug)] pub struct RaylibDrawHandle<'bind>(pub(crate) PhantomData<&'bind RaylibHandle<'bind>>); @@ -30,7 +25,7 @@ impl std::ops::Deref for RaylibTextureMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -68,7 +63,7 @@ impl std::ops::Deref for RaylibVRMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -101,7 +96,7 @@ impl std::ops::Deref for RaylibMode2D<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -109,11 +104,10 @@ pub trait RaylibMode2DExt where Self: Sized, { - #[allow(non_snake_case)] #[must_use] - fn begin_mode2D(&self, camera: impl Into) -> RaylibMode2D { + fn begin_mode_2d(&self, camera: Camera2D) -> RaylibMode2D { unsafe { - ffi::BeginMode2D(camera.into()); + ffi::BeginMode2D(camera); } RaylibMode2D(self) } @@ -134,7 +128,7 @@ impl std::ops::Deref for RaylibMode3D<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -142,11 +136,10 @@ pub trait RaylibMode3DExt where Self: Sized, { - #[allow(non_snake_case)] #[must_use] - fn begin_mode3D(&self, camera: impl Into) -> RaylibMode3D { + fn begin_mode_3d(&self, camera: Camera3D) -> RaylibMode3D { unsafe { - ffi::BeginMode3D(camera.into()); + ffi::BeginMode3D(camera); } RaylibMode3D(self) } @@ -169,7 +162,7 @@ impl std::ops::Deref for RaylibShaderMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -200,7 +193,7 @@ impl<'a, T> std::ops::Deref for RaylibBlendMode<'a, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -231,7 +224,7 @@ impl std::ops::Deref for RaylibScissorMode<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &self.0 + self.0 } } @@ -261,19 +254,15 @@ impl RaylibDraw3D for RaylibScissorMode<'_, T> {} pub trait RaylibDraw { /// Sets background color (framebuffer clear color). #[inline] - fn clear_background(&self, color: impl Into) { + fn clear_background(&self, color: Color) { unsafe { - ffi::ClearBackground(color.into()); + ffi::ClearBackground(color); } } /// Define default texture used to draw shapes - fn set_shapes_texture( - &self, - texture: impl AsRef, - source: impl Into, - ) { - unsafe { ffi::SetShapesTexture(*texture.as_ref(), source.into()) } + fn set_shapes_texture(&self, texture: impl AsRef, source: Rectangle) { + unsafe { ffi::SetShapesTexture(*texture.as_ref(), source) } } // // Draw gui widget @@ -284,17 +273,17 @@ pub trait RaylibDraw { // SHAPES /// Draws a pixel. #[inline] - fn draw_pixel(&self, x: i32, y: i32, color: impl Into) { + fn draw_pixel(&self, x: i32, y: i32, color: Color) { unsafe { - ffi::DrawPixel(x, y, color.into()); + ffi::DrawPixel(x, y, color); } } /// Draws a pixel (Vector version). #[inline] - fn draw_pixel_v(&self, position: impl Into, color: impl Into) { + fn draw_pixel_v(&self, position: Vector2, color: Color) { unsafe { - ffi::DrawPixelV(position.into(), color.into()); + ffi::DrawPixelV(position.into(), color); } } @@ -306,23 +295,18 @@ pub trait RaylibDraw { start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawLine(start_pos_x, start_pos_y, end_pos_x, end_pos_y, color.into()); + ffi::DrawLine(start_pos_x, start_pos_y, end_pos_x, end_pos_y, color); } } /// Draws a line (Vector version). #[inline] - fn draw_line_v( - &self, - start_pos: impl Into, - end_pos: impl Into, - color: impl Into, - ) { + fn draw_line_v(&self, start_pos: Vector2, end_pos: Vector2, color: Color) { unsafe { - ffi::DrawLineV(start_pos.into(), end_pos.into(), color.into()); + ffi::DrawLineV(start_pos.into(), end_pos.into(), color); } } @@ -330,13 +314,13 @@ pub trait RaylibDraw { #[inline] fn draw_line_ex( &self, - start_pos: impl Into, - end_pos: impl Into, + start_pos: Vector2, + end_pos: Vector2, thick: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawLineEx(start_pos.into(), end_pos.into(), thick, color.into()); + ffi::DrawLineEx(start_pos.into(), end_pos.into(), thick, color); } } @@ -344,24 +328,24 @@ pub trait RaylibDraw { #[inline] fn draw_line_bezier( &self, - start_pos: impl Into, - end_pos: impl Into, + start_pos: Vector2, + end_pos: Vector2, thick: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawLineBezier(start_pos.into(), end_pos.into(), thick, color.into()); + ffi::DrawLineBezier(start_pos.into(), end_pos.into(), thick, color); } } /// Draw line using quadratic bezier curves with a control point #[inline] fn draw_line_bezier_quad( &self, - start_pos: impl Into, - end_pos: impl Into, - control_pos: impl Into, + start_pos: Vector2, + end_pos: Vector2, + control_pos: Vector2, thick: f32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawLineBezierQuad( @@ -369,46 +353,40 @@ pub trait RaylibDraw { end_pos.into(), control_pos.into(), thick, - color.into(), + color, ); } } /// Draw lines sequence #[inline] - fn draw_line_strip(&self, points: &[Vector2], color: impl Into) { + fn draw_line_strip(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawLineStrip( points.as_ptr() as *mut ffi::Vector2, points.len() as i32, - color.into(), + color, ); } } /// Draws a color-filled circle. #[inline] - fn draw_circle( - &self, - center_x: i32, - center_y: i32, - radius: f32, - color: impl Into, - ) { + fn draw_circle(&self, center_x: i32, center_y: i32, radius: f32, color: Color) { unsafe { - ffi::DrawCircle(center_x, center_y, radius, color.into()); + ffi::DrawCircle(center_x, center_y, radius, color); } } /// Draw a piece of a circle #[inline] fn draw_circle_sector( &self, - center: impl Into, + center: Vector2, radius: f32, start_angle: f32, end_angle: f32, segments: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawCircleSector( @@ -417,7 +395,7 @@ pub trait RaylibDraw { start_angle, end_angle, segments, - color.into(), + color, ); } } @@ -426,12 +404,12 @@ pub trait RaylibDraw { #[inline] fn draw_circle_sector_lines( &self, - center: impl Into, + center: Vector2, radius: f32, start_angle: f32, end_angle: f32, segments: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawCircleSectorLines( @@ -440,8 +418,8 @@ pub trait RaylibDraw { start_angle, end_angle, segments, - color.into(), - ); + color, + ) } } @@ -452,38 +430,23 @@ pub trait RaylibDraw { center_x: i32, center_y: i32, radius: f32, - color1: impl Into, - color2: impl Into, + color1: Color, + color2: Color, ) { - unsafe { - ffi::DrawCircleGradient(center_x, center_y, radius, color1.into(), color2.into()); - } + unsafe { ffi::DrawCircleGradient(center_x, center_y, radius, color1, color2) } } /// Draws a color-filled circle (Vector version). #[inline] - fn draw_circle_v( - &self, - center: impl Into, - radius: f32, - color: impl Into, - ) { - unsafe { - ffi::DrawCircleV(center.into(), radius, color.into()); - } + fn draw_circle_v(&self, center: Vector2, radius: f32, color: Color) { + unsafe { ffi::DrawCircleV(center.into(), radius, color) } } /// Draws circle outline. #[inline] - fn draw_circle_lines( - &self, - center_x: i32, - center_y: i32, - radius: f32, - color: impl Into, - ) { + fn draw_circle_lines(&self, center_x: i32, center_y: i32, radius: f32, color: Color) { unsafe { - ffi::DrawCircleLines(center_x, center_y, radius, color.into()); + ffi::DrawCircleLines(center_x, center_y, radius, color); } } @@ -495,10 +458,10 @@ pub trait RaylibDraw { center_y: i32, radius_h: f32, radius_v: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawEllipse(center_x, center_y, radius_h, radius_v, color.into()); + ffi::DrawEllipse(center_x, center_y, radius_h, radius_v, color); } } @@ -510,10 +473,10 @@ pub trait RaylibDraw { center_y: i32, radius_h: f32, radius_v: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawEllipseLines(center_x, center_y, radius_h, radius_v, color.into()); + ffi::DrawEllipseLines(center_x, center_y, radius_h, radius_v, color); } } @@ -521,13 +484,13 @@ pub trait RaylibDraw { #[inline] fn draw_ring( &self, - center: impl Into, + center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawRing( @@ -537,7 +500,7 @@ pub trait RaylibDraw { start_angle, end_angle, segments, - color.into(), + color, ); } } @@ -546,13 +509,13 @@ pub trait RaylibDraw { #[inline] fn draw_ring_lines( &self, - center: impl Into, + center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawRingLines( @@ -562,44 +525,32 @@ pub trait RaylibDraw { start_angle, end_angle, segments, - color.into(), + color, ); } } /// Draws a color-filled rectangle. #[inline] - fn draw_rectangle( - &self, - x: i32, - y: i32, - width: i32, - height: i32, - color: impl Into, - ) { + fn draw_rectangle(&self, x: i32, y: i32, width: i32, height: i32, color: Color) { unsafe { - ffi::DrawRectangle(x, y, width, height, color.into()); + ffi::DrawRectangle(x, y, width, height, color); } } /// Draws a color-filled rectangle (Vector version). #[inline] - fn draw_rectangle_v( - &self, - position: impl Into, - size: impl Into, - color: impl Into, - ) { + fn draw_rectangle_v(&self, position: Vector2, size: Vector2, color: Color) { unsafe { - ffi::DrawRectangleV(position.into(), size.into(), color.into()); + ffi::DrawRectangleV(position.into(), size.into(), color); } } /// Draws a color-filled rectangle from `rec`. #[inline] - fn draw_rectangle_rec(&self, rec: impl Into, color: impl Into) { + fn draw_rectangle_rec(&self, rec: Rectangle, color: Color) { unsafe { - ffi::DrawRectangleRec(rec.into(), color.into()); + ffi::DrawRectangleRec(rec, color); } } @@ -607,13 +558,13 @@ pub trait RaylibDraw { #[inline] fn draw_rectangle_pro( &self, - rec: impl Into, - origin: impl Into, + rec: Rectangle, + origin: Vector2, rotation: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawRectanglePro(rec.into(), origin.into(), rotation, color.into()); + ffi::DrawRectanglePro(rec, origin.into(), rotation, color); } } @@ -627,11 +578,11 @@ pub trait RaylibDraw { y: i32, width: i32, height: i32, - color1: impl Into, - color2: impl Into, + color1: Color, + color2: Color, ) { unsafe { - ffi::DrawRectangleGradientV(x, y, width, height, color1.into(), color2.into()); + ffi::DrawRectangleGradientV(x, y, width, height, color1, color2); } } @@ -645,11 +596,11 @@ pub trait RaylibDraw { y: i32, width: i32, height: i32, - color1: impl Into, - color2: impl Into, + color1: Color, + color2: Color, ) { unsafe { - ffi::DrawRectangleGradientH(x, y, width, height, color1.into(), color2.into()); + ffi::DrawRectangleGradientH(x, y, width, height, color1, color2); } } @@ -659,61 +610,43 @@ pub trait RaylibDraw { #[inline] fn draw_rectangle_gradient_ex( &self, - rec: impl Into, - col1: impl Into, - col2: impl Into, - col3: impl Into, - col4: impl Into, + rec: Rectangle, + col1: Color, + col2: Color, + col3: Color, + col4: Color, ) { unsafe { ffi::DrawRectangleGradientEx( - rec.into(), - col1.into(), - col2.into(), - col3.into(), - col4.into(), + rec, + col1, + col2, + col3, + col4, ); } } /// Draws rectangle outline. #[inline] - fn draw_rectangle_lines( - &self, - x: i32, - y: i32, - width: i32, - height: i32, - color: impl Into, - ) { + fn draw_rectangle_lines(&self, x: i32, y: i32, width: i32, height: i32, color: Color) { unsafe { - ffi::DrawRectangleLines(x, y, width, height, color.into()); + ffi::DrawRectangleLines(x, y, width, height, color); } } /// Draws rectangle outline with extended parameters. #[inline] - fn draw_rectangle_lines_ex( - &self, - rec: impl Into, - line_thick: f32, - color: impl Into, - ) { + fn draw_rectangle_lines_ex(&self, rec: Rectangle, line_thick: f32, color: Color) { unsafe { - ffi::DrawRectangleLinesEx(rec.into(), line_thick, color.into()); + ffi::DrawRectangleLinesEx(rec, line_thick, color); } } /// Draws rectangle outline with extended parameters. #[inline] - fn draw_rectangle_rounded( - &self, - rec: impl Into, - roundness: f32, - segments: i32, - color: impl Into, - ) { + fn draw_rectangle_rounded(&self, rec: Rectangle, roundness: f32, segments: i32, color: Color) { unsafe { - ffi::DrawRectangleRounded(rec.into(), roundness, segments, color.into()); + ffi::DrawRectangleRounded(rec, roundness, segments, color); } } @@ -721,34 +654,22 @@ pub trait RaylibDraw { #[inline] fn draw_rectangle_rounded_lines( &self, - rec: impl Into, + rec: Rectangle, roundness: f32, segments: i32, line_thickness: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawRectangleRoundedLines( - rec.into(), - roundness, - segments, - line_thickness, - color.into(), - ); + ffi::DrawRectangleRoundedLines(rec, roundness, segments, line_thickness, color); } } /// Draws a triangle. #[inline] - fn draw_triangle( - &self, - v1: impl Into, - v2: impl Into, - v3: impl Into, - color: impl Into, - ) { + fn draw_triangle(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { unsafe { - ffi::DrawTriangle(v1.into(), v2.into(), v3.into(), color.into()); + ffi::DrawTriangle(v1.into(), v2.into(), v3.into(), color); } } @@ -756,36 +677,36 @@ pub trait RaylibDraw { #[inline] fn draw_triangle_lines( &self, - v1: impl Into, - v2: impl Into, - v3: impl Into, - color: impl Into, + v1: Vector2, + v2: Vector2, + v3: Vector2, + color: Color, ) { unsafe { - ffi::DrawTriangleLines(v1.into(), v2.into(), v3.into(), color.into()); + ffi::DrawTriangleLines(v1.into(), v2.into(), v3.into(), color); } } /// Draw a triangle fan defined by points. #[inline] - fn draw_triangle_fan(&self, points: &[Vector2], color: impl Into) { + fn draw_triangle_fan(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawTriangleFan( points.as_ptr() as *mut ffi::Vector2, points.len() as i32, - color.into(), + color, ); } } /// Draw a triangle strip defined by points #[inline] - fn draw_triangle_strip(&self, points: &[Vector2], color: impl Into) { + fn draw_triangle_strip(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawTriangleStrip( points.as_ptr() as *mut ffi::Vector2, points.len() as i32, - color.into(), + color, ); } } @@ -794,14 +715,14 @@ pub trait RaylibDraw { #[inline] fn draw_poly( &self, - center: impl Into, + center: Vector2, sides: i32, radius: f32, rotation: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawPoly(center.into(), sides, radius, rotation, color.into()); + ffi::DrawPoly(center.into(), sides, radius, rotation, color); } } @@ -809,28 +730,22 @@ pub trait RaylibDraw { #[inline] fn draw_poly_lines( &self, - center: impl Into, + center: Vector2, sides: i32, radius: f32, rotation: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawPolyLines(center.into(), sides, radius, rotation, color.into()); + ffi::DrawPolyLines(center.into(), sides, radius, rotation, color); } } /// Draws a `texture` using specified position and `tint` color. #[inline] - fn draw_texture( - &self, - texture: impl AsRef, - x: i32, - y: i32, - tint: impl Into, - ) { + fn draw_texture(&self, texture: impl AsRef, x: i32, y: i32, tint: Color) { unsafe { - ffi::DrawTexture(*texture.as_ref(), x, y, tint.into()); + ffi::DrawTexture(*texture.as_ref(), x, y, tint); } } @@ -839,11 +754,11 @@ pub trait RaylibDraw { fn draw_texture_v( &self, texture: impl AsRef, - position: impl Into, - tint: impl Into, + position: Vector2, + tint: Color, ) { unsafe { - ffi::DrawTextureV(*texture.as_ref(), position.into(), tint.into()); + ffi::DrawTextureV(*texture.as_ref(), position.into(), tint); } } @@ -852,19 +767,13 @@ pub trait RaylibDraw { fn draw_texture_ex( &self, texture: impl AsRef, - position: impl Into, + position: Vector2, rotation: f32, scale: f32, - tint: impl Into, + tint: Color, ) { unsafe { - ffi::DrawTextureEx( - *texture.as_ref(), - position.into(), - rotation, - scale, - tint.into(), - ); + ffi::DrawTextureEx(*texture.as_ref(), position.into(), rotation, scale, tint); } } @@ -873,17 +782,12 @@ pub trait RaylibDraw { fn draw_texture_rec( &self, texture: impl AsRef, - source_rec: impl Into, - position: impl Into, - tint: impl Into, + source_rec: Rectangle, + position: Vector2, + tint: Color, ) { unsafe { - ffi::DrawTextureRec( - *texture.as_ref(), - source_rec.into(), - position.into(), - tint.into(), - ); + ffi::DrawTextureRec(*texture.as_ref(), source_rec, position.into(), tint); } } @@ -892,20 +796,20 @@ pub trait RaylibDraw { fn draw_texture_n_patch( &self, texture: impl AsRef, - n_patch_info: impl Into, - dest_rec: impl Into, - origin: impl Into, + n_patch_info: NPatchInfo, + dest_rec: Rectangle, + origin: Vector2, rotation: f32, - tint: impl Into, + tint: Color, ) { unsafe { ffi::DrawTextureNPatch( *texture.as_ref(), - n_patch_info.into(), - dest_rec.into(), + n_patch_info, + dest_rec, origin.into(), rotation, - tint.into(), + tint, ); } } @@ -920,10 +824,10 @@ pub trait RaylibDraw { /// Draws text (using default font). #[inline] - fn draw_text(&self, text: &str, x: i32, y: i32, font_size: i32, color: impl Into) { + fn draw_text(&self, text: &str, x: i32, y: i32, font_size: i32, color: Color) { let c_text = CString::new(text).unwrap(); unsafe { - ffi::DrawText(c_text.as_ptr(), x, y, font_size, color.into()); + ffi::DrawText(c_text.as_ptr(), x, y, font_size, color); } } @@ -933,10 +837,10 @@ pub trait RaylibDraw { &self, font: impl AsRef, text: &str, - position: impl Into, + position: Vector2, font_size: f32, spacing: f32, - tint: impl Into, + tint: Color, ) { let c_text = CString::new(text).unwrap(); unsafe { @@ -946,7 +850,7 @@ pub trait RaylibDraw { position.into(), font_size, spacing, - tint.into(), + tint, ); } } @@ -957,80 +861,58 @@ pub trait RaylibDraw { &self, font: impl AsRef, codepoint: i32, - position: impl Into, + position: Vector2, scale: f32, - tint: impl Into, + tint: Color, ) { unsafe { - ffi::DrawTextCodepoint( - *font.as_ref(), - codepoint, - position.into(), - scale, - tint.into(), - ); + ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position.into(), scale, tint); } } } pub trait RaylibDraw3D { /// Draw a point in 3D space, actually a small line - #[allow(non_snake_case)] #[inline] - fn draw_point3D(&self, position: impl Into, color: impl Into) { + fn draw_point_3d(&self, position: Vector3, color: Color) { unsafe { - ffi::DrawPoint3D(position.into(), color.into()); + ffi::DrawPoint3D(position.into(), color); } } ///// Draw a color-filled triangle (vertex in counter-clockwise order!) - #[allow(non_snake_case)] #[inline] - fn draw_triangle3D( - &self, - v1: impl Into, - v2: impl Into, - v3: impl Into, - color: impl Into, - ) { + fn draw_triangle_3d(&self, v1: Vector3, v2: Vector3, v3: Vector3, color: Color) { unsafe { - ffi::DrawTriangle3D(v1.into(), v2.into(), v3.into(), color.into()); + ffi::DrawTriangle3D(v1.into(), v2.into(), v3.into(), color); } } /// // Draw a triangle strip defined by points - #[allow(non_snake_case)] #[inline] - fn draw_triangle_strip3D(&self, points: &[Vector3], color: impl Into) { + fn draw_triangle_strip_3d(&self, points: &[Vector3], color: Color) { unsafe { - ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color.into()); + ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color); } } /// Draws a line in 3D world space. #[inline] - #[allow(non_snake_case)] - fn draw_line_3D( - &self, - start_pos: impl Into, - end_pos: impl Into, - color: impl Into, - ) { + fn draw_line_3d(&self, start_pos: Vector3, end_pos: Vector3, color: Color) { unsafe { - ffi::DrawLine3D(start_pos.into(), end_pos.into(), color.into()); + ffi::DrawLine3D(start_pos.into(), end_pos.into(), color); } } /// Draws a circle in 3D world space. #[inline] - #[allow(non_snake_case)] - fn draw_circle_3D( + fn draw_circle_3d( &self, - center: impl Into, + center: Vector3, radius: f32, - rotation_axis: impl Into, + rotation_axis: Vector3, rotation_angle: f32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawCircle3D( @@ -1038,7 +920,7 @@ pub trait RaylibDraw3D { radius, rotation_axis.into(), rotation_angle, - color.into(), + color, ); } } @@ -1047,27 +929,22 @@ pub trait RaylibDraw3D { #[inline] fn draw_cube( &self, - position: impl Into, + position: Vector3, width: f32, height: f32, length: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawCube(position.into(), width, height, length, color.into()); + ffi::DrawCube(position.into(), width, height, length, color); } } /// Draws a cube (Vector version). #[inline] - fn draw_cube_v( - &self, - position: impl Into, - size: impl Into, - color: impl Into, - ) { + fn draw_cube_v(&self, position: Vector3, size: Vector3, color: Color) { unsafe { - ffi::DrawCubeV(position.into(), size.into(), color.into()); + ffi::DrawCubeV(position.into(), size.into(), color); } } @@ -1075,27 +952,22 @@ pub trait RaylibDraw3D { #[inline] fn draw_cube_wires( &self, - position: impl Into, + position: Vector3, width: f32, height: f32, length: f32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawCubeWires(position.into(), width, height, length, color.into()); + ffi::DrawCubeWires(position.into(), width, height, length, color); } } /// Draws a sphere. #[inline] - fn draw_sphere( - &self, - center_pos: impl Into, - radius: f32, - color: impl Into, - ) { + fn draw_sphere(&self, center_pos: Vector3, radius: f32, color: Color) { unsafe { - ffi::DrawSphere(center_pos.into(), radius, color.into()); + ffi::DrawSphere(center_pos.into(), radius, color); } } @@ -1103,14 +975,14 @@ pub trait RaylibDraw3D { #[inline] fn draw_sphere_ex( &self, - center_pos: impl Into, + center_pos: Vector3, radius: f32, rings: i32, slices: i32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawSphereEx(center_pos.into(), radius, rings, slices, color.into()); + ffi::DrawSphereEx(center_pos.into(), radius, rings, slices, color); } } @@ -1118,14 +990,14 @@ pub trait RaylibDraw3D { #[inline] fn draw_sphere_wires( &self, - center_pos: impl Into, + center_pos: Vector3, radius: f32, rings: i32, slices: i32, - color: impl Into, + color: Color, ) { unsafe { - ffi::DrawSphereWires(center_pos.into(), radius, rings, slices, color.into()); + ffi::DrawSphereWires(center_pos.into(), radius, rings, slices, color); } } @@ -1133,12 +1005,12 @@ pub trait RaylibDraw3D { #[inline] fn draw_cylinder( &self, - position: impl Into, + position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawCylinder( @@ -1147,7 +1019,7 @@ pub trait RaylibDraw3D { radius_bottom, height, slices, - color.into(), + color, ); } } @@ -1156,12 +1028,12 @@ pub trait RaylibDraw3D { #[inline] fn draw_cylinder_wires( &self, - position: impl Into, + position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::DrawCylinderWires( @@ -1170,29 +1042,24 @@ pub trait RaylibDraw3D { radius_bottom, height, slices, - color.into(), + color, ); } } /// Draws an X/Z plane. #[inline] - fn draw_plane( - &self, - center_pos: impl Into, - size: impl Into, - color: impl Into, - ) { + fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { unsafe { - ffi::DrawPlane(center_pos.into(), size.into(), color.into()); + ffi::DrawPlane(center_pos.into(), size.into(), color); } } /// Draws a ray line. #[inline] - fn draw_ray(&self, ray: Ray, color: impl Into) { + fn draw_ray(&self, ray: ffi::Ray, color: Color) { unsafe { - ffi::DrawRay(ray.into(), color.into()); + ffi::DrawRay(ray, color); } } @@ -1209,12 +1076,12 @@ pub trait RaylibDraw3D { fn draw_model( &self, model: impl AsRef, - position: impl Into, + position: Vector3, scale: f32, - tint: impl Into, + tint: Color, ) { unsafe { - ffi::DrawModel(*model.as_ref(), position.into(), scale, tint.into()); + ffi::DrawModel(*model.as_ref(), position.into(), scale, tint); } } @@ -1223,11 +1090,11 @@ pub trait RaylibDraw3D { fn draw_model_ex( &self, model: impl AsRef, - position: impl Into, - rotation_axis: impl Into, + position: Vector3, + rotation_axis: Vector3, rotation_angle: f32, - scale: impl Into, - tint: impl Into, + scale: Vector3, + tint: Color, ) { unsafe { ffi::DrawModelEx( @@ -1236,7 +1103,7 @@ pub trait RaylibDraw3D { rotation_axis.into(), rotation_angle, scale.into(), - tint.into(), + tint, ); } } @@ -1246,12 +1113,12 @@ pub trait RaylibDraw3D { fn draw_model_wires( &self, model: impl AsRef, - position: impl Into, + position: Vector3, scale: f32, - tint: impl Into, + tint: Color, ) { unsafe { - ffi::DrawModelWires(*model.as_ref(), position.into(), scale, tint.into()); + ffi::DrawModelWires(*model.as_ref(), position.into(), scale, tint); } } @@ -1260,11 +1127,11 @@ pub trait RaylibDraw3D { fn draw_model_wires_ex( &self, model: impl AsRef, - position: impl Into, - rotation_axis: impl Into, + position: Vector3, + rotation_axis: Vector3, rotation_angle: f32, - scale: impl Into, - tint: impl Into, + scale: Vector3, + tint: Color, ) { unsafe { ffi::DrawModelWiresEx( @@ -1273,16 +1140,16 @@ pub trait RaylibDraw3D { rotation_axis.into(), rotation_angle, scale.into(), - tint.into(), + tint, ); } } /// Draws a bounding box (wires). #[inline] - fn draw_bounding_box(&self, bbox: impl Into, color: impl Into) { + fn draw_bounding_box(&self, bbox: BoundingBox, color: Color) { unsafe { - ffi::DrawBoundingBox(bbox.into(), color.into()); + ffi::DrawBoundingBox(bbox, color); } } @@ -1290,14 +1157,14 @@ pub trait RaylibDraw3D { #[inline] fn draw_billboard( &self, - camera: impl Into, + camera: Camera3D, texture: &Texture2D, - center: impl Into, + center: Vector3, size: f32, - tint: impl Into, + tint: Color, ) { unsafe { - ffi::DrawBillboard(camera.into(), texture.0, center.into(), size, tint.into()); + ffi::DrawBillboard(camera, texture.0, center.into(), size, tint); } } @@ -1307,19 +1174,19 @@ pub trait RaylibDraw3D { &self, camera: Camera3D, texture: &Texture2D, - source_rec: impl Into, - center: impl Into, - size: impl Into, - tint: impl Into, + source_rec: Rectangle, + center: Vector3, + size: Vector2, + tint: Color, ) { unsafe { ffi::DrawBillboardRec( - camera.into(), + camera, texture.0, - source_rec.into(), + source_rec, center.into(), size.into(), - tint.into(), + tint, ); } } diff --git a/raylib/src/core/file.rs b/raylib/src/core/file.rs index 7aae1ed2..2428093a 100644 --- a/raylib/src/core/file.rs +++ b/raylib/src/core/file.rs @@ -1,10 +1,10 @@ //! File manipulation functions. Should be parity with std::fs except on emscripten -use crate::ffi; - -use crate::core::RaylibHandle; use core::slice; use std::ffi::CStr; +use crate::ffi; +use super::RaylibHandle; + impl<'a> RaylibHandle<'a> { /// Checks if a file has been dropped into the window. #[inline] diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index 127381c1..4ba6ea39 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -1,39 +1,42 @@ //! Keyboard, Controller, and Mouse related functions -use crate::consts::Gesture; -use crate::core::math::Vector2; -use crate::core::RaylibHandle; -use crate::ffi; +use std::ffi::CStr; -use std::ffi::{CStr}; +use mint::Vector2; + +use super::RaylibHandle; +use crate::{ + consts::{GamepadButton, Gesture, KeyboardKey, MouseButton, GamepadAxis}, + ffi, +}; impl RaylibHandle<'_> { /// Detect if a key has been pressed once. #[inline] - pub fn is_key_pressed(&self, key: crate::consts::KeyboardKey) -> bool { + pub fn is_key_pressed(&self, key: KeyboardKey) -> bool { unsafe { ffi::IsKeyPressed((key as u32) as i32) } } /// Detect if a key is being pressed. #[inline] - pub fn is_key_down(&self, key: crate::consts::KeyboardKey) -> bool { + pub fn is_key_down(&self, key: KeyboardKey) -> bool { unsafe { ffi::IsKeyDown((key as u32) as i32) } } /// Detect if a key has been released once. #[inline] - pub fn is_key_released(&self, key: crate::consts::KeyboardKey) -> bool { + pub fn is_key_released(&self, key: KeyboardKey) -> bool { unsafe { ffi::IsKeyReleased((key as u32) as i32) } } /// Detect if a key is NOT being pressed. #[inline] - pub fn is_key_up(&self, key: crate::consts::KeyboardKey) -> bool { + pub fn is_key_up(&self, key: KeyboardKey) -> bool { unsafe { ffi::IsKeyUp((key as u32) as i32) } } /// Gets latest key pressed. #[inline] - pub fn get_key_pressed(&self) -> Option { + pub fn get_key_pressed(&self) -> Option { let key = unsafe { ffi::GetKeyPressed() }; if key > 0 { return key_from_i32(key); @@ -63,7 +66,7 @@ impl RaylibHandle<'_> { /// Sets a custom key to exit program (default is ESC). // #[inline] - pub fn set_exit_key(&self, key: Option) { + pub fn set_exit_key(&self, key: Option) { unsafe { match key { Some(k) => ffi::SetExitKey((k as u32) as i32), @@ -92,43 +95,31 @@ impl RaylibHandle<'_> { /// Detect if a gamepad button has been pressed once. #[inline] - pub fn is_gamepad_button_pressed( - &self, - gamepad: i32, - button: crate::consts::GamepadButton, - ) -> bool { + pub fn is_gamepad_button_pressed(&self, gamepad: i32, button: GamepadButton) -> bool { unsafe { ffi::IsGamepadButtonPressed(gamepad, (button as u32) as i32) } } /// Detect if a gamepad button is being pressed. #[inline] - pub fn is_gamepad_button_down( - &self, - gamepad: i32, - button: crate::consts::GamepadButton, - ) -> bool { + pub fn is_gamepad_button_down(&self, gamepad: i32, button: GamepadButton) -> bool { unsafe { ffi::IsGamepadButtonDown(gamepad, (button as u32) as i32) } } /// Detect if a gamepad button has been released once. #[inline] - pub fn is_gamepad_button_released( - &self, - gamepad: i32, - button: crate::consts::GamepadButton, - ) -> bool { + pub fn is_gamepad_button_released(&self, gamepad: i32, button: GamepadButton) -> bool { unsafe { ffi::IsGamepadButtonReleased(gamepad, (button as u32) as i32) } } /// Detect if a gamepad button is NOT being pressed. #[inline] - pub fn is_gamepad_button_up(&self, gamepad: i32, button: crate::consts::GamepadButton) -> bool { + pub fn is_gamepad_button_up(&self, gamepad: i32, button: GamepadButton) -> bool { unsafe { ffi::IsGamepadButtonUp(gamepad, (button as u32) as i32) } } /// Gets the last gamepad button pressed. #[inline] - pub fn get_gamepad_button_pressed(&self) -> Option { + pub fn get_gamepad_button_pressed(&self) -> Option { let button = unsafe { ffi::GetGamepadButtonPressed() }; if button >= 0 { return Some(unsafe { std::mem::transmute(button as u32) }); @@ -144,31 +135,31 @@ impl RaylibHandle<'_> { /// Returns axis movement value for a gamepad axis. #[inline] - pub fn get_gamepad_axis_movement(&self, gamepad: i32, axis: crate::consts::GamepadAxis) -> f32 { + pub fn get_gamepad_axis_movement(&self, gamepad: i32, axis: GamepadAxis) -> f32 { unsafe { ffi::GetGamepadAxisMovement(gamepad, axis as i32) } } /// Detect if a mouse button has been pressed once. #[inline] - pub fn is_mouse_button_pressed(&self, button: crate::consts::MouseButton) -> bool { + pub fn is_mouse_button_pressed(&self, button: MouseButton) -> bool { unsafe { ffi::IsMouseButtonPressed(button as i32) } } /// Detect if a mouse button is being pressed. #[inline] - pub fn is_mouse_button_down(&self, button: crate::consts::MouseButton) -> bool { + pub fn is_mouse_button_down(&self, button: MouseButton) -> bool { unsafe { ffi::IsMouseButtonDown(button as i32) } } /// Detect if a mouse button has been released once. #[inline] - pub fn is_mouse_button_released(&self, button: crate::consts::MouseButton) -> bool { + pub fn is_mouse_button_released(&self, button: MouseButton) -> bool { unsafe { ffi::IsMouseButtonReleased(button as i32) } } /// Detect if a mouse button is NOT being pressed. #[inline] - pub fn is_mouse_button_up(&self, button: crate::consts::MouseButton) -> bool { + pub fn is_mouse_button_up(&self, button: MouseButton) -> bool { unsafe { ffi::IsMouseButtonUp(button as i32) } } @@ -186,30 +177,30 @@ impl RaylibHandle<'_> { /// Returns mouse position. #[inline] - pub fn get_mouse_position(&self) -> Vector2 { + pub fn get_mouse_position(&self) -> Vector2 { unsafe { ffi::GetMousePosition().into() } } /// Returns mouse delta between frames. #[inline] - pub fn get_mouse_delta(&self) -> Vector2 { + pub fn get_mouse_delta(&self) -> Vector2 { unsafe { ffi::GetMouseDelta().into() } } /// Sets mouse position. #[inline] - pub fn set_mouse_position(&self, position: impl Into) { + pub fn set_mouse_position(&self, position: Vector2) { unsafe { - let Vector2 { x, y } = position.into(); + let Vector2 { x, y } = position; ffi::SetMousePosition(x as i32, y as i32); } } /// Sets mouse offset. #[inline] - pub fn set_mouse_offset(&self, offset: impl Into) { + pub fn set_mouse_offset(&self, offset: Vector2) { unsafe { - let Vector2 { x, y } = offset.into(); + let Vector2 { x, y } = offset; ffi::SetMouseOffset(x as i32, y as i32); } } @@ -242,7 +233,7 @@ impl RaylibHandle<'_> { /// Returns touch position XY for a touch point index (relative to screen size). #[inline] - pub fn get_touch_position(&self, index: u32) -> Vector2 { + pub fn get_touch_position(&self, index: u32) -> Vector2 { unsafe { ffi::GetTouchPosition(index as i32).into() } } @@ -250,7 +241,7 @@ impl RaylibHandle<'_> { #[inline] pub fn set_gestures_enabled(&self, gesture_flags: u32) { unsafe { - ffi::SetGesturesEnabled(gesture_flags as u32); + ffi::SetGesturesEnabled(gesture_flags); } } @@ -286,7 +277,7 @@ impl RaylibHandle<'_> { /// Gets gesture drag vector. #[inline] - pub fn get_gesture_drag_vector(&self) -> Vector2 { + pub fn get_gesture_drag_vector(&self) -> Vector2 { unsafe { ffi::GetGestureDragVector().into() } } @@ -298,7 +289,7 @@ impl RaylibHandle<'_> { /// Gets gesture pinch delta. #[inline] - pub fn get_gesture_pinch_vector(&self) -> Vector2 { + pub fn get_gesture_pinch_vector(&self) -> Vector2 { unsafe { ffi::GetGesturePinchVector().into() } } @@ -309,7 +300,7 @@ impl RaylibHandle<'_> { } } -pub fn key_from_i32(key: i32) -> Option { +pub fn key_from_i32(key: i32) -> Option { use crate::consts::KeyboardKey::*; match key { 39 => Some(KEY_APOSTROPHE), diff --git a/raylib/src/core/logging.rs b/raylib/src/core/logging.rs index 3ee4be94..03092a22 100644 --- a/raylib/src/core/logging.rs +++ b/raylib/src/core/logging.rs @@ -1,8 +1,9 @@ ///! Functions to change the behavior of raylib logging. // TODO: refactor this entire thing to use log +use std::ffi::CString; + use crate::consts::TraceLogLevel; use crate::ffi; -use std::ffi::CString; /// Set the current threshold (minimum) log level #[inline] diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index e595691b..c847c40f 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -1,9 +1,12 @@ //! Useful functions that don't fit anywhere else -use crate::core::texture::Image; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::{ffi, RaylibRenderLoop}; use std::ffi::CString; +use super::RaylibRenderLoop; +use crate::{ + core::{texture::Image, RaylibHandle, RaylibThread}, + ffi, +}; + /// Returns a random value between min and max (both included) /// ```rust /// use raylib::*; @@ -12,7 +15,7 @@ use std::ffi::CString; /// println!("random value: {}", r); /// } pub fn get_random_value>(min: i32, max: i32) -> T { - unsafe { (ffi::GetRandomValue(min, max) as i32).into() } + unsafe { ffi::GetRandomValue(min, max).into() } } /// Open URL with default system browser (if available) @@ -28,6 +31,18 @@ pub fn open_url(url: &str) { } } +/* +pub unsafe extern "C" fn trace_log_trampoline( + log_type: core::ffi::c_int, + text: *const core::ffi::c_char, + variadic: *mut c_void, //NOTE: Look for the stabilization of https://github.com/rust-lang/rust/issues/44930 +) { + +} + +pub fn set_trace_log_callback(callback: C) {} +*/ + impl RaylibRenderLoop<'_> { /// Load pixels from the screen into a CPU image pub fn load_image_from_screen(&mut self, _: &RaylibThread) -> Image { @@ -53,7 +68,7 @@ impl RaylibHandle<'_> { /// println!("random value: {}", r); /// } pub fn get_random_value>(&self, min: i32, max: i32) -> T { - unsafe { (ffi::GetRandomValue(min, max) as i32).into() } + unsafe { ffi::GetRandomValue(min, max).into() } } /// Set the seed for random number generation diff --git a/raylib/src/core/mod.rs b/raylib/src/core/mod.rs index 66992d80..5f5ed90d 100644 --- a/raylib/src/core/mod.rs +++ b/raylib/src/core/mod.rs @@ -2,16 +2,14 @@ mod macros; pub mod audio; -mod buffer; +pub mod buffer; pub mod camera; pub mod collision; -pub mod color; pub mod data; pub mod drawing; pub mod file; pub mod input; pub mod logging; -pub mod math; pub mod misc; pub mod models; pub mod shaders; @@ -208,7 +206,7 @@ impl RaylibBuilder { } unsafe { - ffi::SetConfigFlags(flags as u32); + ffi::SetConfigFlags(flags); } let rl = init_window(self.width, self.height, &self.title); (rl, RaylibThread(PhantomData)) diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index 2ef30a1c..cc35293c 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -1,12 +1,20 @@ //! 3D Model, Mesh, and Animation -use crate::core::math::{BoundingBox, Vector3}; -use crate::core::texture::Image; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::{consts, ffi}; + use core::slice; -use std::ffi::CString; +use std::{ffi::CString, mem}; + +use super::{ + texture::{Image, Texture2D}, + RaylibHandle, RaylibThread, shaders::Shader, +}; +use crate::{ + consts, + ffi::{self, BoundingBox, Color}, +}; +use mint::Vector3; fn no_drop(_thing: T) {} + make_thin_wrapper!(Mesh, ffi::Mesh, |mesh: ffi::Mesh| ffi::UnloadMesh(mesh)); make_bound_thin_wrapper!(Model, ffi::Model, ffi::UnloadModel, RaylibHandle<'bind>); make_thin_wrapper!(Material, ffi::Material, ffi::UnloadMaterial); @@ -21,13 +29,19 @@ make_thin_wrapper!(MaterialMap, ffi::MaterialMap, no_drop); impl<'bind, 'a> RaylibHandle<'a> { /// Loads model from files (mesh and material). // #[inline] - pub fn load_model(&'bind self, _: &RaylibThread, filename: &str) -> Result, String> { + pub fn load_model( + &'bind self, + _: &RaylibThread, + filename: &str, + ) -> Result, String> { let c_filename = CString::new(filename).unwrap(); let m = unsafe { ffi::LoadModel(c_filename.as_ptr()) }; + if m.meshes.is_null() && m.materials.is_null() && m.bones.is_null() && m.bindPose.is_null() { return Err(format!("could not load model {}", filename)); } + // TODO check if null pointer checks are necessary. Ok(unsafe { Model::from_raw(m) }) } @@ -55,7 +69,7 @@ impl<'bind, 'a> RaylibHandle<'a> { let c_filename = CString::new(filename).unwrap(); let mut m_size = 0; let m_ptr = unsafe { ffi::LoadModelAnimations(c_filename.as_ptr(), &mut m_size) }; - if m_size <= 0 { + if m_size == 0 { return Err(format!("No model animations loaded from {}", filename)); } let mut m_vec = Vec::with_capacity(m_size as usize); @@ -86,15 +100,7 @@ impl<'bind, 'a> RaylibHandle<'a> { impl<'bind, 'a> RaylibModel for Model<'bind, 'a> {} pub trait RaylibModel: AsRef + AsMut { - fn transform(&self) -> &crate::math::Matrix { - unsafe { std::mem::transmute(&self.as_ref().transform) } - } - - fn set_transform(&mut self, mat: &crate::math::Matrix) { - self.as_mut().transform = mat.into(); - } - - fn meshes<'a>(&'a self) -> &'a [Mesh] { + fn meshes(&self) -> &[Mesh] { unsafe { slice::from_raw_parts( self.as_ref().meshes as *const Mesh, @@ -103,7 +109,7 @@ pub trait RaylibModel: AsRef + AsMut { } } - fn meshes_mut<'a>(&'a mut self) -> &'a mut [Mesh] { + fn meshes_mut(&mut self) -> &mut [Mesh] { unsafe { slice::from_raw_parts_mut( self.as_ref().meshes as *mut Mesh, @@ -112,7 +118,7 @@ pub trait RaylibModel: AsRef + AsMut { } } - fn materials<'a>(&'a self) -> &'a [Material] { + fn materials(&self) -> &[Material] { unsafe { slice::from_raw_parts( self.as_ref().materials as *const Material, @@ -121,7 +127,7 @@ pub trait RaylibModel: AsRef + AsMut { } } - fn materials_mut<'a>(&'a mut self) -> &'a mut [Material] { + fn materials_mut(&mut self) -> &mut [Material] { unsafe { slice::from_raw_parts_mut( self.as_ref().materials as *mut Material, @@ -130,7 +136,7 @@ pub trait RaylibModel: AsRef + AsMut { } } - fn bones<'a>(&'a self) -> Option<&'a [BoneInfo]> { + fn bones(&self) -> Option<&[BoneInfo]> { if self.as_ref().bones.is_null() { return None; } @@ -143,7 +149,7 @@ pub trait RaylibModel: AsRef + AsMut { }) } - fn bones_mut<'a>(&'a mut self) -> Option<&'a mut [BoneInfo]> { + fn bones_mut(&mut self) -> Option<&mut [BoneInfo]> { if self.as_ref().bones.is_null() { return None; } @@ -156,20 +162,20 @@ pub trait RaylibModel: AsRef + AsMut { }) } - fn bind_pose<'a>(&'a self) -> Option<&'a crate::math::Transform> { + fn bind_pose(&self) -> Option<&ffi::Transform> { if self.as_ref().bindPose.is_null() { return None; } - Some(unsafe { std::mem::transmute(self.as_ref().bindPose) }) + Some(unsafe { &*self.as_ref().bindPose }) } - fn bind_pose_mut<'a>(&'a mut self) -> Option<&'a mut crate::math::Transform> { + fn bind_pose_mut(&mut self) -> Option<&mut ffi::Transform> { if self.as_ref().bindPose.is_null() { return None; } - Some(unsafe { std::mem::transmute(self.as_mut().bindPose) }) + Some(unsafe { &mut *self.as_mut().bindPose }) } /// Check model animation skeleton match @@ -182,71 +188,71 @@ pub trait RaylibModel: AsRef + AsMut { impl RaylibMesh for Mesh {} pub trait RaylibMesh: AsRef + AsMut { - fn vertices<'a>(&'a self) -> &'a [Vector3] { + fn vertices(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().vertices as *const Vector3, + self.as_ref().vertices as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn vertices_mut<'a>(&'a mut self) -> &'a mut [Vector3] { + fn vertices_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().vertices as *mut Vector3, + self.as_mut().vertices as *mut Vector3, self.as_mut().vertexCount as usize, ) } } - fn normals<'a>(&'a self) -> &'a [Vector3] { + fn normals(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().normals as *const Vector3, + self.as_ref().normals as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn normals_mut<'a>(&'a mut self) -> &'a mut [Vector3] { + fn normals_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().normals as *mut Vector3, + self.as_mut().normals as *mut Vector3, self.as_mut().vertexCount as usize, ) } } - fn tangents<'a>(&'a self) -> &'a [Vector3] { + fn tangents(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().tangents as *const Vector3, + self.as_ref().tangents as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn tangents_mut<'a>(&'a mut self) -> &'a mut [Vector3] { + fn tangents_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().tangents as *mut Vector3, + self.as_mut().tangents as *mut Vector3, self.as_mut().vertexCount as usize, ) } } - fn colors<'a>(&'a self) -> &'a [crate::color::Color] { + fn colors(&self) -> &[Color] { unsafe { std::slice::from_raw_parts( - self.as_ref().colors as *const crate::color::Color, + self.as_ref().colors as *const Color, self.as_ref().vertexCount as usize, ) } } - fn colors_mut<'a>(&'a mut self) -> &'a mut [crate::color::Color] { + fn colors_mut(&mut self) -> &mut [Color] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().colors as *mut crate::color::Color, + self.as_mut().colors as *mut Color, self.as_mut().vertexCount as usize, ) } } - fn indicies<'a>(&'a self) -> &'a [u16] { + fn indicies(&self) -> &[u16] { unsafe { std::slice::from_raw_parts( self.as_ref().indices as *const u16, @@ -254,7 +260,7 @@ pub trait RaylibMesh: AsRef + AsMut { ) } } - fn indicies_mut<'a>(&'a mut self) -> &'a mut [u16] { + fn indicies_mut(&mut self) -> &mut [u16] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().indices as *mut u16, @@ -313,28 +319,20 @@ pub trait RaylibMesh: AsRef + AsMut { /// Generates heightmap mesh from image data. #[inline] - fn gen_mesh_heightmap( - _: &RaylibThread, - heightmap: &Image, - size: impl Into, - ) -> Mesh { + fn gen_mesh_heightmap(_: &RaylibThread, heightmap: &Image, size: Vector3) -> Mesh { unsafe { Mesh(ffi::GenMeshHeightmap(heightmap.0, size.into())) } } /// Generates cubes-based map mesh from image data. #[inline] - fn gen_mesh_cubicmap( - _: &RaylibThread, - cubicmap: &Image, - cube_size: impl Into, - ) -> Mesh { + fn gen_mesh_cubicmap(_: &RaylibThread, cubicmap: &Image, cube_size: Vector3) -> Mesh { unsafe { Mesh(ffi::GenMeshCubicmap(cubicmap.0, cube_size.into())) } } /// Computes mesh bounding box limits. #[inline] fn get_mesh_bounding_box(&self) -> BoundingBox { - unsafe { ffi::GetMeshBoundingBox(*self.as_ref()).into() } + unsafe { ffi::GetMeshBoundingBox(*self.as_ref()) } } /// Computes mesh tangents. @@ -380,15 +378,15 @@ impl Material { impl RaylibMaterial for Material {} pub trait RaylibMaterial: AsRef + AsMut { - fn shader<'a>(&'a self) -> &'a crate::shaders::Shader { - unsafe { std::mem::transmute(&self.as_ref().shader) } + fn shader(&self) -> &Shader { + unsafe { mem::transmute(&self.as_ref().shader) } } - fn shader_mut<'a>(&'a mut self) -> &'a mut crate::shaders::Shader { - unsafe { std::mem::transmute(&mut self.as_mut().shader) } + fn shader_mut(&mut self) -> &mut Shader { + unsafe { mem::transmute(&mut self.as_mut().shader) } } - fn maps<'a>(&'a self) -> &'a [MaterialMap] { + fn maps(&self) -> &[MaterialMap] { unsafe { std::slice::from_raw_parts( self.as_ref().maps as *const MaterialMap, @@ -397,7 +395,7 @@ pub trait RaylibMaterial: AsRef + AsMut { } } - fn maps_mut<'a>(&'a mut self) -> &'a mut [MaterialMap] { + fn maps_mut(&mut self) -> &mut [MaterialMap] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().maps as *mut MaterialMap, @@ -420,7 +418,7 @@ pub trait RaylibMaterial: AsRef + AsMut { impl RaylibModelAnimation for ModelAnimation {} pub trait RaylibModelAnimation: AsRef + AsMut { - fn bones<'a>(&'a self) -> &'a [BoneInfo] { + fn bones(&self) -> &[BoneInfo] { unsafe { std::slice::from_raw_parts( self.as_ref().bones as *const BoneInfo, @@ -429,7 +427,7 @@ pub trait RaylibModelAnimation: AsRef + AsMut(&'a mut self) -> &'a mut [BoneInfo] { + fn bones_mut(&mut self) -> &mut [BoneInfo] { unsafe { std::slice::from_raw_parts_mut( self.as_mut().bones as *mut BoneInfo, @@ -438,7 +436,7 @@ pub trait RaylibModelAnimation: AsRef + AsMut(&'a self) -> Vec<&'a [crate::math::Transform]> { + fn frame_poses(&self) -> Vec<&[ffi::Transform]> { let anim = self.as_ref(); let mut top = Vec::with_capacity(anim.frameCount as usize); @@ -446,7 +444,7 @@ pub trait RaylibModelAnimation: AsRef + AsMut + AsMut(&'a mut self) -> Vec<&'a mut [crate::math::Transform]> { + fn frame_poses_mut(&mut self) -> Vec<&mut [ffi::Transform]> { let anim = self.as_ref(); let mut top = Vec::with_capacity(anim.frameCount as usize); for i in 0..anim.frameCount { top.push(unsafe { std::slice::from_raw_parts_mut( - *(anim.framePoses.offset(i as isize) as *mut *mut crate::math::Transform), + *(anim.framePoses.offset(i as isize) as *mut *mut ffi::Transform), anim.boneCount as usize, ) }); @@ -473,25 +471,25 @@ pub trait RaylibModelAnimation: AsRef + AsMut(&'a self) -> &'a crate::texture::Texture2D { - unsafe { std::mem::transmute(&self.0.texture) } + pub fn texture(&self) -> &Texture2D { + unsafe { mem::transmute(&self.0.texture) } } - pub fn texture_mut<'a>(&'a mut self) -> &'a mut crate::texture::Texture2D { - unsafe { std::mem::transmute(&mut self.0.texture) } + pub fn texture_mut(&mut self) -> &mut Texture2D { + unsafe { mem::transmute(&mut self.0.texture) } } - pub fn color<'a>(&'a self) -> &'a crate::color::Color { - unsafe { std::mem::transmute(&self.0.color) } + pub fn color(&self) -> &Color { + unsafe { mem::transmute(&self.0.color) } } - pub fn color_mut<'a>(&'a mut self) -> &'a mut crate::color::Color { - unsafe { std::mem::transmute(&mut self.0.color) } + pub fn color_mut(&mut self) -> &mut Color { + unsafe { mem::transmute(&mut self.0.color) } } - pub fn value<'a>(&'a self) -> &'a f32 { - unsafe { std::mem::transmute(&self.0.value) } + pub fn value(&self) -> &f32 { + unsafe { mem::transmute(&self.0.value) } } - pub fn value_mut<'a>(&'a mut self) -> &'a mut f32 { - unsafe { std::mem::transmute(&mut self.0.value) } + pub fn value_mut(&mut self) -> &mut f32 { + unsafe { mem::transmute(&mut self.0.value) } } } diff --git a/raylib/src/core/shaders.rs b/raylib/src/core/shaders.rs index a0c9dc1a..fb0c1fe5 100644 --- a/raylib/src/core/shaders.rs +++ b/raylib/src/core/shaders.rs @@ -1,13 +1,12 @@ //! Code for the safe manipulation of shaders -use crate::consts::ShaderUniformDataType; -use crate::core::math::Matrix; -use crate::core::math::{Vector2, Vector3, Vector4}; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; use std::ffi::CString; use std::mem::ManuallyDrop; use std::os::raw::{c_char, c_void}; +use super::{RaylibHandle, RaylibThread}; +use crate::{consts::ShaderUniformDataType, ffi}; +use mint::{ColumnMatrix4, Vector2, Vector3, Vector4}; + make_bound_thin_wrapper!(Shader, ffi::Shader, ffi::UnloadShader, RaylibHandle<'bind>); // #[cfg(feature = "nightly")] @@ -90,24 +89,24 @@ impl ShaderV for f32 { } } -impl ShaderV for Vector2 { +impl ShaderV for Vector2 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC2; unsafe fn value(&self) -> *const c_void { - self as *const Vector2 as *const c_void + self as *const Vector2 as *const c_void } } -impl ShaderV for Vector3 { +impl ShaderV for Vector3 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC3; unsafe fn value(&self) -> *const c_void { - self as *const Vector3 as *const c_void + self as *const Vector3 as *const c_void } } -impl ShaderV for Vector4 { +impl ShaderV for Vector4 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC4; unsafe fn value(&self) -> *const c_void { - self as *const Vector4 as *const c_void + self as *const Vector4 as *const c_void } } @@ -197,7 +196,7 @@ impl<'bind, 'a> Shader<'bind, 'a> { /// Sets shader uniform value (matrix 4x4). #[inline] - pub fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: Matrix) { + pub fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: ColumnMatrix4) { unsafe { ffi::SetShaderValueMatrix(self.0, uniform_loc, mat.into()); } @@ -233,11 +232,6 @@ pub trait RaylibShader: AsRef + AsMut { #[inline] fn get_shader_location(&self, uniform_name: &str) -> i32 { let c_uniform_name = CString::new(uniform_name).unwrap(); - println!( - "Getting shader location {:?} {}", - c_uniform_name, - uniform_name.len() - ); unsafe { ffi::GetShaderLocation(*self.as_ref(), c_uniform_name.as_ptr()) } } @@ -270,7 +264,7 @@ pub trait RaylibShader: AsRef + AsMut { /// Sets shader uniform value (matrix 4x4). #[inline] - fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: Matrix) { + fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: ColumnMatrix4) { unsafe { ffi::SetShaderValueMatrix(*self.as_mut(), uniform_loc, mat.into()); } @@ -288,7 +282,7 @@ pub trait RaylibShader: AsRef + AsMut { impl<'a> RaylibHandle<'a> { /// Sets a custom projection matrix (replaces internal projection matrix). #[inline] - pub fn set_matrix_projection(&mut self, _: &RaylibThread, proj: Matrix) { + pub fn set_matrix_projection(&mut self, _: &RaylibThread, proj: ColumnMatrix4) { unsafe { ffi::rlSetMatrixProjection(proj.into()); } @@ -296,7 +290,7 @@ impl<'a> RaylibHandle<'a> { /// Sets a custom modelview matrix (replaces internal modelview matrix). #[inline] - pub fn set_matrix_modelview(&mut self, _: &RaylibThread, view: Matrix) { + pub fn set_matrix_modelview(&mut self, _: &RaylibThread, view: ColumnMatrix4) { unsafe { ffi::rlSetMatrixModelview(view.into()); } @@ -304,13 +298,13 @@ impl<'a> RaylibHandle<'a> { /// Gets internal modelview matrix. #[inline] - pub fn get_matrix_modelview(&self) -> Matrix { + pub fn get_matrix_modelview(&self) -> ColumnMatrix4 { unsafe { ffi::rlGetMatrixModelview().into() } } /// Gets internal projection matrix. #[inline] - pub fn get_matrix_projection(&self) -> Matrix { + pub fn get_matrix_projection(&self) -> ColumnMatrix4 { unsafe { ffi::rlGetMatrixProjection().into() } } } diff --git a/raylib/src/core/text.rs b/raylib/src/core/text.rs index cb65db07..71457ef7 100644 --- a/raylib/src/core/text.rs +++ b/raylib/src/core/text.rs @@ -1,13 +1,18 @@ //! Text and Font related functions //! Text manipulation functions are super unsafe so use rust String functions -use crate::core::math::Vector2; -use crate::core::texture::{Image, Texture2D}; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; - +use std::boxed::Box; use std::convert::{AsMut, AsRef}; use std::ffi::CString; use std::mem::ManuallyDrop; +use std::ptr; + +use super::{ + buffer::RaylibBuffer, + texture::{Image, Texture2D}, + RaylibHandle, RaylibThread, +}; +use crate::ffi::{self, Color}; +use mint::Vector2; fn no_drop(_thing: T) {} make_bound_thin_wrapper!(Font, ffi::Font, ffi::UnloadFont, RaylibHandle<'bind>); @@ -15,23 +20,20 @@ make_thin_wrapper!(GlyphInfo, ffi::GlyphInfo, no_drop); #[repr(transparent)] #[derive(Debug)] -pub struct RSliceGlyphInfo(pub(crate) std::mem::ManuallyDrop>); +pub struct RSliceGlyphInfo(pub(crate) ManuallyDrop>); impl Drop for RSliceGlyphInfo { #[allow(unused_unsafe)] fn drop(&mut self) { unsafe { - let inner = std::mem::ManuallyDrop::take(&mut self.0); + let inner = ManuallyDrop::take(&mut self.0); let len = inner.len(); - ffi::UnloadFontData( - std::boxed::Box::leak(inner).as_mut_ptr() as *mut _, - len as i32, - ); + ffi::UnloadFontData(Box::leak(inner).as_mut_ptr() as *mut _, len as i32); } } } -impl std::convert::AsRef> for RSliceGlyphInfo { +impl AsRef> for RSliceGlyphInfo { fn as_ref(&self) -> &Box<[GlyphInfo]> { &self.0 } @@ -69,7 +71,7 @@ impl std::ops::DerefMut for RSliceGlyphInfo { impl<'bind, 'a> AsRef for Font<'bind, 'a> { fn as_ref(&self) -> &ffi::Texture2D { - return &self.0.texture; + &self.0.texture } } @@ -118,7 +120,7 @@ impl<'bind> RaylibHandle<'_> { c.len() as i32, ), FontLoadEx::Default(count) => { - ffi::LoadFontEx(c_filename.as_ptr(), font_size, std::ptr::null_mut(), count) + ffi::LoadFontEx(c_filename.as_ptr(), font_size, ptr::null_mut(), count) } } }; @@ -137,12 +139,12 @@ impl<'bind> RaylibHandle<'_> { &'bind self, _: &RaylibThread, image: &Image, - key: impl Into, + key: Color, first_char: i32, ) -> Result, String> { - let f = unsafe { ffi::LoadFontFromImage(image.0, key.into(), first_char) }; + let f = unsafe { ffi::LoadFontFromImage(image.0, key, first_char) }; if f.glyphs.is_null() { - return Err(format!("Error loading font from image.")); + return Err("Error loading font from image.".to_string()); } Ok(unsafe { Font::from_raw(f) }) } @@ -171,7 +173,7 @@ impl<'bind> RaylibHandle<'_> { data.as_ptr(), data.len() as i32, font_size, - std::ptr::null_mut(), + ptr::null_mut(), 0, sdf, ), @@ -180,7 +182,7 @@ impl<'bind> RaylibHandle<'_> { if ci_arr_ptr.is_null() { None } else { - Some(RSliceGlyphInfo(std::mem::ManuallyDrop::new(Box::from_raw( + Some(RSliceGlyphInfo(ManuallyDrop::new(Box::from_raw( std::slice::from_raw_parts_mut(ci_arr_ptr as *mut _, ci_size), )))) } @@ -242,7 +244,7 @@ impl<'a, 'bind> Font<'bind, 'a> { f }; if f.0.glyphs.is_null() || f.0.texture.id == 0 { - return Err(format!("Error loading font from image.")); + return Err("Error loading font from image.".to_string()); } Ok(f) } @@ -253,7 +255,7 @@ impl<'a, 'bind> Font<'bind, 'a> { self.glyphCount = chars.len() as i32; let data_size = self.glyphCount as usize * std::mem::size_of::(); let ci_arr_ptr = libc::malloc(data_size); // raylib frees this data in UnloadFont - std::ptr::copy( + ptr::copy( chars.as_ptr(), ci_arr_ptr as *mut ffi::GlyphInfo, chars.len(), @@ -270,8 +272,6 @@ impl<'a, 'bind> Font<'bind, 'a> { } /// Generates image font atlas using `chars` info. -/// Sets a pointer to an array of rectangles raylib allocated that MUST manually be freed. -/// Good luck freeing it safely though ;) #[inline] pub fn gen_image_font_atlas( _: &RaylibThread, @@ -279,9 +279,9 @@ pub fn gen_image_font_atlas( font_size: i32, padding: i32, pack_method: i32, -) -> (Image, Vec) { +) -> Option<(Image, RaylibBuffer<'static, ffi::Rectangle>)> { unsafe { - let mut ptr = std::ptr::null_mut(); + let mut ptr = ptr::null_mut(); let img = Image(ffi::GenImageFontAtlas( chars.as_mut_ptr(), @@ -292,11 +292,9 @@ pub fn gen_image_font_atlas( pack_method, )); - let mut recs = Vec::with_capacity(chars.len()); - recs.set_len(chars.len()); - std::ptr::copy(ptr, recs.as_mut_ptr(), chars.len()); - ffi::MemFree(ptr as *mut libc::c_void); - return (img, recs); + let buffer = RaylibBuffer::::new(ptr, chars.len()); + + buffer.map(|b| (img, b)) } } @@ -318,17 +316,17 @@ pub fn measure_text(text: &str, font_size: i32) -> i32 { /// Measures string width in pixels for `font`. #[inline] pub fn measure_text_ex( - font: impl std::convert::AsRef, + font: impl AsRef, text: &str, font_size: f32, spacing: f32, -) -> Vector2 { +) -> Vector2 { let c_text = CString::new(text).unwrap(); unsafe { ffi::MeasureTextEx(*font.as_ref(), c_text.as_ptr(), font_size, spacing).into() } } /// Gets index position for a unicode character on `font`. #[inline] -pub fn get_glyph_index(font: impl std::convert::AsRef, character: i32) -> i32 { +pub fn get_glyph_index(font: impl AsRef, character: i32) -> i32 { unsafe { ffi::GetGlyphIndex(*font.as_ref(), character) } } diff --git a/raylib/src/core/texture.rs b/raylib/src/core/texture.rs index 94758fad..4d123604 100644 --- a/raylib/src/core/texture.rs +++ b/raylib/src/core/texture.rs @@ -1,11 +1,13 @@ //! Image and texture related functions -use crate::core::color::Color; -use crate::core::math::Rectangle; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; use std::ffi::CString; -use super::buffer::RaylibBuffer; +use mint::Vector2; + +use super::{buffer::RaylibBuffer, RaylibHandle, RaylibThread}; +use crate::{ + consts::{NPatchLayout, PixelFormat}, + ffi::{self, Color, Rectangle}, +}; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -15,7 +17,7 @@ pub struct NPatchInfo { pub top: i32, pub right: i32, pub bottom: i32, - pub layout: crate::consts::NPatchLayout, + pub layout: NPatchLayout, } impl From for NPatchInfo { @@ -24,21 +26,21 @@ impl From for NPatchInfo { } } -impl Into for NPatchInfo { - fn into(self) -> ffi::NPatchInfo { - unsafe { std::mem::transmute(self) } +impl From for ffi::NPatchInfo { + fn from(val: NPatchInfo) -> Self { + unsafe { std::mem::transmute(val) } } } -impl Into for &NPatchInfo { - fn into(self) -> ffi::NPatchInfo { +impl From<&NPatchInfo> for ffi::NPatchInfo { + fn from(val: &NPatchInfo) -> Self { ffi::NPatchInfo { - source: self.source.into(), - left: self.left, - top: self.top, - right: self.right, - bottom: self.bottom, - layout: (self.layout as u32) as i32, + source: val.source, + left: val.left, + top: val.top, + right: val.right, + bottom: val.bottom, + layout: (val.layout as u32) as i32, } } } @@ -95,14 +97,14 @@ impl Image { } #[inline] - pub fn format(&self) -> crate::consts::PixelFormat { + pub fn format(&self) -> PixelFormat { let i: u32 = self.format as u32; unsafe { std::mem::transmute(i) } } #[inline] - pub fn from_image(&self, rec: impl Into) -> Image { - unsafe { Image(ffi::ImageFromImage(self.0, rec.into())) } + pub fn from_image(&self, rec: Rectangle) -> Image { + unsafe { Image(ffi::ImageFromImage(self.0, rec)) } } /// Exports image as a PNG file. @@ -152,15 +154,15 @@ impl Image { /// Converts `image` to POT (power-of-two). #[inline] - pub fn to_pot(&mut self, fill_color: impl Into) { + pub fn to_pot(&mut self, fill_color: Color) { unsafe { - ffi::ImageToPOT(&mut self.0, fill_color.into()); + ffi::ImageToPOT(&mut self.0, fill_color); } } /// Converts `image` data to desired pixel format. #[inline] - pub fn set_format(&mut self, new_format: crate::consts::PixelFormat) { + pub fn set_format(&mut self, new_format: PixelFormat) { unsafe { ffi::ImageFormat(&mut self.0, (new_format as u32) as i32); } @@ -178,9 +180,9 @@ impl Image { /// Clears alpha channel on `image` to desired color. #[inline] - pub fn alpha_clear(&mut self, color: impl Into, threshold: f32) { + pub fn alpha_clear(&mut self, color: Color, threshold: f32) { unsafe { - ffi::ImageAlphaClear(&mut self.0, color.into(), threshold); + ffi::ImageAlphaClear(&mut self.0, color, threshold); } } @@ -202,9 +204,9 @@ impl Image { /// Crops `image` to a defined rectangle. #[inline] - pub fn crop(&mut self, crop: impl Into) { + pub fn crop(&mut self, crop: Rectangle) { unsafe { - ffi::ImageCrop(&mut self.0, crop.into()); + ffi::ImageCrop(&mut self.0, crop); } } @@ -232,7 +234,7 @@ impl Image { new_height: i32, offset_x: i32, offset_y: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::ImageResizeCanvas( @@ -241,7 +243,7 @@ impl Image { new_height, offset_x, offset_y, - color.into(), + color, ); } } @@ -265,49 +267,33 @@ impl Image { /// Get image alpha border rectangle #[inline] pub fn get_image_alpha_border(&self, threshold: f32) -> Rectangle { - unsafe { ffi::GetImageAlphaBorder(self.0, threshold).into() } + unsafe { ffi::GetImageAlphaBorder(self.0, threshold) } } /// Clear image background with given color #[inline] - pub fn clear_background(&mut self, color: impl Into) { - unsafe { ffi::ImageClearBackground(&mut self.0, color.into()) } + pub fn clear_background(&mut self, color: Color) { + unsafe { ffi::ImageClearBackground(&mut self.0, color) } } /// Draws a source image within a destination image. #[inline] - pub fn draw( - &mut self, - src: &Image, - src_rec: Rectangle, - dst_rec: Rectangle, - tint: impl Into, - ) { + pub fn draw(&mut self, src: &Image, src_rec: Rectangle, dst_rec: Rectangle, tint: Color) { unsafe { - ffi::ImageDraw( - &mut self.0, - src.0, - src_rec.into(), - dst_rec.into(), - tint.into(), - ); + ffi::ImageDraw(&mut self.0, src.0, src_rec, dst_rec, tint); } } /// Draw pixel within an image #[inline] - pub fn draw_pixel(&mut self, pos_x: i32, pos_y: i32, color: impl Into) { - unsafe { ffi::ImageDrawPixel(&mut self.0, pos_x, pos_y, color.into()) } + pub fn draw_pixel(&mut self, pos_x: i32, pos_y: i32, color: Color) { + unsafe { ffi::ImageDrawPixel(&mut self.0, pos_x, pos_y, color) } } /// Draw pixel within an image (Vector version) #[inline] - pub fn draw_pixel_v( - &mut self, - position: impl Into, - color: impl Into, - ) { - unsafe { ffi::ImageDrawPixelV(&mut self.0, position.into(), color.into()) } + pub fn draw_pixel_v(&mut self, position: Vector2, color: Color) { + unsafe { ffi::ImageDrawPixelV(&mut self.0, position.into(), color) } } /// Draw line within an image @@ -318,7 +304,7 @@ impl Image { start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, - color: impl Into, + color: Color, ) { unsafe { ffi::ImageDrawLine( @@ -327,43 +313,27 @@ impl Image { start_pos_y, end_pos_x, end_pos_y, - color.into(), + color, ) } } /// Draw line within an image (Vector version) #[inline] - pub fn draw_line_v( - &mut self, - start: impl Into, - end: impl Into, - color: impl Into, - ) { - unsafe { ffi::ImageDrawLineV(&mut self.0, start.into(), end.into(), color.into()) } + pub fn draw_line_v(&mut self, start: Vector2, end: Vector2, color: Color) { + unsafe { ffi::ImageDrawLineV(&mut self.0, start.into(), end.into(), color) } } /// Draw circle within an image #[inline] - pub fn draw_circle( - &mut self, - center_x: i32, - center_y: i32, - radius: i32, - color: impl Into, - ) { - unsafe { ffi::ImageDrawCircle(&mut self.0, center_x, center_y, radius, color.into()) } + pub fn draw_circle(&mut self, center_x: i32, center_y: i32, radius: i32, color: Color) { + unsafe { ffi::ImageDrawCircle(&mut self.0, center_x, center_y, radius, color) } } /// Draw circle within an image (Vector version) #[inline] - pub fn draw_circle_v( - &mut self, - center: impl Into, - radius: i32, - color: impl Into, - ) { - unsafe { ffi::ImageDrawCircleV(&mut self.0, center.into(), radius, color.into()) } + pub fn draw_circle_v(&mut self, center: Vector2, radius: i32, color: Color) { + unsafe { ffi::ImageDrawCircleV(&mut self.0, center.into(), radius, color) } } /// Draws a rectangle within an image. @@ -374,46 +344,27 @@ impl Image { pos_y: i32, width: i32, height: i32, - color: impl Into, + color: Color, ) { unsafe { - ffi::ImageDrawRectangle(&mut self.0, pos_x, pos_y, width, height, color.into()); + ffi::ImageDrawRectangle(&mut self.0, pos_x, pos_y, width, height, color); } } /// Draws a rectangle within an image. #[inline] - pub fn draw_rectangle_lines( - &mut self, - rec: Rectangle, - thickness: i32, - color: impl Into, - ) { + pub fn draw_rectangle_lines(&mut self, rec: Rectangle, thickness: i32, color: Color) { unsafe { - ffi::ImageDrawRectangleLines(&mut self.0, rec.into(), thickness, color.into()); + ffi::ImageDrawRectangleLines(&mut self.0, rec, thickness, color); } } /// Draws text (default font) within an image (destination). #[inline] - pub fn draw_text( - &mut self, - text: &str, - pos_x: i32, - pos_y: i32, - font_size: i32, - color: impl Into, - ) { + pub fn draw_text(&mut self, text: &str, pos_x: i32, pos_y: i32, font_size: i32, color: Color) { let c_text = CString::new(text).unwrap(); unsafe { - ffi::ImageDrawText( - &mut self.0, - c_text.as_ptr(), - pos_x, - pos_y, - font_size, - color.into(), - ); + ffi::ImageDrawText(&mut self.0, c_text.as_ptr(), pos_x, pos_y, font_size, color); } } @@ -423,10 +374,10 @@ impl Image { &mut self, font: impl AsRef, text: &str, - position: impl Into, + position: Vector2, font_size: f32, spacing: f32, - color: impl Into, + color: Color, ) { let c_text = CString::new(text).unwrap(); unsafe { @@ -437,7 +388,7 @@ impl Image { position.into(), font_size, spacing, - color.into(), + color, ); } } @@ -445,123 +396,79 @@ impl Image { /// Flips `image` vertically. #[inline] pub fn flip_vertical(&mut self) { - unsafe { - ffi::ImageFlipVertical(&mut self.0); - } + unsafe { ffi::ImageFlipVertical(&mut self.0) } } /// Flips `image` horizontally. #[inline] pub fn flip_horizontal(&mut self) { - unsafe { - ffi::ImageFlipHorizontal(&mut self.0); - } + unsafe { ffi::ImageFlipHorizontal(&mut self.0) } } /// Rotates `image` clockwise by 90 degrees (PI/2 radians). #[inline] pub fn rotate_cw(&mut self) { - unsafe { - ffi::ImageRotateCW(&mut self.0); - } + unsafe { ffi::ImageRotateCW(&mut self.0) } } /// Rotates `image` counterclockwise by 90 degrees (PI/2 radians). #[inline] pub fn rotate_ccw(&mut self) { - unsafe { - ffi::ImageRotateCCW(&mut self.0); - } + unsafe { ffi::ImageRotateCCW(&mut self.0) } } /// Tints colors in `image` using specified `color`. #[inline] - pub fn color_tint(&mut self, color: impl Into) { - unsafe { - ffi::ImageColorTint(&mut self.0, color.into()); - } + pub fn color_tint(&mut self, color: Color) { + unsafe { ffi::ImageColorTint(&mut self.0, color) } } /// Inverts the colors in `image`. #[inline] pub fn color_invert(&mut self) { - unsafe { - ffi::ImageColorInvert(&mut self.0); - } + unsafe { ffi::ImageColorInvert(&mut self.0) } } /// Converts `image color to grayscale. #[inline] pub fn color_grayscale(&mut self) { - unsafe { - ffi::ImageColorGrayscale(&mut self.0); - } + unsafe { ffi::ImageColorGrayscale(&mut self.0) } } /// Adjusts the contrast of `image`. #[inline] pub fn color_contrast(&mut self, contrast: f32) { - unsafe { - ffi::ImageColorContrast(&mut self.0, contrast); - } + unsafe { ffi::ImageColorContrast(&mut self.0, contrast) } } /// Adjusts the brightness of `image`. #[inline] pub fn color_brightness(&mut self, brightness: i32) { - unsafe { - ffi::ImageColorBrightness(&mut self.0, brightness); - } + unsafe { ffi::ImageColorBrightness(&mut self.0, brightness) } } /// Searches `image` for all occurences of `color` and replaces them with `replace` color. #[inline] - pub fn color_replace(&mut self, color: impl Into, replace: impl Into) { - unsafe { - ffi::ImageColorReplace(&mut self.0, color.into(), replace.into()); - } + pub fn color_replace(&mut self, color: Color, replace: Color) { + unsafe { ffi::ImageColorReplace(&mut self.0, color, replace) } } /// Generates a plain `color` Image. #[inline] - pub fn gen_image_color(width: i32, height: i32, color: impl Into) -> Image { - unsafe { Image(ffi::GenImageColor(width, height, color.into())) } + pub fn gen_image_color(width: i32, height: i32, color: Color) -> Image { + unsafe { Image(ffi::GenImageColor(width, height, color)) } } /// Generates an Image containing a vertical gradient. #[inline] - pub fn gen_image_gradient_v( - width: i32, - height: i32, - top: impl Into, - bottom: impl Into, - ) -> Image { - unsafe { - Image(ffi::GenImageGradientV( - width, - height, - top.into(), - bottom.into(), - )) - } + pub fn gen_image_gradient_v(width: i32, height: i32, top: Color, bottom: Color) -> Image { + unsafe { Image(ffi::GenImageGradientV(width, height, top, bottom)) } } /// Generates an Image containing a horizonal gradient. #[inline] - pub fn gen_image_gradient_h( - width: i32, - height: i32, - left: impl Into, - right: impl Into, - ) -> Image { - unsafe { - Image(ffi::GenImageGradientH( - width, - height, - left.into(), - right.into(), - )) - } + pub fn gen_image_gradient_h(width: i32, height: i32, left: Color, right: Color) -> Image { + unsafe { Image(ffi::GenImageGradientH(width, height, left, right)) } } /// Generates an Image containing a radial gradient. @@ -570,16 +477,12 @@ impl Image { width: i32, height: i32, density: f32, - inner: impl Into, - outer: impl Into, + inner: Color, + outer: Color, ) -> Image { unsafe { Image(ffi::GenImageGradientRadial( - width, - height, - density, - inner.into(), - outer.into(), + width, height, density, inner, outer, )) } } @@ -591,17 +494,12 @@ impl Image { height: i32, checks_x: i32, checks_y: i32, - col1: impl Into, - col2: impl Into, + col1: Color, + col2: Color, ) -> Image { unsafe { Image(ffi::GenImageChecked( - width, - height, - checks_x, - checks_y, - col1.into(), - col2.into(), + width, height, checks_x, checks_y, col1, col2, )) } } @@ -623,9 +521,9 @@ impl Image { let c_filename = CString::new(filename).unwrap(); let i = unsafe { ffi::LoadImage(c_filename.as_ptr()) }; if i.data.is_null() { - return Err(format!( - "Image data is null. Either the file doesnt exist or the image type is unsupported." - )); + return Err( + "Image data is null. Either the file doesnt exist or the image type is unsupported.".to_string() + ); } Ok(Image(i)) } @@ -640,7 +538,7 @@ impl Image { let c_bytes = bytes.as_ptr(); let i = unsafe { ffi::LoadImageFromMemory(c_filetype.as_ptr(), c_bytes, size) }; if i.data.is_null() { - return Err(format!("Image data is null. Check provided buffer data")); + return Err("Image data is null. Check provided buffer data".to_string()); }; Ok(Image(i)) } @@ -657,18 +555,17 @@ impl Image { let i = unsafe { ffi::LoadImageRaw(c_filename.as_ptr(), width, height, format, header_size) }; if i.data.is_null() { - return Err(format!( - "Image data is null. Either the file doesnt exist or the image type is unsupported." - )); + return Err("Image data is null. Either the file doesnt exist or the image type is unsupported.".to_string() + ); } Ok(Image(i)) } /// Creates an image from `text` (custom font). #[inline] - pub fn image_text(text: &str, font_size: i32, color: impl Into) -> Image { + pub fn image_text(text: &str, font_size: i32, color: Color) -> Image { let c_text = CString::new(text).unwrap(); - unsafe { Image(ffi::ImageText(c_text.as_ptr(), font_size, color.into())) } + unsafe { Image(ffi::ImageText(c_text.as_ptr(), font_size, color)) } } /// Creates an image from `text` (custom font). @@ -678,7 +575,7 @@ impl Image { text: &str, font_size: f32, spacing: f32, - tint: impl Into, + tint: Color, ) -> Image { let c_text = CString::new(text).unwrap(); unsafe { @@ -687,7 +584,7 @@ impl Image { c_text.as_ptr(), font_size, spacing, - tint.into(), + tint, )) } } @@ -725,7 +622,7 @@ pub trait RaylibTexture2D: AsRef + AsMut { fn load_image(&self) -> Result { let i = unsafe { ffi::LoadImageFromTexture(*self.as_ref()) }; if i.data.is_null() { - return Err(format!("Texture cannot be rendered to an image")); + return Err("Texture cannot be rendered to an image".to_string()); } Ok(Image(i)) } @@ -785,7 +682,7 @@ impl<'bind, 'a> RaylibHandle<'_> { ) -> Result, String> { let t = unsafe { ffi::LoadTextureCubemap(image.0, layout as i32) }; if t.id == 0 { - return Err(format!("failed to load image as a texture cubemap.")); + return Err("failed to load image as a texture cubemap.".to_string()); } Ok(unsafe { Texture2D::from_raw(t) }) } @@ -799,7 +696,7 @@ impl<'bind, 'a> RaylibHandle<'_> { ) -> Result, String> { let t = unsafe { ffi::LoadTextureFromImage(image.0) }; if t.id == 0 { - return Err(format!("failed to load image as a texture.")); + return Err("failed to load image as a texture.".to_string()); } Ok(unsafe { Texture2D::from_raw(t) }) } @@ -813,7 +710,7 @@ impl<'bind, 'a> RaylibHandle<'_> { ) -> Result, String> { let t = unsafe { ffi::LoadRenderTexture(width as i32, height as i32) }; if t.id == 0 { - return Err(format!("failed to create render texture.")); + return Err("failed to create render texture.".to_string()); } Ok(unsafe { RenderTexture2D::from_raw(t) }) } diff --git a/raylib/src/core/vr.rs b/raylib/src/core/vr.rs index cb48a0b2..42d87d86 100644 --- a/raylib/src/core/vr.rs +++ b/raylib/src/core/vr.rs @@ -1,5 +1,5 @@ //! Vr related functions -use crate::core::{RaylibHandle, RaylibThread}; +use super::{RaylibHandle, RaylibThread}; use crate::ffi; make_thin_wrapper!( @@ -8,56 +8,12 @@ make_thin_wrapper!( ffi::UnloadVrStereoConfig ); -#[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq)] -pub struct VrDeviceInfo { - pub h_resolution: i32, // Horizontal resolution in pixels - pub v_esolution: i32, // Vertical resolution in pixels - pub h_screen_size: f32, // Horizontal size in meters - pub v_screen_size: f32, // Vertical size in meters - pub v_screen_center: f32, // Screen center in meters - pub eye_to_screen_distance: f32, // Distance between eye and display in meters - pub lens_separation_distance: f32, // Lens separation distance in meters - pub interpupillary_distance: f32, // IPD (distance between pupils) in meters - pub lens_distortion_values: [f32; 4], // Lens distortion constant parameters - pub chroma_ab_correction: [f32; 4], // Chromatic aberration correction parameters -} - -impl From for VrDeviceInfo { - fn from(v: ffi::VrDeviceInfo) -> VrDeviceInfo { - unsafe { std::mem::transmute(v) } - } -} - -impl Into for VrDeviceInfo { - fn into(self) -> ffi::VrDeviceInfo { - unsafe { std::mem::transmute(self) } - } -} - -impl Into for &VrDeviceInfo { - fn into(self) -> ffi::VrDeviceInfo { - ffi::VrDeviceInfo { - hResolution: self.h_resolution, // Horizontal resolution in pixels - vResolution: self.v_esolution, // Vertical resolution in pixels - hScreenSize: self.h_screen_size, // Horizontal size in meters - vScreenSize: self.v_screen_size, // Vertical size in meters - vScreenCenter: self.v_screen_center, // Screen center in meters - eyeToScreenDistance: self.eye_to_screen_distance, // Distance between eye and display in meters - lensSeparationDistance: self.lens_separation_distance, // Lens separation distance in meters - interpupillaryDistance: self.interpupillary_distance, // IPD (distance between pupils) in meters - lensDistortionValues: self.lens_distortion_values, // Lens distortion constant parameters - chromaAbCorrection: self.chroma_ab_correction, - } - } -} - impl RaylibHandle<'_> { pub fn load_vr_stereo_config( &self, _: &RaylibThread, - device: impl Into, + device: ffi::VrDeviceInfo, ) -> VrStereoConfig { - return VrStereoConfig(unsafe { ffi::LoadVrStereoConfig(device.into()) }); + VrStereoConfig(unsafe { ffi::LoadVrStereoConfig(device) }) } } diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index f7088ff5..eb3d2bb3 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -1,12 +1,14 @@ //! Window manipulation functions -use crate::core::math::{Matrix, Ray, Vector2}; -use crate::core::{RaylibHandle, RaylibThread}; -use crate::ffi; use core::ffi::c_char; +use mint::{ColumnMatrix4, Vector2, Vector3}; + #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::ffi::{CStr, CString, IntoStringError, NulError}; +use super::{RaylibHandle, RaylibThread}; +use crate::ffi::{self, Camera2D, Camera3D, Ray}; + #[cfg(feature = "with_serde")] use serde::{Deserialize, Serialize}; @@ -266,6 +268,16 @@ pub fn get_monitor_refresh_rate(monitor: i32) -> i32 { unsafe { ffi::GetMonitorRefreshRate(monitor) } } +/// Get specified monitor position +#[inline] +pub fn get_monitor_position(monitor: i32) -> Option> { + if monitor >= 0 && monitor < get_monitor_count() { + Some(unsafe { ffi::GetMonitorPosition(monitor).into() }) + } else { + None + } +} + /// Get number of connected monitors /// Only checks that monitor index is in range in debug mode #[inline] @@ -358,8 +370,8 @@ pub fn get_monitor_info(monitor: i32) -> Result { /// assert_eq!(m, Matrix::identity()); /// } /// ``` -pub fn get_camera_matrix(camera: impl Into) -> Matrix { - unsafe { ffi::GetCameraMatrix(camera.into()).into() } +pub fn get_camera_matrix(camera: Camera3D) -> ColumnMatrix4 { + unsafe { ffi::GetCameraMatrix(camera).into() } } /// Returns camera 2D transform matrix (view matrix) @@ -374,9 +386,8 @@ pub fn get_camera_matrix(camera: impl Into) -> Matrix { /// assert_eq!(m, check); /// } /// ``` -#[allow(non_snake_case)] -pub fn get_camera_matrix2D(camera: impl Into) -> Matrix { - unsafe { ffi::GetCameraMatrix2D(camera.into()).into() } +pub fn get_camera_matrix_2d(camera: Camera2D) -> ColumnMatrix4 { + unsafe { ffi::GetCameraMatrix2D(camera).into() } } impl RaylibHandle<'_> { @@ -402,52 +413,34 @@ impl RaylibHandle<'_> { // Screen-space-related functions impl RaylibHandle<'_> { /// Returns a ray trace from mouse position - pub fn get_mouse_ray( - &self, - mouse_position: impl Into, - camera: impl Into, - ) -> Ray { - unsafe { ffi::GetMouseRay(mouse_position.into(), camera.into()).into() } + pub fn get_mouse_ray(&self, mouse_position: Vector2, camera: Camera3D) -> Ray { + unsafe { ffi::GetMouseRay(mouse_position.into(), camera) } } /// Returns the screen space position for a 3d world space position - pub fn get_world_to_screen( - &self, - position: impl Into, - camera: impl Into, - ) -> Vector2 { - unsafe { ffi::GetWorldToScreen(position.into(), camera.into()).into() } + pub fn get_world_to_screen(&self, position: Vector3, camera: Camera3D) -> Vector2 { + unsafe { ffi::GetWorldToScreen(position.into(), camera).into() } } /// Returns the screen space position for a 2d camera world space position - #[allow(non_snake_case)] - pub fn get_world_to_screen2D( - &self, - position: impl Into, - camera: impl Into, - ) -> Vector2 { - unsafe { ffi::GetWorldToScreen2D(position.into(), camera.into()).into() } + pub fn get_world_to_screen_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { + unsafe { ffi::GetWorldToScreen2D(position.into(), camera).into() } } /// Returns size position for a 3d world space position pub fn get_world_to_screen_ex( &self, - position: impl Into, - camera: impl Into, + position: Vector3, + camera: Camera3D, width: i32, height: i32, - ) -> Vector2 { - unsafe { ffi::GetWorldToScreenEx(position.into(), camera.into(), width, height).into() } + ) -> Vector2 { + unsafe { ffi::GetWorldToScreenEx(position.into(), camera, width, height).into() } } /// Returns the world space position for a 2d camera screen space position - #[allow(non_snake_case)] - pub fn get_screen_to_world2D( - &self, - position: impl Into, - camera: impl Into, - ) -> Vector2 { - unsafe { ffi::GetScreenToWorld2D(position.into(), camera.into()).into() } + pub fn get_screen_to_world_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { + unsafe { ffi::GetScreenToWorld2D(position.into(), camera).into() } } } @@ -476,6 +469,34 @@ impl RaylibHandle<'_> { } } +// Event management and custom frame control. +impl RaylibHandle<'_> { + /// Enable waiting for events on EndDrawing(), no automatic event polling + pub fn enable_event_waiting(&self) { + unsafe { ffi::EnableEventWaiting() } + } + + /// Disable waiting for events on EndDrawing(), automatic events polling + pub fn disable_event_waiting(&self) { + unsafe { ffi::DisableEventWaiting() } + } + + /// Swap back buffer with front buffer (screen drawing) + pub fn swap_screen_buffer(&self) { + unsafe { ffi::SwapScreenBuffer() } + } + + /// Register all input events + pub fn poll_input_events(&self) { + unsafe { ffi::PollInputEvents() } + } + + /// Wait for some time (halt program execution) + pub fn wait_time(seconds: f64) { + unsafe { ffi::WaitTime(seconds) } + } +} + // Window handling functions impl RaylibHandle<'_> { /// Checks if `KEY_ESCAPE` or Close icon was pressed. @@ -523,7 +544,7 @@ impl RaylibHandle<'_> { /// Check if window is currently focused (only PLATFORM_DESKTOP) #[inline] - pub fn get_window_scale_dpi(&self) -> Vector2 { + pub fn get_window_scale_dpi(&self) -> Vector2 { unsafe { ffi::GetWindowScaleDPI().into() } } @@ -547,6 +568,30 @@ impl RaylibHandle<'_> { } } + /// Set window state: maximized, if resizable (only PLATFORM_DESKTOP) + #[inline] + pub fn maximize_window(&self) { + unsafe { + ffi::MaximizeWindow(); + } + } + + /// Set window state: minimized, if resizable (only PLATFORM_DESKTOP) + #[inline] + pub fn minimize_window(&self) { + unsafe { + ffi::MinimizeWindow(); + } + } + + /// Set window state: not minimized/maximized (only PLATFORM_DESKTOP) + #[inline] + pub fn restore_window(&self) { + unsafe { + ffi::RestoreWindow(); + } + } + /// Set window configuration state using flags pub fn set_window_state(&self, state: WindowState) { unsafe { ffi::SetWindowState(state.0 as u32) } @@ -612,6 +657,12 @@ impl RaylibHandle<'_> { } } + /// Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) + #[inline] + pub fn set_window_icons(&self, images: &[raylib_sys::Image]) { + unsafe { ffi::SetWindowIcons(images.as_ptr() as _, images.len().try_into().unwrap()) } + } + /// Sets title for window (only on desktop platforms). #[inline] pub fn set_window_title(&self, _: &RaylibThread, title: &str) { @@ -669,7 +720,7 @@ impl RaylibHandle<'_> { /// Get window position #[inline] - pub fn get_window_position(&self) -> Vector2 { + pub fn get_window_position(&self) -> Vector2 { unsafe { ffi::GetWindowPosition().into() } } } @@ -716,7 +767,7 @@ impl RaylibHandle<'_> { /// Get native window handle #[inline] - pub unsafe fn get_window_handle(&self) -> *mut core::ffi::c_void { - ffi::GetWindowHandle() + pub fn get_window_handle(&self) -> *mut core::ffi::c_void { + unsafe { ffi::GetWindowHandle() } } } diff --git a/raylib/src/ease.rs b/raylib/src/ease.rs index 8263efef..76783972 100644 --- a/raylib/src/ease.rs +++ b/raylib/src/ease.rs @@ -208,9 +208,9 @@ pub fn expo_in_out(t: f32, b: f32, c: f32, d: f32) -> f32 { let td = t / (d / 2.0); if td < 1.0 { - return c / 2.0 * 2.0f32.powf(10.0 * (t - 1.0)) + b; + c / 2.0 * 2.0f32.powf(10.0 * (t - 1.0)) + b } else { - return c / 2.0 * (-(2.0f32.powf(-10.0 * td - 1.0)) + 2.0) + b; + c / 2.0 * (-(2.0f32.powf(-10.0 * td - 1.0)) + 2.0) + b } } diff --git a/raylib/src/lib.rs b/raylib/src/lib.rs index b77a16d0..cafd464e 100644 --- a/raylib/src/lib.rs +++ b/raylib/src/lib.rs @@ -57,22 +57,12 @@ Permission is granted to anyone to use this software for any purpose, including pub mod consts; pub mod core; pub mod ease; -pub mod prelude; -pub mod rgui; +//pub mod rgui; /// The raw, unsafe FFI binding, in case you need that escape hatch or the safe layer doesn't provide something you need. pub mod ffi { pub use raylib_sys::*; } -pub use crate::core::collision::*; -pub use crate::core::file::*; -pub use crate::core::logging::*; -pub use crate::core::misc::{open_url}; -pub use crate::core::*; - -// Re-exports -#[cfg(feature = "nalgebra_interop")] -pub use nalgebra as na; -#[cfg(feature = "with_serde")] -pub use serde; +pub use mint; +pub use crate::core::init; \ No newline at end of file diff --git a/raylib/src/prelude.rs b/raylib/src/prelude.rs deleted file mode 100644 index b2d221a0..00000000 --- a/raylib/src/prelude.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* raylib-rs - ease.rs - Easings/interpolation helpers - -Copyright (c) 2018-2019 Paul Clement (@deltaphc) - -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. -*/ - -//! The raylib-rs prelude. -//! -//! This prelude module is for bringing many commonly-used types, functions, and constants into scope all at once. -//! -//! # Example -//! -//! ``` -//! use raylib::prelude::*; -//! ``` - -pub use crate::consts::*; -pub use crate::core::audio::*; -pub use crate::core::camera::*; -pub use crate::core::color::*; -pub use crate::core::data::*; -pub use crate::core::drawing::*; -pub use crate::core::logging::*; -pub use crate::core::math::*; -pub use crate::core::models::*; -pub use crate::core::shaders::*; -pub use crate::core::text::*; -pub use crate::core::texture::*; -pub use crate::core::window::*; -pub use crate::core::*; -pub use crate::rgui::*; -pub use crate::*; diff --git a/raylib/src/rgui/safe.rs b/raylib/src/rgui/safe.rs index 508e5041..df5b7f44 100644 --- a/raylib/src/rgui/safe.rs +++ b/raylib/src/rgui/safe.rs @@ -1,9 +1,7 @@ -use crate::core::color::Color; -use crate::core::drawing::RaylibDraw; -use crate::core::math::{Rectangle, Vector2}; -use crate::core::RaylibHandle; -use crate::ffi; -use crate::text::Font; +use mint::Vector2; + +use crate::core::{drawing::RaylibDraw, text::Font, RaylibHandle}; +use crate::ffi::{self, Color, Rectangle}; use std::ffi::CStr; use std::marker::PhantomData; @@ -205,7 +203,7 @@ pub trait RaylibDrawGui<'a> { text: impl IntoCStr, content: impl Into, scroll: impl Into, - ) -> (Rectangle, Vector2) { + ) -> (Rectangle, Vector2) { let mut scroll = scroll.into(); let bounds: ffi::Rectangle = unsafe { ffi::GuiScrollPanel( @@ -452,7 +450,7 @@ pub trait RaylibDrawGui<'a> { text: impl IntoCStr, spacing: f32, subdivs: i32, - ) -> Vector2 { + ) -> Vector2 { unsafe { ffi::GuiGrid(bounds.into(), text.as_cstr_ptr(), spacing, subdivs).into() } } /// List View control, returns selected list item index @@ -587,6 +585,6 @@ pub trait RaylibDrawGui<'a> { text: impl IntoCStr, alpha: f32, ) -> f32 { - unsafe { ffi::GuiColorBarAlpha(bounds.into(), text.as_cstr_ptr(), alpha).into() } + unsafe { ffi::GuiColorBarAlpha(bounds.into(), text.as_cstr_ptr(), alpha) } } } diff --git a/samples/Cargo.toml b/samples/Cargo.toml index 6638af8d..76b4cb45 100644 --- a/samples/Cargo.toml +++ b/samples/Cargo.toml @@ -10,6 +10,7 @@ repository = "https://github.com/deltaphc/raylib-rs" [dependencies] raylib = { version = "4.5", path = "../raylib" } +nalgebra = { version = "0.32", features = ["mint"] } structopt = "0.2" specs-derive = "0.4.1" rand = "0.7" diff --git a/samples/arkanoid.rs b/samples/arkanoid.rs index 2a713bb7..02be001b 100644 --- a/samples/arkanoid.rs +++ b/samples/arkanoid.rs @@ -1,5 +1,11 @@ extern crate raylib; -use raylib::prelude::*; +extern crate nalgebra; + +use nalgebra::Vector2; +use raylib::core::drawing::RaylibDraw; +use raylib::core::{RaylibHandle, drawing::RaylibDrawHandle}; +use raylib::core::text::measure_text; +use raylib::ffi::{Color, Rectangle}; use structopt::StructOpt; mod options; @@ -10,22 +16,22 @@ const BRICKS_PER_LINE: usize = 20; #[derive(Default)] struct Player { - pub position: Vector2, - pub size: Vector2, + pub position: Vector2, + pub size: Vector2, pub life: i32, } #[derive(Default)] struct Ball { - position: Vector2, - speed: Vector2, + position: Vector2, + speed: Vector2, radius: i32, active: bool, } #[derive(Default)] struct Brick { - position: Vector2, + position: Vector2, active: bool, } @@ -35,7 +41,7 @@ struct Game { player: Player, ball: Ball, bricks: Vec>, - brick_size: Vector2, + brick_size: Vector2, } impl Default for Game { @@ -177,7 +183,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { game.player.size.x, game.player.size.y, ); - if r.check_collision_circle_rec(game.ball.position, game.ball.radius as f32) { + if r.check_collision_circle_rec(game.ball.position.into(), game.ball.radius as f32) { if game.ball.speed.y > 0.0 { game.ball.speed.y *= -1.0; game.ball.speed.x = (game.ball.position.x - game.player.position.x) @@ -294,7 +300,7 @@ fn draw_game(game: &Game, rl: &RaylibHandle, d: &RaylibDrawHandle) { } // Draw ball - d.draw_circle_v(game.ball.position, game.ball.radius as f32, Color::MAROON); + d.draw_circle_v(game.ball.position.into(), game.ball.radius as f32, Color::MAROON); // Draw bricks for i in 0..LINES_OF_BRICKS { diff --git a/samples/asteroids.rs b/samples/asteroids.rs index d72b3df3..64fccb68 100644 --- a/samples/asteroids.rs +++ b/samples/asteroids.rs @@ -1,6 +1,15 @@ extern crate raylib; +use nalgebra::{Vector2, Vector3}; +use raylib::{ + core::{ + collision::check_collision_circles, + drawing::{RaylibDraw, RaylibDrawHandle}, + text::measure_text, + RaylibHandle, RaylibThread, + }, + ffi::Color, +}; -use raylib::prelude::*; use structopt::StructOpt; mod options; @@ -21,18 +30,18 @@ struct Game { #[derive(Default)] struct Player { - position: Vector2, - speed: Vector2, + position: Vector2, + speed: Vector2, acceleration: f32, rotation: f32, - collider: Vector3, + collider: Vector3, color: Color, } #[derive(Default)] struct Meteor { - position: Vector2, - speed: Vector2, + position: Vector2, + speed: Vector2, radius: f32, active: bool, color: Color, @@ -40,8 +49,8 @@ struct Meteor { #[derive(Default)] struct Shoot { - position: Vector2, - speed: Vector2, + position: Vector2, + speed: Vector2, radius: f32, rotation: f32, life_spawn: u8, @@ -315,9 +324,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &mut game.big_meteors { if meteor.active && check_collision_circles( - shot.position, + shot.position.into(), shot.radius, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -360,9 +369,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &mut game.medium_meteors { if meteor.active && check_collision_circles( - shot.position, + shot.position.into(), shot.radius, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -402,9 +411,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &mut game.small_meteors { if meteor.active && check_collision_circles( - shot.position, + shot.position.into(), shot.radius, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -431,9 +440,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &game.big_meteors { if meteor.active && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y), + Vector2::new(game.player.collider.x, game.player.collider.y).into(), game.player.collider.z, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -444,9 +453,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &game.medium_meteors { if meteor.active && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y), + Vector2::new(game.player.collider.x, game.player.collider.y).into(), game.player.collider.z, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -457,9 +466,9 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { for meteor in &game.small_meteors { if meteor.active && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y), + Vector2::new(game.player.collider.x, game.player.collider.y).into(), game.player.collider.z, - meteor.position, + meteor.position.into(), meteor.radius, ) { @@ -540,7 +549,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { let (width, height) = (rl.get_screen_width() as i32, rl.get_screen_height() as i32); - + rl.frame(thread, |d| { let half_width = width / 2; let half_height = height / 2; @@ -562,14 +571,14 @@ fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { game.player.position.x + cosf * 10f32, game.player.position.y + sinf * 10f32, ); - d.draw_triangle(v1, v2, v3, game.player.color); + d.draw_triangle(v1.into(), v2.into(), v3.into(), game.player.color); for meteor in &game.big_meteors { if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); } else { d.draw_circle_v( - meteor.position, + meteor.position.into(), meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3), ); @@ -578,10 +587,10 @@ fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { for meteor in &game.medium_meteors { if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); } else { d.draw_circle_v( - meteor.position, + meteor.position.into(), meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3), ); @@ -590,10 +599,10 @@ fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { for meteor in &game.small_meteors { if meteor.active { - d.draw_circle_v(meteor.position, meteor.radius, meteor.color); + d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); } else { d.draw_circle_v( - meteor.position, + meteor.position.into(), meteor.radius, Color::fade(&Color::LIGHTGRAY, 0.3), ); @@ -602,7 +611,7 @@ fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { for shot in &game.shots { if shot.active { - d.draw_circle_v(shot.position, shot.radius, shot.color); + d.draw_circle_v(shot.position.into(), shot.radius, shot.color); } } @@ -628,7 +637,7 @@ fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { } else { d.draw_text( "PRESS [ENTER] TO PLAY AGAIN", - half_width - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20), + half_width - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20) / 2, half_height - 50, 20, Color::GRAY, diff --git a/samples/options.rs b/samples/options.rs index 2489f2c6..41251149 100644 --- a/samples/options.rs +++ b/samples/options.rs @@ -2,6 +2,7 @@ // extern crate structopt; pub use structopt::StructOpt; +use raylib::core::{RaylibHandle, RaylibThread}; #[derive(Debug, StructOpt)] #[structopt(name = "example", about = "An example of StructOpt usage.")] @@ -19,13 +20,13 @@ impl Opt { pub fn new() -> Self { Opt::from_args() } - pub fn open_window(&self, name: &str) -> (raylib::RaylibHandle<'static>, raylib::RaylibThread) { + pub fn open_window(&self, name: &str) -> (RaylibHandle<'static>, RaylibThread) { let (rl, thread) = raylib::init() .size(self.width, self.height) .title(name) .build(); - let logo = raylib::prelude::Image::load_image("static/logo.png").unwrap(); - rl.set_window_icon(&logo); + //let logo = raylib::prelude::Image::load_image("static/logo.png").unwrap(); + //rl.set_window_icon(&logo); rl.set_target_fps(self.fps); (rl, thread) } diff --git a/samples/texture.rs b/samples/texture.rs index a0abdb6c..da706505 100644 --- a/samples/texture.rs +++ b/samples/texture.rs @@ -1,5 +1,4 @@ extern crate raylib; -use raylib::prelude::*; use structopt::StructOpt; mod options; From a54e4b8b7e2748a45bafc5f46ea76480c5239c8d Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sat, 25 Mar 2023 23:24:49 +0100 Subject: [PATCH 15/30] Some cleanup/reorganization, blocklist math stuff into mint (less painful) --- raylib-sys/GENERATING_BINDINGS.md | 8 - raylib-sys/binding/binding.h | 5 +- raylib-sys/binding/wrapper.c | 7 +- raylib-sys/build.rs | 37 +++- raylib-sys/src/lib.rs | 9 +- raylib-sys/src/math.rs | 42 +--- raylib/Cargo.toml | 2 - raylib/src/{core => }/audio.rs | 5 +- raylib/src/{core => }/buffer.rs | 0 raylib/src/consts.rs | 45 ----- raylib/src/core/camera.rs | 9 +- raylib/src/core/collision.rs | 101 ++++------ raylib/src/core/data.rs | 3 +- raylib/src/core/drawing.rs | 308 ++++++++++-------------------- raylib/src/core/input.rs | 33 ++-- raylib/src/core/logging.rs | 15 +- raylib/src/core/misc.rs | 7 +- raylib/src/core/mod.rs | 10 +- raylib/src/core/models.rs | 46 ++--- raylib/src/core/shaders.rs | 40 ++-- raylib/src/core/text.rs | 16 +- raylib/src/core/texture.rs | 47 ++--- raylib/src/core/vr.rs | 2 +- raylib/src/core/window.rs | 175 ++++++++--------- raylib/src/lib.rs | 8 +- raylib/src/{core => }/macros.rs | 44 +++-- raylib/src/prelude.rs | 17 ++ raylib/src/rgui/safe.rs | 206 ++++++++------------ samples/3d_camera_first_person.rs | 3 +- samples/arkanoid.rs | 5 +- samples/asteroids.rs | 23 +-- samples/camera2D.rs | 20 +- samples/drop.rs | 2 +- samples/extensions.rs | 12 +- samples/font.rs | 7 +- samples/input.rs | 2 +- samples/logo.rs | 2 +- samples/options.rs | 2 +- samples/roguelike.rs | 2 +- samples/specs.rs | 33 +++- samples/texture.rs | 1 + 41 files changed, 572 insertions(+), 789 deletions(-) delete mode 100644 raylib-sys/GENERATING_BINDINGS.md rename raylib/src/{core => }/audio.rs (99%) rename raylib/src/{core => }/buffer.rs (100%) delete mode 100644 raylib/src/consts.rs rename raylib/src/{core => }/macros.rs (95%) create mode 100644 raylib/src/prelude.rs diff --git a/raylib-sys/GENERATING_BINDINGS.md b/raylib-sys/GENERATING_BINDINGS.md deleted file mode 100644 index 2ca8cb64..00000000 --- a/raylib-sys/GENERATING_BINDINGS.md +++ /dev/null @@ -1,8 +0,0 @@ -Bindings were generated with rust_bindgen with rustified enums using c11 - -Ex -bindgen rgui_wrapper.h -o bindings_osx.rs --rustified-enum .+ -- --target=x86_64-apple-darwin -std=c11 -bindgen rgui_wrapper.h -o bindings_linux.rs --rustified-enum .+ -- --target=x86_64-unknown-linux-gnu -std=c11 -Windows and Web bindings are generated from rgui.h and the extern functions are manually copied over -bindgen rgui_wrapper.h -o bindings_windows.rs --rustified-enum .+ -- --target=x86_64-pc-windows-msvc -std=c11 -bindgen rgui_wrapper.h -o bindings_web.rs --rustified-enum .+ -- --target=wasm32-unknown-emscripten -std=c11 diff --git a/raylib-sys/binding/binding.h b/raylib-sys/binding/binding.h index 3c432446..d5547f50 100644 --- a/raylib-sys/binding/binding.h +++ b/raylib-sys/binding/binding.h @@ -1,6 +1,8 @@ #include "../raylib/src/raylib.h" #include "../raylib/src/rlgl.h" #include "../raylib/src/rcamera.h" + +#if 0 #include "../raygui/src/raygui.h" typedef enum @@ -261,4 +263,5 @@ typedef enum RAYGUI_ICON_253 = 253, RAYGUI_ICON_254 = 254, RAYGUI_ICON_255 = 255, -} guiRAYGUI_ICONName; \ No newline at end of file +} guiRAYGUI_ICONName; +#endif \ No newline at end of file diff --git a/raylib-sys/binding/wrapper.c b/raylib-sys/binding/wrapper.c index 058adada..fa028791 100644 --- a/raylib-sys/binding/wrapper.c +++ b/raylib-sys/binding/wrapper.c @@ -1,4 +1,7 @@ -#include "raylib.h" +#include "../raylib/src/raylib.h" + +#if 0 #define RAYGUI_IMPLEMENTATION #define RAYGUI_SUPPORT_ICONS -#include "../raygui/src/raygui.h" \ No newline at end of file +#include "../raygui/src/raygui.h" +#endif \ No newline at end of file diff --git a/raylib-sys/build.rs b/raylib-sys/build.rs index a8138422..ebdc5922 100644 --- a/raylib-sys/build.rs +++ b/raylib-sys/build.rs @@ -20,17 +20,39 @@ extern crate bindgen; use std::env; use std::path::{Path, PathBuf}; +use bindgen::callbacks::{DeriveTrait, ImplementsTrait, ParseCallbacks}; + /// latest version on github's release page as of time or writing const LATEST_RAYLIB_VERSION: &str = "4.5.0"; const LATEST_RAYLIB_API_VERSION: &str = "4"; +#[derive(Debug)] +struct TypeOverrideCallback; + +impl ParseCallbacks for TypeOverrideCallback { + fn blocklisted_type_implements_trait( + &self, + _name: &str, + _derive_trait: DeriveTrait, + ) -> Option { + const OK_TRAITS: [DeriveTrait; 3] = [ + DeriveTrait::Copy, + DeriveTrait::Debug, + DeriveTrait::PartialEqOrPartialOrd, + ]; + const OVERRIDEN_TYPES: [&str; 5] = + ["Vector2", "Vector3", "Vector4", "Matrix", "Quaternion"]; + + (OK_TRAITS.contains(&_derive_trait) && OVERRIDEN_TYPES.contains(&_name)) + .then_some(ImplementsTrait::Yes) + } +} + #[cfg(feature = "nobuild")] fn build_with_cmake(_src_path: &str) {} #[cfg(not(feature = "nobuild"))] fn build_with_cmake(src_path: &str) { - use cmake::build; - // CMake uses different lib directories on different systems. // I do not know how CMake determines what directory to use, // so we will check a few possibilities and use whichever is present. @@ -158,10 +180,16 @@ fn gen_bindings() { let mut builder = bindgen::Builder::default() .header("binding/binding.h") .rustified_enum(".+") + .blocklist_type("Vector2") + .blocklist_type("Vector3") + .blocklist_type("Vector4") + .blocklist_type("Matrix") + .blocklist_type("Quaternion") + .parse_callbacks(Box::new(TypeOverrideCallback)) .clang_arg("-I../raylib/src") .clang_arg("-std=c99") - .clang_arg(plat) - .parse_callbacks(Box::new(bindgen::CargoCallbacks)); + .clang_arg(plat); + //.parse_callbacks(Box::new(bindgen::CargoCallbacks)); if platform == Platform::Desktop && os == PlatformOS::Windows { // odd workaround for booleans being broken @@ -233,7 +261,6 @@ fn link(platform: Platform, platform_os: PlatformOS) { _ => (), } if platform == Platform::Web { - env::set_var("EMCC_CFLAGS", "-sUSE_GLFW=3 -sERROR_ON_UNDEFINED_SYMBOLS=0"); println!("cargo:rustc-link-lib=glfw"); } else if platform == Platform::RPI { println!("cargo:rustc-link-search=/opt/vc/lib"); diff --git a/raylib-sys/src/lib.rs b/raylib-sys/src/lib.rs index 4bc39def..c70982af 100644 --- a/raylib-sys/src/lib.rs +++ b/raylib-sys/src/lib.rs @@ -2,9 +2,16 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] +pub use mint; +pub type Vector2 = mint::Vector2; +pub type Vector3 = mint::Vector3; +pub type Vector4 = mint::Vector4; +pub type Matrix = mint::ColumnMatrix4; +pub type Quaternion = mint::Quaternion; + include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -pub use mint; +pub const MAX_MATERIAL_MAPS: u32 = 12; mod color; mod camera; diff --git a/raylib-sys/src/math.rs b/raylib-sys/src/math.rs index 84039175..1d40dfd1 100644 --- a/raylib-sys/src/math.rs +++ b/raylib-sys/src/math.rs @@ -1,29 +1,4 @@ -use crate::{BoundingBox, Ray, RayCollision, Rectangle}; -use mint::{Vector2, Vector3}; -use std::mem; - -macro_rules! mint_transmutable { - ($ffit:ty, $mt:ty) => { - impl From<$mt> for $ffit { - fn from(value: $mt) -> Self { - unsafe { mem::transmute(value) } - } - } - - impl From<$ffit> for $mt { - fn from(value: $ffit) -> Self { - unsafe { mem::transmute(value) } - } - } - }; -} - -mint_transmutable!(crate::Vector2, mint::Vector2); -mint_transmutable!(crate::Vector3, mint::Vector3); -mint_transmutable!(crate::Vector4, mint::Vector4); - -mint_transmutable!(crate::Matrix, mint::ColumnMatrix4); -mint_transmutable!(crate::Quaternion, mint::Quaternion); +use crate::{BoundingBox, Ray, RayCollision, Rectangle, Vector2, Vector3}; impl Rectangle { pub fn new(x: f32, y: f32, width: f32, height: f32) -> Self { @@ -43,7 +18,7 @@ impl Rectangle { /// Checks collision between circle and rectangle. #[inline] - pub fn check_collision_circle_rec(&self, center: Vector2, radius: f32) -> bool { + pub fn check_collision_circle_rec(&self, center: Vector2, radius: f32) -> bool { unsafe { crate::CheckCollisionCircleRec(center.into(), radius, *self) } } @@ -65,7 +40,7 @@ impl Rectangle { /// Checks if point is inside rectangle. #[inline] - pub fn check_collision_point_rec(&self, point: Vector2) -> bool { + pub fn check_collision_point_rec(&self, point: Vector2) -> bool { unsafe { crate::CheckCollisionPointRec(point.into(), *self) } } } @@ -79,11 +54,7 @@ impl BoundingBox { /// Detects collision between box and sphere. #[inline] - pub fn check_collision_box_sphere( - &self, - center_sphere: Vector3, - radius_sphere: f32, - ) -> bool { + pub fn check_collision_box_sphere(&self, center_sphere: Vector3, radius_sphere: f32) -> bool { unsafe { crate::CheckCollisionBoxSphere(*self, center_sphere.into(), radius_sphere) } } @@ -93,8 +64,3 @@ impl BoundingBox { unsafe { crate::GetRayCollisionBox(ray, *self) } } } - -#[test] -fn math_test() { - // TODO: Do some transmutation tests. -} diff --git a/raylib/Cargo.toml b/raylib/Cargo.toml index 31a40def..0cd58673 100644 --- a/raylib/Cargo.toml +++ b/raylib/Cargo.toml @@ -18,8 +18,6 @@ lazy_static = "1.2.0" cfg-if = "1.0.0" serde = { version = "1.0.125", features = ["derive"], optional = true } serde_json = { version = "1.0.64", optional = true } -mint = "0.5" -nalgebra = { version = "0.32" } [features] nightly = [] diff --git a/raylib/src/core/audio.rs b/raylib/src/audio.rs similarity index 99% rename from raylib/src/core/audio.rs rename to raylib/src/audio.rs index dadf309f..f1cbc62b 100644 --- a/raylib/src/core/audio.rs +++ b/raylib/src/audio.rs @@ -1,7 +1,6 @@ //! Contains code related to audio. [`RaylibAudio`] plays sounds and music. - -use super::{buffer::RaylibBuffer, RaylibThread}; -use crate::ffi; +use crate::{buffer::RaylibBuffer, core::RaylibThread}; +use crate::{ffi, make_bound_thin_wrapper, make_thin_wrapper}; use std::ffi::CString; make_thin_wrapper!(Wave, ffi::Wave, ffi::UnloadWave); diff --git a/raylib/src/core/buffer.rs b/raylib/src/buffer.rs similarity index 100% rename from raylib/src/core/buffer.rs rename to raylib/src/buffer.rs diff --git a/raylib/src/consts.rs b/raylib/src/consts.rs deleted file mode 100644 index 797de7af..00000000 --- a/raylib/src/consts.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Various constant enums to use with raylib -pub use crate::ffi; - -pub use ffi::BlendMode; -pub use ffi::CameraMode; -pub use ffi::CameraProjection; -pub use ffi::ConfigFlags; -pub use ffi::CubemapLayout; -pub use ffi::GamepadAxis; -pub use ffi::GamepadButton; -pub use ffi::Gesture; -pub use ffi::KeyboardKey; -pub use ffi::MaterialMapIndex; -pub use ffi::MouseButton; -pub use ffi::NPatchLayout; -pub use ffi::PixelFormat; -pub use ffi::ShaderLocationIndex; -pub use ffi::ShaderUniformDataType; -pub use ffi::TextureFilter; -pub use ffi::TextureWrap; -pub use ffi::TraceLogLevel; -pub use ffi::DEG2RAD; -// TODO Fix when rlgl bindings are in -pub const MAX_MATERIAL_MAPS: u32 = 12; -pub const MAX_SHADER_LOCATIONS: u32 = 32; -pub use ffi::GuiCheckBoxProperty; -pub use ffi::GuiColorPickerProperty; -pub use ffi::GuiComboBoxProperty; -pub use ffi::GuiControl; -pub use ffi::GuiControlProperty; -pub use ffi::GuiDefaultProperty; -pub use ffi::GuiDropdownBoxProperty; -pub use ffi::GuiIconName; -pub use ffi::GuiListViewProperty; -pub use ffi::GuiProgressBarProperty; -pub use ffi::GuiScrollBarProperty; -pub use ffi::GuiSliderProperty; -pub use ffi::GuiSpinnerProperty; -pub use ffi::GuiState; -pub use ffi::GuiTextAlignment; -pub use ffi::GuiTextBoxProperty; -pub use ffi::GuiToggleProperty; -pub use ffi::MouseCursor; -pub use ffi::PI; -pub use ffi::RAD2DEG; diff --git a/raylib/src/core/camera.rs b/raylib/src/core/camera.rs index 81df95de..b8e72395 100644 --- a/raylib/src/core/camera.rs +++ b/raylib/src/core/camera.rs @@ -1,9 +1,6 @@ //! Utility code for using Raylib [`Camera3D`] and [`Camera2D`] -use mint::Vector3; -use raylib_sys::{Camera3D, CameraMode}; - use super::RaylibHandle; -use crate::ffi; +use crate::ffi::{self, Vector3, Camera3D, CameraMode}; impl RaylibHandle<'_> { /// Updates camera position for selected mode. @@ -15,8 +12,8 @@ impl RaylibHandle<'_> { pub fn update_camera_pro( &self, camera: &mut Camera3D, - movement: Vector3, - rotation: Vector3, + movement: Vector3, + rotation: Vector3, zoom: f32, ) { unsafe { ffi::UpdateCameraPro(camera, movement.into(), rotation.into(), zoom) } diff --git a/raylib/src/core/collision.rs b/raylib/src/core/collision.rs index 9b671854..9561073f 100644 --- a/raylib/src/core/collision.rs +++ b/raylib/src/core/collision.rs @@ -1,131 +1,108 @@ //! Common collision handling code -use mint::{ColumnMatrix4, Vector2, Vector3}; -use raylib_sys::{Ray, RayCollision}; - use super::models::Mesh; -use crate::ffi; +use crate::ffi::{self, Matrix, Ray, RayCollision, Vector2, Vector3}; // Collision Handling /// Checks collision between two circles. #[inline] pub fn check_collision_circles( - center1: Vector2, + center1: Vector2, radius1: f32, - center2: Vector2, + center2: Vector2, radius2: f32, ) -> bool { - unsafe { ffi::CheckCollisionCircles(center1.into(), radius1, center2.into(), radius2) } + unsafe { ffi::CheckCollisionCircles(center1, radius1, center2, radius2) } } /// Checks if point is inside circle. #[inline] -pub fn check_collision_point_circle( - point: Vector2, - center: Vector2, - radius: f32, -) -> bool { - unsafe { ffi::CheckCollisionPointCircle(point.into(), center.into(), radius) } +pub fn check_collision_point_circle(point: Vector2, center: Vector2, radius: f32) -> bool { + unsafe { ffi::CheckCollisionPointCircle(point, center, radius) } } /// Checks if point is inside a triangle. #[inline] pub fn check_collision_point_triangle( - point: Vector2, - p1: Vector2, - p2: Vector2, - p3: Vector2, + point: Vector2, + p1: Vector2, + p2: Vector2, + p3: Vector2, ) -> bool { - unsafe { ffi::CheckCollisionPointTriangle(point.into(), p1.into(), p2.into(), p3.into()) } + unsafe { ffi::CheckCollisionPointTriangle(point, p1, p2, p3) } } #[inline] -pub fn check_collision_point_poly(point: Vector2, points: &[Vector2]) -> bool { - unsafe { ffi::CheckCollisionPointPoly(point.into(), points.as_ptr() as _, points.len() as _) } +pub fn check_collision_point_poly(point: Vector2, points: &[Vector2]) -> bool { + unsafe { ffi::CheckCollisionPointPoly(point, points.as_ptr() as _, points.len() as _) } } /// Check the collision between two lines defined by two points each, returns collision point by reference #[inline] pub fn check_collision_lines( - start_pos1: Vector2, - end_pos1: Vector2, - start_pos2: Vector2, - end_pos2: Vector2, -) -> Option> { + start_pos1: Vector2, + end_pos1: Vector2, + start_pos2: Vector2, + end_pos2: Vector2, +) -> Option { let mut out = ffi::Vector2 { x: 0.0, y: 0.0 }; - let collision = unsafe { - ffi::CheckCollisionLines( - start_pos1.into(), - end_pos1.into(), - start_pos2.into(), - end_pos2.into(), - &mut out, - ) - }; + let collision = + unsafe { ffi::CheckCollisionLines(start_pos1, end_pos1, start_pos2, end_pos2, &mut out) }; - collision.then_some(out.into()) + collision.then_some(out) } #[inline] pub fn check_collision_point_line( - point: Vector2, - p1: Vector2, - p2: Vector2, + point: Vector2, + p1: Vector2, + p2: Vector2, threshold: i32, ) -> bool { - unsafe { ffi::CheckCollisionPointLine(point.into(), p1.into(), p2.into(), threshold) } + unsafe { ffi::CheckCollisionPointLine(point, p1, p2, threshold) } } /// Detects collision between two spheres. #[inline] pub fn check_collision_spheres( - center_a: Vector3, + center_a: Vector3, radius_a: f32, - center_b: Vector3, + center_b: Vector3, radius_b: f32, ) -> bool { - unsafe { ffi::CheckCollisionSpheres(center_a.into(), radius_a, center_b.into(), radius_b) } + unsafe { ffi::CheckCollisionSpheres(center_a, radius_a, center_b, radius_b) } } /// Detects collision between ray and sphere. #[inline] pub fn get_ray_collision_sphere( ray: Ray, - sphere_position: Vector3, + sphere_position: Vector3, sphere_radius: f32, ) -> RayCollision { - unsafe { ffi::GetRayCollisionSphere(ray, sphere_position.into(), sphere_radius) } + unsafe { ffi::GetRayCollisionSphere(ray, sphere_position, sphere_radius) } } /// Gets collision info between ray and model. #[inline] -pub fn get_ray_collision_mesh( - ray: Ray, - model: &Mesh, - transform: ColumnMatrix4, -) -> RayCollision { - unsafe { ffi::GetRayCollisionMesh(ray, model.0, transform.into()) } +pub fn get_ray_collision_mesh(ray: Ray, model: &Mesh, transform: Matrix) -> RayCollision { + unsafe { ffi::GetRayCollisionMesh(ray, model.0, transform) } } /// Gets collision info between ray and triangle. #[inline] -pub fn get_ray_collision_triangle( - ray: Ray, - p1: Vector3, - p2: Vector3, - p3: Vector3, -) -> RayCollision { - unsafe { ffi::GetRayCollisionTriangle(ray, p1.into(), p2.into(), p3.into()) } +pub fn get_ray_collision_triangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) -> RayCollision { + unsafe { ffi::GetRayCollisionTriangle(ray, p1, p2, p3) } } /// Gets collision info between ray and model. #[inline] pub fn get_ray_collision_quad( ray: Ray, - p1: Vector3, - p2: Vector3, - p3: Vector3, - p4: Vector3, + p1: Vector3, + p2: Vector3, + p3: Vector3, + p4: Vector3, ) -> RayCollision { - unsafe { ffi::GetRayCollisionQuad(ray, p1.into(), p2.into(), p3.into(), p4.into()) } + unsafe { ffi::GetRayCollisionQuad(ray, p1, p2, p3, p4) } } diff --git a/raylib/src/core/data.rs b/raylib/src/core/data.rs index 54546a26..5372ee01 100644 --- a/raylib/src/core/data.rs +++ b/raylib/src/core/data.rs @@ -1,6 +1,5 @@ //! Data manipulation functions. Compress and Decompress with DEFLATE -use crate::ffi; -use super::buffer::RaylibBuffer; +use crate::{buffer::RaylibBuffer, ffi}; /// Compress data (DEFLATE algorythm) /// ```rust diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index 666a36b9..cbe20da7 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -1,8 +1,9 @@ //! Contains code related to drawing. Types that can be set as a surface to draw will implement the [`RaylibDraw`] trait -use mint::{Vector2, Vector3}; - -use super::{texture::Texture2D, vr::VrStereoConfig, RaylibHandle, RaylibRenderLoop, RaylibThread}; -use crate::ffi::{self, BoundingBox, Camera2D, Camera3D, Color, NPatchInfo, Rectangle}; +use super::{texture::Texture2D, vr::VrStereoConfig, RaylibHandle, RaylibThread}; +use crate::ffi::{ + self, BlendMode, BoundingBox, Camera2D, Camera3D, Color, NPatchInfo, Rectangle, Vector2, + Vector3, +}; use std::{convert::AsRef, ffi::CString, marker::PhantomData}; @@ -44,9 +45,8 @@ where } } -// Only the DrawHandle and the RaylibRenderLoop can start a texture +// Only the DrawHandle can start a texture impl RaylibTextureModeExt for RaylibDrawHandle<'_> {} -impl RaylibTextureModeExt for &mut RaylibRenderLoop<'_> {} impl RaylibDraw for RaylibTextureMode<'_, T> {} // VR Stuff @@ -202,7 +202,7 @@ where Self: Sized, { #[must_use] - fn begin_blend_mode(&self, blend_mode: crate::consts::BlendMode) -> RaylibBlendMode { + fn begin_blend_mode(&self, blend_mode: BlendMode) -> RaylibBlendMode { unsafe { ffi::BeginBlendMode((blend_mode as u32) as i32) } RaylibBlendMode(self) } @@ -281,9 +281,9 @@ pub trait RaylibDraw { /// Draws a pixel (Vector version). #[inline] - fn draw_pixel_v(&self, position: Vector2, color: Color) { + fn draw_pixel_v(&self, position: Vector2, color: Color) { unsafe { - ffi::DrawPixelV(position.into(), color); + ffi::DrawPixelV(position, color); } } @@ -304,63 +304,45 @@ pub trait RaylibDraw { /// Draws a line (Vector version). #[inline] - fn draw_line_v(&self, start_pos: Vector2, end_pos: Vector2, color: Color) { + fn draw_line_v(&self, start_pos: Vector2, end_pos: Vector2, color: Color) { unsafe { - ffi::DrawLineV(start_pos.into(), end_pos.into(), color); + ffi::DrawLineV(start_pos, end_pos, color); } } /// Draws a line with thickness. #[inline] - fn draw_line_ex( - &self, - start_pos: Vector2, - end_pos: Vector2, - thick: f32, - color: Color, - ) { + fn draw_line_ex(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { unsafe { - ffi::DrawLineEx(start_pos.into(), end_pos.into(), thick, color); + ffi::DrawLineEx(start_pos, end_pos, thick, color); } } /// Draws a line using cubic-bezier curves in-out. #[inline] - fn draw_line_bezier( - &self, - start_pos: Vector2, - end_pos: Vector2, - thick: f32, - color: Color, - ) { + fn draw_line_bezier(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { unsafe { - ffi::DrawLineBezier(start_pos.into(), end_pos.into(), thick, color); + ffi::DrawLineBezier(start_pos, end_pos, thick, color); } } /// Draw line using quadratic bezier curves with a control point #[inline] fn draw_line_bezier_quad( &self, - start_pos: Vector2, - end_pos: Vector2, - control_pos: Vector2, + start_pos: Vector2, + end_pos: Vector2, + control_pos: Vector2, thick: f32, color: Color, ) { unsafe { - ffi::DrawLineBezierQuad( - start_pos.into(), - end_pos.into(), - control_pos.into(), - thick, - color, - ); + ffi::DrawLineBezierQuad(start_pos, end_pos, control_pos, thick, color); } } /// Draw lines sequence #[inline] - fn draw_line_strip(&self, points: &[Vector2], color: Color) { + fn draw_line_strip(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawLineStrip( points.as_ptr() as *mut ffi::Vector2, @@ -381,7 +363,7 @@ pub trait RaylibDraw { #[inline] fn draw_circle_sector( &self, - center: Vector2, + center: Vector2, radius: f32, start_angle: f32, end_angle: f32, @@ -389,14 +371,7 @@ pub trait RaylibDraw { color: Color, ) { unsafe { - ffi::DrawCircleSector( - center.into(), - radius, - start_angle, - end_angle, - segments, - color, - ); + ffi::DrawCircleSector(center, radius, start_angle, end_angle, segments, color); } } @@ -404,7 +379,7 @@ pub trait RaylibDraw { #[inline] fn draw_circle_sector_lines( &self, - center: Vector2, + center: Vector2, radius: f32, start_angle: f32, end_angle: f32, @@ -412,14 +387,7 @@ pub trait RaylibDraw { color: Color, ) { unsafe { - ffi::DrawCircleSectorLines( - center.into(), - radius, - start_angle, - end_angle, - segments, - color, - ) + ffi::DrawCircleSectorLines(center, radius, start_angle, end_angle, segments, color) } } @@ -438,8 +406,8 @@ pub trait RaylibDraw { /// Draws a color-filled circle (Vector version). #[inline] - fn draw_circle_v(&self, center: Vector2, radius: f32, color: Color) { - unsafe { ffi::DrawCircleV(center.into(), radius, color) } + fn draw_circle_v(&self, center: Vector2, radius: f32, color: Color) { + unsafe { ffi::DrawCircleV(center, radius, color) } } /// Draws circle outline. @@ -484,7 +452,7 @@ pub trait RaylibDraw { #[inline] fn draw_ring( &self, - center: Vector2, + center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, @@ -494,7 +462,7 @@ pub trait RaylibDraw { ) { unsafe { ffi::DrawRing( - center.into(), + center, inner_radius, outer_radius, start_angle, @@ -509,7 +477,7 @@ pub trait RaylibDraw { #[inline] fn draw_ring_lines( &self, - center: Vector2, + center: Vector2, inner_radius: f32, outer_radius: f32, start_angle: f32, @@ -519,7 +487,7 @@ pub trait RaylibDraw { ) { unsafe { ffi::DrawRingLines( - center.into(), + center, inner_radius, outer_radius, start_angle, @@ -540,9 +508,9 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle (Vector version). #[inline] - fn draw_rectangle_v(&self, position: Vector2, size: Vector2, color: Color) { + fn draw_rectangle_v(&self, position: Vector2, size: Vector2, color: Color) { unsafe { - ffi::DrawRectangleV(position.into(), size.into(), color); + ffi::DrawRectangleV(position, size, color); } } @@ -556,15 +524,9 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle with pro parameters. #[inline] - fn draw_rectangle_pro( - &self, - rec: Rectangle, - origin: Vector2, - rotation: f32, - color: Color, - ) { + fn draw_rectangle_pro(&self, rec: Rectangle, origin: Vector2, rotation: f32, color: Color) { unsafe { - ffi::DrawRectanglePro(rec, origin.into(), rotation, color); + ffi::DrawRectanglePro(rec, origin, rotation, color); } } @@ -617,13 +579,7 @@ pub trait RaylibDraw { col4: Color, ) { unsafe { - ffi::DrawRectangleGradientEx( - rec, - col1, - col2, - col3, - col4, - ); + ffi::DrawRectangleGradientEx(rec, col1, col2, col3, col4); } } @@ -667,29 +623,23 @@ pub trait RaylibDraw { /// Draws a triangle. #[inline] - fn draw_triangle(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { + fn draw_triangle(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { unsafe { - ffi::DrawTriangle(v1.into(), v2.into(), v3.into(), color); + ffi::DrawTriangle(v1, v2, v3, color); } } /// Draws a triangle using lines. #[inline] - fn draw_triangle_lines( - &self, - v1: Vector2, - v2: Vector2, - v3: Vector2, - color: Color, - ) { + fn draw_triangle_lines(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { unsafe { - ffi::DrawTriangleLines(v1.into(), v2.into(), v3.into(), color); + ffi::DrawTriangleLines(v1, v2, v3, color); } } /// Draw a triangle fan defined by points. #[inline] - fn draw_triangle_fan(&self, points: &[Vector2], color: Color) { + fn draw_triangle_fan(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawTriangleFan( points.as_ptr() as *mut ffi::Vector2, @@ -701,7 +651,7 @@ pub trait RaylibDraw { /// Draw a triangle strip defined by points #[inline] - fn draw_triangle_strip(&self, points: &[Vector2], color: Color) { + fn draw_triangle_strip(&self, points: &[Vector2], color: Color) { unsafe { ffi::DrawTriangleStrip( points.as_ptr() as *mut ffi::Vector2, @@ -713,16 +663,9 @@ pub trait RaylibDraw { /// Draws a regular polygon of n sides (Vector version). #[inline] - fn draw_poly( - &self, - center: Vector2, - sides: i32, - radius: f32, - rotation: f32, - color: Color, - ) { + fn draw_poly(&self, center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) { unsafe { - ffi::DrawPoly(center.into(), sides, radius, rotation, color); + ffi::DrawPoly(center, sides, radius, rotation, color); } } @@ -730,14 +673,14 @@ pub trait RaylibDraw { #[inline] fn draw_poly_lines( &self, - center: Vector2, + center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color, ) { unsafe { - ffi::DrawPolyLines(center.into(), sides, radius, rotation, color); + ffi::DrawPolyLines(center, sides, radius, rotation, color); } } @@ -751,14 +694,9 @@ pub trait RaylibDraw { /// Draws a `texture` using specified `position` vector and `tint` color. #[inline] - fn draw_texture_v( - &self, - texture: impl AsRef, - position: Vector2, - tint: Color, - ) { + fn draw_texture_v(&self, texture: impl AsRef, position: Vector2, tint: Color) { unsafe { - ffi::DrawTextureV(*texture.as_ref(), position.into(), tint); + ffi::DrawTextureV(*texture.as_ref(), position, tint); } } @@ -767,13 +705,13 @@ pub trait RaylibDraw { fn draw_texture_ex( &self, texture: impl AsRef, - position: Vector2, + position: Vector2, rotation: f32, scale: f32, tint: Color, ) { unsafe { - ffi::DrawTextureEx(*texture.as_ref(), position.into(), rotation, scale, tint); + ffi::DrawTextureEx(*texture.as_ref(), position, rotation, scale, tint); } } @@ -783,11 +721,11 @@ pub trait RaylibDraw { &self, texture: impl AsRef, source_rec: Rectangle, - position: Vector2, + position: Vector2, tint: Color, ) { unsafe { - ffi::DrawTextureRec(*texture.as_ref(), source_rec, position.into(), tint); + ffi::DrawTextureRec(*texture.as_ref(), source_rec, position, tint); } } @@ -798,7 +736,7 @@ pub trait RaylibDraw { texture: impl AsRef, n_patch_info: NPatchInfo, dest_rec: Rectangle, - origin: Vector2, + origin: Vector2, rotation: f32, tint: Color, ) { @@ -807,7 +745,7 @@ pub trait RaylibDraw { *texture.as_ref(), n_patch_info, dest_rec, - origin.into(), + origin, rotation, tint, ); @@ -837,7 +775,7 @@ pub trait RaylibDraw { &self, font: impl AsRef, text: &str, - position: Vector2, + position: Vector2, font_size: f32, spacing: f32, tint: Color, @@ -847,7 +785,7 @@ pub trait RaylibDraw { ffi::DrawTextEx( *font.as_ref(), c_text.as_ptr(), - position.into(), + position, font_size, spacing, tint, @@ -861,12 +799,12 @@ pub trait RaylibDraw { &self, font: impl AsRef, codepoint: i32, - position: Vector2, + position: Vector2, scale: f32, tint: Color, ) { unsafe { - ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position.into(), scale, tint); + ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position, scale, tint); } } } @@ -874,23 +812,23 @@ pub trait RaylibDraw { pub trait RaylibDraw3D { /// Draw a point in 3D space, actually a small line #[inline] - fn draw_point_3d(&self, position: Vector3, color: Color) { + fn draw_point_3d(&self, position: Vector3, color: Color) { unsafe { - ffi::DrawPoint3D(position.into(), color); + ffi::DrawPoint3D(position, color); } } ///// Draw a color-filled triangle (vertex in counter-clockwise order!) #[inline] - fn draw_triangle_3d(&self, v1: Vector3, v2: Vector3, v3: Vector3, color: Color) { + fn draw_triangle_3d(&self, v1: Vector3, v2: Vector3, v3: Vector3, color: Color) { unsafe { - ffi::DrawTriangle3D(v1.into(), v2.into(), v3.into(), color); + ffi::DrawTriangle3D(v1, v2, v3, color); } } /// // Draw a triangle strip defined by points #[inline] - fn draw_triangle_strip_3d(&self, points: &[Vector3], color: Color) { + fn draw_triangle_strip_3d(&self, points: &[Vector3], color: Color) { unsafe { ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color); } @@ -898,9 +836,9 @@ pub trait RaylibDraw3D { /// Draws a line in 3D world space. #[inline] - fn draw_line_3d(&self, start_pos: Vector3, end_pos: Vector3, color: Color) { + fn draw_line_3d(&self, start_pos: Vector3, end_pos: Vector3, color: Color) { unsafe { - ffi::DrawLine3D(start_pos.into(), end_pos.into(), color); + ffi::DrawLine3D(start_pos, end_pos, color); } } @@ -908,43 +846,30 @@ pub trait RaylibDraw3D { #[inline] fn draw_circle_3d( &self, - center: Vector3, + center: Vector3, radius: f32, - rotation_axis: Vector3, + rotation_axis: Vector3, rotation_angle: f32, color: Color, ) { unsafe { - ffi::DrawCircle3D( - center.into(), - radius, - rotation_axis.into(), - rotation_angle, - color, - ); + ffi::DrawCircle3D(center, radius, rotation_axis, rotation_angle, color); } } /// Draws a cube. #[inline] - fn draw_cube( - &self, - position: Vector3, - width: f32, - height: f32, - length: f32, - color: Color, - ) { + fn draw_cube(&self, position: Vector3, width: f32, height: f32, length: f32, color: Color) { unsafe { - ffi::DrawCube(position.into(), width, height, length, color); + ffi::DrawCube(position, width, height, length, color); } } /// Draws a cube (Vector version). #[inline] - fn draw_cube_v(&self, position: Vector3, size: Vector3, color: Color) { + fn draw_cube_v(&self, position: Vector3, size: Vector3, color: Color) { unsafe { - ffi::DrawCubeV(position.into(), size.into(), color); + ffi::DrawCubeV(position, size, color); } } @@ -952,22 +877,22 @@ pub trait RaylibDraw3D { #[inline] fn draw_cube_wires( &self, - position: Vector3, + position: Vector3, width: f32, height: f32, length: f32, color: Color, ) { unsafe { - ffi::DrawCubeWires(position.into(), width, height, length, color); + ffi::DrawCubeWires(position, width, height, length, color); } } /// Draws a sphere. #[inline] - fn draw_sphere(&self, center_pos: Vector3, radius: f32, color: Color) { + fn draw_sphere(&self, center_pos: Vector3, radius: f32, color: Color) { unsafe { - ffi::DrawSphere(center_pos.into(), radius, color); + ffi::DrawSphere(center_pos, radius, color); } } @@ -975,14 +900,14 @@ pub trait RaylibDraw3D { #[inline] fn draw_sphere_ex( &self, - center_pos: Vector3, + center_pos: Vector3, radius: f32, rings: i32, slices: i32, color: Color, ) { unsafe { - ffi::DrawSphereEx(center_pos.into(), radius, rings, slices, color); + ffi::DrawSphereEx(center_pos, radius, rings, slices, color); } } @@ -990,14 +915,14 @@ pub trait RaylibDraw3D { #[inline] fn draw_sphere_wires( &self, - center_pos: Vector3, + center_pos: Vector3, radius: f32, rings: i32, slices: i32, color: Color, ) { unsafe { - ffi::DrawSphereWires(center_pos.into(), radius, rings, slices, color); + ffi::DrawSphereWires(center_pos, radius, rings, slices, color); } } @@ -1005,7 +930,7 @@ pub trait RaylibDraw3D { #[inline] fn draw_cylinder( &self, - position: Vector3, + position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, @@ -1013,14 +938,7 @@ pub trait RaylibDraw3D { color: Color, ) { unsafe { - ffi::DrawCylinder( - position.into(), - radius_top, - radius_bottom, - height, - slices, - color, - ); + ffi::DrawCylinder(position, radius_top, radius_bottom, height, slices, color); } } @@ -1028,7 +946,7 @@ pub trait RaylibDraw3D { #[inline] fn draw_cylinder_wires( &self, - position: Vector3, + position: Vector3, radius_top: f32, radius_bottom: f32, height: f32, @@ -1036,22 +954,15 @@ pub trait RaylibDraw3D { color: Color, ) { unsafe { - ffi::DrawCylinderWires( - position.into(), - radius_top, - radius_bottom, - height, - slices, - color, - ); + ffi::DrawCylinderWires(position, radius_top, radius_bottom, height, slices, color); } } /// Draws an X/Z plane. #[inline] - fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { + fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { unsafe { - ffi::DrawPlane(center_pos.into(), size.into(), color); + ffi::DrawPlane(center_pos, size, color); } } @@ -1076,12 +987,12 @@ pub trait RaylibDraw3D { fn draw_model( &self, model: impl AsRef, - position: Vector3, + position: Vector3, scale: f32, tint: Color, ) { unsafe { - ffi::DrawModel(*model.as_ref(), position.into(), scale, tint); + ffi::DrawModel(*model.as_ref(), position, scale, tint); } } @@ -1090,19 +1001,19 @@ pub trait RaylibDraw3D { fn draw_model_ex( &self, model: impl AsRef, - position: Vector3, - rotation_axis: Vector3, + position: Vector3, + rotation_axis: Vector3, rotation_angle: f32, - scale: Vector3, + scale: Vector3, tint: Color, ) { unsafe { ffi::DrawModelEx( *model.as_ref(), - position.into(), - rotation_axis.into(), + position, + rotation_axis, rotation_angle, - scale.into(), + scale, tint, ); } @@ -1113,12 +1024,12 @@ pub trait RaylibDraw3D { fn draw_model_wires( &self, model: impl AsRef, - position: Vector3, + position: Vector3, scale: f32, tint: Color, ) { unsafe { - ffi::DrawModelWires(*model.as_ref(), position.into(), scale, tint); + ffi::DrawModelWires(*model.as_ref(), position, scale, tint); } } @@ -1127,19 +1038,19 @@ pub trait RaylibDraw3D { fn draw_model_wires_ex( &self, model: impl AsRef, - position: Vector3, - rotation_axis: Vector3, + position: Vector3, + rotation_axis: Vector3, rotation_angle: f32, - scale: Vector3, + scale: Vector3, tint: Color, ) { unsafe { ffi::DrawModelWiresEx( *model.as_ref(), - position.into(), - rotation_axis.into(), + position, + rotation_axis, rotation_angle, - scale.into(), + scale, tint, ); } @@ -1159,12 +1070,12 @@ pub trait RaylibDraw3D { &self, camera: Camera3D, texture: &Texture2D, - center: Vector3, + center: Vector3, size: f32, tint: Color, ) { unsafe { - ffi::DrawBillboard(camera, texture.0, center.into(), size, tint); + ffi::DrawBillboard(camera, texture.0, center, size, tint); } } @@ -1175,19 +1086,12 @@ pub trait RaylibDraw3D { camera: Camera3D, texture: &Texture2D, source_rec: Rectangle, - center: Vector3, - size: Vector2, + center: Vector3, + size: Vector2, tint: Color, ) { unsafe { - ffi::DrawBillboardRec( - camera, - texture.0, - source_rec, - center.into(), - size.into(), - tint, - ); + ffi::DrawBillboardRec(camera, texture.0, source_rec, center, size, tint); } } } diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index 4ba6ea39..d6cb2010 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -1,13 +1,8 @@ //! Keyboard, Controller, and Mouse related functions use std::ffi::CStr; -use mint::Vector2; - use super::RaylibHandle; -use crate::{ - consts::{GamepadButton, Gesture, KeyboardKey, MouseButton, GamepadAxis}, - ffi, -}; +use crate::ffi::{self, GamepadAxis, GamepadButton, Gesture, KeyboardKey, MouseButton, Vector2}; impl RaylibHandle<'_> { /// Detect if a key has been pressed once. @@ -177,19 +172,19 @@ impl RaylibHandle<'_> { /// Returns mouse position. #[inline] - pub fn get_mouse_position(&self) -> Vector2 { - unsafe { ffi::GetMousePosition().into() } + pub fn get_mouse_position(&self) -> Vector2 { + unsafe { ffi::GetMousePosition() } } /// Returns mouse delta between frames. #[inline] - pub fn get_mouse_delta(&self) -> Vector2 { - unsafe { ffi::GetMouseDelta().into() } + pub fn get_mouse_delta(&self) -> Vector2 { + unsafe { ffi::GetMouseDelta() } } /// Sets mouse position. #[inline] - pub fn set_mouse_position(&self, position: Vector2) { + pub fn set_mouse_position(&self, position: Vector2) { unsafe { let Vector2 { x, y } = position; ffi::SetMousePosition(x as i32, y as i32); @@ -198,7 +193,7 @@ impl RaylibHandle<'_> { /// Sets mouse offset. #[inline] - pub fn set_mouse_offset(&self, offset: Vector2) { + pub fn set_mouse_offset(&self, offset: Vector2) { unsafe { let Vector2 { x, y } = offset; ffi::SetMouseOffset(x as i32, y as i32); @@ -233,8 +228,8 @@ impl RaylibHandle<'_> { /// Returns touch position XY for a touch point index (relative to screen size). #[inline] - pub fn get_touch_position(&self, index: u32) -> Vector2 { - unsafe { ffi::GetTouchPosition(index as i32).into() } + pub fn get_touch_position(&self, index: u32) -> Vector2 { + unsafe { ffi::GetTouchPosition(index as i32) } } /// Enables a set of gestures using flags. @@ -277,8 +272,8 @@ impl RaylibHandle<'_> { /// Gets gesture drag vector. #[inline] - pub fn get_gesture_drag_vector(&self) -> Vector2 { - unsafe { ffi::GetGestureDragVector().into() } + pub fn get_gesture_drag_vector(&self) -> Vector2 { + unsafe { ffi::GetGestureDragVector() } } /// Gets gesture drag angle. @@ -289,8 +284,8 @@ impl RaylibHandle<'_> { /// Gets gesture pinch delta. #[inline] - pub fn get_gesture_pinch_vector(&self) -> Vector2 { - unsafe { ffi::GetGesturePinchVector().into() } + pub fn get_gesture_pinch_vector(&self) -> Vector2 { + unsafe { ffi::GetGesturePinchVector() } } /// Gets gesture pinch angle. @@ -301,7 +296,7 @@ impl RaylibHandle<'_> { } pub fn key_from_i32(key: i32) -> Option { - use crate::consts::KeyboardKey::*; + use ffi::KeyboardKey::*; match key { 39 => Some(KEY_APOSTROPHE), 44 => Some(KEY_COMMA), diff --git a/raylib/src/core/logging.rs b/raylib/src/core/logging.rs index 03092a22..419a4c6b 100644 --- a/raylib/src/core/logging.rs +++ b/raylib/src/core/logging.rs @@ -2,15 +2,12 @@ // TODO: refactor this entire thing to use log use std::ffi::CString; -use crate::consts::TraceLogLevel; -use crate::ffi; +use crate::ffi::{self, TraceLogLevel}; /// Set the current threshold (minimum) log level #[inline] -pub fn set_trace_log(types: TraceLogLevel) { - unsafe { - ffi::SetTraceLogLevel((types as u32) as i32); - } +pub fn set_trace_log_level(types: TraceLogLevel) { + unsafe { ffi::SetTraceLogLevel((types as u32) as i32) } } /// Writes a trace log message (`Log::INFO`, `Log::WARNING`, `Log::ERROR`, `Log::DEBUG`). @@ -27,9 +24,9 @@ mod test_logging { use super::*; #[test] fn test_logs() { - use crate::consts::TraceLogLevel::*; - set_trace_log(LOG_ALL); + use ffi::TraceLogLevel::*; + set_trace_log_level(LOG_ALL); trace_log(LOG_DEBUG, "This Is From `test_logs`"); - set_trace_log(LOG_INFO); + set_trace_log_level(LOG_INFO); } } diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index c847c40f..2f308334 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -1,7 +1,6 @@ //! Useful functions that don't fit anywhere else use std::ffi::CString; -use super::RaylibRenderLoop; use crate::{ core::{texture::Image, RaylibHandle, RaylibThread}, ffi, @@ -43,14 +42,14 @@ pub unsafe extern "C" fn trace_log_trampoline( pub fn set_trace_log_callback(callback: C) {} */ -impl RaylibRenderLoop<'_> { +impl RaylibHandle<'_> { /// Load pixels from the screen into a CPU image - pub fn load_image_from_screen(&mut self, _: &RaylibThread) -> Image { + pub fn load_image_from_screen(&self, _: &RaylibThread) -> Image { unsafe { Image(ffi::LoadImageFromScreen()) } } /// Takes a screenshot of current screen (saved a .png) - pub fn take_screenshot(&mut self, _: &RaylibThread, filename: &str) { + pub fn take_screenshot(&self, _: &RaylibThread, filename: &str) { let c_filename = CString::new(filename).unwrap(); unsafe { ffi::TakeScreenshot(c_filename.as_ptr()); diff --git a/raylib/src/core/mod.rs b/raylib/src/core/mod.rs index 5f5ed90d..c6657dee 100644 --- a/raylib/src/core/mod.rs +++ b/raylib/src/core/mod.rs @@ -1,8 +1,3 @@ -#[macro_use] -mod macros; - -pub mod audio; -pub mod buffer; pub mod camera; pub mod collision; pub mod data; @@ -62,9 +57,6 @@ pub struct RaylibThread(PhantomData<*const ()>); #[derive(Debug)] pub struct RaylibHandle<'rl>(RefCell>); // inner field is private, preventing manual construction -#[derive(Debug)] -pub struct RaylibRenderLoop<'a>(RefCell>); - impl<'th, 'a: 'th> RaylibHandle<'a> { /// Render a frame. /// Returns the frame_fn return value unmodifed. @@ -184,7 +176,7 @@ impl RaylibBuilder { /// /// Attempting to initialize Raylib more than once will result in a panic. pub fn build(&self) -> (RaylibHandle<'static>, RaylibThread) { - use crate::consts::ConfigFlags::*; + use ffi::ConfigFlags::*; let mut flags = 0u32; if self.fullscreen_mode { flags |= FLAG_FULLSCREEN_MODE as u32; diff --git a/raylib/src/core/models.rs b/raylib/src/core/models.rs index cc35293c..6ab590e5 100644 --- a/raylib/src/core/models.rs +++ b/raylib/src/core/models.rs @@ -4,14 +4,14 @@ use core::slice; use std::{ffi::CString, mem}; use super::{ + shaders::Shader, texture::{Image, Texture2D}, - RaylibHandle, RaylibThread, shaders::Shader, + RaylibHandle, RaylibThread, }; use crate::{ - consts, - ffi::{self, BoundingBox, Color}, + ffi::{self, BoundingBox, Color, Vector3}, + make_bound_thin_wrapper, make_thin_wrapper, }; -use mint::Vector3; fn no_drop(_thing: T) {} @@ -188,50 +188,50 @@ pub trait RaylibModel: AsRef + AsMut { impl RaylibMesh for Mesh {} pub trait RaylibMesh: AsRef + AsMut { - fn vertices(&self) -> &[Vector3] { + fn vertices(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().vertices as *const Vector3, + self.as_ref().vertices as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn vertices_mut(&mut self) -> &mut [Vector3] { + fn vertices_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().vertices as *mut Vector3, + self.as_mut().vertices as *mut Vector3, self.as_mut().vertexCount as usize, ) } } - fn normals(&self) -> &[Vector3] { + fn normals(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().normals as *const Vector3, + self.as_ref().normals as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn normals_mut(&mut self) -> &mut [Vector3] { + fn normals_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().normals as *mut Vector3, + self.as_mut().normals as *mut Vector3, self.as_mut().vertexCount as usize, ) } } - fn tangents(&self) -> &[Vector3] { + fn tangents(&self) -> &[Vector3] { unsafe { std::slice::from_raw_parts( - self.as_ref().tangents as *const Vector3, + self.as_ref().tangents as *const Vector3, self.as_ref().vertexCount as usize, ) } } - fn tangents_mut(&mut self) -> &mut [Vector3] { + fn tangents_mut(&mut self) -> &mut [Vector3] { unsafe { std::slice::from_raw_parts_mut( - self.as_mut().tangents as *mut Vector3, + self.as_mut().tangents as *mut Vector3, self.as_mut().vertexCount as usize, ) } @@ -319,14 +319,14 @@ pub trait RaylibMesh: AsRef + AsMut { /// Generates heightmap mesh from image data. #[inline] - fn gen_mesh_heightmap(_: &RaylibThread, heightmap: &Image, size: Vector3) -> Mesh { - unsafe { Mesh(ffi::GenMeshHeightmap(heightmap.0, size.into())) } + fn gen_mesh_heightmap(_: &RaylibThread, heightmap: &Image, size: Vector3) -> Mesh { + unsafe { Mesh(ffi::GenMeshHeightmap(heightmap.0, size)) } } /// Generates cubes-based map mesh from image data. #[inline] - fn gen_mesh_cubicmap(_: &RaylibThread, cubicmap: &Image, cube_size: Vector3) -> Mesh { - unsafe { Mesh(ffi::GenMeshCubicmap(cubicmap.0, cube_size.into())) } + fn gen_mesh_cubicmap(_: &RaylibThread, cubicmap: &Image, cube_size: Vector3) -> Mesh { + unsafe { Mesh(ffi::GenMeshCubicmap(cubicmap.0, cube_size)) } } /// Computes mesh bounding box limits. @@ -390,7 +390,7 @@ pub trait RaylibMaterial: AsRef + AsMut { unsafe { std::slice::from_raw_parts( self.as_ref().maps as *const MaterialMap, - consts::MAX_MATERIAL_MAPS as usize, + ffi::MAX_MATERIAL_MAPS as usize, ) } } @@ -399,14 +399,14 @@ pub trait RaylibMaterial: AsRef + AsMut { unsafe { std::slice::from_raw_parts_mut( self.as_mut().maps as *mut MaterialMap, - consts::MAX_MATERIAL_MAPS as usize, + ffi::MAX_MATERIAL_MAPS as usize, ) } } fn set_material_texture( &mut self, - map_type: crate::consts::MaterialMapIndex, + map_type: ffi::MaterialMapIndex, texture: impl AsRef, ) { unsafe { diff --git a/raylib/src/core/shaders.rs b/raylib/src/core/shaders.rs index fb0c1fe5..54e1725e 100644 --- a/raylib/src/core/shaders.rs +++ b/raylib/src/core/shaders.rs @@ -4,8 +4,8 @@ use std::mem::ManuallyDrop; use std::os::raw::{c_char, c_void}; use super::{RaylibHandle, RaylibThread}; -use crate::{consts::ShaderUniformDataType, ffi}; -use mint::{ColumnMatrix4, Vector2, Vector3, Vector4}; +use crate::ffi::{self, Matrix, ShaderUniformDataType, Vector2, Vector3, Vector4}; +use crate::make_bound_thin_wrapper; make_bound_thin_wrapper!(Shader, ffi::Shader, ffi::UnloadShader, RaylibHandle<'bind>); @@ -89,24 +89,24 @@ impl ShaderV for f32 { } } -impl ShaderV for Vector2 { +impl ShaderV for Vector2 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC2; unsafe fn value(&self) -> *const c_void { - self as *const Vector2 as *const c_void + self as *const Vector2 as *const c_void } } -impl ShaderV for Vector3 { +impl ShaderV for Vector3 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC3; unsafe fn value(&self) -> *const c_void { - self as *const Vector3 as *const c_void + self as *const Vector3 as *const c_void } } -impl ShaderV for Vector4 { +impl ShaderV for Vector4 { const UNIFORM_TYPE: ShaderUniformDataType = ShaderUniformDataType::SHADER_UNIFORM_VEC4; unsafe fn value(&self) -> *const c_void { - self as *const Vector4 as *const c_void + self as *const Vector4 as *const c_void } } @@ -196,9 +196,9 @@ impl<'bind, 'a> Shader<'bind, 'a> { /// Sets shader uniform value (matrix 4x4). #[inline] - pub fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: ColumnMatrix4) { + pub fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: Matrix) { unsafe { - ffi::SetShaderValueMatrix(self.0, uniform_loc, mat.into()); + ffi::SetShaderValueMatrix(self.0, uniform_loc, mat); } } @@ -264,9 +264,9 @@ pub trait RaylibShader: AsRef + AsMut { /// Sets shader uniform value (matrix 4x4). #[inline] - fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: ColumnMatrix4) { + fn set_shader_value_matrix(&mut self, uniform_loc: i32, mat: Matrix) { unsafe { - ffi::SetShaderValueMatrix(*self.as_mut(), uniform_loc, mat.into()); + ffi::SetShaderValueMatrix(*self.as_mut(), uniform_loc, mat); } } @@ -282,29 +282,29 @@ pub trait RaylibShader: AsRef + AsMut { impl<'a> RaylibHandle<'a> { /// Sets a custom projection matrix (replaces internal projection matrix). #[inline] - pub fn set_matrix_projection(&mut self, _: &RaylibThread, proj: ColumnMatrix4) { + pub fn set_matrix_projection(&mut self, _: &RaylibThread, proj: Matrix) { unsafe { - ffi::rlSetMatrixProjection(proj.into()); + ffi::rlSetMatrixProjection(proj); } } /// Sets a custom modelview matrix (replaces internal modelview matrix). #[inline] - pub fn set_matrix_modelview(&mut self, _: &RaylibThread, view: ColumnMatrix4) { + pub fn set_matrix_modelview(&mut self, _: &RaylibThread, view: Matrix) { unsafe { - ffi::rlSetMatrixModelview(view.into()); + ffi::rlSetMatrixModelview(view); } } /// Gets internal modelview matrix. #[inline] - pub fn get_matrix_modelview(&self) -> ColumnMatrix4 { - unsafe { ffi::rlGetMatrixModelview().into() } + pub fn get_matrix_modelview(&self) -> Matrix { + unsafe { ffi::rlGetMatrixModelview() } } /// Gets internal projection matrix. #[inline] - pub fn get_matrix_projection(&self) -> ColumnMatrix4 { - unsafe { ffi::rlGetMatrixProjection().into() } + pub fn get_matrix_projection(&self) -> Matrix { + unsafe { ffi::rlGetMatrixProjection() } } } diff --git a/raylib/src/core/text.rs b/raylib/src/core/text.rs index 71457ef7..92e7d54c 100644 --- a/raylib/src/core/text.rs +++ b/raylib/src/core/text.rs @@ -7,12 +7,14 @@ use std::mem::ManuallyDrop; use std::ptr; use super::{ - buffer::RaylibBuffer, texture::{Image, Texture2D}, RaylibHandle, RaylibThread, }; -use crate::ffi::{self, Color}; -use mint::Vector2; +use crate::{ + buffer::RaylibBuffer, + ffi::{self, Color, Rectangle, Vector2}, + make_bound_thin_wrapper, make_thin_wrapper, +}; fn no_drop(_thing: T) {} make_bound_thin_wrapper!(Font, ffi::Font, ffi::UnloadFont, RaylibHandle<'bind>); @@ -279,7 +281,7 @@ pub fn gen_image_font_atlas( font_size: i32, padding: i32, pack_method: i32, -) -> Option<(Image, RaylibBuffer<'static, ffi::Rectangle>)> { +) -> Option<(Image, RaylibBuffer<'static, Rectangle>)> { unsafe { let mut ptr = ptr::null_mut(); @@ -292,7 +294,7 @@ pub fn gen_image_font_atlas( pack_method, )); - let buffer = RaylibBuffer::::new(ptr, chars.len()); + let buffer = RaylibBuffer::::new(ptr, chars.len()); buffer.map(|b| (img, b)) } @@ -320,9 +322,9 @@ pub fn measure_text_ex( text: &str, font_size: f32, spacing: f32, -) -> Vector2 { +) -> Vector2 { let c_text = CString::new(text).unwrap(); - unsafe { ffi::MeasureTextEx(*font.as_ref(), c_text.as_ptr(), font_size, spacing).into() } + unsafe { ffi::MeasureTextEx(*font.as_ref(), c_text.as_ptr(), font_size, spacing) } } /// Gets index position for a unicode character on `font`. diff --git a/raylib/src/core/texture.rs b/raylib/src/core/texture.rs index 4d123604..b7787bfc 100644 --- a/raylib/src/core/texture.rs +++ b/raylib/src/core/texture.rs @@ -1,12 +1,14 @@ //! Image and texture related functions use std::ffi::CString; -use mint::Vector2; - -use super::{buffer::RaylibBuffer, RaylibHandle, RaylibThread}; +use super::{RaylibHandle, RaylibThread}; use crate::{ - consts::{NPatchLayout, PixelFormat}, - ffi::{self, Color, Rectangle}, + buffer::RaylibBuffer, + ffi::{ + self, Color, CubemapLayout, NPatchLayout, PixelFormat, Rectangle, TextureFilter, + TextureWrap, Vector2, + }, + impl_wrapper, make_bound_thin_wrapper, }; #[repr(C)] @@ -32,19 +34,6 @@ impl From for ffi::NPatchInfo { } } -impl From<&NPatchInfo> for ffi::NPatchInfo { - fn from(val: &NPatchInfo) -> Self { - ffi::NPatchInfo { - source: val.source, - left: val.left, - top: val.top, - right: val.right, - bottom: val.bottom, - layout: (val.layout as u32) as i32, - } - } -} - #[repr(transparent)] #[derive(Debug)] pub struct Image(pub(crate) ffi::Image); @@ -292,8 +281,8 @@ impl Image { /// Draw pixel within an image (Vector version) #[inline] - pub fn draw_pixel_v(&mut self, position: Vector2, color: Color) { - unsafe { ffi::ImageDrawPixelV(&mut self.0, position.into(), color) } + pub fn draw_pixel_v(&mut self, position: Vector2, color: Color) { + unsafe { ffi::ImageDrawPixelV(&mut self.0, position, color) } } /// Draw line within an image @@ -320,8 +309,8 @@ impl Image { /// Draw line within an image (Vector version) #[inline] - pub fn draw_line_v(&mut self, start: Vector2, end: Vector2, color: Color) { - unsafe { ffi::ImageDrawLineV(&mut self.0, start.into(), end.into(), color) } + pub fn draw_line_v(&mut self, start: Vector2, end: Vector2, color: Color) { + unsafe { ffi::ImageDrawLineV(&mut self.0, start, end, color) } } /// Draw circle within an image @@ -332,8 +321,8 @@ impl Image { /// Draw circle within an image (Vector version) #[inline] - pub fn draw_circle_v(&mut self, center: Vector2, radius: i32, color: Color) { - unsafe { ffi::ImageDrawCircleV(&mut self.0, center.into(), radius, color) } + pub fn draw_circle_v(&mut self, center: Vector2, radius: i32, color: Color) { + unsafe { ffi::ImageDrawCircleV(&mut self.0, center, radius, color) } } /// Draws a rectangle within an image. @@ -374,7 +363,7 @@ impl Image { &mut self, font: impl AsRef, text: &str, - position: Vector2, + position: Vector2, font_size: f32, spacing: f32, color: Color, @@ -385,7 +374,7 @@ impl Image { &mut self.0, *font.as_ref(), c_text.as_ptr(), - position.into(), + position, font_size, spacing, color, @@ -637,7 +626,7 @@ pub trait RaylibTexture2D: AsRef + AsMut { /// Sets global `texture` scaling filter mode. #[inline] - fn set_texture_filter(&self, _: &RaylibThread, filter_mode: crate::consts::TextureFilter) { + fn set_texture_filter(&self, _: &RaylibThread, filter_mode: TextureFilter) { unsafe { ffi::SetTextureFilter(*self.as_ref(), filter_mode as i32); } @@ -645,7 +634,7 @@ pub trait RaylibTexture2D: AsRef + AsMut { /// Sets global texture wrapping mode. #[inline] - fn set_texture_wrap(&self, _: &RaylibThread, wrap_mode: crate::consts::TextureWrap) { + fn set_texture_wrap(&self, _: &RaylibThread, wrap_mode: TextureWrap) { unsafe { ffi::SetTextureWrap(*self.as_ref(), wrap_mode as i32); } @@ -678,7 +667,7 @@ impl<'bind, 'a> RaylibHandle<'_> { &'bind self, _: &RaylibThread, image: &Image, - layout: crate::consts::CubemapLayout, + layout: CubemapLayout, ) -> Result, String> { let t = unsafe { ffi::LoadTextureCubemap(image.0, layout as i32) }; if t.id == 0 { diff --git a/raylib/src/core/vr.rs b/raylib/src/core/vr.rs index 42d87d86..65cce4fc 100644 --- a/raylib/src/core/vr.rs +++ b/raylib/src/core/vr.rs @@ -1,6 +1,6 @@ //! Vr related functions use super::{RaylibHandle, RaylibThread}; -use crate::ffi; +use crate::{ffi, make_thin_wrapper}; make_thin_wrapper!( VrStereoConfig, diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index eb3d2bb3..259aaa78 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -1,13 +1,14 @@ //! Window manipulation functions use core::ffi::c_char; -use mint::{ColumnMatrix4, Vector2, Vector3}; +use std::ffi::{CStr, CString, IntoStringError, NulError}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use std::ffi::{CStr, CString, IntoStringError, NulError}; use super::{RaylibHandle, RaylibThread}; -use crate::ffi::{self, Camera2D, Camera3D, Ray}; +use crate::ffi::{ + self, Camera2D, Camera3D, ConfigFlags, Matrix, MouseCursor, Ray, Vector2, Vector3, +}; #[cfg(feature = "with_serde")] use serde::{Deserialize, Serialize}; @@ -29,211 +30,211 @@ pub struct WindowState(i32); impl WindowState { pub fn vsync_hint(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_VSYNC_HINT as i32) != 0 + self.0 & (ConfigFlags::FLAG_VSYNC_HINT as i32) != 0 } /// Set to try enabling V-Sync on GPU pub fn set_vsync_hint(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_VSYNC_HINT as i32; + self.0 |= ConfigFlags::FLAG_VSYNC_HINT as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_VSYNC_HINT as i32); + self.0 &= !(ConfigFlags::FLAG_VSYNC_HINT as i32); } self } pub fn fullscreen_mode(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as i32) != 0 + self.0 & (ConfigFlags::FLAG_FULLSCREEN_MODE as i32) != 0 } /// Set to run program in fullscreen pub fn set_fullscreen_mode(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as i32; + self.0 |= ConfigFlags::FLAG_FULLSCREEN_MODE as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as i32); + self.0 &= !(ConfigFlags::FLAG_FULLSCREEN_MODE as i32); } self } pub fn window_resizable(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_RESIZABLE as i32) != 0 } /// Set to allow resizable window pub fn set_window_resizable(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_RESIZABLE as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_RESIZABLE as i32); } self } pub fn window_undecorated(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_UNDECORATED as i32) != 0 } /// Set to disable window decoration (frame and buttons) pub fn set_window_undecorated(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_UNDECORATED as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_UNDECORATED as i32); } self } pub fn window_hidden(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_HIDDEN as i32) != 0 } /// Set to hide window pub fn set_window_hidden(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_HIDDEN as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_HIDDEN as i32); } self } pub fn window_minimized(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_MINIMIZED as i32) != 0 } /// Set to minimize window (iconify) pub fn set_window_minimized(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_MINIMIZED as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_MINIMIZED as i32); } self } pub fn window_maximized(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32) != 0 } /// Set to maximize window (expanded to monitor) pub fn set_window_maximized(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_MAXIMIZED as i32); } self } pub fn window_unfocused(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32) != 0 } /// Set to window non focused pub fn set_window_unfocused(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_UNFOCUSED as i32); } self } pub fn window_topmost(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_TOPMOST as i32) != 0 } /// Set to window always on top pub fn set_window_topmost(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_TOPMOST as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_TOPMOST as i32); } self } pub fn window_always_run(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32) != 0 } /// Set to allow windows running while minimized pub fn set_window_always_run(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as i32); } self } pub fn window_transparent(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32) != 0 } /// Set to allow transparent framebuffer pub fn set_window_transparent(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_TRANSPARENT as i32); } self } pub fn window_highdpi(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as i32) != 0 + self.0 & (ConfigFlags::FLAG_WINDOW_HIGHDPI as i32) != 0 } /// Set to support HighDPI pub fn set_window_highdpi(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as i32; + self.0 |= ConfigFlags::FLAG_WINDOW_HIGHDPI as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as i32); + self.0 &= !(ConfigFlags::FLAG_WINDOW_HIGHDPI as i32); } self } pub fn msaa(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_MSAA_4X_HINT as i32) != 0 + self.0 & (ConfigFlags::FLAG_MSAA_4X_HINT as i32) != 0 } /// Set to try enabling MSAA 4X pub fn set_msaa(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_MSAA_4X_HINT as i32; + self.0 |= ConfigFlags::FLAG_MSAA_4X_HINT as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_MSAA_4X_HINT as i32); + self.0 &= !(ConfigFlags::FLAG_MSAA_4X_HINT as i32); } self } pub fn interlaced_hint(&self) -> bool { - self.0 & (ffi::ConfigFlags::FLAG_INTERLACED_HINT as i32) != 0 + self.0 & (ConfigFlags::FLAG_INTERLACED_HINT as i32) != 0 } /// Set to try enabling interlaced video format (for V3D) pub fn set_interlaced_hint(mut self, enabled: bool) -> Self { if enabled { // set the bit - self.0 |= ffi::ConfigFlags::FLAG_INTERLACED_HINT as i32; + self.0 |= ConfigFlags::FLAG_INTERLACED_HINT as i32; } else { // enable the bit - self.0 &= !(ffi::ConfigFlags::FLAG_INTERLACED_HINT as i32); + self.0 &= !(ConfigFlags::FLAG_INTERLACED_HINT as i32); } self } @@ -270,9 +271,9 @@ pub fn get_monitor_refresh_rate(monitor: i32) -> i32 { /// Get specified monitor position #[inline] -pub fn get_monitor_position(monitor: i32) -> Option> { +pub fn get_monitor_position(monitor: i32) -> Option { if monitor >= 0 && monitor < get_monitor_count() { - Some(unsafe { ffi::GetMonitorPosition(monitor).into() }) + Some(unsafe { ffi::GetMonitorPosition(monitor) }) } else { None } @@ -370,8 +371,8 @@ pub fn get_monitor_info(monitor: i32) -> Result { /// assert_eq!(m, Matrix::identity()); /// } /// ``` -pub fn get_camera_matrix(camera: Camera3D) -> ColumnMatrix4 { - unsafe { ffi::GetCameraMatrix(camera).into() } +pub fn get_camera_matrix(camera: Camera3D) -> Matrix { + unsafe { ffi::GetCameraMatrix(camera) } } /// Returns camera 2D transform matrix (view matrix) @@ -386,8 +387,8 @@ pub fn get_camera_matrix(camera: Camera3D) -> ColumnMatrix4 { /// assert_eq!(m, check); /// } /// ``` -pub fn get_camera_matrix_2d(camera: Camera2D) -> ColumnMatrix4 { - unsafe { ffi::GetCameraMatrix2D(camera).into() } +pub fn get_camera_matrix_2d(camera: Camera2D) -> Matrix { + unsafe { ffi::GetCameraMatrix2D(camera) } } impl RaylibHandle<'_> { @@ -413,34 +414,34 @@ impl RaylibHandle<'_> { // Screen-space-related functions impl RaylibHandle<'_> { /// Returns a ray trace from mouse position - pub fn get_mouse_ray(&self, mouse_position: Vector2, camera: Camera3D) -> Ray { - unsafe { ffi::GetMouseRay(mouse_position.into(), camera) } + pub fn get_mouse_ray(&self, mouse_position: Vector2, camera: Camera3D) -> Ray { + unsafe { ffi::GetMouseRay(mouse_position, camera) } } /// Returns the screen space position for a 3d world space position - pub fn get_world_to_screen(&self, position: Vector3, camera: Camera3D) -> Vector2 { - unsafe { ffi::GetWorldToScreen(position.into(), camera).into() } + pub fn get_world_to_screen(&self, position: Vector3, camera: Camera3D) -> Vector2 { + unsafe { ffi::GetWorldToScreen(position, camera) } } /// Returns the screen space position for a 2d camera world space position - pub fn get_world_to_screen_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { - unsafe { ffi::GetWorldToScreen2D(position.into(), camera).into() } + pub fn get_world_to_screen_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { + unsafe { ffi::GetWorldToScreen2D(position, camera) } } /// Returns size position for a 3d world space position pub fn get_world_to_screen_ex( &self, - position: Vector3, + position: Vector3, camera: Camera3D, width: i32, height: i32, - ) -> Vector2 { - unsafe { ffi::GetWorldToScreenEx(position.into(), camera, width, height).into() } + ) -> Vector2 { + unsafe { ffi::GetWorldToScreenEx(position, camera, width, height) } } /// Returns the world space position for a 2d camera screen space position - pub fn get_screen_to_world_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { - unsafe { ffi::GetScreenToWorld2D(position.into(), camera).into() } + pub fn get_screen_to_world_2d(&self, position: Vector2, camera: Camera2D) -> Vector2 { + unsafe { ffi::GetScreenToWorld2D(position, camera) } } } @@ -544,8 +545,8 @@ impl RaylibHandle<'_> { /// Check if window is currently focused (only PLATFORM_DESKTOP) #[inline] - pub fn get_window_scale_dpi(&self) -> Vector2 { - unsafe { ffi::GetWindowScaleDPI().into() } + pub fn get_window_scale_dpi(&self) -> Vector2 { + unsafe { ffi::GetWindowScaleDPI() } } /// Check if cursor is on the current screen. @@ -556,7 +557,7 @@ impl RaylibHandle<'_> { /// Set mouse cursor #[inline] - pub fn set_mouse_cursor(&self, cursor: crate::consts::MouseCursor) { + pub fn set_mouse_cursor(&self, cursor: MouseCursor) { unsafe { ffi::SetMouseCursor(cursor as i32) } } @@ -606,46 +607,34 @@ impl RaylibHandle<'_> { pub fn get_window_state(&self) -> WindowState { unsafe { WindowState::default() - .set_vsync_hint(ffi::IsWindowState(ffi::ConfigFlags::FLAG_VSYNC_HINT as u32)) - .set_fullscreen_mode(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_FULLSCREEN_MODE as u32, - )) + .set_vsync_hint(ffi::IsWindowState(ConfigFlags::FLAG_VSYNC_HINT as u32)) + .set_fullscreen_mode(ffi::IsWindowState(ConfigFlags::FLAG_FULLSCREEN_MODE as u32)) .set_window_resizable(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_RESIZABLE as u32, + ConfigFlags::FLAG_WINDOW_RESIZABLE as u32, )) .set_window_undecorated(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_UNDECORATED as u32, - )) - .set_window_hidden(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_HIDDEN as u32, + ConfigFlags::FLAG_WINDOW_UNDECORATED as u32, )) + .set_window_hidden(ffi::IsWindowState(ConfigFlags::FLAG_WINDOW_HIDDEN as u32)) .set_window_minimized(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_MINIMIZED as u32, + ConfigFlags::FLAG_WINDOW_MINIMIZED as u32, )) .set_window_maximized(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_MAXIMIZED as u32, + ConfigFlags::FLAG_WINDOW_MAXIMIZED as u32, )) .set_window_unfocused(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_UNFOCUSED as u32, - )) - .set_window_topmost(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_TOPMOST as u32, + ConfigFlags::FLAG_WINDOW_UNFOCUSED as u32, )) + .set_window_topmost(ffi::IsWindowState(ConfigFlags::FLAG_WINDOW_TOPMOST as u32)) .set_window_always_run(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as u32, + ConfigFlags::FLAG_WINDOW_ALWAYS_RUN as u32, )) .set_window_transparent(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_TRANSPARENT as u32, - )) - .set_window_highdpi(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_WINDOW_HIGHDPI as u32, - )) - .set_msaa(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_MSAA_4X_HINT as u32, - )) - .set_interlaced_hint(ffi::IsWindowState( - ffi::ConfigFlags::FLAG_INTERLACED_HINT as u32, + ConfigFlags::FLAG_WINDOW_TRANSPARENT as u32, )) + .set_window_highdpi(ffi::IsWindowState(ConfigFlags::FLAG_WINDOW_HIGHDPI as u32)) + .set_msaa(ffi::IsWindowState(ConfigFlags::FLAG_MSAA_4X_HINT as u32)) + .set_interlaced_hint(ffi::IsWindowState(ConfigFlags::FLAG_INTERLACED_HINT as u32)) } } @@ -720,8 +709,8 @@ impl RaylibHandle<'_> { /// Get window position #[inline] - pub fn get_window_position(&self) -> Vector2 { - unsafe { ffi::GetWindowPosition().into() } + pub fn get_window_position(&self) -> Vector2 { + unsafe { ffi::GetWindowPosition() } } } diff --git a/raylib/src/lib.rs b/raylib/src/lib.rs index cafd464e..636c00a5 100644 --- a/raylib/src/lib.rs +++ b/raylib/src/lib.rs @@ -54,15 +54,19 @@ Permission is granted to anyone to use this software for any purpose, including //! } //! } //! ``` -pub mod consts; pub mod core; +pub mod audio; +pub mod buffer; pub mod ease; +pub mod prelude; //pub mod rgui; +#[macro_use] +pub(crate) mod macros; + /// The raw, unsafe FFI binding, in case you need that escape hatch or the safe layer doesn't provide something you need. pub mod ffi { pub use raylib_sys::*; } -pub use mint; pub use crate::core::init; \ No newline at end of file diff --git a/raylib/src/core/macros.rs b/raylib/src/macros.rs similarity index 95% rename from raylib/src/core/macros.rs rename to raylib/src/macros.rs index 6ab24771..3e1af86c 100644 --- a/raylib/src/core/macros.rs +++ b/raylib/src/macros.rs @@ -1,23 +1,4 @@ -macro_rules! make_thin_wrapper { - ($name:ident, $t:ty, $dropfunc:expr) => { - #[repr(transparent)] - #[derive(Debug)] - pub struct $name(pub(crate) $t); - - impl_wrapper!($name, $t, $dropfunc, 0); - }; -} - -macro_rules! make_bound_thin_wrapper { - ($name:ident, $t:ty, $dropfunc:expr, $binding:ty) => { - #[repr(transparent)] - #[derive(Debug)] - pub struct $name<'a, 'bind: 'a>(pub(crate) $t, pub std::marker::PhantomData<&'a Self>, pub std::marker::PhantomData<&'bind $binding>); - - impl_wrapper_bounded!($name, $t, $dropfunc, 0, 'a); - }; -} - +#[macro_export] macro_rules! impl_wrapper { ($name:ident, $t:ty, $dropfunc:expr, $rawfield:tt) => { impl $name { @@ -83,6 +64,7 @@ macro_rules! impl_wrapper { }; } +#[macro_export] macro_rules! impl_wrapper_bounded { ($name:ident, $t:ty, $dropfunc:expr, $rawfield:tt, $lt:lifetime) => { impl<'bind, $lt> $name<'bind, $lt> { @@ -147,3 +129,25 @@ macro_rules! impl_wrapper_bounded { } }; } + +#[macro_export] +macro_rules! make_thin_wrapper { + ($name:ident, $t:ty, $dropfunc:expr) => { + #[repr(transparent)] + #[derive(Debug)] + pub struct $name(pub(crate) $t); + + crate::impl_wrapper!($name, $t, $dropfunc, 0); + }; +} + +#[macro_export] +macro_rules! make_bound_thin_wrapper { + ($name:ident, $t:ty, $dropfunc:expr, $binding:ty) => { + #[repr(transparent)] + #[derive(Debug)] + pub struct $name<'a, 'bind: 'a>(pub(crate) $t, pub std::marker::PhantomData<&'a Self>, pub std::marker::PhantomData<&'bind $binding>); + + crate::impl_wrapper_bounded!($name, $t, $dropfunc, 0, 'a); + }; +} \ No newline at end of file diff --git a/raylib/src/prelude.rs b/raylib/src/prelude.rs new file mode 100644 index 00000000..48ccfe8e --- /dev/null +++ b/raylib/src/prelude.rs @@ -0,0 +1,17 @@ +/* raylib-rs + prelude.rs + +Copyright (c) 2018-2019 Paul Clement (@deltaphc) + +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. +*/ +pub use crate::audio::RaylibAudio; +pub use crate::core::{drawing::*, init, RaylibBuilder, RaylibHandle, RaylibThread}; diff --git a/raylib/src/rgui/safe.rs b/raylib/src/rgui/safe.rs index df5b7f44..cd0e2bd4 100644 --- a/raylib/src/rgui/safe.rs +++ b/raylib/src/rgui/safe.rs @@ -1,7 +1,5 @@ -use mint::Vector2; - use crate::core::{drawing::RaylibDraw, text::Font, RaylibHandle}; -use crate::ffi::{self, Color, Rectangle}; +use crate::ffi::{self, Vector2, Color, Rectangle}; use std::ffi::CStr; use std::marker::PhantomData; @@ -61,12 +59,12 @@ impl RaylibHandle<'_> { } /// Set gui state (global state) #[inline] - pub fn gui_set_state(&mut self, state: crate::consts::GuiState) { + pub fn gui_set_state(&mut self, state: ffi::GuiState) { unsafe { ffi::GuiSetState(state as i32) } } /// Get gui state (global state) #[inline] - pub fn gui_get_state(&mut self) -> crate::consts::GuiState { + pub fn gui_get_state(&mut self) -> ffi::GuiState { unsafe { std::mem::transmute(ffi::GuiGetState()) } } /// Set gui custom font (global state) @@ -82,14 +80,14 @@ impl RaylibHandle<'_> { /// Set one style property /// SHOULD use one of the Gui*Property enums #[inline] - pub fn gui_set_style(&mut self, control: crate::consts::GuiControl, property: i32, value: i32) { + pub fn gui_set_style(&mut self, control: ffi::GuiControl, property: i32, value: i32) { unsafe { ffi::GuiSetStyle(control as i32, property as i32, value) } } /// Get one style property /// SHOULD use one of the Gui*Property enums #[inline] - pub fn gui_get_style(&mut self, control: crate::consts::GuiControl, property: i32) -> i32 { + pub fn gui_get_style(&mut self, control: ffi::GuiControl, property: i32) -> i32 { unsafe { ffi::GuiGetStyle(control as i32, property as i32) } } /// Load style file (.rgs) @@ -134,12 +132,12 @@ pub trait RaylibDrawGui<'a> { } /// Set gui state (global state) #[inline] - fn gui_set_state(&mut self, state: crate::consts::GuiState) { + fn gui_set_state(&mut self, state: ffi::GuiState) { unsafe { ffi::GuiSetState(state as i32) } } /// Get gui state (global state) #[inline] - fn gui_get_state(&mut self) -> crate::consts::GuiState { + fn gui_get_state(&mut self) -> ffi::GuiState { unsafe { std::mem::transmute(ffi::GuiGetState()) } } /// Set gui custom font (global state) @@ -155,14 +153,14 @@ pub trait RaylibDrawGui<'a> { /// Set one style property /// SHOULD use one of the Gui*Property enums #[inline] - fn gui_set_style(&mut self, control: crate::consts::GuiControl, property: i32, value: i32) { + fn gui_set_style(&mut self, control: ffi::GuiControl, property: i32, value: i32) { unsafe { ffi::GuiSetStyle(control as i32, property as i32, value) } } /// Get one style property /// SHOULD use one of the Gui*Property enums #[inline] - fn gui_get_style(&self, control: crate::consts::GuiControl, property: i32) -> i32 { + fn gui_get_style(&self, control: ffi::GuiControl, property: i32) -> i32 { unsafe { ffi::GuiGetStyle(control as i32, property as i32) } } /// Load style file (.rgs) @@ -177,115 +175,89 @@ pub trait RaylibDrawGui<'a> { } /// Window Box control, shows a window that can be closed #[inline] - fn gui_window_box(&mut self, bounds: impl Into, title: impl IntoCStr) -> bool { - unsafe { ffi::GuiWindowBox(bounds.into(), title.as_cstr_ptr()) } + fn gui_window_box(&mut self, bounds: Rectangle, title: impl IntoCStr) -> bool { + unsafe { ffi::GuiWindowBox(bounds, title.as_cstr_ptr()) } } /// Group Box control with text name #[inline] - fn gui_group_box(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiGroupBox(bounds.into(), text.as_cstr_ptr()) } + fn gui_group_box(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiGroupBox(bounds, text.as_cstr_ptr()) } } /// Line separator control, could contain text #[inline] - fn gui_line(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiLine(bounds.into(), text.as_cstr_ptr()) } + fn gui_line(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiLine(bounds, text.as_cstr_ptr()) } } /// Panel control, useful to group controls #[inline] - fn gui_panel(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiPanel(bounds.into(), text.as_cstr_ptr()) } + fn gui_panel(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiPanel(bounds, text.as_cstr_ptr()) } } /// Scroll Panel control #[inline] fn gui_scroll_panel( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, - content: impl Into, - scroll: impl Into, - ) -> (Rectangle, Vector2) { + content: Rectangle, + scroll: Vector2, + ) -> (Rectangle, Vector2) { let mut scroll = scroll.into(); - let bounds: ffi::Rectangle = unsafe { - ffi::GuiScrollPanel( - bounds.into(), - text.as_cstr_ptr(), - content.into(), - &mut scroll, - ) - }; - return (bounds.into(), scroll.into()); + let bounds: ffi::Rectangle = + unsafe { ffi::GuiScrollPanel(bounds, text.as_cstr_ptr(), content.into(), &mut scroll) }; + return (bounds, scroll.into()); } /// Label control, shows text #[inline] - fn gui_label(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiLabel(bounds.into(), text.as_cstr_ptr()) } + fn gui_label(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiLabel(bounds, text.as_cstr_ptr()) } } /// Button control, returns true when clicked #[inline] - fn gui_button(&mut self, bounds: impl Into, text: impl IntoCStr) -> bool { - unsafe { ffi::GuiButton(bounds.into(), text.as_cstr_ptr()) } + fn gui_button(&mut self, bounds: Rectangle, text: impl IntoCStr) -> bool { + unsafe { ffi::GuiButton(bounds, text.as_cstr_ptr()) } } /// Label button control, show true when clicked #[inline] - fn gui_label_button(&mut self, bounds: impl Into, text: impl IntoCStr) -> bool { - unsafe { ffi::GuiLabelButton(bounds.into(), text.as_cstr_ptr()) } + fn gui_label_button(&mut self, bounds: Rectangle, text: impl IntoCStr) -> bool { + unsafe { ffi::GuiLabelButton(bounds, text.as_cstr_ptr()) } } /// Toggle Button control, returns true when active #[inline] - fn gui_toggle( - &mut self, - bounds: impl Into, - text: impl IntoCStr, - active: bool, - ) -> bool { - unsafe { ffi::GuiToggle(bounds.into(), text.as_cstr_ptr(), active) } + fn gui_toggle(&mut self, bounds: Rectangle, text: impl IntoCStr, active: bool) -> bool { + unsafe { ffi::GuiToggle(bounds, text.as_cstr_ptr(), active) } } /// Toggle Group control, returns active toggle index #[inline] - fn gui_toggle_group( - &mut self, - bounds: impl Into, - text: impl IntoCStr, - active: i32, - ) -> i32 { - unsafe { ffi::GuiToggleGroup(bounds.into(), text.as_cstr_ptr(), active) } + fn gui_toggle_group(&mut self, bounds: Rectangle, text: impl IntoCStr, active: i32) -> i32 { + unsafe { ffi::GuiToggleGroup(bounds, text.as_cstr_ptr(), active) } } /// Check Box control, returns true when active #[inline] - fn gui_check_box( - &mut self, - bounds: impl Into, - text: impl IntoCStr, - checked: bool, - ) -> bool { - unsafe { ffi::GuiCheckBox(bounds.into(), text.as_cstr_ptr(), checked) } + fn gui_check_box(&mut self, bounds: Rectangle, text: impl IntoCStr, checked: bool) -> bool { + unsafe { ffi::GuiCheckBox(bounds, text.as_cstr_ptr(), checked) } } /// Combo Box control, returns selected item index #[inline] - fn gui_combo_box( - &mut self, - bounds: impl Into, - text: impl IntoCStr, - active: i32, - ) -> i32 { - unsafe { ffi::GuiComboBox(bounds.into(), text.as_cstr_ptr(), active) } + fn gui_combo_box(&mut self, bounds: Rectangle, text: impl IntoCStr, active: i32) -> i32 { + unsafe { ffi::GuiComboBox(bounds, text.as_cstr_ptr(), active) } } /// Dropdown Box control, returns selected item #[inline] fn gui_dropdown_box( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, active: &mut i32, edit_mode: bool, ) -> bool { - unsafe { ffi::GuiDropdownBox(bounds.into(), text.as_cstr_ptr(), active, edit_mode) } + unsafe { ffi::GuiDropdownBox(bounds, text.as_cstr_ptr(), active, edit_mode) } } /// Spinner control, returns selected value #[inline] fn gui_spinner( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, value: &mut i32, min_value: i32, @@ -294,7 +266,7 @@ pub trait RaylibDrawGui<'a> { ) -> bool { unsafe { ffi::GuiSpinner( - bounds.into(), + bounds, // text.map(CStr::as_ptr).unwrap_or(crate::rstr!("").as_ptr()), text.as_cstr_ptr(), value, @@ -308,7 +280,7 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_value_box( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, value: &mut i32, min_value: i32, @@ -317,7 +289,7 @@ pub trait RaylibDrawGui<'a> { ) -> bool { unsafe { ffi::GuiValueBox( - bounds.into(), + bounds, text.as_cstr_ptr(), value, min_value, @@ -329,48 +301,29 @@ pub trait RaylibDrawGui<'a> { /// Text Box control, updates input text /// Use at your own risk!!! The allocated vector MUST have enough space for edits. #[inline] - fn gui_text_box( - &mut self, - bounds: impl Into, - buffer: &mut [u8], - edit_mode: bool, - ) -> bool { + fn gui_text_box(&mut self, bounds: Rectangle, buffer: &mut [u8], edit_mode: bool) -> bool { let len = buffer.len(); let c_text = unsafe { CStr::from_bytes_with_nul_unchecked(buffer) }; - unsafe { - ffi::GuiTextBox( - bounds.into(), - c_text.as_ptr() as *mut _, - len as i32, - edit_mode, - ) - } + unsafe { ffi::GuiTextBox(bounds, c_text.as_ptr() as *mut _, len as i32, edit_mode) } } /// Text Box control with multiple lines /// Use at your own risk!!! The allocated vector MUST have a nul terminator. #[inline] fn gui_text_box_multi( &mut self, - bounds: impl Into, + bounds: Rectangle, buffer: &mut [u8], edit_mode: bool, ) -> bool { let len = buffer.len(); let c_text = unsafe { CStr::from_bytes_with_nul_unchecked(buffer) }; - unsafe { - ffi::GuiTextBoxMulti( - bounds.into(), - c_text.as_ptr() as *mut _, - len as i32, - edit_mode, - ) - } + unsafe { ffi::GuiTextBoxMulti(bounds, c_text.as_ptr() as *mut _, len as i32, edit_mode) } } /// Slider control, returns selected value #[inline] fn gui_slider( &mut self, - bounds: impl Into, + bounds: Rectangle, text_left: impl IntoCStr, text_right: impl IntoCStr, value: f32, @@ -379,7 +332,7 @@ pub trait RaylibDrawGui<'a> { ) -> f32 { unsafe { ffi::GuiSlider( - bounds.into(), + bounds, text_left.as_cstr_ptr(), text_right.as_cstr_ptr(), value, @@ -392,7 +345,7 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_slider_bar( &mut self, - bounds: impl Into, + bounds: Rectangle, text_left: impl IntoCStr, text_right: impl IntoCStr, value: f32, @@ -401,7 +354,7 @@ pub trait RaylibDrawGui<'a> { ) -> f32 { unsafe { ffi::GuiSliderBar( - bounds.into(), + bounds, text_left.as_cstr_ptr(), text_right.as_cstr_ptr(), value, @@ -414,7 +367,7 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_progress_bar( &mut self, - bounds: impl Into, + bounds: Rectangle, text_left: impl IntoCStr, text_right: impl IntoCStr, value: f32, @@ -423,7 +376,7 @@ pub trait RaylibDrawGui<'a> { ) -> f32 { unsafe { ffi::GuiProgressBar( - bounds.into(), + bounds, text_left.as_cstr_ptr(), text_right.as_cstr_ptr(), value, @@ -434,41 +387,41 @@ pub trait RaylibDrawGui<'a> { } /// Status Bar control, shows info text #[inline] - fn gui_status_bar(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiStatusBar(bounds.into(), text.as_cstr_ptr()) } + fn gui_status_bar(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiStatusBar(bounds, text.as_cstr_ptr()) } } /// Dummy control for placeholders #[inline] - fn gui_dummy_rec(&mut self, bounds: impl Into, text: impl IntoCStr) { - unsafe { ffi::GuiStatusBar(bounds.into(), text.as_cstr_ptr()) } + fn gui_dummy_rec(&mut self, bounds: Rectangle, text: impl IntoCStr) { + unsafe { ffi::GuiStatusBar(bounds, text.as_cstr_ptr()) } } /// Grid control #[inline] fn gui_grid( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, spacing: f32, subdivs: i32, - ) -> Vector2 { - unsafe { ffi::GuiGrid(bounds.into(), text.as_cstr_ptr(), spacing, subdivs).into() } + ) -> Vector2 { + unsafe { ffi::GuiGrid(bounds, text.as_cstr_ptr(), spacing, subdivs).into() } } /// List View control, returns selected list item index #[inline] fn gui_list_view( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, scroll_index: &mut i32, active: i32, ) -> i32 { - unsafe { ffi::GuiListView(bounds.into(), text.as_cstr_ptr(), scroll_index, active) } + unsafe { ffi::GuiListView(bounds, text.as_cstr_ptr(), scroll_index, active) } } /// List View with extended parameters #[inline] fn gui_list_view_ex( &mut self, - bounds: impl Into, + bounds: Rectangle, text: &[&CStr], focus: &mut i32, scroll_index: &mut i32, @@ -480,7 +433,7 @@ pub trait RaylibDrawGui<'a> { } unsafe { ffi::GuiListViewEx( - bounds.into(), + bounds, buffer.as_mut_ptr(), text.len() as i32, focus, @@ -493,14 +446,14 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_message_box( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, message: impl IntoCStr, buttons: impl IntoCStr, ) -> i32 { unsafe { ffi::GuiMessageBox( - bounds.into(), + bounds, text.as_cstr_ptr(), message.as_cstr_ptr(), buttons.as_cstr_ptr(), @@ -511,7 +464,7 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_text_input_box( &mut self, - bounds: impl Into, + bounds: Rectangle, title: impl IntoCStr, message: impl IntoCStr, buttons: impl IntoCStr, @@ -526,7 +479,7 @@ pub trait RaylibDrawGui<'a> { text.reserve((256 - text.len()).max(0) as usize); let btn_index = unsafe { ffi::GuiTextInputBox( - bounds.into(), + bounds, title.as_cstr_ptr(), message.as_cstr_ptr(), buttons.as_cstr_ptr(), @@ -546,21 +499,17 @@ pub trait RaylibDrawGui<'a> { #[inline] fn gui_color_picker( &mut self, - bounds: impl Into, + bounds: Rectangle, text: impl IntoCStr, - color: impl Into, + color: Color, ) -> Color { - unsafe { ffi::GuiColorPicker(bounds.into(), text.as_cstr_ptr(), color.into()).into() } + unsafe { ffi::GuiColorPicker(bounds, text.as_cstr_ptr(), color).into() } } // Get text with icon id prepended // NOTE: Useful to add icons by name id (enum) instead of // a number that can change between ricon versions #[inline] - fn gui_icon_text( - &mut self, - icon_id: crate::consts::GuiIconName, - text: impl IntoCStr, - ) -> String { + fn gui_icon_text(&mut self, icon_id: ffi::GuiIconName, text: impl IntoCStr) -> String { let buffer = unsafe { ffi::GuiIconText(icon_id as i32, text.as_cstr_ptr()) }; if buffer.is_null() { let ptr = text.as_cstr_ptr(); @@ -579,12 +528,7 @@ pub trait RaylibDrawGui<'a> { /// Color Bar Alpha control /// NOTE: Returns alpha value normalized [0..1] #[inline] - fn gui_color_bar_alpha( - &mut self, - bounds: impl Into, - text: impl IntoCStr, - alpha: f32, - ) -> f32 { - unsafe { ffi::GuiColorBarAlpha(bounds.into(), text.as_cstr_ptr(), alpha) } + fn gui_color_bar_alpha(&mut self, bounds: Rectangle, text: impl IntoCStr, alpha: f32) -> f32 { + unsafe { ffi::GuiColorBarAlpha(bounds, text.as_cstr_ptr(), alpha) } } } diff --git a/samples/3d_camera_first_person.rs b/samples/3d_camera_first_person.rs index b0483494..56314995 100644 --- a/samples/3d_camera_first_person.rs +++ b/samples/3d_camera_first_person.rs @@ -1,4 +1,5 @@ use arr_macro::arr; +use nalgebra::Vector3; use rand::prelude::*; use raylib::prelude::*; @@ -7,7 +8,7 @@ const WINDOW_HEIGHT: i32 = 720; struct Column { height: f32, - position: Vector3, + position: Vector3, color: Color, } diff --git a/samples/arkanoid.rs b/samples/arkanoid.rs index 02be001b..c5eb4233 100644 --- a/samples/arkanoid.rs +++ b/samples/arkanoid.rs @@ -2,8 +2,7 @@ extern crate raylib; extern crate nalgebra; use nalgebra::Vector2; -use raylib::core::drawing::RaylibDraw; -use raylib::core::{RaylibHandle, drawing::RaylibDrawHandle}; +use raylib::prelude::*; use raylib::core::text::measure_text; use raylib::ffi::{Color, Rectangle}; use structopt::StructOpt; @@ -123,7 +122,7 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { } fn update_game(game: &mut Game, rl: &RaylibHandle) { - use raylib::consts::KeyboardKey::*; + use raylib::ffi::KeyboardKey::*; let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); if !game.game_over { diff --git a/samples/asteroids.rs b/samples/asteroids.rs index 64fccb68..7fa47fce 100644 --- a/samples/asteroids.rs +++ b/samples/asteroids.rs @@ -2,12 +2,10 @@ extern crate raylib; use nalgebra::{Vector2, Vector3}; use raylib::{ core::{ - collision::check_collision_circles, - drawing::{RaylibDraw, RaylibDrawHandle}, - text::measure_text, - RaylibHandle, RaylibThread, + collision::check_collision_circles, drawing::RaylibDraw, text::measure_text, RaylibHandle, + RaylibThread, }, - ffi::Color, + ffi::{Color, KeyboardKey}, }; use structopt::StructOpt; @@ -219,24 +217,23 @@ fn init_game(game: &mut Game, rl: &RaylibHandle) { } fn update_game(game: &mut Game, rl: &RaylibHandle) { - use raylib::consts::KeyboardKey::*; if !game.game_over { - if rl.is_key_pressed(KEY_P) { + if rl.is_key_pressed(KeyboardKey::KEY_P) { game.pause = !game.pause; } if !game.pause { - if rl.is_key_down(KEY_LEFT) { + if rl.is_key_down(KeyboardKey::KEY_LEFT) { game.player.rotation -= 5f32; } - if rl.is_key_down(KEY_RIGHT) { + if rl.is_key_down(KeyboardKey::KEY_RIGHT) { game.player.rotation += 5f32; } game.player.speed.x = game.player.rotation.to_radians().sin() * PLAYER_SPEED; game.player.speed.y = game.player.rotation.to_radians().cos() * PLAYER_SPEED; - if rl.is_key_down(KEY_UP) { + if rl.is_key_down(KeyboardKey::KEY_UP) { if game.player.acceleration < 1f32 { game.player.acceleration += 0.04; } @@ -248,7 +245,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { } } - if rl.is_key_down(KEY_DOWN) { + if rl.is_key_down(KeyboardKey::KEY_DOWN) { if game.player.acceleration > 0f32 { game.player.acceleration -= 0.04; } else if game.player.acceleration < 0f32 { @@ -273,7 +270,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { game.player.position.y = height + SHIP_HEIGHT; } - if rl.is_key_pressed(KEY_SPACE) { + if rl.is_key_pressed(KeyboardKey::KEY_SPACE) { for shot in &mut game.shots { if !shot.active { shot.position = Vector2::new( @@ -540,7 +537,7 @@ fn update_game(game: &mut Game, rl: &RaylibHandle) { game.victory = true; } } else { - if rl.is_key_pressed(KEY_ENTER) { + if rl.is_key_pressed(KeyboardKey::KEY_ENTER) { init_game(game, rl); game.game_over = false; } diff --git a/samples/camera2D.rs b/samples/camera2D.rs index 9387bc0a..f485f5bf 100644 --- a/samples/camera2D.rs +++ b/samples/camera2D.rs @@ -1,5 +1,9 @@ #![allow(non_snake_case)] -use raylib::prelude::*; +use nalgebra::Vector2; +use raylib::{ + ffi::{Color, Rectangle, Camera2D}, + prelude::*, +}; use structopt::StructOpt; mod options; @@ -7,7 +11,7 @@ mod options; const MAX_BUILDINGS: usize = 100; fn main() { - use raylib::consts::KeyboardKey::*; + use raylib::ffi::KeyboardKey::*; let opt = options::Opt::from_args(); let (rl, thread) = opt.open_window("Camera 2D"); let (w, h) = (opt.width, opt.height); @@ -36,9 +40,9 @@ fn main() { } let mut camera = Camera2D { - target: Vector2::new(player.x + 20.0, player.y + 20.0), + target: Vector2::new(player.x + 20.0, player.y + 20.0).into(), // offset: Vector2::new(player.x, player.y), - offset: Vector2::new(0.0, 0.0), + offset: Vector2::new(0.0, 0.0).into(), rotation: 0.0, zoom: 1.0, }; @@ -53,7 +57,7 @@ fn main() { } // Camera follows player - camera.target = Vector2::new(player.x + 20.0, player.y + 20.0); + camera.target = Vector2::new(player.x + 20.0, player.y + 20.0).into(); // Camera rotation controls if rl.is_key_down(KEY_A) { @@ -77,13 +81,13 @@ fn main() { rl.frame(&thread, |d| { d.clear_background(Color::RAYWHITE); { - let d2 = d.begin_mode2D(camera); + let d2 = d.begin_mode_2d(camera); d2.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); for i in 0..MAX_BUILDINGS { - d2.draw_rectangle_rec(&buildings[i], build_colors[i]); + d2.draw_rectangle_rec(buildings[i], build_colors[i]); } - d2.draw_rectangle_rec(&player, Color::RED); + d2.draw_rectangle_rec(player, Color::RED); d2.draw_line( camera.target.x as i32, diff --git a/samples/drop.rs b/samples/drop.rs index 77c2908d..b87139d7 100644 --- a/samples/drop.rs +++ b/samples/drop.rs @@ -1,5 +1,5 @@ extern crate raylib; -use raylib::prelude::*; +use raylib::{prelude::*, ffi::Color, core::texture::Image}; use std::{thread, time}; use structopt::StructOpt; diff --git a/samples/extensions.rs b/samples/extensions.rs index 6b926c65..725253cb 100644 --- a/samples/extensions.rs +++ b/samples/extensions.rs @@ -1,12 +1,20 @@ extern crate raylib; -use raylib::prelude::*; +use nalgebra::Vector2; +use raylib::{core::text::Font, ffi::Color, prelude::*}; use structopt::StructOpt; mod options; trait RaylibDrawExt: RaylibDraw { fn custom_draw(&mut self, font: &Font) { - self.draw_text_ex(font, "custom", rvec2(0, 0), 16.0, 0.0, Color::GREEN); + self.draw_text_ex( + font, + "custom", + Vector2::new(0.0, 0.0).into(), + 16.0, + 0.0, + Color::GREEN, + ); } } diff --git a/samples/font.rs b/samples/font.rs index f8d132e4..843a77ef 100644 --- a/samples/font.rs +++ b/samples/font.rs @@ -1,6 +1,7 @@ extern crate raylib; -use raylib::prelude::*; +use nalgebra::Vector2; +use raylib::{ffi::Color, prelude::*}; fn main() { let w = 800; @@ -25,7 +26,7 @@ fn main() { d.draw_text_ex( &font, "rust", - Vector2::new((w / 2 - 69) as f32, (h / 2 + 18) as f32), + Vector2::new((w / 2 - 69) as f32, (h / 2 + 18) as f32).into(), 50.0, 1.0, rust_orange, @@ -33,7 +34,7 @@ fn main() { d.draw_text_ex( &font, "raylib", - Vector2::new((w / 2 - 44) as f32, (h / 2 + 48) as f32), + Vector2::new((w / 2 - 44) as f32, (h / 2 + 48) as f32).into(), 50.0, 1.0, rust_orange, diff --git a/samples/input.rs b/samples/input.rs index 2218dd46..51372d7d 100644 --- a/samples/input.rs +++ b/samples/input.rs @@ -1,5 +1,5 @@ extern crate raylib; -use raylib::prelude::*; +use raylib::{prelude::*, ffi::Color}; use structopt::StructOpt; mod options; diff --git a/samples/logo.rs b/samples/logo.rs index 134fafb0..bd9eb30e 100644 --- a/samples/logo.rs +++ b/samples/logo.rs @@ -1,5 +1,5 @@ extern crate raylib; -use raylib::prelude::*; +use raylib::{prelude::*, ffi::Color}; use structopt::StructOpt; mod options; diff --git a/samples/options.rs b/samples/options.rs index 41251149..aff64d07 100644 --- a/samples/options.rs +++ b/samples/options.rs @@ -2,7 +2,7 @@ // extern crate structopt; pub use structopt::StructOpt; -use raylib::core::{RaylibHandle, RaylibThread}; +use raylib::prelude::*; #[derive(Debug, StructOpt)] #[structopt(name = "example", about = "An example of StructOpt usage.")] diff --git a/samples/roguelike.rs b/samples/roguelike.rs index de11c166..996fc7f8 100644 --- a/samples/roguelike.rs +++ b/samples/roguelike.rs @@ -4,7 +4,7 @@ /// IMHO Don't write code like this. Use ECS and other methods to have game objects and components. /// Only do this as an exercise. extern crate raylib; -use crate::KeyboardKey::KEY_A; +use raylib::ffi::KeyboardKey; use rand::distributions::WeightedIndex; use rand::prelude::*; use rand::Rng; diff --git a/samples/specs.rs b/samples/specs.rs index 3bd99297..b61bd5a3 100644 --- a/samples/specs.rs +++ b/samples/specs.rs @@ -1,7 +1,8 @@ //! Die if you touch fire #[macro_use] extern crate specs_derive; -use raylib::prelude::*; +use nalgebra::Vector2; +use raylib::{ffi::Color, prelude::*}; use specs::prelude::*; use std::collections::HashMap; @@ -16,8 +17,8 @@ const MARGIN: i32 = 2; #[derive(Clone, Component)] struct Pos(i32, i32); -impl From<&Pos> for Vector2 { - fn from(pos: &Pos) -> Vector2 { +impl From<&Pos> for Vector2 { + fn from(pos: &Pos) -> Vector2 { Vector2::new(pos.0 as f32, pos.1 as f32) } } @@ -75,7 +76,7 @@ impl<'a> System<'a> for PlayerSys { ); fn run(&mut self, (ents, rl, emap, mut players, pos): Self::SystemData) { - use raylib::consts::KeyboardKey::*; + use raylib::ffi::KeyboardKey::*; let player = (&*ents, &pos, &players).join().nth(0).unwrap(); @@ -129,18 +130,30 @@ impl<'a> System<'a> for DrawSys { d.clear_background(Color::BLACK); // draw the tiles for (pos, _) in (&pos, &tiles).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::RAYWHITE); + let p: Vector2 = pos.into(); + d.draw_rectangle_v( + (p.component_mul(&size) + margin).into(), + tile_size.into(), + Color::RAYWHITE, + ); } // draw the fire tiles for (pos, _, _) in (&pos, &tiles, &fire).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::RED); + let p: Vector2 = pos.into(); + d.draw_rectangle_v( + (p.component_mul(&size) + margin).into(), + tile_size.into(), + Color::RED, + ); } // draw the player tiles for (pos, _, _) in (&pos, &tiles, &player).join() { - let p: Vector2 = pos.into(); - d.draw_rectangle_v(p * size + margin, tile_size, Color::GREEN); + let p: Vector2 = pos.into(); + d.draw_rectangle_v( + (p.component_mul(&size) + margin).into(), + tile_size.into(), + Color::GREEN, + ); } }); } diff --git a/samples/texture.rs b/samples/texture.rs index da706505..f5b4b685 100644 --- a/samples/texture.rs +++ b/samples/texture.rs @@ -1,4 +1,5 @@ extern crate raylib; +use raylib::{core::texture::Image, ffi::Color, prelude::*}; use structopt::StructOpt; mod options; From fc5236dd43c4a38e418282d5db83e519addf0784 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sun, 26 Mar 2023 13:26:09 +0200 Subject: [PATCH 16/30] Formating changes and implement some missing functions. --- raylib/src/core/drawing.rs | 297 +++++++++++++++---------------------- raylib/src/core/input.rs | 16 +- raylib/src/core/misc.rs | 8 +- raylib/src/core/shaders.rs | 9 ++ raylib/src/core/texture.rs | 69 +++++---- raylib/src/core/window.rs | 64 ++------ 6 files changed, 200 insertions(+), 263 deletions(-) diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index cbe20da7..7aa50add 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -106,9 +106,7 @@ where { #[must_use] fn begin_mode_2d(&self, camera: Camera2D) -> RaylibMode2D { - unsafe { - ffi::BeginMode2D(camera); - } + unsafe { ffi::BeginMode2D(camera) } RaylibMode2D(self) } } @@ -138,9 +136,7 @@ where { #[must_use] fn begin_mode_3d(&self, camera: Camera3D) -> RaylibMode3D { - unsafe { - ffi::BeginMode3D(camera); - } + unsafe { ffi::BeginMode3D(camera) } RaylibMode3D(self) } } @@ -255,9 +251,7 @@ pub trait RaylibDraw { /// Sets background color (framebuffer clear color). #[inline] fn clear_background(&self, color: Color) { - unsafe { - ffi::ClearBackground(color); - } + unsafe { ffi::ClearBackground(color) } } /// Define default texture used to draw shapes @@ -274,17 +268,13 @@ pub trait RaylibDraw { /// Draws a pixel. #[inline] fn draw_pixel(&self, x: i32, y: i32, color: Color) { - unsafe { - ffi::DrawPixel(x, y, color); - } + unsafe { ffi::DrawPixel(x, y, color) } } /// Draws a pixel (Vector version). #[inline] fn draw_pixel_v(&self, position: Vector2, color: Color) { - unsafe { - ffi::DrawPixelV(position, color); - } + unsafe { ffi::DrawPixelV(position, color) } } /// Draws a line. @@ -297,33 +287,25 @@ pub trait RaylibDraw { end_pos_y: i32, color: Color, ) { - unsafe { - ffi::DrawLine(start_pos_x, start_pos_y, end_pos_x, end_pos_y, color); - } + unsafe { ffi::DrawLine(start_pos_x, start_pos_y, end_pos_x, end_pos_y, color) } } /// Draws a line (Vector version). #[inline] fn draw_line_v(&self, start_pos: Vector2, end_pos: Vector2, color: Color) { - unsafe { - ffi::DrawLineV(start_pos, end_pos, color); - } + unsafe { ffi::DrawLineV(start_pos, end_pos, color) } } /// Draws a line with thickness. #[inline] fn draw_line_ex(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { - unsafe { - ffi::DrawLineEx(start_pos, end_pos, thick, color); - } + unsafe { ffi::DrawLineEx(start_pos, end_pos, thick, color) } } /// Draws a line using cubic-bezier curves in-out. #[inline] fn draw_line_bezier(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { - unsafe { - ffi::DrawLineBezier(start_pos, end_pos, thick, color); - } + unsafe { ffi::DrawLineBezier(start_pos, end_pos, thick, color) } } /// Draw line using quadratic bezier curves with a control point #[inline] @@ -334,9 +316,30 @@ pub trait RaylibDraw { control_pos: Vector2, thick: f32, color: Color, + ) { + unsafe { ffi::DrawLineBezierQuad(start_pos, end_pos, control_pos, thick, color) } + } + + /// Draw line using cubic bezier curves with 2 control points + #[inline] + fn draw_line_bezier_cubic( + &self, + start_pos: Vector2, + end_pos: Vector2, + start_control_pos: Vector2, + end_control_pos: Vector2, + thick: f32, + color: Color, ) { unsafe { - ffi::DrawLineBezierQuad(start_pos, end_pos, control_pos, thick, color); + ffi::DrawLineBezierCubic( + start_pos, + end_pos, + start_control_pos, + end_control_pos, + thick, + color, + ) } } @@ -348,17 +351,16 @@ pub trait RaylibDraw { points.as_ptr() as *mut ffi::Vector2, points.len() as i32, color, - ); + ) } } /// Draws a color-filled circle. #[inline] fn draw_circle(&self, center_x: i32, center_y: i32, radius: f32, color: Color) { - unsafe { - ffi::DrawCircle(center_x, center_y, radius, color); - } + unsafe { ffi::DrawCircle(center_x, center_y, radius, color) } } + /// Draw a piece of a circle #[inline] fn draw_circle_sector( @@ -370,9 +372,7 @@ pub trait RaylibDraw { segments: i32, color: Color, ) { - unsafe { - ffi::DrawCircleSector(center, radius, start_angle, end_angle, segments, color); - } + unsafe { ffi::DrawCircleSector(center, radius, start_angle, end_angle, segments, color) } } /// Draw circle sector outline @@ -413,9 +413,7 @@ pub trait RaylibDraw { /// Draws circle outline. #[inline] fn draw_circle_lines(&self, center_x: i32, center_y: i32, radius: f32, color: Color) { - unsafe { - ffi::DrawCircleLines(center_x, center_y, radius, color); - } + unsafe { ffi::DrawCircleLines(center_x, center_y, radius, color) } } /// Draws ellipse. @@ -428,9 +426,7 @@ pub trait RaylibDraw { radius_v: f32, color: Color, ) { - unsafe { - ffi::DrawEllipse(center_x, center_y, radius_h, radius_v, color); - } + unsafe { ffi::DrawEllipse(center_x, center_y, radius_h, radius_v, color) } } /// Draws ellipse. @@ -443,9 +439,7 @@ pub trait RaylibDraw { radius_v: f32, color: Color, ) { - unsafe { - ffi::DrawEllipseLines(center_x, center_y, radius_h, radius_v, color); - } + unsafe { ffi::DrawEllipseLines(center_x, center_y, radius_h, radius_v, color) } } /// Draw ring @@ -469,7 +463,7 @@ pub trait RaylibDraw { end_angle, segments, color, - ); + ) } } @@ -494,40 +488,32 @@ pub trait RaylibDraw { end_angle, segments, color, - ); + ) } } /// Draws a color-filled rectangle. #[inline] fn draw_rectangle(&self, x: i32, y: i32, width: i32, height: i32, color: Color) { - unsafe { - ffi::DrawRectangle(x, y, width, height, color); - } + unsafe { ffi::DrawRectangle(x, y, width, height, color) } } /// Draws a color-filled rectangle (Vector version). #[inline] fn draw_rectangle_v(&self, position: Vector2, size: Vector2, color: Color) { - unsafe { - ffi::DrawRectangleV(position, size, color); - } + unsafe { ffi::DrawRectangleV(position, size, color) } } /// Draws a color-filled rectangle from `rec`. #[inline] fn draw_rectangle_rec(&self, rec: Rectangle, color: Color) { - unsafe { - ffi::DrawRectangleRec(rec, color); - } + unsafe { ffi::DrawRectangleRec(rec, color) } } /// Draws a color-filled rectangle with pro parameters. #[inline] fn draw_rectangle_pro(&self, rec: Rectangle, origin: Vector2, rotation: f32, color: Color) { - unsafe { - ffi::DrawRectanglePro(rec, origin, rotation, color); - } + unsafe { ffi::DrawRectanglePro(rec, origin, rotation, color) } } /// Draws a vertical-gradient-filled rectangle. @@ -543,9 +529,7 @@ pub trait RaylibDraw { color1: Color, color2: Color, ) { - unsafe { - ffi::DrawRectangleGradientV(x, y, width, height, color1, color2); - } + unsafe { ffi::DrawRectangleGradientV(x, y, width, height, color1, color2) } } /// Draws a horizontal-gradient-filled rectangle. @@ -561,9 +545,7 @@ pub trait RaylibDraw { color1: Color, color2: Color, ) { - unsafe { - ffi::DrawRectangleGradientH(x, y, width, height, color1, color2); - } + unsafe { ffi::DrawRectangleGradientH(x, y, width, height, color1, color2) } } /// Draws a gradient-filled rectangle with custom vertex colors. @@ -578,32 +560,24 @@ pub trait RaylibDraw { col3: Color, col4: Color, ) { - unsafe { - ffi::DrawRectangleGradientEx(rec, col1, col2, col3, col4); - } + unsafe { ffi::DrawRectangleGradientEx(rec, col1, col2, col3, col4) } } /// Draws rectangle outline. #[inline] fn draw_rectangle_lines(&self, x: i32, y: i32, width: i32, height: i32, color: Color) { - unsafe { - ffi::DrawRectangleLines(x, y, width, height, color); - } + unsafe { ffi::DrawRectangleLines(x, y, width, height, color) } } /// Draws rectangle outline with extended parameters. #[inline] fn draw_rectangle_lines_ex(&self, rec: Rectangle, line_thick: f32, color: Color) { - unsafe { - ffi::DrawRectangleLinesEx(rec, line_thick, color); - } + unsafe { ffi::DrawRectangleLinesEx(rec, line_thick, color) } } /// Draws rectangle outline with extended parameters. #[inline] fn draw_rectangle_rounded(&self, rec: Rectangle, roundness: f32, segments: i32, color: Color) { - unsafe { - ffi::DrawRectangleRounded(rec, roundness, segments, color); - } + unsafe { ffi::DrawRectangleRounded(rec, roundness, segments, color) } } /// Draws rectangle outline with extended parameters. @@ -616,25 +590,19 @@ pub trait RaylibDraw { line_thickness: f32, color: Color, ) { - unsafe { - ffi::DrawRectangleRoundedLines(rec, roundness, segments, line_thickness, color); - } + unsafe { ffi::DrawRectangleRoundedLines(rec, roundness, segments, line_thickness, color) } } /// Draws a triangle. #[inline] fn draw_triangle(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { - unsafe { - ffi::DrawTriangle(v1, v2, v3, color); - } + unsafe { ffi::DrawTriangle(v1, v2, v3, color) } } /// Draws a triangle using lines. #[inline] fn draw_triangle_lines(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { - unsafe { - ffi::DrawTriangleLines(v1, v2, v3, color); - } + unsafe { ffi::DrawTriangleLines(v1, v2, v3, color) } } /// Draw a triangle fan defined by points. @@ -645,7 +613,7 @@ pub trait RaylibDraw { points.as_ptr() as *mut ffi::Vector2, points.len() as i32, color, - ); + ) } } @@ -657,16 +625,14 @@ pub trait RaylibDraw { points.as_ptr() as *mut ffi::Vector2, points.len() as i32, color, - ); + ) } } /// Draws a regular polygon of n sides (Vector version). #[inline] fn draw_poly(&self, center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) { - unsafe { - ffi::DrawPoly(center, sides, radius, rotation, color); - } + unsafe { ffi::DrawPoly(center, sides, radius, rotation, color) } } /// Draws a regular polygon of n sides (Vector version). @@ -679,25 +645,32 @@ pub trait RaylibDraw { rotation: f32, color: Color, ) { - unsafe { - ffi::DrawPolyLines(center, sides, radius, rotation, color); - } + unsafe { ffi::DrawPolyLines(center, sides, radius, rotation, color) } + } + + #[inline] + fn draw_poly_lines_ex( + &self, + center: Vector2, + sides: i32, + radius: f32, + rotation: f32, + line_thick: f32, + color: Color, + ) { + unsafe { ffi::DrawPolyLinesEx(center, sides, radius, rotation, line_thick, color) } } /// Draws a `texture` using specified position and `tint` color. #[inline] fn draw_texture(&self, texture: impl AsRef, x: i32, y: i32, tint: Color) { - unsafe { - ffi::DrawTexture(*texture.as_ref(), x, y, tint); - } + unsafe { ffi::DrawTexture(*texture.as_ref(), x, y, tint) } } /// Draws a `texture` using specified `position` vector and `tint` color. #[inline] fn draw_texture_v(&self, texture: impl AsRef, position: Vector2, tint: Color) { - unsafe { - ffi::DrawTextureV(*texture.as_ref(), position, tint); - } + unsafe { ffi::DrawTextureV(*texture.as_ref(), position, tint) } } /// Draws a `texture` with extended parameters. @@ -710,9 +683,7 @@ pub trait RaylibDraw { scale: f32, tint: Color, ) { - unsafe { - ffi::DrawTextureEx(*texture.as_ref(), position, rotation, scale, tint); - } + unsafe { ffi::DrawTextureEx(*texture.as_ref(), position, rotation, scale, tint) } } /// Draws from a region of `texture` defined by the `source_rec` rectangle. @@ -724,9 +695,7 @@ pub trait RaylibDraw { position: Vector2, tint: Color, ) { - unsafe { - ffi::DrawTextureRec(*texture.as_ref(), source_rec, position, tint); - } + unsafe { ffi::DrawTextureRec(*texture.as_ref(), source_rec, position, tint) } } ///Draws a texture (or part of it) that stretches or shrinks nicely @@ -748,25 +717,21 @@ pub trait RaylibDraw { origin, rotation, tint, - ); + ) } } /// Shows current FPS. #[inline] fn draw_fps(&self, x: i32, y: i32) { - unsafe { - ffi::DrawFPS(x, y); - } + unsafe { ffi::DrawFPS(x, y) } } /// Draws text (using default font). #[inline] fn draw_text(&self, text: &str, x: i32, y: i32, font_size: i32, color: Color) { let c_text = CString::new(text).unwrap(); - unsafe { - ffi::DrawText(c_text.as_ptr(), x, y, font_size, color); - } + unsafe { ffi::DrawText(c_text.as_ptr(), x, y, font_size, color) } } /// Draws text using `font` and additional parameters. @@ -789,7 +754,7 @@ pub trait RaylibDraw { font_size, spacing, tint, - ); + ) } } @@ -803,9 +768,7 @@ pub trait RaylibDraw { scale: f32, tint: Color, ) { - unsafe { - ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position, scale, tint); - } + unsafe { ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position, scale, tint) } } } @@ -813,33 +776,25 @@ pub trait RaylibDraw3D { /// Draw a point in 3D space, actually a small line #[inline] fn draw_point_3d(&self, position: Vector3, color: Color) { - unsafe { - ffi::DrawPoint3D(position, color); - } + unsafe { ffi::DrawPoint3D(position, color) } } ///// Draw a color-filled triangle (vertex in counter-clockwise order!) #[inline] fn draw_triangle_3d(&self, v1: Vector3, v2: Vector3, v3: Vector3, color: Color) { - unsafe { - ffi::DrawTriangle3D(v1, v2, v3, color); - } + unsafe { ffi::DrawTriangle3D(v1, v2, v3, color) } } /// // Draw a triangle strip defined by points #[inline] fn draw_triangle_strip_3d(&self, points: &[Vector3], color: Color) { - unsafe { - ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color); - } + unsafe { ffi::DrawTriangleStrip3D(points.as_ptr() as *mut _, points.len() as i32, color) } } /// Draws a line in 3D world space. #[inline] fn draw_line_3d(&self, start_pos: Vector3, end_pos: Vector3, color: Color) { - unsafe { - ffi::DrawLine3D(start_pos, end_pos, color); - } + unsafe { ffi::DrawLine3D(start_pos, end_pos, color) } } /// Draws a circle in 3D world space. @@ -852,25 +807,19 @@ pub trait RaylibDraw3D { rotation_angle: f32, color: Color, ) { - unsafe { - ffi::DrawCircle3D(center, radius, rotation_axis, rotation_angle, color); - } + unsafe { ffi::DrawCircle3D(center, radius, rotation_axis, rotation_angle, color) } } /// Draws a cube. #[inline] fn draw_cube(&self, position: Vector3, width: f32, height: f32, length: f32, color: Color) { - unsafe { - ffi::DrawCube(position, width, height, length, color); - } + unsafe { ffi::DrawCube(position, width, height, length, color) } } /// Draws a cube (Vector version). #[inline] fn draw_cube_v(&self, position: Vector3, size: Vector3, color: Color) { - unsafe { - ffi::DrawCubeV(position, size, color); - } + unsafe { ffi::DrawCubeV(position, size, color) } } /// Draws a cube in wireframe. @@ -883,17 +832,13 @@ pub trait RaylibDraw3D { length: f32, color: Color, ) { - unsafe { - ffi::DrawCubeWires(position, width, height, length, color); - } + unsafe { ffi::DrawCubeWires(position, width, height, length, color) } } /// Draws a sphere. #[inline] fn draw_sphere(&self, center_pos: Vector3, radius: f32, color: Color) { - unsafe { - ffi::DrawSphere(center_pos, radius, color); - } + unsafe { ffi::DrawSphere(center_pos, radius, color) } } /// Draws a sphere with extended parameters. @@ -906,9 +851,7 @@ pub trait RaylibDraw3D { slices: i32, color: Color, ) { - unsafe { - ffi::DrawSphereEx(center_pos, radius, rings, slices, color); - } + unsafe { ffi::DrawSphereEx(center_pos, radius, rings, slices, color) } } /// Draws a sphere in wireframe. @@ -921,9 +864,7 @@ pub trait RaylibDraw3D { slices: i32, color: Color, ) { - unsafe { - ffi::DrawSphereWires(center_pos, radius, rings, slices, color); - } + unsafe { ffi::DrawSphereWires(center_pos, radius, rings, slices, color) } } /// Draws a cylinder. @@ -937,9 +878,7 @@ pub trait RaylibDraw3D { slices: i32, color: Color, ) { - unsafe { - ffi::DrawCylinder(position, radius_top, radius_bottom, height, slices, color); - } + unsafe { ffi::DrawCylinder(position, radius_top, radius_bottom, height, slices, color) } } /// Draws a cylinder in wireframe. @@ -954,32 +893,42 @@ pub trait RaylibDraw3D { color: Color, ) { unsafe { - ffi::DrawCylinderWires(position, radius_top, radius_bottom, height, slices, color); + ffi::DrawCylinderWires(position, radius_top, radius_bottom, height, slices, color) } } - /// Draws an X/Z plane. + /// Draw a cylinder wires with base at startPos and top at endPos #[inline] - fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { + fn draw_cylinder_wires_ex( + &self, + start_pos: Vector3, + end_pos: Vector3, + start_radius: f32, + end_radius: f32, + sides: i32, + color: Color, + ) { unsafe { - ffi::DrawPlane(center_pos, size, color); + ffi::DrawCylinderWiresEx(start_pos, end_pos, start_radius, end_radius, sides, color) } } + /// Draws an X/Z plane. + #[inline] + fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { + unsafe { ffi::DrawPlane(center_pos, size, color) } + } + /// Draws a ray line. #[inline] fn draw_ray(&self, ray: ffi::Ray, color: Color) { - unsafe { - ffi::DrawRay(ray, color); - } + unsafe { ffi::DrawRay(ray, color) } } /// Draws a grid (centered at (0, 0, 0)). #[inline] fn draw_grid(&self, slices: i32, spacing: f32) { - unsafe { - ffi::DrawGrid(slices, spacing); - } + unsafe { ffi::DrawGrid(slices, spacing) } } /// Draws a model (with texture if set). @@ -991,9 +940,7 @@ pub trait RaylibDraw3D { scale: f32, tint: Color, ) { - unsafe { - ffi::DrawModel(*model.as_ref(), position, scale, tint); - } + unsafe { ffi::DrawModel(*model.as_ref(), position, scale, tint) } } /// Draws a model with extended parameters. @@ -1015,7 +962,7 @@ pub trait RaylibDraw3D { rotation_angle, scale, tint, - ); + ) } } @@ -1028,9 +975,7 @@ pub trait RaylibDraw3D { scale: f32, tint: Color, ) { - unsafe { - ffi::DrawModelWires(*model.as_ref(), position, scale, tint); - } + unsafe { ffi::DrawModelWires(*model.as_ref(), position, scale, tint) } } /// Draws a model with wires. @@ -1052,16 +997,14 @@ pub trait RaylibDraw3D { rotation_angle, scale, tint, - ); + ) } } /// Draws a bounding box (wires). #[inline] fn draw_bounding_box(&self, bbox: BoundingBox, color: Color) { - unsafe { - ffi::DrawBoundingBox(bbox, color); - } + unsafe { ffi::DrawBoundingBox(bbox, color) } } /// Draws a billboard texture. @@ -1074,9 +1017,7 @@ pub trait RaylibDraw3D { size: f32, tint: Color, ) { - unsafe { - ffi::DrawBillboard(camera, texture.0, center, size, tint); - } + unsafe { ffi::DrawBillboard(camera, texture.0, center, size, tint) } } /// Draws a billboard texture defined by `source_rec`. @@ -1090,8 +1031,6 @@ pub trait RaylibDraw3D { size: Vector2, tint: Color, ) { - unsafe { - ffi::DrawBillboardRec(camera, texture.0, source_rec, center, size, tint); - } + unsafe { ffi::DrawBillboardRec(camera, texture.0, source_rec, center, size, tint) } } } diff --git a/raylib/src/core/input.rs b/raylib/src/core/input.rs index d6cb2010..0bd2cc5a 100644 --- a/raylib/src/core/input.rs +++ b/raylib/src/core/input.rs @@ -1,5 +1,5 @@ //! Keyboard, Controller, and Mouse related functions -use std::ffi::CStr; +use std::ffi::{CStr, CString}; use super::RaylibHandle; use crate::ffi::{self, GamepadAxis, GamepadButton, Gesture, KeyboardKey, MouseButton, Vector2}; @@ -134,6 +134,12 @@ impl RaylibHandle<'_> { unsafe { ffi::GetGamepadAxisMovement(gamepad, axis as i32) } } + #[inline] + pub fn set_gamepad_mapping(&self, mapping: &str) -> bool { + let c_mapping = CString::new(mapping).unwrap(); + unsafe { ffi::SetGamepadMappings(c_mapping.as_ptr()) >= 0 } + } + /// Detect if a mouse button has been pressed once. #[inline] pub fn is_mouse_button_pressed(&self, button: MouseButton) -> bool { @@ -208,12 +214,18 @@ impl RaylibHandle<'_> { } } - /// Returns mouse wheel movement Y. + /// Get mouse wheel movement for X or Y, whichever is larger #[inline] pub fn get_mouse_wheel_move(&self) -> f32 { unsafe { ffi::GetMouseWheelMove() } } + // Get mouse wheel movement for both X and Y + #[inline] + pub fn get_mouse_wheel_move_v(&self) -> Vector2 { + unsafe { ffi::GetMouseWheelMoveV() } + } + /// Returns touch position X for touch point 0 (relative to screen size). #[inline] pub fn get_touch_x(&self) -> i32 { diff --git a/raylib/src/core/misc.rs b/raylib/src/core/misc.rs index 2f308334..74ec9850 100644 --- a/raylib/src/core/misc.rs +++ b/raylib/src/core/misc.rs @@ -51,9 +51,7 @@ impl RaylibHandle<'_> { /// Takes a screenshot of current screen (saved a .png) pub fn take_screenshot(&self, _: &RaylibThread, filename: &str) { let c_filename = CString::new(filename).unwrap(); - unsafe { - ffi::TakeScreenshot(c_filename.as_ptr()); - } + unsafe { ffi::TakeScreenshot(c_filename.as_ptr()) } } } @@ -72,9 +70,7 @@ impl RaylibHandle<'_> { /// Set the seed for random number generation pub fn set_random_seed(&self, seed: u32) { - unsafe { - ffi::SetRandomSeed(seed); - } + unsafe { ffi::SetRandomSeed(seed) } } } diff --git a/raylib/src/core/shaders.rs b/raylib/src/core/shaders.rs index 54e1725e..fa336610 100644 --- a/raylib/src/core/shaders.rs +++ b/raylib/src/core/shaders.rs @@ -235,6 +235,15 @@ pub trait RaylibShader: AsRef + AsMut { unsafe { ffi::GetShaderLocation(*self.as_ref(), c_uniform_name.as_ptr()) } } + /// Get shader attribute location + #[inline] + fn get_shader_location_attrib(&self, attrib_name: &str) -> Option { + let c_attrib_name = CString::new(attrib_name).ok()?; + let attrib = unsafe { ffi::GetShaderLocationAttrib(*self.as_ref(), c_attrib_name.as_ptr()) }; + + (attrib >= 0).then_some(attrib) + } + /// Sets shader uniform value #[inline] fn set_shader_value(&mut self, uniform_loc: i32, value: S) { diff --git a/raylib/src/core/texture.rs b/raylib/src/core/texture.rs index b7787bfc..6776c75a 100644 --- a/raylib/src/core/texture.rs +++ b/raylib/src/core/texture.rs @@ -170,49 +170,43 @@ impl Image { /// Clears alpha channel on `image` to desired color. #[inline] pub fn alpha_clear(&mut self, color: Color, threshold: f32) { - unsafe { - ffi::ImageAlphaClear(&mut self.0, color, threshold); - } + unsafe { ffi::ImageAlphaClear(&mut self.0, color, threshold) } } /// Crops `image` depending on alpha value. #[inline] pub fn alpha_crop(&mut self, threshold: f32) { - unsafe { - ffi::ImageAlphaCrop(&mut self.0, threshold); - } + unsafe { ffi::ImageAlphaCrop(&mut self.0, threshold) } } /// Premultiplies alpha channel on `image`. #[inline] pub fn alpha_premultiply(&mut self) { - unsafe { - ffi::ImageAlphaPremultiply(&mut self.0); - } + unsafe { ffi::ImageAlphaPremultiply(&mut self.0) } + } + + /// Apply Gaussian blur using a box blur approximation + #[inline] + pub fn blur_gaussian(&mut self, blur_size: i32) { + unsafe { ffi::ImageBlurGaussian(&mut self.0, blur_size) } } /// Crops `image` to a defined rectangle. #[inline] pub fn crop(&mut self, crop: Rectangle) { - unsafe { - ffi::ImageCrop(&mut self.0, crop); - } + unsafe { ffi::ImageCrop(&mut self.0, crop) } } /// Resizes `image` (bilinear filtering). #[inline] pub fn resize(&mut self, new_width: i32, new_height: i32) { - unsafe { - ffi::ImageResize(&mut self.0, new_width, new_height); - } + unsafe { ffi::ImageResize(&mut self.0, new_width, new_height) } } /// Resizes `image` (nearest-neighbor scaling). #[inline] pub fn resize_nn(&mut self, new_width: i32, new_height: i32) { - unsafe { - ffi::ImageResizeNN(&mut self.0, new_width, new_height); - } + unsafe { ffi::ImageResizeNN(&mut self.0, new_width, new_height) } } /// Resizes `image` canvas and fills with `color`. @@ -233,24 +227,20 @@ impl Image { offset_x, offset_y, color, - ); + ) } } /// Generates all mipmap levels for a provided `image`. #[inline] pub fn gen_mipmaps(&mut self) { - unsafe { - ffi::ImageMipmaps(&mut self.0); - } + unsafe { ffi::ImageMipmaps(&mut self.0) } } /// Dithers `image` data to 16bpp or lower (Floyd-Steinberg dithering). #[inline] pub fn dither(&mut self, r_bpp: i32, g_bpp: i32, b_bpp: i32, a_bpp: i32) { - unsafe { - ffi::ImageDither(&mut self.0, r_bpp, g_bpp, b_bpp, a_bpp); - } + unsafe { ffi::ImageDither(&mut self.0, r_bpp, g_bpp, b_bpp, a_bpp) } } /// Get image alpha border rectangle @@ -268,9 +258,7 @@ impl Image { /// Draws a source image within a destination image. #[inline] pub fn draw(&mut self, src: &Image, src_rec: Rectangle, dst_rec: Rectangle, tint: Color) { - unsafe { - ffi::ImageDraw(&mut self.0, src.0, src_rec, dst_rec, tint); - } + unsafe { ffi::ImageDraw(&mut self.0, src.0, src_rec, dst_rec, tint) } } /// Draw pixel within an image @@ -499,6 +487,22 @@ impl Image { unsafe { Image(ffi::GenImageWhiteNoise(width, height, factor)) } } + /// Generates an Image containing white noise. + #[inline] + pub fn gen_image_perlin_noise( + width: i32, + height: i32, + offset_x: i32, + offset_y: i32, + scale: f32, + ) -> Image { + unsafe { + Image(ffi::GenImagePerlinNoise( + width, height, offset_x, offset_y, scale, + )) + } + } + /// Generates an Image using a cellular algorithm. Bigger `tile_size` means bigger cells. #[inline] pub fn gen_image_cellular(width: i32, height: i32, tile_size: i32) -> Image { @@ -550,6 +554,15 @@ impl Image { Ok(Image(i)) } + /// Load image sequence from file (frames appended to image.data) + pub fn load_image_anim(filename: &str) -> (Image, u32) { + let c_filename = CString::new(filename).unwrap(); + let mut count = 0i32; + let image = unsafe { ffi::LoadImageAnim(c_filename.as_ptr(), &mut count) }; + + (Image(image), count as u32) + } + /// Creates an image from `text` (custom font). #[inline] pub fn image_text(text: &str, font_size: i32, color: Color) -> Image { diff --git a/raylib/src/core/window.rs b/raylib/src/core/window.rs index 259aaa78..5bebc15e 100644 --- a/raylib/src/core/window.rs +++ b/raylib/src/core/window.rs @@ -404,9 +404,7 @@ impl RaylibHandle<'_> { /// Set clipboard text content pub fn set_clipboard_text(&self, text: &str) -> Result<(), NulError> { let s = CString::new(text)?; - unsafe { - ffi::SetClipboardText(s.as_ptr()); - } + unsafe { ffi::SetClipboardText(s.as_ptr()) } Ok(()) } } @@ -449,9 +447,7 @@ impl RaylibHandle<'_> { impl RaylibHandle<'_> { /// Set target FPS (maximum) pub fn set_target_fps(&self, fps: u32) { - unsafe { - ffi::SetTargetFPS(fps as i32); - } + unsafe { ffi::SetTargetFPS(fps as i32) } } /// Returns current FPS @@ -564,33 +560,25 @@ impl RaylibHandle<'_> { /// Toggles fullscreen mode (only on desktop platforms). #[inline] pub fn toggle_fullscreen(&self) { - unsafe { - ffi::ToggleFullscreen(); - } + unsafe { ffi::ToggleFullscreen() } } /// Set window state: maximized, if resizable (only PLATFORM_DESKTOP) #[inline] pub fn maximize_window(&self) { - unsafe { - ffi::MaximizeWindow(); - } + unsafe { ffi::MaximizeWindow() } } /// Set window state: minimized, if resizable (only PLATFORM_DESKTOP) #[inline] pub fn minimize_window(&self) { - unsafe { - ffi::MinimizeWindow(); - } + unsafe { ffi::MinimizeWindow() } } /// Set window state: not minimized/maximized (only PLATFORM_DESKTOP) #[inline] pub fn restore_window(&self) { - unsafe { - ffi::RestoreWindow(); - } + unsafe { ffi::RestoreWindow() } } /// Set window configuration state using flags @@ -641,9 +629,7 @@ impl RaylibHandle<'_> { /// Sets icon for window (only on desktop platforms). #[inline] pub fn set_window_icon(&self, image: impl AsRef) { - unsafe { - ffi::SetWindowIcon(*image.as_ref()); - } + unsafe { ffi::SetWindowIcon(*image.as_ref()) } } /// Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) @@ -656,17 +642,13 @@ impl RaylibHandle<'_> { #[inline] pub fn set_window_title(&self, _: &RaylibThread, title: &str) { let c_title = CString::new(title).unwrap(); - unsafe { - ffi::SetWindowTitle(c_title.as_ptr()); - } + unsafe { ffi::SetWindowTitle(c_title.as_ptr()) } } /// Sets window position on screen (only on desktop platforms). #[inline] pub fn set_window_position(&self, x: i32, y: i32) { - unsafe { - ffi::SetWindowPosition(x, y); - } + unsafe { ffi::SetWindowPosition(x, y) } } /// Sets monitor for the current window (fullscreen mode). @@ -674,25 +656,19 @@ impl RaylibHandle<'_> { pub fn set_window_monitor(&self, monitor: i32) { let len = get_monitor_count(); debug_assert!(monitor < len && monitor >= 0, "monitor index out of range"); - unsafe { - ffi::SetWindowMonitor(monitor); - } + unsafe { ffi::SetWindowMonitor(monitor) } } /// Sets minimum window dimensions (for `FLAG_WINDOW_RESIZABLE`). #[inline] pub fn set_window_min_size(&self, width: i32, height: i32) { - unsafe { - ffi::SetWindowMinSize(width, height); - } + unsafe { ffi::SetWindowMinSize(width, height) } } /// Sets window dimensions. #[inline] pub fn set_window_size(&self, width: i32, height: i32) { - unsafe { - ffi::SetWindowSize(width, height); - } + unsafe { ffi::SetWindowSize(width, height) } } /// Gets current screen width. @@ -719,17 +695,13 @@ impl RaylibHandle<'_> { /// Shows mouse cursor. #[inline] pub fn show_cursor(&self) { - unsafe { - ffi::ShowCursor(); - } + unsafe { ffi::ShowCursor() } } /// Hides mouse cursor. #[inline] pub fn hide_cursor(&self) { - unsafe { - ffi::HideCursor(); - } + unsafe { ffi::HideCursor() } } /// Checks if mouse cursor is not visible. @@ -741,17 +713,13 @@ impl RaylibHandle<'_> { /// Enables mouse cursor (unlock cursor). #[inline] pub fn enable_cursor(&self) { - unsafe { - ffi::EnableCursor(); - } + unsafe { ffi::EnableCursor() } } /// Disables mouse cursor (lock cursor). #[inline] pub fn disable_cursor(&self) { - unsafe { - ffi::DisableCursor(); - } + unsafe { ffi::DisableCursor() } } /// Get native window handle From 187ddc23d8f6a8631d22202ebd6233e47984ecd2 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Thu, 30 Mar 2023 21:45:37 +0200 Subject: [PATCH 17/30] Rework Begin*Mode in a similar way than for BeginDrawing. Actually makes things simpler, and avoids invalid nested begin*mode. --- raylib/src/core/drawing.rs | 307 ++++++++++++++----------------------- raylib/src/core/mod.rs | 5 +- samples/camera2D.rs | 15 +- samples/roguelike.rs | 36 +++-- 4 files changed, 140 insertions(+), 223 deletions(-) diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index 7aa50add..dc6afb9e 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -1,252 +1,167 @@ //! Contains code related to drawing. Types that can be set as a surface to draw will implement the [`RaylibDraw`] trait -use super::{texture::Texture2D, vr::VrStereoConfig, RaylibHandle, RaylibThread}; +use raylib_sys::Camera; + +use super::{ + shaders::Shader, + texture::{RenderTexture2D, Texture2D}, + vr::VrStereoConfig, + RaylibHandle, +}; use crate::ffi::{ self, BlendMode, BoundingBox, Camera2D, Camera3D, Color, NPatchInfo, Rectangle, Vector2, Vector3, }; -use std::{convert::AsRef, ffi::CString, marker::PhantomData}; - -#[derive(Debug)] -pub struct RaylibDrawHandle<'bind>(pub(crate) PhantomData<&'bind RaylibHandle<'bind>>); +use std::{cell::Cell, convert::AsRef, ffi::CString, marker::PhantomData}; + +/// Holds the state of "special" Begin/End modes. +#[derive(Clone, Default)] +pub(crate) struct RaylibDrawState { + texture: bool, + vr: bool, + camera2d: bool, + camera3d: bool, + shader: bool, + blend: bool, + scissor: bool, +} -impl RaylibDraw for RaylibDrawHandle<'_> {} +pub struct RaylibDrawHandle<'bind>( + pub(crate) PhantomData<&'bind RaylibHandle<'bind>>, + pub(crate) Cell, +); -// Texture2D Stuff +impl RaylibDrawHandle<'_> { + pub fn mode_texture2d(&self, target: &mut RenderTexture2D, func: F) { + let mut state = self.1.take(); -pub struct RaylibTextureMode<'a, T>(&'a T, &'a mut ffi::RenderTexture2D); + if state.texture { + panic!("Nested mode_texture2d occured !"); + } -impl Drop for RaylibTextureMode<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndTextureMode() } - } -} + state.texture = true; + self.1.set(state.clone()); -impl std::ops::Deref for RaylibTextureMode<'_, T> { - type Target = T; + unsafe { ffi::BeginTextureMode(target.0) }; + func(); + unsafe { ffi::EndTextureMode() }; - fn deref(&self) -> &Self::Target { - self.0 + state.texture = false; + self.1.set(state); } -} -pub trait RaylibTextureModeExt -where - Self: Sized, -{ - #[must_use] - fn begin_texture_mode<'a>( - &'a mut self, - _: &RaylibThread, - framebuffer: &'a mut ffi::RenderTexture2D, - ) -> RaylibTextureMode { - unsafe { ffi::BeginTextureMode(*framebuffer) } - RaylibTextureMode(self, framebuffer) - } -} + pub fn mode_vr(&self, config: &VrStereoConfig, func: F) { + let mut state = self.1.take(); -// Only the DrawHandle can start a texture -impl RaylibTextureModeExt for RaylibDrawHandle<'_> {} -impl RaylibDraw for RaylibTextureMode<'_, T> {} + if state.vr { + panic!("Nested mode_vr occured !"); + } -// VR Stuff + state.vr = true; + self.1.set(state.clone()); -pub struct RaylibVRMode<'a, T>(&'a T, &'a mut VrStereoConfig); + unsafe { ffi::BeginVrStereoMode(config.0) }; + func(); + unsafe { ffi::EndVrStereoMode() }; -impl Drop for RaylibVRMode<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndVrStereoMode() } + state.vr = false; + self.1.set(state); } -} -impl std::ops::Deref for RaylibVRMode<'_, T> { - type Target = T; + pub fn mode_camera_2d(&self, camera: &Camera2D, func: F) { + let mut state = self.1.take(); - fn deref(&self) -> &Self::Target { - self.0 - } -} - -pub trait RaylibVRModeExt -where - Self: Sized, -{ - #[must_use] - fn begin_vr_stereo_mode<'a>( - &'a mut self, - vr_config: &'a mut VrStereoConfig, - ) -> RaylibVRMode { - unsafe { ffi::BeginVrStereoMode(*vr_config.as_ref()) } - RaylibVRMode(self, vr_config) - } -} + if state.camera2d { + panic!("Nested mode_camera_2d occured !"); + } -impl RaylibVRModeExt for D {} -impl RaylibDraw for RaylibVRMode<'_, T> {} + state.camera2d = true; + self.1.set(state.clone()); -// 2D Mode + unsafe { ffi::BeginMode2D(*camera) }; + func(); + unsafe { ffi::EndMode2D() }; -pub struct RaylibMode2D<'a, T>(&'a T); -impl Drop for RaylibMode2D<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndMode2D() } + state.camera2d = false; + self.1.set(state); } -} -impl std::ops::Deref for RaylibMode2D<'_, T> { - type Target = T; - fn deref(&self) -> &Self::Target { - self.0 - } -} + pub fn mode_camera_3d(&self, camera: &Camera, func: F) { + let mut state = self.1.take(); -pub trait RaylibMode2DExt -where - Self: Sized, -{ - #[must_use] - fn begin_mode_2d(&self, camera: Camera2D) -> RaylibMode2D { - unsafe { ffi::BeginMode2D(camera) } - RaylibMode2D(self) - } -} + if state.camera3d { + panic!("Nested mode_camera_3d occured !"); + } -impl RaylibMode2DExt for D {} -impl RaylibDraw for RaylibMode2D<'_, T> {} + state.camera3d = true; + self.1.set(state.clone()); -// 3D Mode + unsafe { ffi::BeginMode3D(*camera) }; + func(); + unsafe { ffi::EndMode3D() }; -pub struct RaylibMode3D<'a, T>(&'a T); -impl Drop for RaylibMode3D<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndMode3D() } + state.camera3d = false; + self.1.set(state); } -} -impl std::ops::Deref for RaylibMode3D<'_, T> { - type Target = T; - fn deref(&self) -> &Self::Target { - self.0 - } -} + pub fn mode_shader(&self, shader: &Shader, func: F) { + let mut state = self.1.take(); -pub trait RaylibMode3DExt -where - Self: Sized, -{ - #[must_use] - fn begin_mode_3d(&self, camera: Camera3D) -> RaylibMode3D { - unsafe { ffi::BeginMode3D(camera) } - RaylibMode3D(self) - } -} - -impl RaylibMode3DExt for D {} -impl RaylibDraw for RaylibMode3D<'_, T> {} -impl RaylibDraw3D for RaylibMode3D<'_, T> {} - -// shader Mode - -pub struct RaylibShaderMode<'a, T>(&'a mut T, &'a ffi::Shader); + if state.shader { + panic!("Nested mode_shader occured !"); + } -impl Drop for RaylibShaderMode<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndShaderMode() } - } -} -impl std::ops::Deref for RaylibShaderMode<'_, T> { - type Target = T; + state.shader = true; + self.1.set(state.clone()); - fn deref(&self) -> &Self::Target { - self.0 - } -} + unsafe { ffi::BeginShaderMode(shader.0) }; + func(); + unsafe { ffi::EndShaderMode() }; -pub trait RaylibShaderModeExt -where - Self: Sized, -{ - #[must_use] - fn begin_shader_mode<'a>(&'a mut self, shader: &'a ffi::Shader) -> RaylibShaderMode { - unsafe { ffi::BeginShaderMode(*shader) } - RaylibShaderMode(self, shader) + state.shader = false; + self.1.set(state); } -} -impl RaylibShaderModeExt for D {} -impl<'a, T> RaylibDraw for RaylibShaderMode<'a, T> {} -impl<'a, T> RaylibDraw3D for RaylibShaderMode<'a, T> {} + pub fn mode_blend(&self, blend_mode: BlendMode, func: F) { + let mut state = self.1.take(); -// Blend Mode + if state.blend { + panic!("Nested mode_blend occured !"); + } -pub struct RaylibBlendMode<'a, T>(&'a T); -impl<'a, T> Drop for RaylibBlendMode<'a, T> { - fn drop(&mut self) { - unsafe { ffi::EndBlendMode() } - } -} -impl<'a, T> std::ops::Deref for RaylibBlendMode<'a, T> { - type Target = T; + state.blend = true; + self.1.set(state.clone()); - fn deref(&self) -> &Self::Target { - self.0 - } -} + unsafe { ffi::BeginBlendMode(blend_mode as _) }; + func(); + unsafe { ffi::EndBlendMode() }; -pub trait RaylibBlendModeExt -where - Self: Sized, -{ - #[must_use] - fn begin_blend_mode(&self, blend_mode: BlendMode) -> RaylibBlendMode { - unsafe { ffi::BeginBlendMode((blend_mode as u32) as i32) } - RaylibBlendMode(self) + state.blend = false; + self.1.set(state); } -} -impl RaylibBlendModeExt for D {} -impl RaylibDraw for RaylibBlendMode<'_, T> {} -impl RaylibDraw3D for RaylibBlendMode<'_, T> {} + pub fn mode_scissors(&self, x: i32, y: i32, width: i32, height: i32, func: F) { + let mut state = self.1.take(); -// Scissor Mode stuff + if state.scissor { + panic!("Nested mode_scissors occured !"); + } -pub struct RaylibScissorMode<'a, T>(&'a T); -impl Drop for RaylibScissorMode<'_, T> { - fn drop(&mut self) { - unsafe { ffi::EndScissorMode() } - } -} -impl std::ops::Deref for RaylibScissorMode<'_, T> { - type Target = T; + state.scissor = true; + self.1.set(state.clone()); - fn deref(&self) -> &Self::Target { - self.0 - } -} + unsafe { ffi::BeginScissorMode(x, y, width, height) }; + func(); + unsafe { ffi::EndScissorMode() }; -pub trait RaylibScissorModeExt -where - Self: Sized, -{ - #[must_use] - fn begin_scissor_mode( - &self, - x: i32, - y: i32, - width: i32, - height: i32, - ) -> RaylibScissorMode { - unsafe { ffi::BeginScissorMode(x, y, width, height) } - RaylibScissorMode(self) + state.scissor = false; + self.1.set(state); } } -impl RaylibScissorModeExt for D {} -impl RaylibDraw for RaylibScissorMode<'_, T> {} -impl RaylibDraw3D for RaylibScissorMode<'_, T> {} +impl RaylibDraw for RaylibDrawHandle<'_> {} // Actual drawing functions - pub trait RaylibDraw { /// Sets background color (framebuffer clear color). #[inline] diff --git a/raylib/src/core/mod.rs b/raylib/src/core/mod.rs index c6657dee..1ebc527b 100644 --- a/raylib/src/core/mod.rs +++ b/raylib/src/core/mod.rs @@ -15,7 +15,7 @@ pub mod window; use crate::ffi; -use std::cell::{RefCell, RefMut}; +use std::cell::{Cell, RefCell, RefMut}; use std::ffi::CString; use std::marker::PhantomData; use std::sync::atomic::{AtomicBool, Ordering}; @@ -54,7 +54,6 @@ pub struct RaylibThread(PhantomData<*const ()>); /// [`init_window`]: fn.init_window.html /// [`RaylibBuilder`]: struct.RaylibBuilder.html /// [`init`]: fn.init.html -#[derive(Debug)] pub struct RaylibHandle<'rl>(RefCell>); // inner field is private, preventing manual construction impl<'th, 'a: 'th> RaylibHandle<'a> { @@ -223,6 +222,6 @@ fn init_window(width: i32, height: i32, title: &str) -> RaylibHandle<'static> { } IS_INITIALIZED.store(true, Ordering::Relaxed); - RaylibHandle(RefCell::new(RaylibDrawHandle(PhantomData))) + RaylibHandle(RefCell::new(RaylibDrawHandle(PhantomData, Cell::default()))) } } diff --git a/samples/camera2D.rs b/samples/camera2D.rs index f485f5bf..897d9a04 100644 --- a/samples/camera2D.rs +++ b/samples/camera2D.rs @@ -80,30 +80,29 @@ fn main() { rl.frame(&thread, |d| { d.clear_background(Color::RAYWHITE); - { - let d2 = d.begin_mode_2d(camera); - d2.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); + d.mode_camera_2d(&camera, || { + d.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); for i in 0..MAX_BUILDINGS { - d2.draw_rectangle_rec(buildings[i], build_colors[i]); + d.draw_rectangle_rec(buildings[i], build_colors[i]); } - d2.draw_rectangle_rec(player, Color::RED); + d.draw_rectangle_rec(player, Color::RED); - d2.draw_line( + d.draw_line( camera.target.x as i32, -h * 10, camera.target.x as i32, h * 10, Color::GREEN, ); - d2.draw_line( + d.draw_line( -w * 10, camera.target.y as i32, w * 10, camera.target.y as i32, Color::GREEN, ); - } + }); d.draw_text("SCREEN AREA", 640, 10, 20, Color::RED); diff --git a/samples/roguelike.rs b/samples/roguelike.rs index 996fc7f8..2195ae6e 100644 --- a/samples/roguelike.rs +++ b/samples/roguelike.rs @@ -4,11 +4,18 @@ /// IMHO Don't write code like this. Use ECS and other methods to have game objects and components. /// Only do this as an exercise. extern crate raylib; -use raylib::ffi::KeyboardKey; +use nalgebra::Vector2; use rand::distributions::WeightedIndex; use rand::prelude::*; use rand::Rng; -use raylib::prelude::*; +use raylib::{ + core::{ + text::measure_text, + texture::{Image, RaylibTexture2D}, + }, + ffi::{Color, KeyboardKey, MouseButton, Rectangle}, + prelude::*, +}; use serde::{Deserialize, Serialize}; use std::error::Error; use std::fs::File; @@ -99,7 +106,7 @@ impl RectExt for &Rectangle {} /// things here struct Tcod { fov: FovMap, - mouse: Vector2, + mouse: Vector2, } /// This enum tells us if the player has taken an action. This is significant @@ -598,7 +605,7 @@ fn make_map(objects: &mut Vec, level: u32) -> Map { let new_room = Rectangle::new(x as f32, y as f32, w as f32, h as f32); let failed = rooms .iter() - .any(|other| new_room.check_collision_recs(other)); + .any(|other| new_room.check_collision_recs(*other)); if !failed { create_room(&new_room, &mut map); @@ -894,7 +901,7 @@ fn create_v_tunnel(y1: i32, y2: i32, x: i32, map: &mut Map) { } } -fn get_names_under_mouse(mouse: Vector2, objects: &[Object], fov_map: &FovMap) -> String { +fn get_names_under_mouse(mouse: Vector2, objects: &[Object], fov_map: &FovMap) -> String { let (x, y) = (mouse.x as i32 / TILE_WIDTH, mouse.y as i32 / TILE_HEIGHT); let names = objects @@ -934,8 +941,8 @@ fn play_game( // handle game logic level_up(rl, thread, game, objects); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) { - tcod.mouse = rl.get_mouse_position(); + if rl.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_LEFT) { + tcod.mouse = rl.get_mouse_position().into(); } let player_action = handle_keys(rl, thread, tcod, game, objects); @@ -985,7 +992,7 @@ fn handle_keys( game: &mut Game, objects: &mut Vec, ) -> PlayerAction { - use raylib::consts::KeyboardKey::*; + use raylib::ffi::KeyboardKey::*; use PlayerAction::*; let pressed_key = rl.get_key_pressed_number(); @@ -1577,7 +1584,7 @@ fn main_menu(rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { let img = rl .load_texture_from_image(&thread, &img) .expect("could not load texture from image"); - img.set_texture_wrap(thread, raylib::consts::TextureWrap::TEXTURE_WRAP_CLAMP); + img.set_texture_wrap(thread, raylib::ffi::TextureWrap::TEXTURE_WRAP_CLAMP); while !rl.window_should_close() { // show the background image, at twice the regular console resolution @@ -1585,7 +1592,7 @@ fn main_menu(rl: &RaylibHandle, thread: &RaylibThread, tcod: &mut Tcod) { let mut choice = None; rl.frame(thread, |d| { d.clear_background(Color::BLACK); - d.draw_texture_ex(&img, Vector2::new(0.0, 0.0), 0.0, 1.0, Color::WHITE); + d.draw_texture_ex(&img, Vector2::new(0.0, 0.0).into(), 0.0, 1.0, Color::WHITE); // Game title d.draw_text( "TOMBS OF THE ANCIENT KINGS", @@ -1801,14 +1808,11 @@ fn target_tile( let (x, y) = (pos.x as i32 / TILE_WIDTH, pos.y as i32 / TILE_HEIGHT); let in_fov = (x < MAP_WIDTH) && (y < MAP_HEIGHT) && tcod.fov.is_in_fov(x, y); let in_range = max_range.map_or(true, |range| objects[PLAYER].distance(x, y) <= range); - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_LEFT) - && in_fov - && in_range - { + if rl.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_LEFT) && in_fov && in_range { return Some((x, y)); } - if rl.is_mouse_button_pressed(raylib::consts::MouseButton::MOUSE_BUTTON_RIGHT) { + if rl.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_RIGHT) { return None; } // ... @@ -1893,7 +1897,7 @@ fn menu>( if let Some(pressed_key) = pressed_key { dbg!(pressed_key); use std::num::Wrapping; - let index = Wrapping(pressed_key) - Wrapping(KEY_A as u32); + let index = Wrapping(pressed_key) - Wrapping(KeyboardKey::KEY_A as u32); let index: u32 = index.0; if (index as usize) < options.len() { Some(index as usize) From 361e613369adcade0c2ba107f2a096e27cb0e50d Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Thu, 30 Mar 2023 21:46:46 +0200 Subject: [PATCH 18/30] Add myself to contributors. --- LICENSE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE.md b/LICENSE.md index 963771b6..98df7158 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,7 @@ # License Copyright (c) 2018-2019 Paul Clement (@deltaphc) +Copyright (c) 2023 Teddy Astie (@tsnake41) 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. From d826b68c21bacb07bc7c3ff62c27c6e0ee0eb3e7 Mon Sep 17 00:00:00 2001 From: Dacode45 Date: Sat, 1 Apr 2023 16:09:25 -0700 Subject: [PATCH 19/30] Working PR --- Cargo.toml | 2 +- DECISIONS.md | 5 + {showcase => examples}/.cargo/config.toml | 0 {showcase => examples}/Cargo.toml | 0 {showcase => examples}/Makefile | 0 .../original/audio/audio_module_playing.c | 0 .../original/audio/audio_module_playing.png | Bin .../original/audio/audio_multichannel_sound.c | 0 .../audio/audio_multichannel_sound.png | Bin .../original/audio/audio_music_stream.c | 0 .../original/audio/audio_music_stream.png | Bin .../original/audio/audio_raw_stream.c | 0 .../original/audio/audio_raw_stream.png | Bin .../original/audio/audio_sound_loading.c | 0 .../original/audio/audio_sound_loading.png | Bin .../original/audio/resources/chiptun1.mod | Bin .../original/audio/resources/coin.wav | Bin .../audio/resources/guitar_noodling.ogg | Bin .../original/audio/resources/mini1111.xm | Bin .../original/audio/resources/sound.wav | Bin .../original/audio/resources/spring.wav | Bin .../original/audio/resources/tanatana.flac | Bin .../original/audio/resources/tanatana.ogg | Bin .../original/audio/resources/weird.wav | Bin .../controls_test_suite/controls_test_suite.c | 0 .../fonts/FiveByFive10.ttf | Bin .../fonts/NorthernLights.ttf | Bin .../controls_test_suite/fonts/PIXEARG11.ttf | Bin .../fonts/PixelOperator8.ttf | Bin .../fonts/pixelpoiiz10.ttf | Bin .../controls_test_suite/fonts/prstartk8.ttf | Bin .../fonts/rainyhearts16.ttf | Bin .../original/core/core_2d_camera.c | 0 .../original/core/core_2d_camera.png | Bin .../original/core/core_2d_camera_platformer.c | 0 .../core/core_2d_camera_platformer.png | Bin .../core/core_3d_camera_first_person.c | 0 .../core/core_3d_camera_first_person.png | Bin .../original/core/core_3d_camera_free.c | 0 .../original/core/core_3d_camera_free.png | Bin .../original/core/core_3d_camera_mode.c | 0 .../original/core/core_3d_camera_mode.png | Bin .../original/core/core_3d_picking.c | 0 .../original/core/core_3d_picking.png | Bin .../original/core/core_basic_window.c | 0 .../original/core/core_basic_window.cpp | 0 .../original/core/core_basic_window.png | Bin .../original/core/core_basic_window_web.c | 0 .../original/core/core_custom_logging.c | 0 .../original/core/core_custom_logging.png | Bin .../original/core/core_drop_files.c | 0 .../original/core/core_drop_files.png | Bin .../original/core/core_input_gamepad.c | 0 .../original/core/core_input_gamepad.png | Bin .../original/core/core_input_gestures.c | 0 .../original/core/core_input_gestures.png | Bin .../original/core/core_input_keys.c | 0 .../original/core/core_input_keys.png | Bin .../original/core/core_input_mouse.c | 0 .../original/core/core_input_mouse.png | Bin .../original/core/core_input_mouse_wheel.c | 0 .../original/core/core_input_mouse_wheel.png | Bin .../original/core/core_input_multitouch.c | 0 .../original/core/core_input_multitouch.png | Bin .../original/core/core_loading_thread.c | 0 .../original/core/core_loading_thread.png | Bin .../original/core/core_random_values.c | 0 .../original/core/core_random_values.png | Bin .../original/core/core_scissor_test.c | 0 .../original/core/core_scissor_test.png | Bin .../original/core/core_storage_values.c | 0 .../original/core/core_storage_values.png | Bin .../original/core/core_vr_simulator.c | 0 .../original/core/core_vr_simulator.png | Bin .../original/core/core_window_letterbox.c | 0 .../original/core/core_window_letterbox.png | Bin .../original/core/core_world_screen.c | 0 .../original/core/core_world_screen.png | Bin .../original/core/resources/distortion100.fs | 0 .../original/core/resources/distortion330.fs | 0 .../original/core/resources/ps3.png | Bin .../original/core/resources/xbox.png | Bin .../original/custom_file_dialog/cat.png | Bin .../custom_file_dialog/custom_file_dialog.c | 0 .../custom_file_dialog/gui_file_dialog.h | 0 .../original/image_exporter/image_exporter.c | 0 .../original/image_exporter/resources/cat.png | Bin .../image_exporter/resources/fudesumi.png | Bin .../image_exporter/resources/parrots.png | Bin .../image_exporter/resources/scarfy.png | Bin .../design/raw_importer_REF.png | Bin .../design/raw_importer_REV0.png | Bin .../design/raw_importer_REV1.png | Bin .../design/raw_importer_REV2.png | Bin .../design/raw_importer_REV3.png | Bin .../design/raw_importer_REV4.png | Bin .../design/raw_importer_REV5.png | Bin .../image_raw_importer/image_2x2_RGBA.raw | Bin .../image_raw_importer/image_raw_importer.c | 0 .../original/models/models_animation.c | 0 .../original/models/models_animation.png | Bin .../original/models/models_billboard.c | 0 .../original/models/models_billboard.png | Bin .../original/models/models_box_collisions.c | 0 .../original/models/models_box_collisions.png | Bin .../original/models/models_cubicmap.c | 0 .../original/models/models_cubicmap.png | Bin .../models/models_first_person_maze.c | 0 .../models/models_first_person_maze.png | Bin .../original/models/models_geometric_shapes.c | 0 .../models/models_geometric_shapes.png | Bin .../original/models/models_heightmap.c | 0 .../original/models/models_heightmap.png | Bin .../original/models/models_loading.c | 0 .../original/models/models_loading.png | Bin .../original/models/models_material_pbr.c | 0 .../original/models/models_material_pbr.png | Bin .../original/models/models_mesh_generation.c | 0 .../models/models_mesh_generation.png | Bin .../original/models/models_mesh_picking.c | 0 .../original/models/models_mesh_picking.png | Bin .../models/models_orthographic_projection.c | 0 .../models/models_orthographic_projection.png | Bin .../models/models_rlgl_solar_system.c | 0 .../models/models_rlgl_solar_system.png | Bin .../original/models/models_skybox.c | 0 .../original/models/models_skybox.png | Bin .../original/models/models_waving_cubes.c | 0 .../original/models/models_waving_cubes.png | Bin .../original/models/models_yaw_pitch_roll.c | 0 .../original/models/models_yaw_pitch_roll.png | Bin .../models/resources}/angle_gauge.png | Bin .../original/models/resources}/background.png | Bin .../original/models/resources}/billboard.png | Bin .../original/models/resources/cubicmap.png | Bin .../models/resources/cubicmap_atlas.png | Bin .../models/resources/dresden_square.hdr | Bin .../original/models/resources}/guy/guy.blend | Bin .../original/models/resources}/guy/guy.iqm | Bin .../models/resources}/guy/guyanim.iqm | Bin .../original/models/resources}/guy/guytex.png | Bin .../original/models/resources/heightmap.png | Bin .../models/resources/models/Duck/Duck.glb | Bin .../models/resources/models/Duck/Duck.gltf | 0 .../models/resources/models/Duck/Duck0.bin | Bin .../models/resources/models/Duck/DuckCM.png | Bin .../resources/models/Duck/Duck_license.txt | 0 .../original/models/resources/models/LICENSE | 0 .../models/resources/models/bridge.obj | 0 .../resources/models/bridge_diffuse.png | Bin .../models/resources/models/castle.obj | 0 .../resources/models/castle_diffuse.png | Bin .../original/models/resources/models/cube.obj | 0 .../models/resources/models/cube_diffuse.png | Bin .../models/resources/models/house.obj | 0 .../models/resources/models/house_diffuse.png | Bin .../models/resources/models/market.obj | 0 .../resources/models/market_diffuse.png | Bin .../models/resources/models/turret.obj | 0 .../resources/models/turret_diffuse.png | Bin .../original/models/resources/models/well.obj | 0 .../models/resources/models/well_diffuse.png | Bin .../models/resources}/pbr/trooper.obj | 0 .../models/resources}/pbr/trooper_albedo.png | Bin .../models/resources}/pbr/trooper_ao.png | Bin .../resources}/pbr/trooper_metalness.png | Bin .../models/resources}/pbr/trooper_normals.png | Bin .../resources}/pbr/trooper_roughness.png | Bin .../original/models/resources}/pitch.png | Bin .../original/models/resources}/plane.obj | 0 .../original/models/resources}/plane.png | Bin .../models/resources}/plane_diffuse.png | Bin .../resources/shaders/glsl100/cubemap.fs | 0 .../resources/shaders/glsl100/cubemap.vs | 0 .../resources/shaders/glsl100/skybox.fs | 0 .../resources/shaders/glsl100/skybox.vs | 0 .../models/resources/shaders/glsl330/brdf.fs | 0 .../models/resources/shaders/glsl330/brdf.vs | 0 .../resources/shaders/glsl330/cubemap.fs | 0 .../resources/shaders/glsl330/cubemap.vs | 0 .../resources/shaders/glsl330/irradiance.fs | 0 .../models/resources/shaders/glsl330/pbr.fs | 0 .../models/resources/shaders/glsl330/pbr.vs | 0 .../resources/shaders/glsl330/prefilter.fs | 0 .../resources/shaders/glsl330/skybox.fs | 0 .../resources/shaders/glsl330/skybox.vs | 0 .../original/models/rlights.h | 0 .../original/network/network_ping_pong.c | 0 .../original/network/network_resolve_host.c | 0 .../original/network/network_tcp_client.c | 0 .../original/network/network_tcp_server.c | 0 .../original/network/network_test.c | 0 .../original/network/network_udp_client.c | 0 .../original/network/network_udp_server.c | 0 .../original/others/easings.h | 0 .../original/others/easings_testbed.c | 0 .../others/external/include/GLFW/glfw3.h | 0 .../external/include/GLFW/glfw3native.h | 0 .../original/others/external/include/glad.h | 0 .../original/others/external/lib/libglfw3.a | Bin .../original/others/raudio_standalone.c | 0 .../resources/audio/guitar_noodling.ogg | Bin .../others/resources/audio/tanatana.ogg | Bin .../original/others/resources/audio/weird.wav | Bin .../original/others/rlgl_standalone.c | 0 .../original/physics/physics_demo.c | 0 .../original/physics/physics_demo.png | Bin .../original/physics/physics_friction.c | 0 .../original/physics/physics_friction.png | Bin .../original/physics/physics_movement.c | 0 .../original/physics/physics_movement.png | Bin .../original/physics/physics_restitution.c | 0 .../original/physics/physics_restitution.png | Bin .../original/physics/physics_shatter.c | 0 .../original/physics/physics_shatter.png | Bin .../portable_window/portable_window.c | 0 .../original/property_list/dm_property_list.h | 0 .../original/property_list/property_list.c | 0 .../original/scroll_panel/gui_scroll_panel.c | 0 .../original/shaders/resources/fudesumi.png | Bin .../original/shaders/resources/mask.png | Bin .../shaders/resources/models/barracks.obj | 0 .../resources/models/barracks_diffuse.png | Bin .../shaders/resources/models/church.obj | 0 .../resources/models/church_diffuse.png | Bin .../shaders/resources/models}/watermill.obj | 0 .../resources/models}/watermill_diffuse.png | Bin .../original/shaders/resources/plasma.png | Bin .../original/shaders/resources/raysan.png | Bin .../shaders/resources/shaders/glsl100/base.fs | 0 .../shaders/resources/shaders/glsl100/base.vs | 0 .../shaders/glsl100/base_lighting.vs | 0 .../resources/shaders/glsl100/bloom.fs | 0 .../shaders/resources/shaders/glsl100/blur.fs | 0 .../shaders/glsl100/cross_hatching.fs | 0 .../shaders/glsl100/cross_stitching.fs | 0 .../shaders/glsl100/cubes_panning.fs | 0 .../resources/shaders/glsl100/depth.fs | 0 .../resources/shaders/glsl100/distortion.fs | 0 .../resources/shaders/glsl100/dream_vision.fs | 0 .../resources/shaders/glsl100/eratosthenes.fs | 0 .../resources/shaders/glsl100/fisheye.fs | 0 .../shaders/resources/shaders/glsl100/fog.fs | 0 .../resources/shaders/glsl100/grayscale.fs | 0 .../resources/shaders/glsl100/julia_set.fs | 0 .../resources/shaders/glsl100/lighting.fs | 0 .../shaders/resources/shaders/glsl100/mask.fs | 0 .../shaders/glsl100/palette_switch.fs | 0 .../resources/shaders/glsl100/pixelizer.fs | 0 .../shaders/glsl100/posterization.fs | 0 .../resources/shaders/glsl100/predator.fs | 0 .../resources/shaders/glsl100/raymarching.fs | 0 .../resources/shaders/glsl100/scanlines.fs | 0 .../resources/shaders/glsl100/sobel.fs | 0 .../resources/shaders/glsl100/spotlight.fs | 0 .../resources/shaders/glsl100/swirl.fs | 0 .../shaders/resources/shaders/glsl100/wave.fs | 0 .../shaders/resources/shaders/glsl120/base.fs | 0 .../shaders/resources/shaders/glsl120/base.vs | 0 .../shaders/glsl120/base_lighting.vs | 0 .../resources/shaders/glsl120/bloom.fs | 0 .../shaders/resources/shaders/glsl120/blur.fs | 0 .../shaders/glsl120/cross_hatching.fs | 0 .../shaders/glsl120/cross_stitching.fs | 0 .../resources/shaders/glsl120/distortion.fs | 0 .../resources/shaders/glsl120/dream_vision.fs | 0 .../resources/shaders/glsl120/fisheye.fs | 0 .../shaders/resources/shaders/glsl120/fog.fs | 0 .../resources/shaders/glsl120/grayscale.fs | 0 .../shaders/glsl120/palette_switch.fs | 0 .../resources/shaders/glsl120/pixelizer.fs | 0 .../shaders/glsl120/posterization.fs | 0 .../resources/shaders/glsl120/predator.fs | 0 .../resources/shaders/glsl120/scanlines.fs | 0 .../resources/shaders/glsl120/sobel.fs | 0 .../resources/shaders/glsl120/swirl.fs | 0 .../shaders/resources/shaders/glsl330/base.fs | 0 .../shaders/resources/shaders/glsl330/base.vs | 0 .../shaders/glsl330/base_lighting.vs | 0 .../resources/shaders/glsl330/bloom.fs | 0 .../shaders/resources/shaders/glsl330/blur.fs | 0 .../shaders/glsl330/cross_hatching.fs | 0 .../shaders/glsl330/cross_stitching.fs | 0 .../shaders/glsl330/cubes_panning.fs | 0 .../resources/shaders/glsl330/depth.fs | 0 .../resources/shaders/glsl330/distortion.fs | 0 .../resources/shaders/glsl330/dream_vision.fs | 0 .../resources/shaders/glsl330/eratosthenes.fs | 0 .../resources/shaders/glsl330/fisheye.fs | 0 .../shaders/resources/shaders/glsl330/fog.fs | 0 .../resources/shaders/glsl330}/grayscale.fs | 0 .../resources/shaders/glsl330/julia_set.fs | 0 .../resources/shaders/glsl330/lighting.fs | 0 .../shaders/resources/shaders/glsl330/mask.fs | 0 .../resources/shaders/glsl330/overdraw.fs | 0 .../shaders/glsl330/palette_switch.fs | 0 .../resources/shaders/glsl330/pixelizer.fs | 0 .../shaders/glsl330/posterization.fs | 0 .../resources/shaders/glsl330/predator.fs | 0 .../resources/shaders/glsl330/raymarching.fs | 0 .../resources/shaders/glsl330/scanlines.fs | 0 .../resources/shaders/glsl330/sobel.fs | 0 .../resources/shaders/glsl330/spotlight.fs | 0 .../resources/shaders/glsl330/swirl.fs | 0 .../shaders/resources/shaders/glsl330/wave.fs | 0 .../original/shaders/resources/space.png | Bin .../shaders/resources/texel_checker.png | Bin .../original/shaders/rlights.h | 0 .../original/shaders/shaders_basic_lighting.c | 0 .../shaders/shaders_basic_lighting.png | Bin .../original/shaders/shaders_custom_uniform.c | 0 .../shaders/shaders_custom_uniform.png | Bin .../original/shaders/shaders_eratosthenes.c | 0 .../original/shaders/shaders_eratosthenes.png | Bin .../original/shaders/shaders_fog.c | 0 .../original/shaders/shaders_fog.png | Bin .../original/shaders/shaders_julia_set.c | 0 .../original/shaders/shaders_julia_set.png | Bin .../original/shaders/shaders_model_shader.c | 0 .../original/shaders/shaders_model_shader.png | Bin .../original/shaders/shaders_palette_switch.c | 0 .../shaders/shaders_palette_switch.png | Bin .../original/shaders/shaders_postprocessing.c | 0 .../shaders/shaders_postprocessing.png | Bin .../original/shaders/shaders_raymarching.c | 0 .../original/shaders/shaders_raymarching.png | Bin .../shaders/shaders_shapes_textures.c | 0 .../shaders/shaders_shapes_textures.png | Bin .../original/shaders/shaders_simple_mask.c | 0 .../original/shaders/shaders_simple_mask.png | Bin .../original/shaders/shaders_spotlight.c | 0 .../original/shaders/shaders_spotlight.png | Bin .../shaders/shaders_texture_drawing.c | 0 .../shaders/shaders_texture_drawing.png | Bin .../original/shaders/shaders_texture_waves.c | 0 .../shaders/shaders_texture_waves.png | Bin .../original/shapes/easings.h | 0 .../original/shapes/raygui.h | 0 .../original/shapes/shapes_basic_shapes.c | 0 .../original/shapes/shapes_basic_shapes.png | Bin .../original/shapes/shapes_bouncing_ball.c | 0 .../original/shapes/shapes_bouncing_ball.png | Bin .../original/shapes/shapes_collision_area.c | 0 .../original/shapes/shapes_collision_area.png | Bin .../original/shapes/shapes_colors_palette.c | 0 .../original/shapes/shapes_colors_palette.png | Bin .../shapes/shapes_draw_circle_sector.c | 0 .../shapes/shapes_draw_circle_sector.png | Bin .../shapes/shapes_draw_rectangle_rounded.c | 0 .../shapes/shapes_draw_rectangle_rounded.png | Bin .../original/shapes/shapes_draw_ring.c | 0 .../original/shapes/shapes_draw_ring.png | Bin .../shapes/shapes_easings_ball_anim.c | 0 .../shapes/shapes_easings_ball_anim.png | Bin .../original/shapes/shapes_easings_box_anim.c | 0 .../shapes/shapes_easings_box_anim.png | Bin .../shapes/shapes_easings_rectangle_array.c | 0 .../shapes/shapes_easings_rectangle_array.png | Bin .../original/shapes/shapes_following_eyes.c | 0 .../original/shapes/shapes_following_eyes.png | Bin .../original/shapes/shapes_lines_bezier.c | 0 .../original/shapes/shapes_lines_bezier.png | Bin .../original/shapes/shapes_logo_raylib.c | 0 .../original/shapes/shapes_logo_raylib.png | Bin .../original/shapes/shapes_logo_raylib_anim.c | 0 .../shapes/shapes_logo_raylib_anim.png | Bin .../shapes/shapes_rectangle_scaling.c | 0 .../shapes/shapes_rectangle_scaling.png | Bin .../original/standalone/custom_backend.h | 0 .../original/standalone/raygui_standalone.c | 0 .../text/resources/AnonymousPro-Bold.ttf | Bin .../original/text/resources/KAISG.ttf | Bin .../original/text/resources/LICENSE | 0 .../original/text/resources/bmfont.fnt | 0 .../original/text/resources/bmfont.png | Bin .../text/resources/custom_alagard.png | Bin .../text/resources/custom_jupiter_crash.png | Bin .../original/text/resources/custom_mecha.png | Bin .../original/text/resources/dejavu.fnt | 0 .../original/text/resources/dejavu.png | Bin .../original/text/resources/emoji.fnt | 0 .../original/text/resources/emoji.png | Bin .../text/resources/fonts}/alagard.png | Bin .../text/resources/fonts/alpha_beta.png | Bin .../text/resources/fonts/jupiter_crash.png | Bin .../original/text/resources/fonts/mecha.png | Bin .../text/resources/fonts/pixantiqua.png | Bin .../text/resources/fonts/pixelplay.png | Bin .../original/text/resources/fonts/romulus.png | Bin .../original/text/resources/fonts/setback.png | Bin .../original/text/resources/notoCJK.fnt | 0 .../original/text/resources/notoCJK.png | Bin .../original/text/resources/pixantiqua.fnt | 0 .../original/text/resources/pixantiqua.png | Bin .../original/text/resources/pixantiqua.ttf | Bin .../text/resources/shaders/glsl100/sdf.fs | 0 .../text/resources/shaders/glsl330/sdf.fs | 0 .../original/text/text_font_filters.c | 0 .../original/text/text_font_filters.png | Bin .../original/text/text_font_loading.c | 0 .../original/text/text_font_loading.png | Bin .../original/text/text_font_sdf.c | 0 .../original/text/text_font_sdf.png | Bin .../original/text/text_font_spritefont.c | 0 .../original/text/text_font_spritefont.png | Bin .../original/text/text_format_text.c | 0 .../original/text/text_format_text.png | Bin .../original/text/text_input_box.c | 0 .../original/text/text_input_box.png | Bin .../original/text/text_raylib_fonts.c | 0 .../original/text/text_raylib_fonts.png | Bin .../original/text/text_rectangle_bounds.c | 0 .../original/text/text_rectangle_bounds.png | Bin .../original/text/text_unicode.c | 0 .../original/text/text_unicode.png | Bin .../original/text/text_writing_anim.c | 0 .../original/text/text_writing_anim.png | Bin .../textbox_extended_demo.c | 0 .../original/text_editor/text_editor.c | 0 .../original/textures/resources/KAISG.ttf | Bin .../original/textures/resources/LICENSE | 0 .../original/textures/resources/boom.wav | Bin .../original/textures/resources/button.png | Bin .../original/textures/resources/buttonfx.wav | Bin .../original/textures/resources/cat.png | Bin .../resources/custom_jupiter_crash.png | Bin .../resources/cyberpunk_street_background.png | Bin .../resources/cyberpunk_street_foreground.png | Bin .../resources/cyberpunk_street_midground.png | Bin .../original/textures/resources/explosion.png | Bin .../original/textures/resources/fudesumi.png | Bin .../original/textures/resources/fudesumi.raw | Bin .../textures/resources/ninepatch_button.png | Bin .../original/textures/resources/parrots.png | Bin .../textures/resources/raylib_logo.png | Bin .../original/textures/resources/scarfy.png | Bin .../original/textures/resources/smoke.png | Bin .../textures/resources/wabbit_alpha.png | Bin .../textures/textures_background_scrolling.c | 0 .../textures_background_scrolling.png | Bin .../original/textures/textures_bunnymark.c | 0 .../original/textures/textures_bunnymark.png | Bin .../textures/textures_image_drawing.c | 0 .../textures/textures_image_drawing.png | Bin .../textures/textures_image_generation.c | 0 .../textures/textures_image_generation.png | Bin .../textures/textures_image_loading.c | 0 .../textures/textures_image_loading.png | Bin .../textures/textures_image_processing.c | 0 .../textures/textures_image_processing.png | Bin .../original/textures/textures_image_text.c | 0 .../original/textures/textures_image_text.png | Bin .../original/textures/textures_logo_raylib.c | 0 .../textures/textures_logo_raylib.png | Bin .../textures/textures_mouse_painting.c | 0 .../textures/textures_mouse_painting.png | Bin .../textures/textures_npatch_drawing.c | 0 .../textures/textures_npatch_drawing.png | Bin .../textures/textures_particles_blending.c | 0 .../textures/textures_particles_blending.png | Bin .../original/textures/textures_raw_data.c | 0 .../original/textures/textures_raw_data.png | Bin .../original/textures/textures_rectangle.c | 0 .../original/textures/textures_rectangle.png | Bin .../textures/textures_sprite_button.c | 0 .../textures/textures_sprite_button.png | Bin .../textures/textures_sprite_explosion.c | 0 .../textures/textures_sprite_explosion.png | Bin .../textures/textures_srcrec_dstrec.c | 0 .../textures/textures_srcrec_dstrec.png | Bin .../original/textures/textures_to_image.c | 0 .../original/textures/textures_to_image.png | Bin .../src/example/audio/audio_module_playing.rs | 0 .../example/audio/audio_multichannel_sound.rs | 0 .../src/example/audio/audio_music_stream.rs | 0 .../src/example/audio/audio_raw_stream.rs | 0 .../src/example/audio/audio_sound_loading.png | Bin .../src/example/audio/audio_sound_loading.rs | 0 .../src/example/audio/mod.rs | 0 .../controls_test_suite.rs | 0 .../src/example/controls_test_suite/mod.rs | 0 .../src/example/core/core_2d_camera.rs | 0 .../example/core/core_2d_camera_platformer.rs | 0 .../core/core_3d_camera_first_person.rs | 0 .../src/example/core/core_3d_camera_free.rs | 0 .../src/example/core/core_3d_camera_mode.rs | 0 .../src/example/core/core_3d_picking.rs | 0 .../src/example/core/core_basic_window.rs | 0 .../src/example/core/core_custom_logging.png | Bin .../src/example/core/core_custom_logging.rs | 0 .../src/example/core/core_drop_files.rs | 0 .../src/example/core/core_input_gamepad.rs | 0 .../src/example/core/core_input_gestures.rs | 0 .../src/example/core/core_input_keys.rs | 0 .../src/example/core/core_input_mouse.png | Bin .../src/example/core/core_input_mouse.rs | 0 .../example/core/core_input_mouse_wheel.rs | 0 .../src/example/core/core_input_multitouch.rs | 0 .../src/example/core/core_random_values.png | Bin .../src/example/core/core_random_values.rs | 0 .../src/example/core/core_scissor_test.rs | 0 .../src/example/core/core_vr_simulator.rs | 0 .../src/example/core/core_window_letterbox.rs | 0 .../src/example/core/core_world_screen.rs | 0 .../src/example/core/mod.rs | 0 .../example/image_exporter/image_exporter.rs | 0 .../src/example/image_exporter/mod.rs | 0 .../example/image_exporter/resources/cat.png | Bin .../image_exporter/resources/fudesumi.png | Bin .../image_exporter/resources/parrots.png | Bin .../image_exporter/resources/scarfy.png | Bin .../design/raw_importer_REF.png | Bin .../design/raw_importer_REV0.png | Bin .../design/raw_importer_REV1.png | Bin .../design/raw_importer_REV2.png | Bin .../design/raw_importer_REV3.png | Bin .../design/raw_importer_REV4.png | Bin .../design/raw_importer_REV5.png | Bin .../image_raw_importer/image_2x2_RGBA.raw | Bin .../image_raw_importer/image_raw_importer.c | 0 {showcase => examples}/src/example/mod.rs | 0 .../src/example/models/mod.rs | 0 .../src/example/models/models_animation.rs | 0 .../src/example/models/models_billboard.rs | 0 .../example/models/models_box_collisions.rs | 0 .../src/example/models/models_cubicmap.rs | 0 .../models/models_first_person_maze.rs | 0 .../example/models/models_geometric_shapes.rs | 0 .../src/example/models/models_heightmap.rs | 0 .../src/example/models/models_loading.rs | 0 .../src/example/models/models_material_pbr.rs | 0 .../example/models/models_mesh_generation.rs | 0 .../src/example/models/models_mesh_picking.rs | 0 .../models/models_orthographic_projection.rs | 0 .../models/models_rlgl_solar_system.rs | 0 .../src/example/models/models_skybox.rs | 0 .../src/example/models/models_waving_cubes.rs | 0 .../example/models/models_yaw_pitch_roll.rs | 0 .../src/example/others/mod.rs | 0 .../src/example/others/rlgl_standalone.rs | 0 .../src/example/portable_window/mod.rs | 0 .../portable_window/portable_window.rs | 0 .../example/scroll_panel/gui_scroll_panel.rs | 0 .../src/example/scroll_panel/mod.rs | 0 .../src/example/shaders/mod.rs | 0 .../example/shaders/shaders_basic_lighting.rs | 0 .../shaders/shaders_custom_uniform.png | Bin .../example/shaders/shaders_custom_uniform.rs | 0 .../example/shaders/shaders_eratosthenes.png | Bin .../example/shaders/shaders_eratosthenes.rs | 0 .../src/example/shaders/shaders_fog.png | Bin .../src/example/shaders/shaders_fog.rs | 0 .../src/example/shaders/shaders_julia_set.png | Bin .../src/example/shaders/shaders_julia_set.rs | 0 .../example/shaders/shaders_model_shader.c | 0 .../example/shaders/shaders_model_shader.png | Bin .../example/shaders/shaders_palette_switch.c | 0 .../shaders/shaders_palette_switch.png | Bin .../example/shaders/shaders_postprocessing.c | 0 .../shaders/shaders_postprocessing.png | Bin .../example/shaders/shaders_postprocessing.rs | 0 .../src/example/shaders/shaders_raymarching.c | 0 .../example/shaders/shaders_raymarching.png | Bin .../example/shaders/shaders_shapes_textures.c | 0 .../shaders/shaders_shapes_textures.png | Bin .../src/example/shaders/shaders_simple_mask.c | 0 .../example/shaders/shaders_simple_mask.png | Bin .../src/example/shaders/shaders_spotlight.c | 0 .../src/example/shaders/shaders_spotlight.png | Bin .../example/shaders/shaders_texture_drawing.c | 0 .../shaders/shaders_texture_drawing.png | Bin .../example/shaders/shaders_texture_waves.c | 0 .../example/shaders/shaders_texture_waves.png | Bin .../src/example/shapes/easings.h | 0 .../src/example/shapes/raygui.h | 0 .../src/example/shapes/shapes_basic_shapes.c | 0 .../example/shapes/shapes_basic_shapes.png | Bin .../src/example/shapes/shapes_bouncing_ball.c | 0 .../example/shapes/shapes_bouncing_ball.png | Bin .../example/shapes/shapes_collision_area.c | 0 .../example/shapes/shapes_collision_area.png | Bin .../example/shapes/shapes_colors_palette.c | 0 .../example/shapes/shapes_colors_palette.png | Bin .../shapes/shapes_draw_circle_sector.c | 0 .../shapes/shapes_draw_circle_sector.png | Bin .../shapes/shapes_draw_rectangle_rounded.c | 0 .../shapes/shapes_draw_rectangle_rounded.png | Bin .../src/example/shapes/shapes_draw_ring.c | 0 .../src/example/shapes/shapes_draw_ring.png | Bin .../example/shapes/shapes_easings_ball_anim.c | 0 .../shapes/shapes_easings_ball_anim.png | Bin .../example/shapes/shapes_easings_box_anim.c | 0 .../shapes/shapes_easings_box_anim.png | Bin .../shapes/shapes_easings_rectangle_array.c | 0 .../shapes/shapes_easings_rectangle_array.png | Bin .../example/shapes/shapes_following_eyes.c | 0 .../example/shapes/shapes_following_eyes.png | Bin .../src/example/shapes/shapes_lines_bezier.c | 0 .../example/shapes/shapes_lines_bezier.png | Bin .../src/example/shapes/shapes_logo_raylib.c | 0 .../src/example/shapes/shapes_logo_raylib.png | Bin .../example/shapes/shapes_logo_raylib_anim.c | 0 .../shapes/shapes_logo_raylib_anim.png | Bin .../example/shapes/shapes_rectangle_scaling.c | 0 .../shapes/shapes_rectangle_scaling.png | Bin .../text/resources/AnonymousPro-Bold.ttf | Bin .../src/example/text/resources/KAISG.ttf | Bin .../src/example/text/resources/LICENSE | 0 .../src/example/text/resources/bmfont.fnt | 0 .../src/example/text/resources/bmfont.png | Bin .../example/text/resources/custom_alagard.png | Bin .../text/resources/custom_jupiter_crash.png | Bin .../example/text/resources/custom_mecha.png | Bin .../src/example/text/resources/dejavu.fnt | 0 .../src/example/text/resources/dejavu.png | Bin .../src/example/text/resources/emoji.fnt | 0 .../src/example/text/resources/emoji.png | Bin .../example}/text/resources/fonts/alagard.png | Bin .../text/resources/fonts/alpha_beta.png | Bin .../text/resources/fonts/jupiter_crash.png | Bin .../example/text/resources/fonts/mecha.png | Bin .../text/resources/fonts/pixantiqua.png | Bin .../text/resources/fonts/pixelplay.png | Bin .../example/text/resources/fonts/romulus.png | Bin .../example/text/resources/fonts/setback.png | Bin .../src/example/text/resources/notoCJK.fnt | 0 .../src/example/text/resources/notoCJK.png | Bin .../src/example/text/resources/pixantiqua.fnt | 0 .../src/example/text/resources/pixantiqua.png | Bin .../src/example/text/resources/pixantiqua.ttf | Bin .../text/resources/shaders/glsl100/sdf.fs | 0 .../text/resources/shaders/glsl330/sdf.fs | 0 .../src/example/text/text_font_filters.c | 0 .../src/example/text/text_font_filters.png | Bin .../src/example/text/text_font_loading.c | 0 .../src/example/text/text_font_loading.png | Bin .../src/example/text/text_font_sdf.c | 0 .../src/example/text/text_font_sdf.png | Bin .../src/example/text/text_font_spritefont.c | 0 .../src/example/text/text_font_spritefont.png | Bin .../src/example/text/text_format_text.c | 0 .../src/example/text/text_format_text.png | Bin .../src/example/text/text_input_box.c | 0 .../src/example/text/text_input_box.png | Bin .../src/example/text/text_raylib_fonts.c | 0 .../src/example/text/text_raylib_fonts.png | Bin .../src/example/text/text_rectangle_bounds.c | 0 .../example/text/text_rectangle_bounds.png | Bin .../src/example/text/text_unicode.c | 0 .../src/example/text/text_unicode.png | Bin .../src/example/text/text_writing_anim.c | 0 .../src/example/text/text_writing_anim.png | Bin .../textbox_extended_demo.c | 0 .../src/example/text_editor/text_editor.c | 0 .../src/example/textures/mod.rs | 0 .../textures/textures_background_scrolling.c | 0 .../textures_background_scrolling.png | Bin .../src/example/textures/textures_bunnymark.c | 0 .../example/textures/textures_bunnymark.png | Bin .../example/textures/textures_bunnymark.rs | 0 .../example/textures/textures_image_drawing.c | 0 .../textures/textures_image_drawing.png | Bin .../textures/textures_image_generation.c | 0 .../textures/textures_image_generation.png | Bin .../example/textures/textures_image_loading.c | 0 .../textures/textures_image_loading.png | Bin .../textures/textures_image_processing.c | 0 .../textures/textures_image_processing.png | Bin .../example/textures/textures_image_text.c | 0 .../example/textures/textures_image_text.png | Bin .../example/textures/textures_logo_raylib.c | 0 .../example/textures/textures_logo_raylib.png | Bin .../textures/textures_mouse_painting.c | 0 .../textures/textures_mouse_painting.png | Bin .../textures/textures_mouse_painting.rs | 0 .../textures/textures_npatch_drawing.c | 0 .../textures/textures_npatch_drawing.png | Bin .../textures/textures_particles_blending.c | 0 .../textures/textures_particles_blending.png | Bin .../src/example/textures/textures_raw_data.c | 0 .../example/textures/textures_raw_data.png | Bin .../src/example/textures/textures_rectangle.c | 0 .../example/textures/textures_rectangle.png | Bin .../example/textures/textures_rectangle.rs | 0 .../example/textures/textures_sprite_button.c | 0 .../textures/textures_sprite_button.png | Bin .../textures/textures_sprite_explosion.c | 0 .../textures/textures_sprite_explosion.png | Bin .../example/textures/textures_srcrec_dstrec.c | 0 .../textures/textures_srcrec_dstrec.png | Bin .../src/example/textures/textures_to_image.c | 0 .../example/textures/textures_to_image.png | Bin {showcase => examples}/src/main.rs | 0 raylib-sys/src/lib.rs | 4 +- raylib/src/core/drawing.rs | 218 +- raylib/src/prelude.rs | 3 +- samples/3d_camera_first_person.rs | 86 - samples/Cargo.toml | 90 - samples/README.md | 37 - samples/Web.toml | 22 - samples/arkanoid.rs | 347 - samples/asteroids.rs | 644 - samples/camera2D.rs | 130 - samples/docs/3d_camera_first_person.PNG | Bin 33157 -> 0 bytes samples/docs/arkanoid.PNG | Bin 18324 -> 0 bytes samples/docs/camera2D.PNG | Bin 16766 -> 0 bytes samples/docs/font.PNG | Bin 12028 -> 0 bytes samples/docs/logo.PNG | Bin 7393 -> 0 bytes samples/docs/model_shader.PNG | Bin 155898 -> 0 bytes samples/docs/raymarch.PNG | Bin 309446 -> 0 bytes samples/docs/rgui.PNG | Bin 6034 -> 0 bytes samples/docs/roguelike.PNG | Bin 39685 -> 0 bytes samples/docs/specs.PNG | Bin 14003 -> 0 bytes samples/docs/texture.PNG | Bin 30065 -> 0 bytes samples/docs/yaw_pitch_roll.PNG | Bin 156213 -> 0 bytes samples/drop.rs | 101 - samples/extensions.rs | 36 - samples/font.rs | 44 - samples/input.rs | 26 - samples/logo.rs | 25 - samples/model_shader.rs | 74 - samples/options.rs | 33 - samples/raylib.h | 1488 -- samples/raymarch.rs | 81 - samples/rgui.rs | 441 - samples/roguelike.rs | 1925 -- samples/specs.rs | 228 - samples/static/exists.txt | 1 - samples/static/logo.png | Bin 296 -> 0 bytes samples/static/menu_background.png | Bin 10785 -> 0 bytes samples/static/raylib-rust_16x16.png | Bin 112 -> 0 bytes samples/static/raymarching.fs | 432 - samples/static/shader/pbr.fs | 298 - samples/static/shader/pbr.vs | 49 - samples/static/wave.ogg | Bin 1364969 -> 0 bytes samples/static/white_noise.mp3 | Bin 241371 -> 0 bytes samples/texture.rs | 27 - samples/yaw_pitch_roll.rs | 307 - .../original/models/resources/angle_gauge.png | Bin 12919 -> 0 bytes .../original/models/resources/background.png | Bin 16574 -> 0 bytes .../original/models/resources/billboard.png | Bin 22439 -> 0 bytes .../original/models/resources/guy/guy.blend | Bin 665304 -> 0 bytes .../original/models/resources/guy/guy.iqm | Bin 39408 -> 0 bytes .../original/models/resources/guy/guyanim.iqm | Bin 18244 -> 0 bytes .../original/models/resources/guy/guytex.png | Bin 302388 -> 0 bytes .../original/models/resources/pbr/trooper.obj | 18312 ---------------- .../models/resources/pbr/trooper_albedo.png | Bin 1838043 -> 0 bytes .../models/resources/pbr/trooper_ao.png | Bin 559997 -> 0 bytes .../resources/pbr/trooper_metalness.png | Bin 6424 -> 0 bytes .../models/resources/pbr/trooper_normals.png | Bin 1313366 -> 0 bytes .../resources/pbr/trooper_roughness.png | Bin 733780 -> 0 bytes showcase/original/models/resources/pitch.png | Bin 45945 -> 0 bytes showcase/original/models/resources/plane.obj | 10700 --------- showcase/original/models/resources/plane.png | Bin 4810 -> 0 bytes .../models/resources/plane_diffuse.png | Bin 301756 -> 0 bytes .../shaders/resources/models/watermill.obj | 5316 ----- .../resources/models/watermill_diffuse.png | Bin 447765 -> 0 bytes .../resources/shaders/glsl330/grayscale.fs | 26 - .../example/text/resources/fonts/alagard.png | Bin 3626 -> 0 bytes 759 files changed, 149 insertions(+), 41409 deletions(-) rename {showcase => examples}/.cargo/config.toml (100%) rename {showcase => examples}/Cargo.toml (100%) rename {showcase => examples}/Makefile (100%) rename {showcase => examples}/original/audio/audio_module_playing.c (100%) rename {showcase => examples}/original/audio/audio_module_playing.png (100%) rename {showcase => examples}/original/audio/audio_multichannel_sound.c (100%) rename {showcase => examples}/original/audio/audio_multichannel_sound.png (100%) rename {showcase => examples}/original/audio/audio_music_stream.c (100%) rename {showcase => examples}/original/audio/audio_music_stream.png (100%) rename {showcase => examples}/original/audio/audio_raw_stream.c (100%) rename {showcase => examples}/original/audio/audio_raw_stream.png (100%) rename {showcase => examples}/original/audio/audio_sound_loading.c (100%) rename {showcase => examples}/original/audio/audio_sound_loading.png (100%) rename {showcase => examples}/original/audio/resources/chiptun1.mod (100%) rename {showcase => examples}/original/audio/resources/coin.wav (100%) rename {showcase => examples}/original/audio/resources/guitar_noodling.ogg (100%) rename {showcase => examples}/original/audio/resources/mini1111.xm (100%) rename {showcase => examples}/original/audio/resources/sound.wav (100%) rename {showcase => examples}/original/audio/resources/spring.wav (100%) rename {showcase => examples}/original/audio/resources/tanatana.flac (100%) rename {showcase => examples}/original/audio/resources/tanatana.ogg (100%) rename {showcase => examples}/original/audio/resources/weird.wav (100%) rename {showcase => examples}/original/controls_test_suite/controls_test_suite.c (100%) rename {showcase => examples}/original/controls_test_suite/fonts/FiveByFive10.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/NorthernLights.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/PIXEARG11.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/PixelOperator8.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/pixelpoiiz10.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/prstartk8.ttf (100%) rename {showcase => examples}/original/controls_test_suite/fonts/rainyhearts16.ttf (100%) rename {showcase => examples}/original/core/core_2d_camera.c (100%) rename {showcase => examples}/original/core/core_2d_camera.png (100%) rename {showcase => examples}/original/core/core_2d_camera_platformer.c (100%) rename {showcase => examples}/original/core/core_2d_camera_platformer.png (100%) rename {showcase => examples}/original/core/core_3d_camera_first_person.c (100%) rename {showcase => examples}/original/core/core_3d_camera_first_person.png (100%) rename {showcase => examples}/original/core/core_3d_camera_free.c (100%) rename {showcase => examples}/original/core/core_3d_camera_free.png (100%) rename {showcase => examples}/original/core/core_3d_camera_mode.c (100%) rename {showcase => examples}/original/core/core_3d_camera_mode.png (100%) rename {showcase => examples}/original/core/core_3d_picking.c (100%) rename {showcase => examples}/original/core/core_3d_picking.png (100%) rename {showcase => examples}/original/core/core_basic_window.c (100%) rename {showcase => examples}/original/core/core_basic_window.cpp (100%) rename {showcase => examples}/original/core/core_basic_window.png (100%) rename {showcase => examples}/original/core/core_basic_window_web.c (100%) rename {showcase => examples}/original/core/core_custom_logging.c (100%) rename {showcase => examples}/original/core/core_custom_logging.png (100%) rename {showcase => examples}/original/core/core_drop_files.c (100%) rename {showcase => examples}/original/core/core_drop_files.png (100%) rename {showcase => examples}/original/core/core_input_gamepad.c (100%) rename {showcase => examples}/original/core/core_input_gamepad.png (100%) rename {showcase => examples}/original/core/core_input_gestures.c (100%) rename {showcase => examples}/original/core/core_input_gestures.png (100%) rename {showcase => examples}/original/core/core_input_keys.c (100%) rename {showcase => examples}/original/core/core_input_keys.png (100%) rename {showcase => examples}/original/core/core_input_mouse.c (100%) rename {showcase => examples}/original/core/core_input_mouse.png (100%) rename {showcase => examples}/original/core/core_input_mouse_wheel.c (100%) rename {showcase => examples}/original/core/core_input_mouse_wheel.png (100%) rename {showcase => examples}/original/core/core_input_multitouch.c (100%) rename {showcase => examples}/original/core/core_input_multitouch.png (100%) rename {showcase => examples}/original/core/core_loading_thread.c (100%) rename {showcase => examples}/original/core/core_loading_thread.png (100%) rename {showcase => examples}/original/core/core_random_values.c (100%) rename {showcase => examples}/original/core/core_random_values.png (100%) rename {showcase => examples}/original/core/core_scissor_test.c (100%) rename {showcase => examples}/original/core/core_scissor_test.png (100%) rename {showcase => examples}/original/core/core_storage_values.c (100%) rename {showcase => examples}/original/core/core_storage_values.png (100%) rename {showcase => examples}/original/core/core_vr_simulator.c (100%) rename {showcase => examples}/original/core/core_vr_simulator.png (100%) rename {showcase => examples}/original/core/core_window_letterbox.c (100%) rename {showcase => examples}/original/core/core_window_letterbox.png (100%) rename {showcase => examples}/original/core/core_world_screen.c (100%) rename {showcase => examples}/original/core/core_world_screen.png (100%) rename {showcase => examples}/original/core/resources/distortion100.fs (100%) rename {showcase => examples}/original/core/resources/distortion330.fs (100%) rename {showcase => examples}/original/core/resources/ps3.png (100%) rename {showcase => examples}/original/core/resources/xbox.png (100%) rename {showcase => examples}/original/custom_file_dialog/cat.png (100%) rename {showcase => examples}/original/custom_file_dialog/custom_file_dialog.c (100%) rename {showcase => examples}/original/custom_file_dialog/gui_file_dialog.h (100%) rename {showcase => examples}/original/image_exporter/image_exporter.c (100%) rename {showcase => examples}/original/image_exporter/resources/cat.png (100%) rename {showcase => examples}/original/image_exporter/resources/fudesumi.png (100%) rename {showcase => examples}/original/image_exporter/resources/parrots.png (100%) rename {showcase => examples}/original/image_exporter/resources/scarfy.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REF.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV0.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV1.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV2.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV3.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV4.png (100%) rename {showcase => examples}/original/image_raw_importer/design/raw_importer_REV5.png (100%) rename {showcase => examples}/original/image_raw_importer/image_2x2_RGBA.raw (100%) rename {showcase => examples}/original/image_raw_importer/image_raw_importer.c (100%) rename {showcase => examples}/original/models/models_animation.c (100%) rename {showcase => examples}/original/models/models_animation.png (100%) rename {showcase => examples}/original/models/models_billboard.c (100%) rename {showcase => examples}/original/models/models_billboard.png (100%) rename {showcase => examples}/original/models/models_box_collisions.c (100%) rename {showcase => examples}/original/models/models_box_collisions.png (100%) rename {showcase => examples}/original/models/models_cubicmap.c (100%) rename {showcase => examples}/original/models/models_cubicmap.png (100%) rename {showcase => examples}/original/models/models_first_person_maze.c (100%) rename {showcase => examples}/original/models/models_first_person_maze.png (100%) rename {showcase => examples}/original/models/models_geometric_shapes.c (100%) rename {showcase => examples}/original/models/models_geometric_shapes.png (100%) rename {showcase => examples}/original/models/models_heightmap.c (100%) rename {showcase => examples}/original/models/models_heightmap.png (100%) rename {showcase => examples}/original/models/models_loading.c (100%) rename {showcase => examples}/original/models/models_loading.png (100%) rename {showcase => examples}/original/models/models_material_pbr.c (100%) rename {showcase => examples}/original/models/models_material_pbr.png (100%) rename {showcase => examples}/original/models/models_mesh_generation.c (100%) rename {showcase => examples}/original/models/models_mesh_generation.png (100%) rename {showcase => examples}/original/models/models_mesh_picking.c (100%) rename {showcase => examples}/original/models/models_mesh_picking.png (100%) rename {showcase => examples}/original/models/models_orthographic_projection.c (100%) rename {showcase => examples}/original/models/models_orthographic_projection.png (100%) rename {showcase => examples}/original/models/models_rlgl_solar_system.c (100%) rename {showcase => examples}/original/models/models_rlgl_solar_system.png (100%) rename {showcase => examples}/original/models/models_skybox.c (100%) rename {showcase => examples}/original/models/models_skybox.png (100%) rename {showcase => examples}/original/models/models_waving_cubes.c (100%) rename {showcase => examples}/original/models/models_waving_cubes.png (100%) rename {showcase => examples}/original/models/models_yaw_pitch_roll.c (100%) rename {showcase => examples}/original/models/models_yaw_pitch_roll.png (100%) rename {samples/static => examples/original/models/resources}/angle_gauge.png (100%) rename {samples/static => examples/original/models/resources}/background.png (100%) rename {samples/static => examples/original/models/resources}/billboard.png (100%) rename {showcase => examples}/original/models/resources/cubicmap.png (100%) rename {showcase => examples}/original/models/resources/cubicmap_atlas.png (100%) rename {showcase => examples}/original/models/resources/dresden_square.hdr (100%) rename {samples/static => examples/original/models/resources}/guy/guy.blend (100%) rename {samples/static => examples/original/models/resources}/guy/guy.iqm (100%) rename {samples/static => examples/original/models/resources}/guy/guyanim.iqm (100%) rename {samples/static => examples/original/models/resources}/guy/guytex.png (100%) rename {showcase => examples}/original/models/resources/heightmap.png (100%) rename {showcase => examples}/original/models/resources/models/Duck/Duck.glb (100%) rename {showcase => examples}/original/models/resources/models/Duck/Duck.gltf (100%) rename {showcase => examples}/original/models/resources/models/Duck/Duck0.bin (100%) rename {showcase => examples}/original/models/resources/models/Duck/DuckCM.png (100%) rename {showcase => examples}/original/models/resources/models/Duck/Duck_license.txt (100%) rename {showcase => examples}/original/models/resources/models/LICENSE (100%) rename {showcase => examples}/original/models/resources/models/bridge.obj (100%) rename {showcase => examples}/original/models/resources/models/bridge_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/castle.obj (100%) rename {showcase => examples}/original/models/resources/models/castle_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/cube.obj (100%) rename {showcase => examples}/original/models/resources/models/cube_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/house.obj (100%) rename {showcase => examples}/original/models/resources/models/house_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/market.obj (100%) rename {showcase => examples}/original/models/resources/models/market_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/turret.obj (100%) rename {showcase => examples}/original/models/resources/models/turret_diffuse.png (100%) rename {showcase => examples}/original/models/resources/models/well.obj (100%) rename {showcase => examples}/original/models/resources/models/well_diffuse.png (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper.obj (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper_albedo.png (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper_ao.png (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper_metalness.png (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper_normals.png (100%) rename {samples/static => examples/original/models/resources}/pbr/trooper_roughness.png (100%) rename {samples/static => examples/original/models/resources}/pitch.png (100%) rename {samples/static => examples/original/models/resources}/plane.obj (100%) rename {samples/static => examples/original/models/resources}/plane.png (100%) rename {samples/static => examples/original/models/resources}/plane_diffuse.png (100%) rename {showcase => examples}/original/models/resources/shaders/glsl100/cubemap.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl100/cubemap.vs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl100/skybox.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl100/skybox.vs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/brdf.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/brdf.vs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/cubemap.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/cubemap.vs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/irradiance.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/pbr.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/pbr.vs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/prefilter.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/skybox.fs (100%) rename {showcase => examples}/original/models/resources/shaders/glsl330/skybox.vs (100%) rename {showcase => examples}/original/models/rlights.h (100%) rename {showcase => examples}/original/network/network_ping_pong.c (100%) rename {showcase => examples}/original/network/network_resolve_host.c (100%) rename {showcase => examples}/original/network/network_tcp_client.c (100%) rename {showcase => examples}/original/network/network_tcp_server.c (100%) rename {showcase => examples}/original/network/network_test.c (100%) rename {showcase => examples}/original/network/network_udp_client.c (100%) rename {showcase => examples}/original/network/network_udp_server.c (100%) rename {showcase => examples}/original/others/easings.h (100%) rename {showcase => examples}/original/others/easings_testbed.c (100%) rename {showcase => examples}/original/others/external/include/GLFW/glfw3.h (100%) rename {showcase => examples}/original/others/external/include/GLFW/glfw3native.h (100%) rename {showcase => examples}/original/others/external/include/glad.h (100%) rename {showcase => examples}/original/others/external/lib/libglfw3.a (100%) rename {showcase => examples}/original/others/raudio_standalone.c (100%) rename {showcase => examples}/original/others/resources/audio/guitar_noodling.ogg (100%) rename {showcase => examples}/original/others/resources/audio/tanatana.ogg (100%) rename {showcase => examples}/original/others/resources/audio/weird.wav (100%) rename {showcase => examples}/original/others/rlgl_standalone.c (100%) rename {showcase => examples}/original/physics/physics_demo.c (100%) rename {showcase => examples}/original/physics/physics_demo.png (100%) rename {showcase => examples}/original/physics/physics_friction.c (100%) rename {showcase => examples}/original/physics/physics_friction.png (100%) rename {showcase => examples}/original/physics/physics_movement.c (100%) rename {showcase => examples}/original/physics/physics_movement.png (100%) rename {showcase => examples}/original/physics/physics_restitution.c (100%) rename {showcase => examples}/original/physics/physics_restitution.png (100%) rename {showcase => examples}/original/physics/physics_shatter.c (100%) rename {showcase => examples}/original/physics/physics_shatter.png (100%) rename {showcase => examples}/original/portable_window/portable_window.c (100%) rename {showcase => examples}/original/property_list/dm_property_list.h (100%) rename {showcase => examples}/original/property_list/property_list.c (100%) rename {showcase => examples}/original/scroll_panel/gui_scroll_panel.c (100%) rename {showcase => examples}/original/shaders/resources/fudesumi.png (100%) rename {showcase => examples}/original/shaders/resources/mask.png (100%) rename {showcase => examples}/original/shaders/resources/models/barracks.obj (100%) rename {showcase => examples}/original/shaders/resources/models/barracks_diffuse.png (100%) rename {showcase => examples}/original/shaders/resources/models/church.obj (100%) rename {showcase => examples}/original/shaders/resources/models/church_diffuse.png (100%) rename {samples/static/model_shader => examples/original/shaders/resources/models}/watermill.obj (100%) rename {samples/static/model_shader => examples/original/shaders/resources/models}/watermill_diffuse.png (100%) rename {showcase => examples}/original/shaders/resources/plasma.png (100%) rename {showcase => examples}/original/shaders/resources/raysan.png (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/base.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/base.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/base_lighting.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/bloom.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/blur.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/cross_hatching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/cross_stitching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/cubes_panning.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/depth.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/distortion.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/dream_vision.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/eratosthenes.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/fisheye.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/fog.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/grayscale.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/julia_set.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/lighting.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/mask.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/palette_switch.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/pixelizer.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/posterization.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/predator.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/raymarching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/scanlines.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/sobel.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/spotlight.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/swirl.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl100/wave.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/base.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/base.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/base_lighting.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/bloom.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/blur.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/cross_hatching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/cross_stitching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/distortion.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/dream_vision.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/fisheye.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/fog.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/grayscale.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/palette_switch.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/pixelizer.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/posterization.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/predator.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/scanlines.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/sobel.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl120/swirl.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/base.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/base.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/base_lighting.vs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/bloom.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/blur.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/cross_hatching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/cross_stitching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/cubes_panning.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/depth.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/distortion.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/dream_vision.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/eratosthenes.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/fisheye.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/fog.fs (100%) rename {samples/static/model_shader => examples/original/shaders/resources/shaders/glsl330}/grayscale.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/julia_set.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/lighting.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/mask.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/overdraw.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/palette_switch.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/pixelizer.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/posterization.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/predator.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/raymarching.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/scanlines.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/sobel.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/spotlight.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/swirl.fs (100%) rename {showcase => examples}/original/shaders/resources/shaders/glsl330/wave.fs (100%) rename {showcase => examples}/original/shaders/resources/space.png (100%) rename {showcase => examples}/original/shaders/resources/texel_checker.png (100%) rename {showcase => examples}/original/shaders/rlights.h (100%) rename {showcase => examples}/original/shaders/shaders_basic_lighting.c (100%) rename {showcase => examples}/original/shaders/shaders_basic_lighting.png (100%) rename {showcase => examples}/original/shaders/shaders_custom_uniform.c (100%) rename {showcase => examples}/original/shaders/shaders_custom_uniform.png (100%) rename {showcase => examples}/original/shaders/shaders_eratosthenes.c (100%) rename {showcase => examples}/original/shaders/shaders_eratosthenes.png (100%) rename {showcase => examples}/original/shaders/shaders_fog.c (100%) rename {showcase => examples}/original/shaders/shaders_fog.png (100%) rename {showcase => examples}/original/shaders/shaders_julia_set.c (100%) rename {showcase => examples}/original/shaders/shaders_julia_set.png (100%) rename {showcase => examples}/original/shaders/shaders_model_shader.c (100%) rename {showcase => examples}/original/shaders/shaders_model_shader.png (100%) rename {showcase => examples}/original/shaders/shaders_palette_switch.c (100%) rename {showcase => examples}/original/shaders/shaders_palette_switch.png (100%) rename {showcase => examples}/original/shaders/shaders_postprocessing.c (100%) rename {showcase => examples}/original/shaders/shaders_postprocessing.png (100%) rename {showcase => examples}/original/shaders/shaders_raymarching.c (100%) rename {showcase => examples}/original/shaders/shaders_raymarching.png (100%) rename {showcase => examples}/original/shaders/shaders_shapes_textures.c (100%) rename {showcase => examples}/original/shaders/shaders_shapes_textures.png (100%) rename {showcase => examples}/original/shaders/shaders_simple_mask.c (100%) rename {showcase => examples}/original/shaders/shaders_simple_mask.png (100%) rename {showcase => examples}/original/shaders/shaders_spotlight.c (100%) rename {showcase => examples}/original/shaders/shaders_spotlight.png (100%) rename {showcase => examples}/original/shaders/shaders_texture_drawing.c (100%) rename {showcase => examples}/original/shaders/shaders_texture_drawing.png (100%) rename {showcase => examples}/original/shaders/shaders_texture_waves.c (100%) rename {showcase => examples}/original/shaders/shaders_texture_waves.png (100%) rename {showcase => examples}/original/shapes/easings.h (100%) rename {showcase => examples}/original/shapes/raygui.h (100%) rename {showcase => examples}/original/shapes/shapes_basic_shapes.c (100%) rename {showcase => examples}/original/shapes/shapes_basic_shapes.png (100%) rename {showcase => examples}/original/shapes/shapes_bouncing_ball.c (100%) rename {showcase => examples}/original/shapes/shapes_bouncing_ball.png (100%) rename {showcase => examples}/original/shapes/shapes_collision_area.c (100%) rename {showcase => examples}/original/shapes/shapes_collision_area.png (100%) rename {showcase => examples}/original/shapes/shapes_colors_palette.c (100%) rename {showcase => examples}/original/shapes/shapes_colors_palette.png (100%) rename {showcase => examples}/original/shapes/shapes_draw_circle_sector.c (100%) rename {showcase => examples}/original/shapes/shapes_draw_circle_sector.png (100%) rename {showcase => examples}/original/shapes/shapes_draw_rectangle_rounded.c (100%) rename {showcase => examples}/original/shapes/shapes_draw_rectangle_rounded.png (100%) rename {showcase => examples}/original/shapes/shapes_draw_ring.c (100%) rename {showcase => examples}/original/shapes/shapes_draw_ring.png (100%) rename {showcase => examples}/original/shapes/shapes_easings_ball_anim.c (100%) rename {showcase => examples}/original/shapes/shapes_easings_ball_anim.png (100%) rename {showcase => examples}/original/shapes/shapes_easings_box_anim.c (100%) rename {showcase => examples}/original/shapes/shapes_easings_box_anim.png (100%) rename {showcase => examples}/original/shapes/shapes_easings_rectangle_array.c (100%) rename {showcase => examples}/original/shapes/shapes_easings_rectangle_array.png (100%) rename {showcase => examples}/original/shapes/shapes_following_eyes.c (100%) rename {showcase => examples}/original/shapes/shapes_following_eyes.png (100%) rename {showcase => examples}/original/shapes/shapes_lines_bezier.c (100%) rename {showcase => examples}/original/shapes/shapes_lines_bezier.png (100%) rename {showcase => examples}/original/shapes/shapes_logo_raylib.c (100%) rename {showcase => examples}/original/shapes/shapes_logo_raylib.png (100%) rename {showcase => examples}/original/shapes/shapes_logo_raylib_anim.c (100%) rename {showcase => examples}/original/shapes/shapes_logo_raylib_anim.png (100%) rename {showcase => examples}/original/shapes/shapes_rectangle_scaling.c (100%) rename {showcase => examples}/original/shapes/shapes_rectangle_scaling.png (100%) rename {showcase => examples}/original/standalone/custom_backend.h (100%) rename {showcase => examples}/original/standalone/raygui_standalone.c (100%) rename {showcase => examples}/original/text/resources/AnonymousPro-Bold.ttf (100%) rename {showcase => examples}/original/text/resources/KAISG.ttf (100%) rename {showcase => examples}/original/text/resources/LICENSE (100%) rename {showcase => examples}/original/text/resources/bmfont.fnt (100%) rename {showcase => examples}/original/text/resources/bmfont.png (100%) rename {showcase => examples}/original/text/resources/custom_alagard.png (100%) rename {showcase => examples}/original/text/resources/custom_jupiter_crash.png (100%) rename {showcase => examples}/original/text/resources/custom_mecha.png (100%) rename {showcase => examples}/original/text/resources/dejavu.fnt (100%) rename {showcase => examples}/original/text/resources/dejavu.png (100%) rename {showcase => examples}/original/text/resources/emoji.fnt (100%) rename {showcase => examples}/original/text/resources/emoji.png (100%) rename {samples/static => examples/original/text/resources/fonts}/alagard.png (100%) rename {showcase => examples}/original/text/resources/fonts/alpha_beta.png (100%) rename {showcase => examples}/original/text/resources/fonts/jupiter_crash.png (100%) rename {showcase => examples}/original/text/resources/fonts/mecha.png (100%) rename {showcase => examples}/original/text/resources/fonts/pixantiqua.png (100%) rename {showcase => examples}/original/text/resources/fonts/pixelplay.png (100%) rename {showcase => examples}/original/text/resources/fonts/romulus.png (100%) rename {showcase => examples}/original/text/resources/fonts/setback.png (100%) rename {showcase => examples}/original/text/resources/notoCJK.fnt (100%) rename {showcase => examples}/original/text/resources/notoCJK.png (100%) rename {showcase => examples}/original/text/resources/pixantiqua.fnt (100%) rename {showcase => examples}/original/text/resources/pixantiqua.png (100%) rename {showcase => examples}/original/text/resources/pixantiqua.ttf (100%) rename {showcase => examples}/original/text/resources/shaders/glsl100/sdf.fs (100%) rename {showcase => examples}/original/text/resources/shaders/glsl330/sdf.fs (100%) rename {showcase => examples}/original/text/text_font_filters.c (100%) rename {showcase => examples}/original/text/text_font_filters.png (100%) rename {showcase => examples}/original/text/text_font_loading.c (100%) rename {showcase => examples}/original/text/text_font_loading.png (100%) rename {showcase => examples}/original/text/text_font_sdf.c (100%) rename {showcase => examples}/original/text/text_font_sdf.png (100%) rename {showcase => examples}/original/text/text_font_spritefont.c (100%) rename {showcase => examples}/original/text/text_font_spritefont.png (100%) rename {showcase => examples}/original/text/text_format_text.c (100%) rename {showcase => examples}/original/text/text_format_text.png (100%) rename {showcase => examples}/original/text/text_input_box.c (100%) rename {showcase => examples}/original/text/text_input_box.png (100%) rename {showcase => examples}/original/text/text_raylib_fonts.c (100%) rename {showcase => examples}/original/text/text_raylib_fonts.png (100%) rename {showcase => examples}/original/text/text_rectangle_bounds.c (100%) rename {showcase => examples}/original/text/text_rectangle_bounds.png (100%) rename {showcase => examples}/original/text/text_unicode.c (100%) rename {showcase => examples}/original/text/text_unicode.png (100%) rename {showcase => examples}/original/text/text_writing_anim.c (100%) rename {showcase => examples}/original/text/text_writing_anim.png (100%) rename {showcase => examples}/original/text_box_selection/textbox_extended_demo.c (100%) rename {showcase => examples}/original/text_editor/text_editor.c (100%) rename {showcase => examples}/original/textures/resources/KAISG.ttf (100%) rename {showcase => examples}/original/textures/resources/LICENSE (100%) rename {showcase => examples}/original/textures/resources/boom.wav (100%) rename {showcase => examples}/original/textures/resources/button.png (100%) rename {showcase => examples}/original/textures/resources/buttonfx.wav (100%) rename {showcase => examples}/original/textures/resources/cat.png (100%) rename {showcase => examples}/original/textures/resources/custom_jupiter_crash.png (100%) rename {showcase => examples}/original/textures/resources/cyberpunk_street_background.png (100%) rename {showcase => examples}/original/textures/resources/cyberpunk_street_foreground.png (100%) rename {showcase => examples}/original/textures/resources/cyberpunk_street_midground.png (100%) rename {showcase => examples}/original/textures/resources/explosion.png (100%) rename {showcase => examples}/original/textures/resources/fudesumi.png (100%) rename {showcase => examples}/original/textures/resources/fudesumi.raw (100%) rename {showcase => examples}/original/textures/resources/ninepatch_button.png (100%) rename {showcase => examples}/original/textures/resources/parrots.png (100%) rename {showcase => examples}/original/textures/resources/raylib_logo.png (100%) rename {showcase => examples}/original/textures/resources/scarfy.png (100%) rename {showcase => examples}/original/textures/resources/smoke.png (100%) rename {showcase => examples}/original/textures/resources/wabbit_alpha.png (100%) rename {showcase => examples}/original/textures/textures_background_scrolling.c (100%) rename {showcase => examples}/original/textures/textures_background_scrolling.png (100%) rename {showcase => examples}/original/textures/textures_bunnymark.c (100%) rename {showcase => examples}/original/textures/textures_bunnymark.png (100%) rename {showcase => examples}/original/textures/textures_image_drawing.c (100%) rename {showcase => examples}/original/textures/textures_image_drawing.png (100%) rename {showcase => examples}/original/textures/textures_image_generation.c (100%) rename {showcase => examples}/original/textures/textures_image_generation.png (100%) rename {showcase => examples}/original/textures/textures_image_loading.c (100%) rename {showcase => examples}/original/textures/textures_image_loading.png (100%) rename {showcase => examples}/original/textures/textures_image_processing.c (100%) rename {showcase => examples}/original/textures/textures_image_processing.png (100%) rename {showcase => examples}/original/textures/textures_image_text.c (100%) rename {showcase => examples}/original/textures/textures_image_text.png (100%) rename {showcase => examples}/original/textures/textures_logo_raylib.c (100%) rename {showcase => examples}/original/textures/textures_logo_raylib.png (100%) rename {showcase => examples}/original/textures/textures_mouse_painting.c (100%) rename {showcase => examples}/original/textures/textures_mouse_painting.png (100%) rename {showcase => examples}/original/textures/textures_npatch_drawing.c (100%) rename {showcase => examples}/original/textures/textures_npatch_drawing.png (100%) rename {showcase => examples}/original/textures/textures_particles_blending.c (100%) rename {showcase => examples}/original/textures/textures_particles_blending.png (100%) rename {showcase => examples}/original/textures/textures_raw_data.c (100%) rename {showcase => examples}/original/textures/textures_raw_data.png (100%) rename {showcase => examples}/original/textures/textures_rectangle.c (100%) rename {showcase => examples}/original/textures/textures_rectangle.png (100%) rename {showcase => examples}/original/textures/textures_sprite_button.c (100%) rename {showcase => examples}/original/textures/textures_sprite_button.png (100%) rename {showcase => examples}/original/textures/textures_sprite_explosion.c (100%) rename {showcase => examples}/original/textures/textures_sprite_explosion.png (100%) rename {showcase => examples}/original/textures/textures_srcrec_dstrec.c (100%) rename {showcase => examples}/original/textures/textures_srcrec_dstrec.png (100%) rename {showcase => examples}/original/textures/textures_to_image.c (100%) rename {showcase => examples}/original/textures/textures_to_image.png (100%) rename {showcase => examples}/src/example/audio/audio_module_playing.rs (100%) rename {showcase => examples}/src/example/audio/audio_multichannel_sound.rs (100%) rename {showcase => examples}/src/example/audio/audio_music_stream.rs (100%) rename {showcase => examples}/src/example/audio/audio_raw_stream.rs (100%) rename {showcase => examples}/src/example/audio/audio_sound_loading.png (100%) rename {showcase => examples}/src/example/audio/audio_sound_loading.rs (100%) rename {showcase => examples}/src/example/audio/mod.rs (100%) rename {showcase => examples}/src/example/controls_test_suite/controls_test_suite.rs (100%) rename {showcase => examples}/src/example/controls_test_suite/mod.rs (100%) rename {showcase => examples}/src/example/core/core_2d_camera.rs (100%) rename {showcase => examples}/src/example/core/core_2d_camera_platformer.rs (100%) rename {showcase => examples}/src/example/core/core_3d_camera_first_person.rs (100%) rename {showcase => examples}/src/example/core/core_3d_camera_free.rs (100%) rename {showcase => examples}/src/example/core/core_3d_camera_mode.rs (100%) rename {showcase => examples}/src/example/core/core_3d_picking.rs (100%) rename {showcase => examples}/src/example/core/core_basic_window.rs (100%) rename {showcase => examples}/src/example/core/core_custom_logging.png (100%) rename {showcase => examples}/src/example/core/core_custom_logging.rs (100%) rename {showcase => examples}/src/example/core/core_drop_files.rs (100%) rename {showcase => examples}/src/example/core/core_input_gamepad.rs (100%) rename {showcase => examples}/src/example/core/core_input_gestures.rs (100%) rename {showcase => examples}/src/example/core/core_input_keys.rs (100%) rename {showcase => examples}/src/example/core/core_input_mouse.png (100%) rename {showcase => examples}/src/example/core/core_input_mouse.rs (100%) rename {showcase => examples}/src/example/core/core_input_mouse_wheel.rs (100%) rename {showcase => examples}/src/example/core/core_input_multitouch.rs (100%) rename {showcase => examples}/src/example/core/core_random_values.png (100%) rename {showcase => examples}/src/example/core/core_random_values.rs (100%) rename {showcase => examples}/src/example/core/core_scissor_test.rs (100%) rename {showcase => examples}/src/example/core/core_vr_simulator.rs (100%) rename {showcase => examples}/src/example/core/core_window_letterbox.rs (100%) rename {showcase => examples}/src/example/core/core_world_screen.rs (100%) rename {showcase => examples}/src/example/core/mod.rs (100%) rename {showcase => examples}/src/example/image_exporter/image_exporter.rs (100%) rename {showcase => examples}/src/example/image_exporter/mod.rs (100%) rename {showcase => examples}/src/example/image_exporter/resources/cat.png (100%) rename {showcase => examples}/src/example/image_exporter/resources/fudesumi.png (100%) rename {showcase => examples}/src/example/image_exporter/resources/parrots.png (100%) rename {showcase => examples}/src/example/image_exporter/resources/scarfy.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REF.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV0.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV1.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV2.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV3.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV4.png (100%) rename {showcase => examples}/src/example/image_raw_importer/design/raw_importer_REV5.png (100%) rename {showcase => examples}/src/example/image_raw_importer/image_2x2_RGBA.raw (100%) rename {showcase => examples}/src/example/image_raw_importer/image_raw_importer.c (100%) rename {showcase => examples}/src/example/mod.rs (100%) rename {showcase => examples}/src/example/models/mod.rs (100%) rename {showcase => examples}/src/example/models/models_animation.rs (100%) rename {showcase => examples}/src/example/models/models_billboard.rs (100%) rename {showcase => examples}/src/example/models/models_box_collisions.rs (100%) rename {showcase => examples}/src/example/models/models_cubicmap.rs (100%) rename {showcase => examples}/src/example/models/models_first_person_maze.rs (100%) rename {showcase => examples}/src/example/models/models_geometric_shapes.rs (100%) rename {showcase => examples}/src/example/models/models_heightmap.rs (100%) rename {showcase => examples}/src/example/models/models_loading.rs (100%) rename {showcase => examples}/src/example/models/models_material_pbr.rs (100%) rename {showcase => examples}/src/example/models/models_mesh_generation.rs (100%) rename {showcase => examples}/src/example/models/models_mesh_picking.rs (100%) rename {showcase => examples}/src/example/models/models_orthographic_projection.rs (100%) rename {showcase => examples}/src/example/models/models_rlgl_solar_system.rs (100%) rename {showcase => examples}/src/example/models/models_skybox.rs (100%) rename {showcase => examples}/src/example/models/models_waving_cubes.rs (100%) rename {showcase => examples}/src/example/models/models_yaw_pitch_roll.rs (100%) rename {showcase => examples}/src/example/others/mod.rs (100%) rename {showcase => examples}/src/example/others/rlgl_standalone.rs (100%) rename {showcase => examples}/src/example/portable_window/mod.rs (100%) rename {showcase => examples}/src/example/portable_window/portable_window.rs (100%) rename {showcase => examples}/src/example/scroll_panel/gui_scroll_panel.rs (100%) rename {showcase => examples}/src/example/scroll_panel/mod.rs (100%) rename {showcase => examples}/src/example/shaders/mod.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_basic_lighting.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_custom_uniform.png (100%) rename {showcase => examples}/src/example/shaders/shaders_custom_uniform.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_eratosthenes.png (100%) rename {showcase => examples}/src/example/shaders/shaders_eratosthenes.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_fog.png (100%) rename {showcase => examples}/src/example/shaders/shaders_fog.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_julia_set.png (100%) rename {showcase => examples}/src/example/shaders/shaders_julia_set.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_model_shader.c (100%) rename {showcase => examples}/src/example/shaders/shaders_model_shader.png (100%) rename {showcase => examples}/src/example/shaders/shaders_palette_switch.c (100%) rename {showcase => examples}/src/example/shaders/shaders_palette_switch.png (100%) rename {showcase => examples}/src/example/shaders/shaders_postprocessing.c (100%) rename {showcase => examples}/src/example/shaders/shaders_postprocessing.png (100%) rename {showcase => examples}/src/example/shaders/shaders_postprocessing.rs (100%) rename {showcase => examples}/src/example/shaders/shaders_raymarching.c (100%) rename {showcase => examples}/src/example/shaders/shaders_raymarching.png (100%) rename {showcase => examples}/src/example/shaders/shaders_shapes_textures.c (100%) rename {showcase => examples}/src/example/shaders/shaders_shapes_textures.png (100%) rename {showcase => examples}/src/example/shaders/shaders_simple_mask.c (100%) rename {showcase => examples}/src/example/shaders/shaders_simple_mask.png (100%) rename {showcase => examples}/src/example/shaders/shaders_spotlight.c (100%) rename {showcase => examples}/src/example/shaders/shaders_spotlight.png (100%) rename {showcase => examples}/src/example/shaders/shaders_texture_drawing.c (100%) rename {showcase => examples}/src/example/shaders/shaders_texture_drawing.png (100%) rename {showcase => examples}/src/example/shaders/shaders_texture_waves.c (100%) rename {showcase => examples}/src/example/shaders/shaders_texture_waves.png (100%) rename {showcase => examples}/src/example/shapes/easings.h (100%) rename {showcase => examples}/src/example/shapes/raygui.h (100%) rename {showcase => examples}/src/example/shapes/shapes_basic_shapes.c (100%) rename {showcase => examples}/src/example/shapes/shapes_basic_shapes.png (100%) rename {showcase => examples}/src/example/shapes/shapes_bouncing_ball.c (100%) rename {showcase => examples}/src/example/shapes/shapes_bouncing_ball.png (100%) rename {showcase => examples}/src/example/shapes/shapes_collision_area.c (100%) rename {showcase => examples}/src/example/shapes/shapes_collision_area.png (100%) rename {showcase => examples}/src/example/shapes/shapes_colors_palette.c (100%) rename {showcase => examples}/src/example/shapes/shapes_colors_palette.png (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_circle_sector.c (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_circle_sector.png (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_rectangle_rounded.c (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_rectangle_rounded.png (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_ring.c (100%) rename {showcase => examples}/src/example/shapes/shapes_draw_ring.png (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_ball_anim.c (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_ball_anim.png (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_box_anim.c (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_box_anim.png (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_rectangle_array.c (100%) rename {showcase => examples}/src/example/shapes/shapes_easings_rectangle_array.png (100%) rename {showcase => examples}/src/example/shapes/shapes_following_eyes.c (100%) rename {showcase => examples}/src/example/shapes/shapes_following_eyes.png (100%) rename {showcase => examples}/src/example/shapes/shapes_lines_bezier.c (100%) rename {showcase => examples}/src/example/shapes/shapes_lines_bezier.png (100%) rename {showcase => examples}/src/example/shapes/shapes_logo_raylib.c (100%) rename {showcase => examples}/src/example/shapes/shapes_logo_raylib.png (100%) rename {showcase => examples}/src/example/shapes/shapes_logo_raylib_anim.c (100%) rename {showcase => examples}/src/example/shapes/shapes_logo_raylib_anim.png (100%) rename {showcase => examples}/src/example/shapes/shapes_rectangle_scaling.c (100%) rename {showcase => examples}/src/example/shapes/shapes_rectangle_scaling.png (100%) rename {showcase => examples}/src/example/text/resources/AnonymousPro-Bold.ttf (100%) rename {showcase => examples}/src/example/text/resources/KAISG.ttf (100%) rename {showcase => examples}/src/example/text/resources/LICENSE (100%) rename {showcase => examples}/src/example/text/resources/bmfont.fnt (100%) rename {showcase => examples}/src/example/text/resources/bmfont.png (100%) rename {showcase => examples}/src/example/text/resources/custom_alagard.png (100%) rename {showcase => examples}/src/example/text/resources/custom_jupiter_crash.png (100%) rename {showcase => examples}/src/example/text/resources/custom_mecha.png (100%) rename {showcase => examples}/src/example/text/resources/dejavu.fnt (100%) rename {showcase => examples}/src/example/text/resources/dejavu.png (100%) rename {showcase => examples}/src/example/text/resources/emoji.fnt (100%) rename {showcase => examples}/src/example/text/resources/emoji.png (100%) rename {showcase/original => examples/src/example}/text/resources/fonts/alagard.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/alpha_beta.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/jupiter_crash.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/mecha.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/pixantiqua.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/pixelplay.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/romulus.png (100%) rename {showcase => examples}/src/example/text/resources/fonts/setback.png (100%) rename {showcase => examples}/src/example/text/resources/notoCJK.fnt (100%) rename {showcase => examples}/src/example/text/resources/notoCJK.png (100%) rename {showcase => examples}/src/example/text/resources/pixantiqua.fnt (100%) rename {showcase => examples}/src/example/text/resources/pixantiqua.png (100%) rename {showcase => examples}/src/example/text/resources/pixantiqua.ttf (100%) rename {showcase => examples}/src/example/text/resources/shaders/glsl100/sdf.fs (100%) rename {showcase => examples}/src/example/text/resources/shaders/glsl330/sdf.fs (100%) rename {showcase => examples}/src/example/text/text_font_filters.c (100%) rename {showcase => examples}/src/example/text/text_font_filters.png (100%) rename {showcase => examples}/src/example/text/text_font_loading.c (100%) rename {showcase => examples}/src/example/text/text_font_loading.png (100%) rename {showcase => examples}/src/example/text/text_font_sdf.c (100%) rename {showcase => examples}/src/example/text/text_font_sdf.png (100%) rename {showcase => examples}/src/example/text/text_font_spritefont.c (100%) rename {showcase => examples}/src/example/text/text_font_spritefont.png (100%) rename {showcase => examples}/src/example/text/text_format_text.c (100%) rename {showcase => examples}/src/example/text/text_format_text.png (100%) rename {showcase => examples}/src/example/text/text_input_box.c (100%) rename {showcase => examples}/src/example/text/text_input_box.png (100%) rename {showcase => examples}/src/example/text/text_raylib_fonts.c (100%) rename {showcase => examples}/src/example/text/text_raylib_fonts.png (100%) rename {showcase => examples}/src/example/text/text_rectangle_bounds.c (100%) rename {showcase => examples}/src/example/text/text_rectangle_bounds.png (100%) rename {showcase => examples}/src/example/text/text_unicode.c (100%) rename {showcase => examples}/src/example/text/text_unicode.png (100%) rename {showcase => examples}/src/example/text/text_writing_anim.c (100%) rename {showcase => examples}/src/example/text/text_writing_anim.png (100%) rename {showcase => examples}/src/example/text_box_selection/textbox_extended_demo.c (100%) rename {showcase => examples}/src/example/text_editor/text_editor.c (100%) rename {showcase => examples}/src/example/textures/mod.rs (100%) rename {showcase => examples}/src/example/textures/textures_background_scrolling.c (100%) rename {showcase => examples}/src/example/textures/textures_background_scrolling.png (100%) rename {showcase => examples}/src/example/textures/textures_bunnymark.c (100%) rename {showcase => examples}/src/example/textures/textures_bunnymark.png (100%) rename {showcase => examples}/src/example/textures/textures_bunnymark.rs (100%) rename {showcase => examples}/src/example/textures/textures_image_drawing.c (100%) rename {showcase => examples}/src/example/textures/textures_image_drawing.png (100%) rename {showcase => examples}/src/example/textures/textures_image_generation.c (100%) rename {showcase => examples}/src/example/textures/textures_image_generation.png (100%) rename {showcase => examples}/src/example/textures/textures_image_loading.c (100%) rename {showcase => examples}/src/example/textures/textures_image_loading.png (100%) rename {showcase => examples}/src/example/textures/textures_image_processing.c (100%) rename {showcase => examples}/src/example/textures/textures_image_processing.png (100%) rename {showcase => examples}/src/example/textures/textures_image_text.c (100%) rename {showcase => examples}/src/example/textures/textures_image_text.png (100%) rename {showcase => examples}/src/example/textures/textures_logo_raylib.c (100%) rename {showcase => examples}/src/example/textures/textures_logo_raylib.png (100%) rename {showcase => examples}/src/example/textures/textures_mouse_painting.c (100%) rename {showcase => examples}/src/example/textures/textures_mouse_painting.png (100%) rename {showcase => examples}/src/example/textures/textures_mouse_painting.rs (100%) rename {showcase => examples}/src/example/textures/textures_npatch_drawing.c (100%) rename {showcase => examples}/src/example/textures/textures_npatch_drawing.png (100%) rename {showcase => examples}/src/example/textures/textures_particles_blending.c (100%) rename {showcase => examples}/src/example/textures/textures_particles_blending.png (100%) rename {showcase => examples}/src/example/textures/textures_raw_data.c (100%) rename {showcase => examples}/src/example/textures/textures_raw_data.png (100%) rename {showcase => examples}/src/example/textures/textures_rectangle.c (100%) rename {showcase => examples}/src/example/textures/textures_rectangle.png (100%) rename {showcase => examples}/src/example/textures/textures_rectangle.rs (100%) rename {showcase => examples}/src/example/textures/textures_sprite_button.c (100%) rename {showcase => examples}/src/example/textures/textures_sprite_button.png (100%) rename {showcase => examples}/src/example/textures/textures_sprite_explosion.c (100%) rename {showcase => examples}/src/example/textures/textures_sprite_explosion.png (100%) rename {showcase => examples}/src/example/textures/textures_srcrec_dstrec.c (100%) rename {showcase => examples}/src/example/textures/textures_srcrec_dstrec.png (100%) rename {showcase => examples}/src/example/textures/textures_to_image.c (100%) rename {showcase => examples}/src/example/textures/textures_to_image.png (100%) rename {showcase => examples}/src/main.rs (100%) delete mode 100644 samples/3d_camera_first_person.rs delete mode 100644 samples/Cargo.toml delete mode 100644 samples/README.md delete mode 100644 samples/Web.toml delete mode 100644 samples/arkanoid.rs delete mode 100644 samples/asteroids.rs delete mode 100644 samples/camera2D.rs delete mode 100644 samples/docs/3d_camera_first_person.PNG delete mode 100644 samples/docs/arkanoid.PNG delete mode 100644 samples/docs/camera2D.PNG delete mode 100644 samples/docs/font.PNG delete mode 100644 samples/docs/logo.PNG delete mode 100644 samples/docs/model_shader.PNG delete mode 100644 samples/docs/raymarch.PNG delete mode 100644 samples/docs/rgui.PNG delete mode 100644 samples/docs/roguelike.PNG delete mode 100644 samples/docs/specs.PNG delete mode 100644 samples/docs/texture.PNG delete mode 100644 samples/docs/yaw_pitch_roll.PNG delete mode 100644 samples/drop.rs delete mode 100644 samples/extensions.rs delete mode 100644 samples/font.rs delete mode 100644 samples/input.rs delete mode 100644 samples/logo.rs delete mode 100644 samples/model_shader.rs delete mode 100644 samples/options.rs delete mode 100644 samples/raylib.h delete mode 100644 samples/raymarch.rs delete mode 100644 samples/rgui.rs delete mode 100644 samples/roguelike.rs delete mode 100644 samples/specs.rs delete mode 100644 samples/static/exists.txt delete mode 100644 samples/static/logo.png delete mode 100644 samples/static/menu_background.png delete mode 100644 samples/static/raylib-rust_16x16.png delete mode 100644 samples/static/raymarching.fs delete mode 100644 samples/static/shader/pbr.fs delete mode 100644 samples/static/shader/pbr.vs delete mode 100644 samples/static/wave.ogg delete mode 100644 samples/static/white_noise.mp3 delete mode 100644 samples/texture.rs delete mode 100644 samples/yaw_pitch_roll.rs delete mode 100644 showcase/original/models/resources/angle_gauge.png delete mode 100644 showcase/original/models/resources/background.png delete mode 100644 showcase/original/models/resources/billboard.png delete mode 100644 showcase/original/models/resources/guy/guy.blend delete mode 100644 showcase/original/models/resources/guy/guy.iqm delete mode 100644 showcase/original/models/resources/guy/guyanim.iqm delete mode 100644 showcase/original/models/resources/guy/guytex.png delete mode 100644 showcase/original/models/resources/pbr/trooper.obj delete mode 100644 showcase/original/models/resources/pbr/trooper_albedo.png delete mode 100644 showcase/original/models/resources/pbr/trooper_ao.png delete mode 100644 showcase/original/models/resources/pbr/trooper_metalness.png delete mode 100644 showcase/original/models/resources/pbr/trooper_normals.png delete mode 100644 showcase/original/models/resources/pbr/trooper_roughness.png delete mode 100644 showcase/original/models/resources/pitch.png delete mode 100644 showcase/original/models/resources/plane.obj delete mode 100644 showcase/original/models/resources/plane.png delete mode 100644 showcase/original/models/resources/plane_diffuse.png delete mode 100644 showcase/original/shaders/resources/models/watermill.obj delete mode 100644 showcase/original/shaders/resources/models/watermill_diffuse.png delete mode 100644 showcase/original/shaders/resources/shaders/glsl330/grayscale.fs delete mode 100644 showcase/src/example/text/resources/fonts/alagard.png diff --git a/Cargo.toml b/Cargo.toml index f629a369..5870072c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["raylib", "raylib-sys", "samples"] +members = ["raylib", "raylib-sys", "examples"] diff --git a/DECISIONS.md b/DECISIONS.md index 239cb6bc..2d7b6be6 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -9,3 +9,8 @@ Now we cast buffers to `ManuallyDrop>` This allows us to created a box slice and have all the crazy iterator shenanigans users love, without invoking a copy allocation. We use `Box::leak` and `ManuallyDrop::take` to get the slice and then cast that to a `* void` for raylibs various `UnloadX` functions. If an `UnloadX` function doesn't exist, we use the `MemFree` function to return memory using the same allocator as raylib. + + +2. impl Into + +Where posible, have the library call `.into` on function params instead of relying on the user to make the call. diff --git a/showcase/.cargo/config.toml b/examples/.cargo/config.toml similarity index 100% rename from showcase/.cargo/config.toml rename to examples/.cargo/config.toml diff --git a/showcase/Cargo.toml b/examples/Cargo.toml similarity index 100% rename from showcase/Cargo.toml rename to examples/Cargo.toml diff --git a/showcase/Makefile b/examples/Makefile similarity index 100% rename from showcase/Makefile rename to examples/Makefile diff --git a/showcase/original/audio/audio_module_playing.c b/examples/original/audio/audio_module_playing.c similarity index 100% rename from showcase/original/audio/audio_module_playing.c rename to examples/original/audio/audio_module_playing.c diff --git a/showcase/original/audio/audio_module_playing.png b/examples/original/audio/audio_module_playing.png similarity index 100% rename from showcase/original/audio/audio_module_playing.png rename to examples/original/audio/audio_module_playing.png diff --git a/showcase/original/audio/audio_multichannel_sound.c b/examples/original/audio/audio_multichannel_sound.c similarity index 100% rename from showcase/original/audio/audio_multichannel_sound.c rename to examples/original/audio/audio_multichannel_sound.c diff --git a/showcase/original/audio/audio_multichannel_sound.png b/examples/original/audio/audio_multichannel_sound.png similarity index 100% rename from showcase/original/audio/audio_multichannel_sound.png rename to examples/original/audio/audio_multichannel_sound.png diff --git a/showcase/original/audio/audio_music_stream.c b/examples/original/audio/audio_music_stream.c similarity index 100% rename from showcase/original/audio/audio_music_stream.c rename to examples/original/audio/audio_music_stream.c diff --git a/showcase/original/audio/audio_music_stream.png b/examples/original/audio/audio_music_stream.png similarity index 100% rename from showcase/original/audio/audio_music_stream.png rename to examples/original/audio/audio_music_stream.png diff --git a/showcase/original/audio/audio_raw_stream.c b/examples/original/audio/audio_raw_stream.c similarity index 100% rename from showcase/original/audio/audio_raw_stream.c rename to examples/original/audio/audio_raw_stream.c diff --git a/showcase/original/audio/audio_raw_stream.png b/examples/original/audio/audio_raw_stream.png similarity index 100% rename from showcase/original/audio/audio_raw_stream.png rename to examples/original/audio/audio_raw_stream.png diff --git a/showcase/original/audio/audio_sound_loading.c b/examples/original/audio/audio_sound_loading.c similarity index 100% rename from showcase/original/audio/audio_sound_loading.c rename to examples/original/audio/audio_sound_loading.c diff --git a/showcase/original/audio/audio_sound_loading.png b/examples/original/audio/audio_sound_loading.png similarity index 100% rename from showcase/original/audio/audio_sound_loading.png rename to examples/original/audio/audio_sound_loading.png diff --git a/showcase/original/audio/resources/chiptun1.mod b/examples/original/audio/resources/chiptun1.mod similarity index 100% rename from showcase/original/audio/resources/chiptun1.mod rename to examples/original/audio/resources/chiptun1.mod diff --git a/showcase/original/audio/resources/coin.wav b/examples/original/audio/resources/coin.wav similarity index 100% rename from showcase/original/audio/resources/coin.wav rename to examples/original/audio/resources/coin.wav diff --git a/showcase/original/audio/resources/guitar_noodling.ogg b/examples/original/audio/resources/guitar_noodling.ogg similarity index 100% rename from showcase/original/audio/resources/guitar_noodling.ogg rename to examples/original/audio/resources/guitar_noodling.ogg diff --git a/showcase/original/audio/resources/mini1111.xm b/examples/original/audio/resources/mini1111.xm similarity index 100% rename from showcase/original/audio/resources/mini1111.xm rename to examples/original/audio/resources/mini1111.xm diff --git a/showcase/original/audio/resources/sound.wav b/examples/original/audio/resources/sound.wav similarity index 100% rename from showcase/original/audio/resources/sound.wav rename to examples/original/audio/resources/sound.wav diff --git a/showcase/original/audio/resources/spring.wav b/examples/original/audio/resources/spring.wav similarity index 100% rename from showcase/original/audio/resources/spring.wav rename to examples/original/audio/resources/spring.wav diff --git a/showcase/original/audio/resources/tanatana.flac b/examples/original/audio/resources/tanatana.flac similarity index 100% rename from showcase/original/audio/resources/tanatana.flac rename to examples/original/audio/resources/tanatana.flac diff --git a/showcase/original/audio/resources/tanatana.ogg b/examples/original/audio/resources/tanatana.ogg similarity index 100% rename from showcase/original/audio/resources/tanatana.ogg rename to examples/original/audio/resources/tanatana.ogg diff --git a/showcase/original/audio/resources/weird.wav b/examples/original/audio/resources/weird.wav similarity index 100% rename from showcase/original/audio/resources/weird.wav rename to examples/original/audio/resources/weird.wav diff --git a/showcase/original/controls_test_suite/controls_test_suite.c b/examples/original/controls_test_suite/controls_test_suite.c similarity index 100% rename from showcase/original/controls_test_suite/controls_test_suite.c rename to examples/original/controls_test_suite/controls_test_suite.c diff --git a/showcase/original/controls_test_suite/fonts/FiveByFive10.ttf b/examples/original/controls_test_suite/fonts/FiveByFive10.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/FiveByFive10.ttf rename to examples/original/controls_test_suite/fonts/FiveByFive10.ttf diff --git a/showcase/original/controls_test_suite/fonts/NorthernLights.ttf b/examples/original/controls_test_suite/fonts/NorthernLights.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/NorthernLights.ttf rename to examples/original/controls_test_suite/fonts/NorthernLights.ttf diff --git a/showcase/original/controls_test_suite/fonts/PIXEARG11.ttf b/examples/original/controls_test_suite/fonts/PIXEARG11.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/PIXEARG11.ttf rename to examples/original/controls_test_suite/fonts/PIXEARG11.ttf diff --git a/showcase/original/controls_test_suite/fonts/PixelOperator8.ttf b/examples/original/controls_test_suite/fonts/PixelOperator8.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/PixelOperator8.ttf rename to examples/original/controls_test_suite/fonts/PixelOperator8.ttf diff --git a/showcase/original/controls_test_suite/fonts/pixelpoiiz10.ttf b/examples/original/controls_test_suite/fonts/pixelpoiiz10.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/pixelpoiiz10.ttf rename to examples/original/controls_test_suite/fonts/pixelpoiiz10.ttf diff --git a/showcase/original/controls_test_suite/fonts/prstartk8.ttf b/examples/original/controls_test_suite/fonts/prstartk8.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/prstartk8.ttf rename to examples/original/controls_test_suite/fonts/prstartk8.ttf diff --git a/showcase/original/controls_test_suite/fonts/rainyhearts16.ttf b/examples/original/controls_test_suite/fonts/rainyhearts16.ttf similarity index 100% rename from showcase/original/controls_test_suite/fonts/rainyhearts16.ttf rename to examples/original/controls_test_suite/fonts/rainyhearts16.ttf diff --git a/showcase/original/core/core_2d_camera.c b/examples/original/core/core_2d_camera.c similarity index 100% rename from showcase/original/core/core_2d_camera.c rename to examples/original/core/core_2d_camera.c diff --git a/showcase/original/core/core_2d_camera.png b/examples/original/core/core_2d_camera.png similarity index 100% rename from showcase/original/core/core_2d_camera.png rename to examples/original/core/core_2d_camera.png diff --git a/showcase/original/core/core_2d_camera_platformer.c b/examples/original/core/core_2d_camera_platformer.c similarity index 100% rename from showcase/original/core/core_2d_camera_platformer.c rename to examples/original/core/core_2d_camera_platformer.c diff --git a/showcase/original/core/core_2d_camera_platformer.png b/examples/original/core/core_2d_camera_platformer.png similarity index 100% rename from showcase/original/core/core_2d_camera_platformer.png rename to examples/original/core/core_2d_camera_platformer.png diff --git a/showcase/original/core/core_3d_camera_first_person.c b/examples/original/core/core_3d_camera_first_person.c similarity index 100% rename from showcase/original/core/core_3d_camera_first_person.c rename to examples/original/core/core_3d_camera_first_person.c diff --git a/showcase/original/core/core_3d_camera_first_person.png b/examples/original/core/core_3d_camera_first_person.png similarity index 100% rename from showcase/original/core/core_3d_camera_first_person.png rename to examples/original/core/core_3d_camera_first_person.png diff --git a/showcase/original/core/core_3d_camera_free.c b/examples/original/core/core_3d_camera_free.c similarity index 100% rename from showcase/original/core/core_3d_camera_free.c rename to examples/original/core/core_3d_camera_free.c diff --git a/showcase/original/core/core_3d_camera_free.png b/examples/original/core/core_3d_camera_free.png similarity index 100% rename from showcase/original/core/core_3d_camera_free.png rename to examples/original/core/core_3d_camera_free.png diff --git a/showcase/original/core/core_3d_camera_mode.c b/examples/original/core/core_3d_camera_mode.c similarity index 100% rename from showcase/original/core/core_3d_camera_mode.c rename to examples/original/core/core_3d_camera_mode.c diff --git a/showcase/original/core/core_3d_camera_mode.png b/examples/original/core/core_3d_camera_mode.png similarity index 100% rename from showcase/original/core/core_3d_camera_mode.png rename to examples/original/core/core_3d_camera_mode.png diff --git a/showcase/original/core/core_3d_picking.c b/examples/original/core/core_3d_picking.c similarity index 100% rename from showcase/original/core/core_3d_picking.c rename to examples/original/core/core_3d_picking.c diff --git a/showcase/original/core/core_3d_picking.png b/examples/original/core/core_3d_picking.png similarity index 100% rename from showcase/original/core/core_3d_picking.png rename to examples/original/core/core_3d_picking.png diff --git a/showcase/original/core/core_basic_window.c b/examples/original/core/core_basic_window.c similarity index 100% rename from showcase/original/core/core_basic_window.c rename to examples/original/core/core_basic_window.c diff --git a/showcase/original/core/core_basic_window.cpp b/examples/original/core/core_basic_window.cpp similarity index 100% rename from showcase/original/core/core_basic_window.cpp rename to examples/original/core/core_basic_window.cpp diff --git a/showcase/original/core/core_basic_window.png b/examples/original/core/core_basic_window.png similarity index 100% rename from showcase/original/core/core_basic_window.png rename to examples/original/core/core_basic_window.png diff --git a/showcase/original/core/core_basic_window_web.c b/examples/original/core/core_basic_window_web.c similarity index 100% rename from showcase/original/core/core_basic_window_web.c rename to examples/original/core/core_basic_window_web.c diff --git a/showcase/original/core/core_custom_logging.c b/examples/original/core/core_custom_logging.c similarity index 100% rename from showcase/original/core/core_custom_logging.c rename to examples/original/core/core_custom_logging.c diff --git a/showcase/original/core/core_custom_logging.png b/examples/original/core/core_custom_logging.png similarity index 100% rename from showcase/original/core/core_custom_logging.png rename to examples/original/core/core_custom_logging.png diff --git a/showcase/original/core/core_drop_files.c b/examples/original/core/core_drop_files.c similarity index 100% rename from showcase/original/core/core_drop_files.c rename to examples/original/core/core_drop_files.c diff --git a/showcase/original/core/core_drop_files.png b/examples/original/core/core_drop_files.png similarity index 100% rename from showcase/original/core/core_drop_files.png rename to examples/original/core/core_drop_files.png diff --git a/showcase/original/core/core_input_gamepad.c b/examples/original/core/core_input_gamepad.c similarity index 100% rename from showcase/original/core/core_input_gamepad.c rename to examples/original/core/core_input_gamepad.c diff --git a/showcase/original/core/core_input_gamepad.png b/examples/original/core/core_input_gamepad.png similarity index 100% rename from showcase/original/core/core_input_gamepad.png rename to examples/original/core/core_input_gamepad.png diff --git a/showcase/original/core/core_input_gestures.c b/examples/original/core/core_input_gestures.c similarity index 100% rename from showcase/original/core/core_input_gestures.c rename to examples/original/core/core_input_gestures.c diff --git a/showcase/original/core/core_input_gestures.png b/examples/original/core/core_input_gestures.png similarity index 100% rename from showcase/original/core/core_input_gestures.png rename to examples/original/core/core_input_gestures.png diff --git a/showcase/original/core/core_input_keys.c b/examples/original/core/core_input_keys.c similarity index 100% rename from showcase/original/core/core_input_keys.c rename to examples/original/core/core_input_keys.c diff --git a/showcase/original/core/core_input_keys.png b/examples/original/core/core_input_keys.png similarity index 100% rename from showcase/original/core/core_input_keys.png rename to examples/original/core/core_input_keys.png diff --git a/showcase/original/core/core_input_mouse.c b/examples/original/core/core_input_mouse.c similarity index 100% rename from showcase/original/core/core_input_mouse.c rename to examples/original/core/core_input_mouse.c diff --git a/showcase/original/core/core_input_mouse.png b/examples/original/core/core_input_mouse.png similarity index 100% rename from showcase/original/core/core_input_mouse.png rename to examples/original/core/core_input_mouse.png diff --git a/showcase/original/core/core_input_mouse_wheel.c b/examples/original/core/core_input_mouse_wheel.c similarity index 100% rename from showcase/original/core/core_input_mouse_wheel.c rename to examples/original/core/core_input_mouse_wheel.c diff --git a/showcase/original/core/core_input_mouse_wheel.png b/examples/original/core/core_input_mouse_wheel.png similarity index 100% rename from showcase/original/core/core_input_mouse_wheel.png rename to examples/original/core/core_input_mouse_wheel.png diff --git a/showcase/original/core/core_input_multitouch.c b/examples/original/core/core_input_multitouch.c similarity index 100% rename from showcase/original/core/core_input_multitouch.c rename to examples/original/core/core_input_multitouch.c diff --git a/showcase/original/core/core_input_multitouch.png b/examples/original/core/core_input_multitouch.png similarity index 100% rename from showcase/original/core/core_input_multitouch.png rename to examples/original/core/core_input_multitouch.png diff --git a/showcase/original/core/core_loading_thread.c b/examples/original/core/core_loading_thread.c similarity index 100% rename from showcase/original/core/core_loading_thread.c rename to examples/original/core/core_loading_thread.c diff --git a/showcase/original/core/core_loading_thread.png b/examples/original/core/core_loading_thread.png similarity index 100% rename from showcase/original/core/core_loading_thread.png rename to examples/original/core/core_loading_thread.png diff --git a/showcase/original/core/core_random_values.c b/examples/original/core/core_random_values.c similarity index 100% rename from showcase/original/core/core_random_values.c rename to examples/original/core/core_random_values.c diff --git a/showcase/original/core/core_random_values.png b/examples/original/core/core_random_values.png similarity index 100% rename from showcase/original/core/core_random_values.png rename to examples/original/core/core_random_values.png diff --git a/showcase/original/core/core_scissor_test.c b/examples/original/core/core_scissor_test.c similarity index 100% rename from showcase/original/core/core_scissor_test.c rename to examples/original/core/core_scissor_test.c diff --git a/showcase/original/core/core_scissor_test.png b/examples/original/core/core_scissor_test.png similarity index 100% rename from showcase/original/core/core_scissor_test.png rename to examples/original/core/core_scissor_test.png diff --git a/showcase/original/core/core_storage_values.c b/examples/original/core/core_storage_values.c similarity index 100% rename from showcase/original/core/core_storage_values.c rename to examples/original/core/core_storage_values.c diff --git a/showcase/original/core/core_storage_values.png b/examples/original/core/core_storage_values.png similarity index 100% rename from showcase/original/core/core_storage_values.png rename to examples/original/core/core_storage_values.png diff --git a/showcase/original/core/core_vr_simulator.c b/examples/original/core/core_vr_simulator.c similarity index 100% rename from showcase/original/core/core_vr_simulator.c rename to examples/original/core/core_vr_simulator.c diff --git a/showcase/original/core/core_vr_simulator.png b/examples/original/core/core_vr_simulator.png similarity index 100% rename from showcase/original/core/core_vr_simulator.png rename to examples/original/core/core_vr_simulator.png diff --git a/showcase/original/core/core_window_letterbox.c b/examples/original/core/core_window_letterbox.c similarity index 100% rename from showcase/original/core/core_window_letterbox.c rename to examples/original/core/core_window_letterbox.c diff --git a/showcase/original/core/core_window_letterbox.png b/examples/original/core/core_window_letterbox.png similarity index 100% rename from showcase/original/core/core_window_letterbox.png rename to examples/original/core/core_window_letterbox.png diff --git a/showcase/original/core/core_world_screen.c b/examples/original/core/core_world_screen.c similarity index 100% rename from showcase/original/core/core_world_screen.c rename to examples/original/core/core_world_screen.c diff --git a/showcase/original/core/core_world_screen.png b/examples/original/core/core_world_screen.png similarity index 100% rename from showcase/original/core/core_world_screen.png rename to examples/original/core/core_world_screen.png diff --git a/showcase/original/core/resources/distortion100.fs b/examples/original/core/resources/distortion100.fs similarity index 100% rename from showcase/original/core/resources/distortion100.fs rename to examples/original/core/resources/distortion100.fs diff --git a/showcase/original/core/resources/distortion330.fs b/examples/original/core/resources/distortion330.fs similarity index 100% rename from showcase/original/core/resources/distortion330.fs rename to examples/original/core/resources/distortion330.fs diff --git a/showcase/original/core/resources/ps3.png b/examples/original/core/resources/ps3.png similarity index 100% rename from showcase/original/core/resources/ps3.png rename to examples/original/core/resources/ps3.png diff --git a/showcase/original/core/resources/xbox.png b/examples/original/core/resources/xbox.png similarity index 100% rename from showcase/original/core/resources/xbox.png rename to examples/original/core/resources/xbox.png diff --git a/showcase/original/custom_file_dialog/cat.png b/examples/original/custom_file_dialog/cat.png similarity index 100% rename from showcase/original/custom_file_dialog/cat.png rename to examples/original/custom_file_dialog/cat.png diff --git a/showcase/original/custom_file_dialog/custom_file_dialog.c b/examples/original/custom_file_dialog/custom_file_dialog.c similarity index 100% rename from showcase/original/custom_file_dialog/custom_file_dialog.c rename to examples/original/custom_file_dialog/custom_file_dialog.c diff --git a/showcase/original/custom_file_dialog/gui_file_dialog.h b/examples/original/custom_file_dialog/gui_file_dialog.h similarity index 100% rename from showcase/original/custom_file_dialog/gui_file_dialog.h rename to examples/original/custom_file_dialog/gui_file_dialog.h diff --git a/showcase/original/image_exporter/image_exporter.c b/examples/original/image_exporter/image_exporter.c similarity index 100% rename from showcase/original/image_exporter/image_exporter.c rename to examples/original/image_exporter/image_exporter.c diff --git a/showcase/original/image_exporter/resources/cat.png b/examples/original/image_exporter/resources/cat.png similarity index 100% rename from showcase/original/image_exporter/resources/cat.png rename to examples/original/image_exporter/resources/cat.png diff --git a/showcase/original/image_exporter/resources/fudesumi.png b/examples/original/image_exporter/resources/fudesumi.png similarity index 100% rename from showcase/original/image_exporter/resources/fudesumi.png rename to examples/original/image_exporter/resources/fudesumi.png diff --git a/showcase/original/image_exporter/resources/parrots.png b/examples/original/image_exporter/resources/parrots.png similarity index 100% rename from showcase/original/image_exporter/resources/parrots.png rename to examples/original/image_exporter/resources/parrots.png diff --git a/showcase/original/image_exporter/resources/scarfy.png b/examples/original/image_exporter/resources/scarfy.png similarity index 100% rename from showcase/original/image_exporter/resources/scarfy.png rename to examples/original/image_exporter/resources/scarfy.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REF.png b/examples/original/image_raw_importer/design/raw_importer_REF.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REF.png rename to examples/original/image_raw_importer/design/raw_importer_REF.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV0.png b/examples/original/image_raw_importer/design/raw_importer_REV0.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV0.png rename to examples/original/image_raw_importer/design/raw_importer_REV0.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV1.png b/examples/original/image_raw_importer/design/raw_importer_REV1.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV1.png rename to examples/original/image_raw_importer/design/raw_importer_REV1.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV2.png b/examples/original/image_raw_importer/design/raw_importer_REV2.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV2.png rename to examples/original/image_raw_importer/design/raw_importer_REV2.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV3.png b/examples/original/image_raw_importer/design/raw_importer_REV3.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV3.png rename to examples/original/image_raw_importer/design/raw_importer_REV3.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV4.png b/examples/original/image_raw_importer/design/raw_importer_REV4.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV4.png rename to examples/original/image_raw_importer/design/raw_importer_REV4.png diff --git a/showcase/original/image_raw_importer/design/raw_importer_REV5.png b/examples/original/image_raw_importer/design/raw_importer_REV5.png similarity index 100% rename from showcase/original/image_raw_importer/design/raw_importer_REV5.png rename to examples/original/image_raw_importer/design/raw_importer_REV5.png diff --git a/showcase/original/image_raw_importer/image_2x2_RGBA.raw b/examples/original/image_raw_importer/image_2x2_RGBA.raw similarity index 100% rename from showcase/original/image_raw_importer/image_2x2_RGBA.raw rename to examples/original/image_raw_importer/image_2x2_RGBA.raw diff --git a/showcase/original/image_raw_importer/image_raw_importer.c b/examples/original/image_raw_importer/image_raw_importer.c similarity index 100% rename from showcase/original/image_raw_importer/image_raw_importer.c rename to examples/original/image_raw_importer/image_raw_importer.c diff --git a/showcase/original/models/models_animation.c b/examples/original/models/models_animation.c similarity index 100% rename from showcase/original/models/models_animation.c rename to examples/original/models/models_animation.c diff --git a/showcase/original/models/models_animation.png b/examples/original/models/models_animation.png similarity index 100% rename from showcase/original/models/models_animation.png rename to examples/original/models/models_animation.png diff --git a/showcase/original/models/models_billboard.c b/examples/original/models/models_billboard.c similarity index 100% rename from showcase/original/models/models_billboard.c rename to examples/original/models/models_billboard.c diff --git a/showcase/original/models/models_billboard.png b/examples/original/models/models_billboard.png similarity index 100% rename from showcase/original/models/models_billboard.png rename to examples/original/models/models_billboard.png diff --git a/showcase/original/models/models_box_collisions.c b/examples/original/models/models_box_collisions.c similarity index 100% rename from showcase/original/models/models_box_collisions.c rename to examples/original/models/models_box_collisions.c diff --git a/showcase/original/models/models_box_collisions.png b/examples/original/models/models_box_collisions.png similarity index 100% rename from showcase/original/models/models_box_collisions.png rename to examples/original/models/models_box_collisions.png diff --git a/showcase/original/models/models_cubicmap.c b/examples/original/models/models_cubicmap.c similarity index 100% rename from showcase/original/models/models_cubicmap.c rename to examples/original/models/models_cubicmap.c diff --git a/showcase/original/models/models_cubicmap.png b/examples/original/models/models_cubicmap.png similarity index 100% rename from showcase/original/models/models_cubicmap.png rename to examples/original/models/models_cubicmap.png diff --git a/showcase/original/models/models_first_person_maze.c b/examples/original/models/models_first_person_maze.c similarity index 100% rename from showcase/original/models/models_first_person_maze.c rename to examples/original/models/models_first_person_maze.c diff --git a/showcase/original/models/models_first_person_maze.png b/examples/original/models/models_first_person_maze.png similarity index 100% rename from showcase/original/models/models_first_person_maze.png rename to examples/original/models/models_first_person_maze.png diff --git a/showcase/original/models/models_geometric_shapes.c b/examples/original/models/models_geometric_shapes.c similarity index 100% rename from showcase/original/models/models_geometric_shapes.c rename to examples/original/models/models_geometric_shapes.c diff --git a/showcase/original/models/models_geometric_shapes.png b/examples/original/models/models_geometric_shapes.png similarity index 100% rename from showcase/original/models/models_geometric_shapes.png rename to examples/original/models/models_geometric_shapes.png diff --git a/showcase/original/models/models_heightmap.c b/examples/original/models/models_heightmap.c similarity index 100% rename from showcase/original/models/models_heightmap.c rename to examples/original/models/models_heightmap.c diff --git a/showcase/original/models/models_heightmap.png b/examples/original/models/models_heightmap.png similarity index 100% rename from showcase/original/models/models_heightmap.png rename to examples/original/models/models_heightmap.png diff --git a/showcase/original/models/models_loading.c b/examples/original/models/models_loading.c similarity index 100% rename from showcase/original/models/models_loading.c rename to examples/original/models/models_loading.c diff --git a/showcase/original/models/models_loading.png b/examples/original/models/models_loading.png similarity index 100% rename from showcase/original/models/models_loading.png rename to examples/original/models/models_loading.png diff --git a/showcase/original/models/models_material_pbr.c b/examples/original/models/models_material_pbr.c similarity index 100% rename from showcase/original/models/models_material_pbr.c rename to examples/original/models/models_material_pbr.c diff --git a/showcase/original/models/models_material_pbr.png b/examples/original/models/models_material_pbr.png similarity index 100% rename from showcase/original/models/models_material_pbr.png rename to examples/original/models/models_material_pbr.png diff --git a/showcase/original/models/models_mesh_generation.c b/examples/original/models/models_mesh_generation.c similarity index 100% rename from showcase/original/models/models_mesh_generation.c rename to examples/original/models/models_mesh_generation.c diff --git a/showcase/original/models/models_mesh_generation.png b/examples/original/models/models_mesh_generation.png similarity index 100% rename from showcase/original/models/models_mesh_generation.png rename to examples/original/models/models_mesh_generation.png diff --git a/showcase/original/models/models_mesh_picking.c b/examples/original/models/models_mesh_picking.c similarity index 100% rename from showcase/original/models/models_mesh_picking.c rename to examples/original/models/models_mesh_picking.c diff --git a/showcase/original/models/models_mesh_picking.png b/examples/original/models/models_mesh_picking.png similarity index 100% rename from showcase/original/models/models_mesh_picking.png rename to examples/original/models/models_mesh_picking.png diff --git a/showcase/original/models/models_orthographic_projection.c b/examples/original/models/models_orthographic_projection.c similarity index 100% rename from showcase/original/models/models_orthographic_projection.c rename to examples/original/models/models_orthographic_projection.c diff --git a/showcase/original/models/models_orthographic_projection.png b/examples/original/models/models_orthographic_projection.png similarity index 100% rename from showcase/original/models/models_orthographic_projection.png rename to examples/original/models/models_orthographic_projection.png diff --git a/showcase/original/models/models_rlgl_solar_system.c b/examples/original/models/models_rlgl_solar_system.c similarity index 100% rename from showcase/original/models/models_rlgl_solar_system.c rename to examples/original/models/models_rlgl_solar_system.c diff --git a/showcase/original/models/models_rlgl_solar_system.png b/examples/original/models/models_rlgl_solar_system.png similarity index 100% rename from showcase/original/models/models_rlgl_solar_system.png rename to examples/original/models/models_rlgl_solar_system.png diff --git a/showcase/original/models/models_skybox.c b/examples/original/models/models_skybox.c similarity index 100% rename from showcase/original/models/models_skybox.c rename to examples/original/models/models_skybox.c diff --git a/showcase/original/models/models_skybox.png b/examples/original/models/models_skybox.png similarity index 100% rename from showcase/original/models/models_skybox.png rename to examples/original/models/models_skybox.png diff --git a/showcase/original/models/models_waving_cubes.c b/examples/original/models/models_waving_cubes.c similarity index 100% rename from showcase/original/models/models_waving_cubes.c rename to examples/original/models/models_waving_cubes.c diff --git a/showcase/original/models/models_waving_cubes.png b/examples/original/models/models_waving_cubes.png similarity index 100% rename from showcase/original/models/models_waving_cubes.png rename to examples/original/models/models_waving_cubes.png diff --git a/showcase/original/models/models_yaw_pitch_roll.c b/examples/original/models/models_yaw_pitch_roll.c similarity index 100% rename from showcase/original/models/models_yaw_pitch_roll.c rename to examples/original/models/models_yaw_pitch_roll.c diff --git a/showcase/original/models/models_yaw_pitch_roll.png b/examples/original/models/models_yaw_pitch_roll.png similarity index 100% rename from showcase/original/models/models_yaw_pitch_roll.png rename to examples/original/models/models_yaw_pitch_roll.png diff --git a/samples/static/angle_gauge.png b/examples/original/models/resources/angle_gauge.png similarity index 100% rename from samples/static/angle_gauge.png rename to examples/original/models/resources/angle_gauge.png diff --git a/samples/static/background.png b/examples/original/models/resources/background.png similarity index 100% rename from samples/static/background.png rename to examples/original/models/resources/background.png diff --git a/samples/static/billboard.png b/examples/original/models/resources/billboard.png similarity index 100% rename from samples/static/billboard.png rename to examples/original/models/resources/billboard.png diff --git a/showcase/original/models/resources/cubicmap.png b/examples/original/models/resources/cubicmap.png similarity index 100% rename from showcase/original/models/resources/cubicmap.png rename to examples/original/models/resources/cubicmap.png diff --git a/showcase/original/models/resources/cubicmap_atlas.png b/examples/original/models/resources/cubicmap_atlas.png similarity index 100% rename from showcase/original/models/resources/cubicmap_atlas.png rename to examples/original/models/resources/cubicmap_atlas.png diff --git a/showcase/original/models/resources/dresden_square.hdr b/examples/original/models/resources/dresden_square.hdr similarity index 100% rename from showcase/original/models/resources/dresden_square.hdr rename to examples/original/models/resources/dresden_square.hdr diff --git a/samples/static/guy/guy.blend b/examples/original/models/resources/guy/guy.blend similarity index 100% rename from samples/static/guy/guy.blend rename to examples/original/models/resources/guy/guy.blend diff --git a/samples/static/guy/guy.iqm b/examples/original/models/resources/guy/guy.iqm similarity index 100% rename from samples/static/guy/guy.iqm rename to examples/original/models/resources/guy/guy.iqm diff --git a/samples/static/guy/guyanim.iqm b/examples/original/models/resources/guy/guyanim.iqm similarity index 100% rename from samples/static/guy/guyanim.iqm rename to examples/original/models/resources/guy/guyanim.iqm diff --git a/samples/static/guy/guytex.png b/examples/original/models/resources/guy/guytex.png similarity index 100% rename from samples/static/guy/guytex.png rename to examples/original/models/resources/guy/guytex.png diff --git a/showcase/original/models/resources/heightmap.png b/examples/original/models/resources/heightmap.png similarity index 100% rename from showcase/original/models/resources/heightmap.png rename to examples/original/models/resources/heightmap.png diff --git a/showcase/original/models/resources/models/Duck/Duck.glb b/examples/original/models/resources/models/Duck/Duck.glb similarity index 100% rename from showcase/original/models/resources/models/Duck/Duck.glb rename to examples/original/models/resources/models/Duck/Duck.glb diff --git a/showcase/original/models/resources/models/Duck/Duck.gltf b/examples/original/models/resources/models/Duck/Duck.gltf similarity index 100% rename from showcase/original/models/resources/models/Duck/Duck.gltf rename to examples/original/models/resources/models/Duck/Duck.gltf diff --git a/showcase/original/models/resources/models/Duck/Duck0.bin b/examples/original/models/resources/models/Duck/Duck0.bin similarity index 100% rename from showcase/original/models/resources/models/Duck/Duck0.bin rename to examples/original/models/resources/models/Duck/Duck0.bin diff --git a/showcase/original/models/resources/models/Duck/DuckCM.png b/examples/original/models/resources/models/Duck/DuckCM.png similarity index 100% rename from showcase/original/models/resources/models/Duck/DuckCM.png rename to examples/original/models/resources/models/Duck/DuckCM.png diff --git a/showcase/original/models/resources/models/Duck/Duck_license.txt b/examples/original/models/resources/models/Duck/Duck_license.txt similarity index 100% rename from showcase/original/models/resources/models/Duck/Duck_license.txt rename to examples/original/models/resources/models/Duck/Duck_license.txt diff --git a/showcase/original/models/resources/models/LICENSE b/examples/original/models/resources/models/LICENSE similarity index 100% rename from showcase/original/models/resources/models/LICENSE rename to examples/original/models/resources/models/LICENSE diff --git a/showcase/original/models/resources/models/bridge.obj b/examples/original/models/resources/models/bridge.obj similarity index 100% rename from showcase/original/models/resources/models/bridge.obj rename to examples/original/models/resources/models/bridge.obj diff --git a/showcase/original/models/resources/models/bridge_diffuse.png b/examples/original/models/resources/models/bridge_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/bridge_diffuse.png rename to examples/original/models/resources/models/bridge_diffuse.png diff --git a/showcase/original/models/resources/models/castle.obj b/examples/original/models/resources/models/castle.obj similarity index 100% rename from showcase/original/models/resources/models/castle.obj rename to examples/original/models/resources/models/castle.obj diff --git a/showcase/original/models/resources/models/castle_diffuse.png b/examples/original/models/resources/models/castle_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/castle_diffuse.png rename to examples/original/models/resources/models/castle_diffuse.png diff --git a/showcase/original/models/resources/models/cube.obj b/examples/original/models/resources/models/cube.obj similarity index 100% rename from showcase/original/models/resources/models/cube.obj rename to examples/original/models/resources/models/cube.obj diff --git a/showcase/original/models/resources/models/cube_diffuse.png b/examples/original/models/resources/models/cube_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/cube_diffuse.png rename to examples/original/models/resources/models/cube_diffuse.png diff --git a/showcase/original/models/resources/models/house.obj b/examples/original/models/resources/models/house.obj similarity index 100% rename from showcase/original/models/resources/models/house.obj rename to examples/original/models/resources/models/house.obj diff --git a/showcase/original/models/resources/models/house_diffuse.png b/examples/original/models/resources/models/house_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/house_diffuse.png rename to examples/original/models/resources/models/house_diffuse.png diff --git a/showcase/original/models/resources/models/market.obj b/examples/original/models/resources/models/market.obj similarity index 100% rename from showcase/original/models/resources/models/market.obj rename to examples/original/models/resources/models/market.obj diff --git a/showcase/original/models/resources/models/market_diffuse.png b/examples/original/models/resources/models/market_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/market_diffuse.png rename to examples/original/models/resources/models/market_diffuse.png diff --git a/showcase/original/models/resources/models/turret.obj b/examples/original/models/resources/models/turret.obj similarity index 100% rename from showcase/original/models/resources/models/turret.obj rename to examples/original/models/resources/models/turret.obj diff --git a/showcase/original/models/resources/models/turret_diffuse.png b/examples/original/models/resources/models/turret_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/turret_diffuse.png rename to examples/original/models/resources/models/turret_diffuse.png diff --git a/showcase/original/models/resources/models/well.obj b/examples/original/models/resources/models/well.obj similarity index 100% rename from showcase/original/models/resources/models/well.obj rename to examples/original/models/resources/models/well.obj diff --git a/showcase/original/models/resources/models/well_diffuse.png b/examples/original/models/resources/models/well_diffuse.png similarity index 100% rename from showcase/original/models/resources/models/well_diffuse.png rename to examples/original/models/resources/models/well_diffuse.png diff --git a/samples/static/pbr/trooper.obj b/examples/original/models/resources/pbr/trooper.obj similarity index 100% rename from samples/static/pbr/trooper.obj rename to examples/original/models/resources/pbr/trooper.obj diff --git a/samples/static/pbr/trooper_albedo.png b/examples/original/models/resources/pbr/trooper_albedo.png similarity index 100% rename from samples/static/pbr/trooper_albedo.png rename to examples/original/models/resources/pbr/trooper_albedo.png diff --git a/samples/static/pbr/trooper_ao.png b/examples/original/models/resources/pbr/trooper_ao.png similarity index 100% rename from samples/static/pbr/trooper_ao.png rename to examples/original/models/resources/pbr/trooper_ao.png diff --git a/samples/static/pbr/trooper_metalness.png b/examples/original/models/resources/pbr/trooper_metalness.png similarity index 100% rename from samples/static/pbr/trooper_metalness.png rename to examples/original/models/resources/pbr/trooper_metalness.png diff --git a/samples/static/pbr/trooper_normals.png b/examples/original/models/resources/pbr/trooper_normals.png similarity index 100% rename from samples/static/pbr/trooper_normals.png rename to examples/original/models/resources/pbr/trooper_normals.png diff --git a/samples/static/pbr/trooper_roughness.png b/examples/original/models/resources/pbr/trooper_roughness.png similarity index 100% rename from samples/static/pbr/trooper_roughness.png rename to examples/original/models/resources/pbr/trooper_roughness.png diff --git a/samples/static/pitch.png b/examples/original/models/resources/pitch.png similarity index 100% rename from samples/static/pitch.png rename to examples/original/models/resources/pitch.png diff --git a/samples/static/plane.obj b/examples/original/models/resources/plane.obj similarity index 100% rename from samples/static/plane.obj rename to examples/original/models/resources/plane.obj diff --git a/samples/static/plane.png b/examples/original/models/resources/plane.png similarity index 100% rename from samples/static/plane.png rename to examples/original/models/resources/plane.png diff --git a/samples/static/plane_diffuse.png b/examples/original/models/resources/plane_diffuse.png similarity index 100% rename from samples/static/plane_diffuse.png rename to examples/original/models/resources/plane_diffuse.png diff --git a/showcase/original/models/resources/shaders/glsl100/cubemap.fs b/examples/original/models/resources/shaders/glsl100/cubemap.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl100/cubemap.fs rename to examples/original/models/resources/shaders/glsl100/cubemap.fs diff --git a/showcase/original/models/resources/shaders/glsl100/cubemap.vs b/examples/original/models/resources/shaders/glsl100/cubemap.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl100/cubemap.vs rename to examples/original/models/resources/shaders/glsl100/cubemap.vs diff --git a/showcase/original/models/resources/shaders/glsl100/skybox.fs b/examples/original/models/resources/shaders/glsl100/skybox.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl100/skybox.fs rename to examples/original/models/resources/shaders/glsl100/skybox.fs diff --git a/showcase/original/models/resources/shaders/glsl100/skybox.vs b/examples/original/models/resources/shaders/glsl100/skybox.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl100/skybox.vs rename to examples/original/models/resources/shaders/glsl100/skybox.vs diff --git a/showcase/original/models/resources/shaders/glsl330/brdf.fs b/examples/original/models/resources/shaders/glsl330/brdf.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/brdf.fs rename to examples/original/models/resources/shaders/glsl330/brdf.fs diff --git a/showcase/original/models/resources/shaders/glsl330/brdf.vs b/examples/original/models/resources/shaders/glsl330/brdf.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/brdf.vs rename to examples/original/models/resources/shaders/glsl330/brdf.vs diff --git a/showcase/original/models/resources/shaders/glsl330/cubemap.fs b/examples/original/models/resources/shaders/glsl330/cubemap.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/cubemap.fs rename to examples/original/models/resources/shaders/glsl330/cubemap.fs diff --git a/showcase/original/models/resources/shaders/glsl330/cubemap.vs b/examples/original/models/resources/shaders/glsl330/cubemap.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/cubemap.vs rename to examples/original/models/resources/shaders/glsl330/cubemap.vs diff --git a/showcase/original/models/resources/shaders/glsl330/irradiance.fs b/examples/original/models/resources/shaders/glsl330/irradiance.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/irradiance.fs rename to examples/original/models/resources/shaders/glsl330/irradiance.fs diff --git a/showcase/original/models/resources/shaders/glsl330/pbr.fs b/examples/original/models/resources/shaders/glsl330/pbr.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/pbr.fs rename to examples/original/models/resources/shaders/glsl330/pbr.fs diff --git a/showcase/original/models/resources/shaders/glsl330/pbr.vs b/examples/original/models/resources/shaders/glsl330/pbr.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/pbr.vs rename to examples/original/models/resources/shaders/glsl330/pbr.vs diff --git a/showcase/original/models/resources/shaders/glsl330/prefilter.fs b/examples/original/models/resources/shaders/glsl330/prefilter.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/prefilter.fs rename to examples/original/models/resources/shaders/glsl330/prefilter.fs diff --git a/showcase/original/models/resources/shaders/glsl330/skybox.fs b/examples/original/models/resources/shaders/glsl330/skybox.fs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/skybox.fs rename to examples/original/models/resources/shaders/glsl330/skybox.fs diff --git a/showcase/original/models/resources/shaders/glsl330/skybox.vs b/examples/original/models/resources/shaders/glsl330/skybox.vs similarity index 100% rename from showcase/original/models/resources/shaders/glsl330/skybox.vs rename to examples/original/models/resources/shaders/glsl330/skybox.vs diff --git a/showcase/original/models/rlights.h b/examples/original/models/rlights.h similarity index 100% rename from showcase/original/models/rlights.h rename to examples/original/models/rlights.h diff --git a/showcase/original/network/network_ping_pong.c b/examples/original/network/network_ping_pong.c similarity index 100% rename from showcase/original/network/network_ping_pong.c rename to examples/original/network/network_ping_pong.c diff --git a/showcase/original/network/network_resolve_host.c b/examples/original/network/network_resolve_host.c similarity index 100% rename from showcase/original/network/network_resolve_host.c rename to examples/original/network/network_resolve_host.c diff --git a/showcase/original/network/network_tcp_client.c b/examples/original/network/network_tcp_client.c similarity index 100% rename from showcase/original/network/network_tcp_client.c rename to examples/original/network/network_tcp_client.c diff --git a/showcase/original/network/network_tcp_server.c b/examples/original/network/network_tcp_server.c similarity index 100% rename from showcase/original/network/network_tcp_server.c rename to examples/original/network/network_tcp_server.c diff --git a/showcase/original/network/network_test.c b/examples/original/network/network_test.c similarity index 100% rename from showcase/original/network/network_test.c rename to examples/original/network/network_test.c diff --git a/showcase/original/network/network_udp_client.c b/examples/original/network/network_udp_client.c similarity index 100% rename from showcase/original/network/network_udp_client.c rename to examples/original/network/network_udp_client.c diff --git a/showcase/original/network/network_udp_server.c b/examples/original/network/network_udp_server.c similarity index 100% rename from showcase/original/network/network_udp_server.c rename to examples/original/network/network_udp_server.c diff --git a/showcase/original/others/easings.h b/examples/original/others/easings.h similarity index 100% rename from showcase/original/others/easings.h rename to examples/original/others/easings.h diff --git a/showcase/original/others/easings_testbed.c b/examples/original/others/easings_testbed.c similarity index 100% rename from showcase/original/others/easings_testbed.c rename to examples/original/others/easings_testbed.c diff --git a/showcase/original/others/external/include/GLFW/glfw3.h b/examples/original/others/external/include/GLFW/glfw3.h similarity index 100% rename from showcase/original/others/external/include/GLFW/glfw3.h rename to examples/original/others/external/include/GLFW/glfw3.h diff --git a/showcase/original/others/external/include/GLFW/glfw3native.h b/examples/original/others/external/include/GLFW/glfw3native.h similarity index 100% rename from showcase/original/others/external/include/GLFW/glfw3native.h rename to examples/original/others/external/include/GLFW/glfw3native.h diff --git a/showcase/original/others/external/include/glad.h b/examples/original/others/external/include/glad.h similarity index 100% rename from showcase/original/others/external/include/glad.h rename to examples/original/others/external/include/glad.h diff --git a/showcase/original/others/external/lib/libglfw3.a b/examples/original/others/external/lib/libglfw3.a similarity index 100% rename from showcase/original/others/external/lib/libglfw3.a rename to examples/original/others/external/lib/libglfw3.a diff --git a/showcase/original/others/raudio_standalone.c b/examples/original/others/raudio_standalone.c similarity index 100% rename from showcase/original/others/raudio_standalone.c rename to examples/original/others/raudio_standalone.c diff --git a/showcase/original/others/resources/audio/guitar_noodling.ogg b/examples/original/others/resources/audio/guitar_noodling.ogg similarity index 100% rename from showcase/original/others/resources/audio/guitar_noodling.ogg rename to examples/original/others/resources/audio/guitar_noodling.ogg diff --git a/showcase/original/others/resources/audio/tanatana.ogg b/examples/original/others/resources/audio/tanatana.ogg similarity index 100% rename from showcase/original/others/resources/audio/tanatana.ogg rename to examples/original/others/resources/audio/tanatana.ogg diff --git a/showcase/original/others/resources/audio/weird.wav b/examples/original/others/resources/audio/weird.wav similarity index 100% rename from showcase/original/others/resources/audio/weird.wav rename to examples/original/others/resources/audio/weird.wav diff --git a/showcase/original/others/rlgl_standalone.c b/examples/original/others/rlgl_standalone.c similarity index 100% rename from showcase/original/others/rlgl_standalone.c rename to examples/original/others/rlgl_standalone.c diff --git a/showcase/original/physics/physics_demo.c b/examples/original/physics/physics_demo.c similarity index 100% rename from showcase/original/physics/physics_demo.c rename to examples/original/physics/physics_demo.c diff --git a/showcase/original/physics/physics_demo.png b/examples/original/physics/physics_demo.png similarity index 100% rename from showcase/original/physics/physics_demo.png rename to examples/original/physics/physics_demo.png diff --git a/showcase/original/physics/physics_friction.c b/examples/original/physics/physics_friction.c similarity index 100% rename from showcase/original/physics/physics_friction.c rename to examples/original/physics/physics_friction.c diff --git a/showcase/original/physics/physics_friction.png b/examples/original/physics/physics_friction.png similarity index 100% rename from showcase/original/physics/physics_friction.png rename to examples/original/physics/physics_friction.png diff --git a/showcase/original/physics/physics_movement.c b/examples/original/physics/physics_movement.c similarity index 100% rename from showcase/original/physics/physics_movement.c rename to examples/original/physics/physics_movement.c diff --git a/showcase/original/physics/physics_movement.png b/examples/original/physics/physics_movement.png similarity index 100% rename from showcase/original/physics/physics_movement.png rename to examples/original/physics/physics_movement.png diff --git a/showcase/original/physics/physics_restitution.c b/examples/original/physics/physics_restitution.c similarity index 100% rename from showcase/original/physics/physics_restitution.c rename to examples/original/physics/physics_restitution.c diff --git a/showcase/original/physics/physics_restitution.png b/examples/original/physics/physics_restitution.png similarity index 100% rename from showcase/original/physics/physics_restitution.png rename to examples/original/physics/physics_restitution.png diff --git a/showcase/original/physics/physics_shatter.c b/examples/original/physics/physics_shatter.c similarity index 100% rename from showcase/original/physics/physics_shatter.c rename to examples/original/physics/physics_shatter.c diff --git a/showcase/original/physics/physics_shatter.png b/examples/original/physics/physics_shatter.png similarity index 100% rename from showcase/original/physics/physics_shatter.png rename to examples/original/physics/physics_shatter.png diff --git a/showcase/original/portable_window/portable_window.c b/examples/original/portable_window/portable_window.c similarity index 100% rename from showcase/original/portable_window/portable_window.c rename to examples/original/portable_window/portable_window.c diff --git a/showcase/original/property_list/dm_property_list.h b/examples/original/property_list/dm_property_list.h similarity index 100% rename from showcase/original/property_list/dm_property_list.h rename to examples/original/property_list/dm_property_list.h diff --git a/showcase/original/property_list/property_list.c b/examples/original/property_list/property_list.c similarity index 100% rename from showcase/original/property_list/property_list.c rename to examples/original/property_list/property_list.c diff --git a/showcase/original/scroll_panel/gui_scroll_panel.c b/examples/original/scroll_panel/gui_scroll_panel.c similarity index 100% rename from showcase/original/scroll_panel/gui_scroll_panel.c rename to examples/original/scroll_panel/gui_scroll_panel.c diff --git a/showcase/original/shaders/resources/fudesumi.png b/examples/original/shaders/resources/fudesumi.png similarity index 100% rename from showcase/original/shaders/resources/fudesumi.png rename to examples/original/shaders/resources/fudesumi.png diff --git a/showcase/original/shaders/resources/mask.png b/examples/original/shaders/resources/mask.png similarity index 100% rename from showcase/original/shaders/resources/mask.png rename to examples/original/shaders/resources/mask.png diff --git a/showcase/original/shaders/resources/models/barracks.obj b/examples/original/shaders/resources/models/barracks.obj similarity index 100% rename from showcase/original/shaders/resources/models/barracks.obj rename to examples/original/shaders/resources/models/barracks.obj diff --git a/showcase/original/shaders/resources/models/barracks_diffuse.png b/examples/original/shaders/resources/models/barracks_diffuse.png similarity index 100% rename from showcase/original/shaders/resources/models/barracks_diffuse.png rename to examples/original/shaders/resources/models/barracks_diffuse.png diff --git a/showcase/original/shaders/resources/models/church.obj b/examples/original/shaders/resources/models/church.obj similarity index 100% rename from showcase/original/shaders/resources/models/church.obj rename to examples/original/shaders/resources/models/church.obj diff --git a/showcase/original/shaders/resources/models/church_diffuse.png b/examples/original/shaders/resources/models/church_diffuse.png similarity index 100% rename from showcase/original/shaders/resources/models/church_diffuse.png rename to examples/original/shaders/resources/models/church_diffuse.png diff --git a/samples/static/model_shader/watermill.obj b/examples/original/shaders/resources/models/watermill.obj similarity index 100% rename from samples/static/model_shader/watermill.obj rename to examples/original/shaders/resources/models/watermill.obj diff --git a/samples/static/model_shader/watermill_diffuse.png b/examples/original/shaders/resources/models/watermill_diffuse.png similarity index 100% rename from samples/static/model_shader/watermill_diffuse.png rename to examples/original/shaders/resources/models/watermill_diffuse.png diff --git a/showcase/original/shaders/resources/plasma.png b/examples/original/shaders/resources/plasma.png similarity index 100% rename from showcase/original/shaders/resources/plasma.png rename to examples/original/shaders/resources/plasma.png diff --git a/showcase/original/shaders/resources/raysan.png b/examples/original/shaders/resources/raysan.png similarity index 100% rename from showcase/original/shaders/resources/raysan.png rename to examples/original/shaders/resources/raysan.png diff --git a/showcase/original/shaders/resources/shaders/glsl100/base.fs b/examples/original/shaders/resources/shaders/glsl100/base.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/base.fs rename to examples/original/shaders/resources/shaders/glsl100/base.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/base.vs b/examples/original/shaders/resources/shaders/glsl100/base.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/base.vs rename to examples/original/shaders/resources/shaders/glsl100/base.vs diff --git a/showcase/original/shaders/resources/shaders/glsl100/base_lighting.vs b/examples/original/shaders/resources/shaders/glsl100/base_lighting.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/base_lighting.vs rename to examples/original/shaders/resources/shaders/glsl100/base_lighting.vs diff --git a/showcase/original/shaders/resources/shaders/glsl100/bloom.fs b/examples/original/shaders/resources/shaders/glsl100/bloom.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/bloom.fs rename to examples/original/shaders/resources/shaders/glsl100/bloom.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/blur.fs b/examples/original/shaders/resources/shaders/glsl100/blur.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/blur.fs rename to examples/original/shaders/resources/shaders/glsl100/blur.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/cross_hatching.fs b/examples/original/shaders/resources/shaders/glsl100/cross_hatching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/cross_hatching.fs rename to examples/original/shaders/resources/shaders/glsl100/cross_hatching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/cross_stitching.fs b/examples/original/shaders/resources/shaders/glsl100/cross_stitching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/cross_stitching.fs rename to examples/original/shaders/resources/shaders/glsl100/cross_stitching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/cubes_panning.fs b/examples/original/shaders/resources/shaders/glsl100/cubes_panning.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/cubes_panning.fs rename to examples/original/shaders/resources/shaders/glsl100/cubes_panning.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/depth.fs b/examples/original/shaders/resources/shaders/glsl100/depth.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/depth.fs rename to examples/original/shaders/resources/shaders/glsl100/depth.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/distortion.fs b/examples/original/shaders/resources/shaders/glsl100/distortion.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/distortion.fs rename to examples/original/shaders/resources/shaders/glsl100/distortion.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/dream_vision.fs b/examples/original/shaders/resources/shaders/glsl100/dream_vision.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/dream_vision.fs rename to examples/original/shaders/resources/shaders/glsl100/dream_vision.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/eratosthenes.fs b/examples/original/shaders/resources/shaders/glsl100/eratosthenes.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/eratosthenes.fs rename to examples/original/shaders/resources/shaders/glsl100/eratosthenes.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/fisheye.fs b/examples/original/shaders/resources/shaders/glsl100/fisheye.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/fisheye.fs rename to examples/original/shaders/resources/shaders/glsl100/fisheye.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/fog.fs b/examples/original/shaders/resources/shaders/glsl100/fog.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/fog.fs rename to examples/original/shaders/resources/shaders/glsl100/fog.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/grayscale.fs b/examples/original/shaders/resources/shaders/glsl100/grayscale.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/grayscale.fs rename to examples/original/shaders/resources/shaders/glsl100/grayscale.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/julia_set.fs b/examples/original/shaders/resources/shaders/glsl100/julia_set.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/julia_set.fs rename to examples/original/shaders/resources/shaders/glsl100/julia_set.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/lighting.fs b/examples/original/shaders/resources/shaders/glsl100/lighting.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/lighting.fs rename to examples/original/shaders/resources/shaders/glsl100/lighting.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/mask.fs b/examples/original/shaders/resources/shaders/glsl100/mask.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/mask.fs rename to examples/original/shaders/resources/shaders/glsl100/mask.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/palette_switch.fs b/examples/original/shaders/resources/shaders/glsl100/palette_switch.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/palette_switch.fs rename to examples/original/shaders/resources/shaders/glsl100/palette_switch.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/pixelizer.fs b/examples/original/shaders/resources/shaders/glsl100/pixelizer.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/pixelizer.fs rename to examples/original/shaders/resources/shaders/glsl100/pixelizer.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/posterization.fs b/examples/original/shaders/resources/shaders/glsl100/posterization.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/posterization.fs rename to examples/original/shaders/resources/shaders/glsl100/posterization.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/predator.fs b/examples/original/shaders/resources/shaders/glsl100/predator.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/predator.fs rename to examples/original/shaders/resources/shaders/glsl100/predator.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/raymarching.fs b/examples/original/shaders/resources/shaders/glsl100/raymarching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/raymarching.fs rename to examples/original/shaders/resources/shaders/glsl100/raymarching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/scanlines.fs b/examples/original/shaders/resources/shaders/glsl100/scanlines.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/scanlines.fs rename to examples/original/shaders/resources/shaders/glsl100/scanlines.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/sobel.fs b/examples/original/shaders/resources/shaders/glsl100/sobel.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/sobel.fs rename to examples/original/shaders/resources/shaders/glsl100/sobel.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/spotlight.fs b/examples/original/shaders/resources/shaders/glsl100/spotlight.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/spotlight.fs rename to examples/original/shaders/resources/shaders/glsl100/spotlight.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/swirl.fs b/examples/original/shaders/resources/shaders/glsl100/swirl.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/swirl.fs rename to examples/original/shaders/resources/shaders/glsl100/swirl.fs diff --git a/showcase/original/shaders/resources/shaders/glsl100/wave.fs b/examples/original/shaders/resources/shaders/glsl100/wave.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl100/wave.fs rename to examples/original/shaders/resources/shaders/glsl100/wave.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/base.fs b/examples/original/shaders/resources/shaders/glsl120/base.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/base.fs rename to examples/original/shaders/resources/shaders/glsl120/base.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/base.vs b/examples/original/shaders/resources/shaders/glsl120/base.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/base.vs rename to examples/original/shaders/resources/shaders/glsl120/base.vs diff --git a/showcase/original/shaders/resources/shaders/glsl120/base_lighting.vs b/examples/original/shaders/resources/shaders/glsl120/base_lighting.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/base_lighting.vs rename to examples/original/shaders/resources/shaders/glsl120/base_lighting.vs diff --git a/showcase/original/shaders/resources/shaders/glsl120/bloom.fs b/examples/original/shaders/resources/shaders/glsl120/bloom.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/bloom.fs rename to examples/original/shaders/resources/shaders/glsl120/bloom.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/blur.fs b/examples/original/shaders/resources/shaders/glsl120/blur.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/blur.fs rename to examples/original/shaders/resources/shaders/glsl120/blur.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/cross_hatching.fs b/examples/original/shaders/resources/shaders/glsl120/cross_hatching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/cross_hatching.fs rename to examples/original/shaders/resources/shaders/glsl120/cross_hatching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/cross_stitching.fs b/examples/original/shaders/resources/shaders/glsl120/cross_stitching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/cross_stitching.fs rename to examples/original/shaders/resources/shaders/glsl120/cross_stitching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/distortion.fs b/examples/original/shaders/resources/shaders/glsl120/distortion.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/distortion.fs rename to examples/original/shaders/resources/shaders/glsl120/distortion.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/dream_vision.fs b/examples/original/shaders/resources/shaders/glsl120/dream_vision.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/dream_vision.fs rename to examples/original/shaders/resources/shaders/glsl120/dream_vision.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/fisheye.fs b/examples/original/shaders/resources/shaders/glsl120/fisheye.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/fisheye.fs rename to examples/original/shaders/resources/shaders/glsl120/fisheye.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/fog.fs b/examples/original/shaders/resources/shaders/glsl120/fog.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/fog.fs rename to examples/original/shaders/resources/shaders/glsl120/fog.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/grayscale.fs b/examples/original/shaders/resources/shaders/glsl120/grayscale.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/grayscale.fs rename to examples/original/shaders/resources/shaders/glsl120/grayscale.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/palette_switch.fs b/examples/original/shaders/resources/shaders/glsl120/palette_switch.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/palette_switch.fs rename to examples/original/shaders/resources/shaders/glsl120/palette_switch.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/pixelizer.fs b/examples/original/shaders/resources/shaders/glsl120/pixelizer.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/pixelizer.fs rename to examples/original/shaders/resources/shaders/glsl120/pixelizer.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/posterization.fs b/examples/original/shaders/resources/shaders/glsl120/posterization.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/posterization.fs rename to examples/original/shaders/resources/shaders/glsl120/posterization.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/predator.fs b/examples/original/shaders/resources/shaders/glsl120/predator.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/predator.fs rename to examples/original/shaders/resources/shaders/glsl120/predator.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/scanlines.fs b/examples/original/shaders/resources/shaders/glsl120/scanlines.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/scanlines.fs rename to examples/original/shaders/resources/shaders/glsl120/scanlines.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/sobel.fs b/examples/original/shaders/resources/shaders/glsl120/sobel.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/sobel.fs rename to examples/original/shaders/resources/shaders/glsl120/sobel.fs diff --git a/showcase/original/shaders/resources/shaders/glsl120/swirl.fs b/examples/original/shaders/resources/shaders/glsl120/swirl.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl120/swirl.fs rename to examples/original/shaders/resources/shaders/glsl120/swirl.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/base.fs b/examples/original/shaders/resources/shaders/glsl330/base.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/base.fs rename to examples/original/shaders/resources/shaders/glsl330/base.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/base.vs b/examples/original/shaders/resources/shaders/glsl330/base.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/base.vs rename to examples/original/shaders/resources/shaders/glsl330/base.vs diff --git a/showcase/original/shaders/resources/shaders/glsl330/base_lighting.vs b/examples/original/shaders/resources/shaders/glsl330/base_lighting.vs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/base_lighting.vs rename to examples/original/shaders/resources/shaders/glsl330/base_lighting.vs diff --git a/showcase/original/shaders/resources/shaders/glsl330/bloom.fs b/examples/original/shaders/resources/shaders/glsl330/bloom.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/bloom.fs rename to examples/original/shaders/resources/shaders/glsl330/bloom.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/blur.fs b/examples/original/shaders/resources/shaders/glsl330/blur.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/blur.fs rename to examples/original/shaders/resources/shaders/glsl330/blur.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/cross_hatching.fs b/examples/original/shaders/resources/shaders/glsl330/cross_hatching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/cross_hatching.fs rename to examples/original/shaders/resources/shaders/glsl330/cross_hatching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/cross_stitching.fs b/examples/original/shaders/resources/shaders/glsl330/cross_stitching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/cross_stitching.fs rename to examples/original/shaders/resources/shaders/glsl330/cross_stitching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/cubes_panning.fs b/examples/original/shaders/resources/shaders/glsl330/cubes_panning.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/cubes_panning.fs rename to examples/original/shaders/resources/shaders/glsl330/cubes_panning.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/depth.fs b/examples/original/shaders/resources/shaders/glsl330/depth.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/depth.fs rename to examples/original/shaders/resources/shaders/glsl330/depth.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/distortion.fs b/examples/original/shaders/resources/shaders/glsl330/distortion.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/distortion.fs rename to examples/original/shaders/resources/shaders/glsl330/distortion.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/dream_vision.fs b/examples/original/shaders/resources/shaders/glsl330/dream_vision.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/dream_vision.fs rename to examples/original/shaders/resources/shaders/glsl330/dream_vision.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/eratosthenes.fs b/examples/original/shaders/resources/shaders/glsl330/eratosthenes.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/eratosthenes.fs rename to examples/original/shaders/resources/shaders/glsl330/eratosthenes.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/fisheye.fs b/examples/original/shaders/resources/shaders/glsl330/fisheye.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/fisheye.fs rename to examples/original/shaders/resources/shaders/glsl330/fisheye.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/fog.fs b/examples/original/shaders/resources/shaders/glsl330/fog.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/fog.fs rename to examples/original/shaders/resources/shaders/glsl330/fog.fs diff --git a/samples/static/model_shader/grayscale.fs b/examples/original/shaders/resources/shaders/glsl330/grayscale.fs similarity index 100% rename from samples/static/model_shader/grayscale.fs rename to examples/original/shaders/resources/shaders/glsl330/grayscale.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/julia_set.fs b/examples/original/shaders/resources/shaders/glsl330/julia_set.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/julia_set.fs rename to examples/original/shaders/resources/shaders/glsl330/julia_set.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/lighting.fs b/examples/original/shaders/resources/shaders/glsl330/lighting.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/lighting.fs rename to examples/original/shaders/resources/shaders/glsl330/lighting.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/mask.fs b/examples/original/shaders/resources/shaders/glsl330/mask.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/mask.fs rename to examples/original/shaders/resources/shaders/glsl330/mask.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/overdraw.fs b/examples/original/shaders/resources/shaders/glsl330/overdraw.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/overdraw.fs rename to examples/original/shaders/resources/shaders/glsl330/overdraw.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/palette_switch.fs b/examples/original/shaders/resources/shaders/glsl330/palette_switch.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/palette_switch.fs rename to examples/original/shaders/resources/shaders/glsl330/palette_switch.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/pixelizer.fs b/examples/original/shaders/resources/shaders/glsl330/pixelizer.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/pixelizer.fs rename to examples/original/shaders/resources/shaders/glsl330/pixelizer.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/posterization.fs b/examples/original/shaders/resources/shaders/glsl330/posterization.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/posterization.fs rename to examples/original/shaders/resources/shaders/glsl330/posterization.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/predator.fs b/examples/original/shaders/resources/shaders/glsl330/predator.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/predator.fs rename to examples/original/shaders/resources/shaders/glsl330/predator.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/raymarching.fs b/examples/original/shaders/resources/shaders/glsl330/raymarching.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/raymarching.fs rename to examples/original/shaders/resources/shaders/glsl330/raymarching.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/scanlines.fs b/examples/original/shaders/resources/shaders/glsl330/scanlines.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/scanlines.fs rename to examples/original/shaders/resources/shaders/glsl330/scanlines.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/sobel.fs b/examples/original/shaders/resources/shaders/glsl330/sobel.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/sobel.fs rename to examples/original/shaders/resources/shaders/glsl330/sobel.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/spotlight.fs b/examples/original/shaders/resources/shaders/glsl330/spotlight.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/spotlight.fs rename to examples/original/shaders/resources/shaders/glsl330/spotlight.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/swirl.fs b/examples/original/shaders/resources/shaders/glsl330/swirl.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/swirl.fs rename to examples/original/shaders/resources/shaders/glsl330/swirl.fs diff --git a/showcase/original/shaders/resources/shaders/glsl330/wave.fs b/examples/original/shaders/resources/shaders/glsl330/wave.fs similarity index 100% rename from showcase/original/shaders/resources/shaders/glsl330/wave.fs rename to examples/original/shaders/resources/shaders/glsl330/wave.fs diff --git a/showcase/original/shaders/resources/space.png b/examples/original/shaders/resources/space.png similarity index 100% rename from showcase/original/shaders/resources/space.png rename to examples/original/shaders/resources/space.png diff --git a/showcase/original/shaders/resources/texel_checker.png b/examples/original/shaders/resources/texel_checker.png similarity index 100% rename from showcase/original/shaders/resources/texel_checker.png rename to examples/original/shaders/resources/texel_checker.png diff --git a/showcase/original/shaders/rlights.h b/examples/original/shaders/rlights.h similarity index 100% rename from showcase/original/shaders/rlights.h rename to examples/original/shaders/rlights.h diff --git a/showcase/original/shaders/shaders_basic_lighting.c b/examples/original/shaders/shaders_basic_lighting.c similarity index 100% rename from showcase/original/shaders/shaders_basic_lighting.c rename to examples/original/shaders/shaders_basic_lighting.c diff --git a/showcase/original/shaders/shaders_basic_lighting.png b/examples/original/shaders/shaders_basic_lighting.png similarity index 100% rename from showcase/original/shaders/shaders_basic_lighting.png rename to examples/original/shaders/shaders_basic_lighting.png diff --git a/showcase/original/shaders/shaders_custom_uniform.c b/examples/original/shaders/shaders_custom_uniform.c similarity index 100% rename from showcase/original/shaders/shaders_custom_uniform.c rename to examples/original/shaders/shaders_custom_uniform.c diff --git a/showcase/original/shaders/shaders_custom_uniform.png b/examples/original/shaders/shaders_custom_uniform.png similarity index 100% rename from showcase/original/shaders/shaders_custom_uniform.png rename to examples/original/shaders/shaders_custom_uniform.png diff --git a/showcase/original/shaders/shaders_eratosthenes.c b/examples/original/shaders/shaders_eratosthenes.c similarity index 100% rename from showcase/original/shaders/shaders_eratosthenes.c rename to examples/original/shaders/shaders_eratosthenes.c diff --git a/showcase/original/shaders/shaders_eratosthenes.png b/examples/original/shaders/shaders_eratosthenes.png similarity index 100% rename from showcase/original/shaders/shaders_eratosthenes.png rename to examples/original/shaders/shaders_eratosthenes.png diff --git a/showcase/original/shaders/shaders_fog.c b/examples/original/shaders/shaders_fog.c similarity index 100% rename from showcase/original/shaders/shaders_fog.c rename to examples/original/shaders/shaders_fog.c diff --git a/showcase/original/shaders/shaders_fog.png b/examples/original/shaders/shaders_fog.png similarity index 100% rename from showcase/original/shaders/shaders_fog.png rename to examples/original/shaders/shaders_fog.png diff --git a/showcase/original/shaders/shaders_julia_set.c b/examples/original/shaders/shaders_julia_set.c similarity index 100% rename from showcase/original/shaders/shaders_julia_set.c rename to examples/original/shaders/shaders_julia_set.c diff --git a/showcase/original/shaders/shaders_julia_set.png b/examples/original/shaders/shaders_julia_set.png similarity index 100% rename from showcase/original/shaders/shaders_julia_set.png rename to examples/original/shaders/shaders_julia_set.png diff --git a/showcase/original/shaders/shaders_model_shader.c b/examples/original/shaders/shaders_model_shader.c similarity index 100% rename from showcase/original/shaders/shaders_model_shader.c rename to examples/original/shaders/shaders_model_shader.c diff --git a/showcase/original/shaders/shaders_model_shader.png b/examples/original/shaders/shaders_model_shader.png similarity index 100% rename from showcase/original/shaders/shaders_model_shader.png rename to examples/original/shaders/shaders_model_shader.png diff --git a/showcase/original/shaders/shaders_palette_switch.c b/examples/original/shaders/shaders_palette_switch.c similarity index 100% rename from showcase/original/shaders/shaders_palette_switch.c rename to examples/original/shaders/shaders_palette_switch.c diff --git a/showcase/original/shaders/shaders_palette_switch.png b/examples/original/shaders/shaders_palette_switch.png similarity index 100% rename from showcase/original/shaders/shaders_palette_switch.png rename to examples/original/shaders/shaders_palette_switch.png diff --git a/showcase/original/shaders/shaders_postprocessing.c b/examples/original/shaders/shaders_postprocessing.c similarity index 100% rename from showcase/original/shaders/shaders_postprocessing.c rename to examples/original/shaders/shaders_postprocessing.c diff --git a/showcase/original/shaders/shaders_postprocessing.png b/examples/original/shaders/shaders_postprocessing.png similarity index 100% rename from showcase/original/shaders/shaders_postprocessing.png rename to examples/original/shaders/shaders_postprocessing.png diff --git a/showcase/original/shaders/shaders_raymarching.c b/examples/original/shaders/shaders_raymarching.c similarity index 100% rename from showcase/original/shaders/shaders_raymarching.c rename to examples/original/shaders/shaders_raymarching.c diff --git a/showcase/original/shaders/shaders_raymarching.png b/examples/original/shaders/shaders_raymarching.png similarity index 100% rename from showcase/original/shaders/shaders_raymarching.png rename to examples/original/shaders/shaders_raymarching.png diff --git a/showcase/original/shaders/shaders_shapes_textures.c b/examples/original/shaders/shaders_shapes_textures.c similarity index 100% rename from showcase/original/shaders/shaders_shapes_textures.c rename to examples/original/shaders/shaders_shapes_textures.c diff --git a/showcase/original/shaders/shaders_shapes_textures.png b/examples/original/shaders/shaders_shapes_textures.png similarity index 100% rename from showcase/original/shaders/shaders_shapes_textures.png rename to examples/original/shaders/shaders_shapes_textures.png diff --git a/showcase/original/shaders/shaders_simple_mask.c b/examples/original/shaders/shaders_simple_mask.c similarity index 100% rename from showcase/original/shaders/shaders_simple_mask.c rename to examples/original/shaders/shaders_simple_mask.c diff --git a/showcase/original/shaders/shaders_simple_mask.png b/examples/original/shaders/shaders_simple_mask.png similarity index 100% rename from showcase/original/shaders/shaders_simple_mask.png rename to examples/original/shaders/shaders_simple_mask.png diff --git a/showcase/original/shaders/shaders_spotlight.c b/examples/original/shaders/shaders_spotlight.c similarity index 100% rename from showcase/original/shaders/shaders_spotlight.c rename to examples/original/shaders/shaders_spotlight.c diff --git a/showcase/original/shaders/shaders_spotlight.png b/examples/original/shaders/shaders_spotlight.png similarity index 100% rename from showcase/original/shaders/shaders_spotlight.png rename to examples/original/shaders/shaders_spotlight.png diff --git a/showcase/original/shaders/shaders_texture_drawing.c b/examples/original/shaders/shaders_texture_drawing.c similarity index 100% rename from showcase/original/shaders/shaders_texture_drawing.c rename to examples/original/shaders/shaders_texture_drawing.c diff --git a/showcase/original/shaders/shaders_texture_drawing.png b/examples/original/shaders/shaders_texture_drawing.png similarity index 100% rename from showcase/original/shaders/shaders_texture_drawing.png rename to examples/original/shaders/shaders_texture_drawing.png diff --git a/showcase/original/shaders/shaders_texture_waves.c b/examples/original/shaders/shaders_texture_waves.c similarity index 100% rename from showcase/original/shaders/shaders_texture_waves.c rename to examples/original/shaders/shaders_texture_waves.c diff --git a/showcase/original/shaders/shaders_texture_waves.png b/examples/original/shaders/shaders_texture_waves.png similarity index 100% rename from showcase/original/shaders/shaders_texture_waves.png rename to examples/original/shaders/shaders_texture_waves.png diff --git a/showcase/original/shapes/easings.h b/examples/original/shapes/easings.h similarity index 100% rename from showcase/original/shapes/easings.h rename to examples/original/shapes/easings.h diff --git a/showcase/original/shapes/raygui.h b/examples/original/shapes/raygui.h similarity index 100% rename from showcase/original/shapes/raygui.h rename to examples/original/shapes/raygui.h diff --git a/showcase/original/shapes/shapes_basic_shapes.c b/examples/original/shapes/shapes_basic_shapes.c similarity index 100% rename from showcase/original/shapes/shapes_basic_shapes.c rename to examples/original/shapes/shapes_basic_shapes.c diff --git a/showcase/original/shapes/shapes_basic_shapes.png b/examples/original/shapes/shapes_basic_shapes.png similarity index 100% rename from showcase/original/shapes/shapes_basic_shapes.png rename to examples/original/shapes/shapes_basic_shapes.png diff --git a/showcase/original/shapes/shapes_bouncing_ball.c b/examples/original/shapes/shapes_bouncing_ball.c similarity index 100% rename from showcase/original/shapes/shapes_bouncing_ball.c rename to examples/original/shapes/shapes_bouncing_ball.c diff --git a/showcase/original/shapes/shapes_bouncing_ball.png b/examples/original/shapes/shapes_bouncing_ball.png similarity index 100% rename from showcase/original/shapes/shapes_bouncing_ball.png rename to examples/original/shapes/shapes_bouncing_ball.png diff --git a/showcase/original/shapes/shapes_collision_area.c b/examples/original/shapes/shapes_collision_area.c similarity index 100% rename from showcase/original/shapes/shapes_collision_area.c rename to examples/original/shapes/shapes_collision_area.c diff --git a/showcase/original/shapes/shapes_collision_area.png b/examples/original/shapes/shapes_collision_area.png similarity index 100% rename from showcase/original/shapes/shapes_collision_area.png rename to examples/original/shapes/shapes_collision_area.png diff --git a/showcase/original/shapes/shapes_colors_palette.c b/examples/original/shapes/shapes_colors_palette.c similarity index 100% rename from showcase/original/shapes/shapes_colors_palette.c rename to examples/original/shapes/shapes_colors_palette.c diff --git a/showcase/original/shapes/shapes_colors_palette.png b/examples/original/shapes/shapes_colors_palette.png similarity index 100% rename from showcase/original/shapes/shapes_colors_palette.png rename to examples/original/shapes/shapes_colors_palette.png diff --git a/showcase/original/shapes/shapes_draw_circle_sector.c b/examples/original/shapes/shapes_draw_circle_sector.c similarity index 100% rename from showcase/original/shapes/shapes_draw_circle_sector.c rename to examples/original/shapes/shapes_draw_circle_sector.c diff --git a/showcase/original/shapes/shapes_draw_circle_sector.png b/examples/original/shapes/shapes_draw_circle_sector.png similarity index 100% rename from showcase/original/shapes/shapes_draw_circle_sector.png rename to examples/original/shapes/shapes_draw_circle_sector.png diff --git a/showcase/original/shapes/shapes_draw_rectangle_rounded.c b/examples/original/shapes/shapes_draw_rectangle_rounded.c similarity index 100% rename from showcase/original/shapes/shapes_draw_rectangle_rounded.c rename to examples/original/shapes/shapes_draw_rectangle_rounded.c diff --git a/showcase/original/shapes/shapes_draw_rectangle_rounded.png b/examples/original/shapes/shapes_draw_rectangle_rounded.png similarity index 100% rename from showcase/original/shapes/shapes_draw_rectangle_rounded.png rename to examples/original/shapes/shapes_draw_rectangle_rounded.png diff --git a/showcase/original/shapes/shapes_draw_ring.c b/examples/original/shapes/shapes_draw_ring.c similarity index 100% rename from showcase/original/shapes/shapes_draw_ring.c rename to examples/original/shapes/shapes_draw_ring.c diff --git a/showcase/original/shapes/shapes_draw_ring.png b/examples/original/shapes/shapes_draw_ring.png similarity index 100% rename from showcase/original/shapes/shapes_draw_ring.png rename to examples/original/shapes/shapes_draw_ring.png diff --git a/showcase/original/shapes/shapes_easings_ball_anim.c b/examples/original/shapes/shapes_easings_ball_anim.c similarity index 100% rename from showcase/original/shapes/shapes_easings_ball_anim.c rename to examples/original/shapes/shapes_easings_ball_anim.c diff --git a/showcase/original/shapes/shapes_easings_ball_anim.png b/examples/original/shapes/shapes_easings_ball_anim.png similarity index 100% rename from showcase/original/shapes/shapes_easings_ball_anim.png rename to examples/original/shapes/shapes_easings_ball_anim.png diff --git a/showcase/original/shapes/shapes_easings_box_anim.c b/examples/original/shapes/shapes_easings_box_anim.c similarity index 100% rename from showcase/original/shapes/shapes_easings_box_anim.c rename to examples/original/shapes/shapes_easings_box_anim.c diff --git a/showcase/original/shapes/shapes_easings_box_anim.png b/examples/original/shapes/shapes_easings_box_anim.png similarity index 100% rename from showcase/original/shapes/shapes_easings_box_anim.png rename to examples/original/shapes/shapes_easings_box_anim.png diff --git a/showcase/original/shapes/shapes_easings_rectangle_array.c b/examples/original/shapes/shapes_easings_rectangle_array.c similarity index 100% rename from showcase/original/shapes/shapes_easings_rectangle_array.c rename to examples/original/shapes/shapes_easings_rectangle_array.c diff --git a/showcase/original/shapes/shapes_easings_rectangle_array.png b/examples/original/shapes/shapes_easings_rectangle_array.png similarity index 100% rename from showcase/original/shapes/shapes_easings_rectangle_array.png rename to examples/original/shapes/shapes_easings_rectangle_array.png diff --git a/showcase/original/shapes/shapes_following_eyes.c b/examples/original/shapes/shapes_following_eyes.c similarity index 100% rename from showcase/original/shapes/shapes_following_eyes.c rename to examples/original/shapes/shapes_following_eyes.c diff --git a/showcase/original/shapes/shapes_following_eyes.png b/examples/original/shapes/shapes_following_eyes.png similarity index 100% rename from showcase/original/shapes/shapes_following_eyes.png rename to examples/original/shapes/shapes_following_eyes.png diff --git a/showcase/original/shapes/shapes_lines_bezier.c b/examples/original/shapes/shapes_lines_bezier.c similarity index 100% rename from showcase/original/shapes/shapes_lines_bezier.c rename to examples/original/shapes/shapes_lines_bezier.c diff --git a/showcase/original/shapes/shapes_lines_bezier.png b/examples/original/shapes/shapes_lines_bezier.png similarity index 100% rename from showcase/original/shapes/shapes_lines_bezier.png rename to examples/original/shapes/shapes_lines_bezier.png diff --git a/showcase/original/shapes/shapes_logo_raylib.c b/examples/original/shapes/shapes_logo_raylib.c similarity index 100% rename from showcase/original/shapes/shapes_logo_raylib.c rename to examples/original/shapes/shapes_logo_raylib.c diff --git a/showcase/original/shapes/shapes_logo_raylib.png b/examples/original/shapes/shapes_logo_raylib.png similarity index 100% rename from showcase/original/shapes/shapes_logo_raylib.png rename to examples/original/shapes/shapes_logo_raylib.png diff --git a/showcase/original/shapes/shapes_logo_raylib_anim.c b/examples/original/shapes/shapes_logo_raylib_anim.c similarity index 100% rename from showcase/original/shapes/shapes_logo_raylib_anim.c rename to examples/original/shapes/shapes_logo_raylib_anim.c diff --git a/showcase/original/shapes/shapes_logo_raylib_anim.png b/examples/original/shapes/shapes_logo_raylib_anim.png similarity index 100% rename from showcase/original/shapes/shapes_logo_raylib_anim.png rename to examples/original/shapes/shapes_logo_raylib_anim.png diff --git a/showcase/original/shapes/shapes_rectangle_scaling.c b/examples/original/shapes/shapes_rectangle_scaling.c similarity index 100% rename from showcase/original/shapes/shapes_rectangle_scaling.c rename to examples/original/shapes/shapes_rectangle_scaling.c diff --git a/showcase/original/shapes/shapes_rectangle_scaling.png b/examples/original/shapes/shapes_rectangle_scaling.png similarity index 100% rename from showcase/original/shapes/shapes_rectangle_scaling.png rename to examples/original/shapes/shapes_rectangle_scaling.png diff --git a/showcase/original/standalone/custom_backend.h b/examples/original/standalone/custom_backend.h similarity index 100% rename from showcase/original/standalone/custom_backend.h rename to examples/original/standalone/custom_backend.h diff --git a/showcase/original/standalone/raygui_standalone.c b/examples/original/standalone/raygui_standalone.c similarity index 100% rename from showcase/original/standalone/raygui_standalone.c rename to examples/original/standalone/raygui_standalone.c diff --git a/showcase/original/text/resources/AnonymousPro-Bold.ttf b/examples/original/text/resources/AnonymousPro-Bold.ttf similarity index 100% rename from showcase/original/text/resources/AnonymousPro-Bold.ttf rename to examples/original/text/resources/AnonymousPro-Bold.ttf diff --git a/showcase/original/text/resources/KAISG.ttf b/examples/original/text/resources/KAISG.ttf similarity index 100% rename from showcase/original/text/resources/KAISG.ttf rename to examples/original/text/resources/KAISG.ttf diff --git a/showcase/original/text/resources/LICENSE b/examples/original/text/resources/LICENSE similarity index 100% rename from showcase/original/text/resources/LICENSE rename to examples/original/text/resources/LICENSE diff --git a/showcase/original/text/resources/bmfont.fnt b/examples/original/text/resources/bmfont.fnt similarity index 100% rename from showcase/original/text/resources/bmfont.fnt rename to examples/original/text/resources/bmfont.fnt diff --git a/showcase/original/text/resources/bmfont.png b/examples/original/text/resources/bmfont.png similarity index 100% rename from showcase/original/text/resources/bmfont.png rename to examples/original/text/resources/bmfont.png diff --git a/showcase/original/text/resources/custom_alagard.png b/examples/original/text/resources/custom_alagard.png similarity index 100% rename from showcase/original/text/resources/custom_alagard.png rename to examples/original/text/resources/custom_alagard.png diff --git a/showcase/original/text/resources/custom_jupiter_crash.png b/examples/original/text/resources/custom_jupiter_crash.png similarity index 100% rename from showcase/original/text/resources/custom_jupiter_crash.png rename to examples/original/text/resources/custom_jupiter_crash.png diff --git a/showcase/original/text/resources/custom_mecha.png b/examples/original/text/resources/custom_mecha.png similarity index 100% rename from showcase/original/text/resources/custom_mecha.png rename to examples/original/text/resources/custom_mecha.png diff --git a/showcase/original/text/resources/dejavu.fnt b/examples/original/text/resources/dejavu.fnt similarity index 100% rename from showcase/original/text/resources/dejavu.fnt rename to examples/original/text/resources/dejavu.fnt diff --git a/showcase/original/text/resources/dejavu.png b/examples/original/text/resources/dejavu.png similarity index 100% rename from showcase/original/text/resources/dejavu.png rename to examples/original/text/resources/dejavu.png diff --git a/showcase/original/text/resources/emoji.fnt b/examples/original/text/resources/emoji.fnt similarity index 100% rename from showcase/original/text/resources/emoji.fnt rename to examples/original/text/resources/emoji.fnt diff --git a/showcase/original/text/resources/emoji.png b/examples/original/text/resources/emoji.png similarity index 100% rename from showcase/original/text/resources/emoji.png rename to examples/original/text/resources/emoji.png diff --git a/samples/static/alagard.png b/examples/original/text/resources/fonts/alagard.png similarity index 100% rename from samples/static/alagard.png rename to examples/original/text/resources/fonts/alagard.png diff --git a/showcase/original/text/resources/fonts/alpha_beta.png b/examples/original/text/resources/fonts/alpha_beta.png similarity index 100% rename from showcase/original/text/resources/fonts/alpha_beta.png rename to examples/original/text/resources/fonts/alpha_beta.png diff --git a/showcase/original/text/resources/fonts/jupiter_crash.png b/examples/original/text/resources/fonts/jupiter_crash.png similarity index 100% rename from showcase/original/text/resources/fonts/jupiter_crash.png rename to examples/original/text/resources/fonts/jupiter_crash.png diff --git a/showcase/original/text/resources/fonts/mecha.png b/examples/original/text/resources/fonts/mecha.png similarity index 100% rename from showcase/original/text/resources/fonts/mecha.png rename to examples/original/text/resources/fonts/mecha.png diff --git a/showcase/original/text/resources/fonts/pixantiqua.png b/examples/original/text/resources/fonts/pixantiqua.png similarity index 100% rename from showcase/original/text/resources/fonts/pixantiqua.png rename to examples/original/text/resources/fonts/pixantiqua.png diff --git a/showcase/original/text/resources/fonts/pixelplay.png b/examples/original/text/resources/fonts/pixelplay.png similarity index 100% rename from showcase/original/text/resources/fonts/pixelplay.png rename to examples/original/text/resources/fonts/pixelplay.png diff --git a/showcase/original/text/resources/fonts/romulus.png b/examples/original/text/resources/fonts/romulus.png similarity index 100% rename from showcase/original/text/resources/fonts/romulus.png rename to examples/original/text/resources/fonts/romulus.png diff --git a/showcase/original/text/resources/fonts/setback.png b/examples/original/text/resources/fonts/setback.png similarity index 100% rename from showcase/original/text/resources/fonts/setback.png rename to examples/original/text/resources/fonts/setback.png diff --git a/showcase/original/text/resources/notoCJK.fnt b/examples/original/text/resources/notoCJK.fnt similarity index 100% rename from showcase/original/text/resources/notoCJK.fnt rename to examples/original/text/resources/notoCJK.fnt diff --git a/showcase/original/text/resources/notoCJK.png b/examples/original/text/resources/notoCJK.png similarity index 100% rename from showcase/original/text/resources/notoCJK.png rename to examples/original/text/resources/notoCJK.png diff --git a/showcase/original/text/resources/pixantiqua.fnt b/examples/original/text/resources/pixantiqua.fnt similarity index 100% rename from showcase/original/text/resources/pixantiqua.fnt rename to examples/original/text/resources/pixantiqua.fnt diff --git a/showcase/original/text/resources/pixantiqua.png b/examples/original/text/resources/pixantiqua.png similarity index 100% rename from showcase/original/text/resources/pixantiqua.png rename to examples/original/text/resources/pixantiqua.png diff --git a/showcase/original/text/resources/pixantiqua.ttf b/examples/original/text/resources/pixantiqua.ttf similarity index 100% rename from showcase/original/text/resources/pixantiqua.ttf rename to examples/original/text/resources/pixantiqua.ttf diff --git a/showcase/original/text/resources/shaders/glsl100/sdf.fs b/examples/original/text/resources/shaders/glsl100/sdf.fs similarity index 100% rename from showcase/original/text/resources/shaders/glsl100/sdf.fs rename to examples/original/text/resources/shaders/glsl100/sdf.fs diff --git a/showcase/original/text/resources/shaders/glsl330/sdf.fs b/examples/original/text/resources/shaders/glsl330/sdf.fs similarity index 100% rename from showcase/original/text/resources/shaders/glsl330/sdf.fs rename to examples/original/text/resources/shaders/glsl330/sdf.fs diff --git a/showcase/original/text/text_font_filters.c b/examples/original/text/text_font_filters.c similarity index 100% rename from showcase/original/text/text_font_filters.c rename to examples/original/text/text_font_filters.c diff --git a/showcase/original/text/text_font_filters.png b/examples/original/text/text_font_filters.png similarity index 100% rename from showcase/original/text/text_font_filters.png rename to examples/original/text/text_font_filters.png diff --git a/showcase/original/text/text_font_loading.c b/examples/original/text/text_font_loading.c similarity index 100% rename from showcase/original/text/text_font_loading.c rename to examples/original/text/text_font_loading.c diff --git a/showcase/original/text/text_font_loading.png b/examples/original/text/text_font_loading.png similarity index 100% rename from showcase/original/text/text_font_loading.png rename to examples/original/text/text_font_loading.png diff --git a/showcase/original/text/text_font_sdf.c b/examples/original/text/text_font_sdf.c similarity index 100% rename from showcase/original/text/text_font_sdf.c rename to examples/original/text/text_font_sdf.c diff --git a/showcase/original/text/text_font_sdf.png b/examples/original/text/text_font_sdf.png similarity index 100% rename from showcase/original/text/text_font_sdf.png rename to examples/original/text/text_font_sdf.png diff --git a/showcase/original/text/text_font_spritefont.c b/examples/original/text/text_font_spritefont.c similarity index 100% rename from showcase/original/text/text_font_spritefont.c rename to examples/original/text/text_font_spritefont.c diff --git a/showcase/original/text/text_font_spritefont.png b/examples/original/text/text_font_spritefont.png similarity index 100% rename from showcase/original/text/text_font_spritefont.png rename to examples/original/text/text_font_spritefont.png diff --git a/showcase/original/text/text_format_text.c b/examples/original/text/text_format_text.c similarity index 100% rename from showcase/original/text/text_format_text.c rename to examples/original/text/text_format_text.c diff --git a/showcase/original/text/text_format_text.png b/examples/original/text/text_format_text.png similarity index 100% rename from showcase/original/text/text_format_text.png rename to examples/original/text/text_format_text.png diff --git a/showcase/original/text/text_input_box.c b/examples/original/text/text_input_box.c similarity index 100% rename from showcase/original/text/text_input_box.c rename to examples/original/text/text_input_box.c diff --git a/showcase/original/text/text_input_box.png b/examples/original/text/text_input_box.png similarity index 100% rename from showcase/original/text/text_input_box.png rename to examples/original/text/text_input_box.png diff --git a/showcase/original/text/text_raylib_fonts.c b/examples/original/text/text_raylib_fonts.c similarity index 100% rename from showcase/original/text/text_raylib_fonts.c rename to examples/original/text/text_raylib_fonts.c diff --git a/showcase/original/text/text_raylib_fonts.png b/examples/original/text/text_raylib_fonts.png similarity index 100% rename from showcase/original/text/text_raylib_fonts.png rename to examples/original/text/text_raylib_fonts.png diff --git a/showcase/original/text/text_rectangle_bounds.c b/examples/original/text/text_rectangle_bounds.c similarity index 100% rename from showcase/original/text/text_rectangle_bounds.c rename to examples/original/text/text_rectangle_bounds.c diff --git a/showcase/original/text/text_rectangle_bounds.png b/examples/original/text/text_rectangle_bounds.png similarity index 100% rename from showcase/original/text/text_rectangle_bounds.png rename to examples/original/text/text_rectangle_bounds.png diff --git a/showcase/original/text/text_unicode.c b/examples/original/text/text_unicode.c similarity index 100% rename from showcase/original/text/text_unicode.c rename to examples/original/text/text_unicode.c diff --git a/showcase/original/text/text_unicode.png b/examples/original/text/text_unicode.png similarity index 100% rename from showcase/original/text/text_unicode.png rename to examples/original/text/text_unicode.png diff --git a/showcase/original/text/text_writing_anim.c b/examples/original/text/text_writing_anim.c similarity index 100% rename from showcase/original/text/text_writing_anim.c rename to examples/original/text/text_writing_anim.c diff --git a/showcase/original/text/text_writing_anim.png b/examples/original/text/text_writing_anim.png similarity index 100% rename from showcase/original/text/text_writing_anim.png rename to examples/original/text/text_writing_anim.png diff --git a/showcase/original/text_box_selection/textbox_extended_demo.c b/examples/original/text_box_selection/textbox_extended_demo.c similarity index 100% rename from showcase/original/text_box_selection/textbox_extended_demo.c rename to examples/original/text_box_selection/textbox_extended_demo.c diff --git a/showcase/original/text_editor/text_editor.c b/examples/original/text_editor/text_editor.c similarity index 100% rename from showcase/original/text_editor/text_editor.c rename to examples/original/text_editor/text_editor.c diff --git a/showcase/original/textures/resources/KAISG.ttf b/examples/original/textures/resources/KAISG.ttf similarity index 100% rename from showcase/original/textures/resources/KAISG.ttf rename to examples/original/textures/resources/KAISG.ttf diff --git a/showcase/original/textures/resources/LICENSE b/examples/original/textures/resources/LICENSE similarity index 100% rename from showcase/original/textures/resources/LICENSE rename to examples/original/textures/resources/LICENSE diff --git a/showcase/original/textures/resources/boom.wav b/examples/original/textures/resources/boom.wav similarity index 100% rename from showcase/original/textures/resources/boom.wav rename to examples/original/textures/resources/boom.wav diff --git a/showcase/original/textures/resources/button.png b/examples/original/textures/resources/button.png similarity index 100% rename from showcase/original/textures/resources/button.png rename to examples/original/textures/resources/button.png diff --git a/showcase/original/textures/resources/buttonfx.wav b/examples/original/textures/resources/buttonfx.wav similarity index 100% rename from showcase/original/textures/resources/buttonfx.wav rename to examples/original/textures/resources/buttonfx.wav diff --git a/showcase/original/textures/resources/cat.png b/examples/original/textures/resources/cat.png similarity index 100% rename from showcase/original/textures/resources/cat.png rename to examples/original/textures/resources/cat.png diff --git a/showcase/original/textures/resources/custom_jupiter_crash.png b/examples/original/textures/resources/custom_jupiter_crash.png similarity index 100% rename from showcase/original/textures/resources/custom_jupiter_crash.png rename to examples/original/textures/resources/custom_jupiter_crash.png diff --git a/showcase/original/textures/resources/cyberpunk_street_background.png b/examples/original/textures/resources/cyberpunk_street_background.png similarity index 100% rename from showcase/original/textures/resources/cyberpunk_street_background.png rename to examples/original/textures/resources/cyberpunk_street_background.png diff --git a/showcase/original/textures/resources/cyberpunk_street_foreground.png b/examples/original/textures/resources/cyberpunk_street_foreground.png similarity index 100% rename from showcase/original/textures/resources/cyberpunk_street_foreground.png rename to examples/original/textures/resources/cyberpunk_street_foreground.png diff --git a/showcase/original/textures/resources/cyberpunk_street_midground.png b/examples/original/textures/resources/cyberpunk_street_midground.png similarity index 100% rename from showcase/original/textures/resources/cyberpunk_street_midground.png rename to examples/original/textures/resources/cyberpunk_street_midground.png diff --git a/showcase/original/textures/resources/explosion.png b/examples/original/textures/resources/explosion.png similarity index 100% rename from showcase/original/textures/resources/explosion.png rename to examples/original/textures/resources/explosion.png diff --git a/showcase/original/textures/resources/fudesumi.png b/examples/original/textures/resources/fudesumi.png similarity index 100% rename from showcase/original/textures/resources/fudesumi.png rename to examples/original/textures/resources/fudesumi.png diff --git a/showcase/original/textures/resources/fudesumi.raw b/examples/original/textures/resources/fudesumi.raw similarity index 100% rename from showcase/original/textures/resources/fudesumi.raw rename to examples/original/textures/resources/fudesumi.raw diff --git a/showcase/original/textures/resources/ninepatch_button.png b/examples/original/textures/resources/ninepatch_button.png similarity index 100% rename from showcase/original/textures/resources/ninepatch_button.png rename to examples/original/textures/resources/ninepatch_button.png diff --git a/showcase/original/textures/resources/parrots.png b/examples/original/textures/resources/parrots.png similarity index 100% rename from showcase/original/textures/resources/parrots.png rename to examples/original/textures/resources/parrots.png diff --git a/showcase/original/textures/resources/raylib_logo.png b/examples/original/textures/resources/raylib_logo.png similarity index 100% rename from showcase/original/textures/resources/raylib_logo.png rename to examples/original/textures/resources/raylib_logo.png diff --git a/showcase/original/textures/resources/scarfy.png b/examples/original/textures/resources/scarfy.png similarity index 100% rename from showcase/original/textures/resources/scarfy.png rename to examples/original/textures/resources/scarfy.png diff --git a/showcase/original/textures/resources/smoke.png b/examples/original/textures/resources/smoke.png similarity index 100% rename from showcase/original/textures/resources/smoke.png rename to examples/original/textures/resources/smoke.png diff --git a/showcase/original/textures/resources/wabbit_alpha.png b/examples/original/textures/resources/wabbit_alpha.png similarity index 100% rename from showcase/original/textures/resources/wabbit_alpha.png rename to examples/original/textures/resources/wabbit_alpha.png diff --git a/showcase/original/textures/textures_background_scrolling.c b/examples/original/textures/textures_background_scrolling.c similarity index 100% rename from showcase/original/textures/textures_background_scrolling.c rename to examples/original/textures/textures_background_scrolling.c diff --git a/showcase/original/textures/textures_background_scrolling.png b/examples/original/textures/textures_background_scrolling.png similarity index 100% rename from showcase/original/textures/textures_background_scrolling.png rename to examples/original/textures/textures_background_scrolling.png diff --git a/showcase/original/textures/textures_bunnymark.c b/examples/original/textures/textures_bunnymark.c similarity index 100% rename from showcase/original/textures/textures_bunnymark.c rename to examples/original/textures/textures_bunnymark.c diff --git a/showcase/original/textures/textures_bunnymark.png b/examples/original/textures/textures_bunnymark.png similarity index 100% rename from showcase/original/textures/textures_bunnymark.png rename to examples/original/textures/textures_bunnymark.png diff --git a/showcase/original/textures/textures_image_drawing.c b/examples/original/textures/textures_image_drawing.c similarity index 100% rename from showcase/original/textures/textures_image_drawing.c rename to examples/original/textures/textures_image_drawing.c diff --git a/showcase/original/textures/textures_image_drawing.png b/examples/original/textures/textures_image_drawing.png similarity index 100% rename from showcase/original/textures/textures_image_drawing.png rename to examples/original/textures/textures_image_drawing.png diff --git a/showcase/original/textures/textures_image_generation.c b/examples/original/textures/textures_image_generation.c similarity index 100% rename from showcase/original/textures/textures_image_generation.c rename to examples/original/textures/textures_image_generation.c diff --git a/showcase/original/textures/textures_image_generation.png b/examples/original/textures/textures_image_generation.png similarity index 100% rename from showcase/original/textures/textures_image_generation.png rename to examples/original/textures/textures_image_generation.png diff --git a/showcase/original/textures/textures_image_loading.c b/examples/original/textures/textures_image_loading.c similarity index 100% rename from showcase/original/textures/textures_image_loading.c rename to examples/original/textures/textures_image_loading.c diff --git a/showcase/original/textures/textures_image_loading.png b/examples/original/textures/textures_image_loading.png similarity index 100% rename from showcase/original/textures/textures_image_loading.png rename to examples/original/textures/textures_image_loading.png diff --git a/showcase/original/textures/textures_image_processing.c b/examples/original/textures/textures_image_processing.c similarity index 100% rename from showcase/original/textures/textures_image_processing.c rename to examples/original/textures/textures_image_processing.c diff --git a/showcase/original/textures/textures_image_processing.png b/examples/original/textures/textures_image_processing.png similarity index 100% rename from showcase/original/textures/textures_image_processing.png rename to examples/original/textures/textures_image_processing.png diff --git a/showcase/original/textures/textures_image_text.c b/examples/original/textures/textures_image_text.c similarity index 100% rename from showcase/original/textures/textures_image_text.c rename to examples/original/textures/textures_image_text.c diff --git a/showcase/original/textures/textures_image_text.png b/examples/original/textures/textures_image_text.png similarity index 100% rename from showcase/original/textures/textures_image_text.png rename to examples/original/textures/textures_image_text.png diff --git a/showcase/original/textures/textures_logo_raylib.c b/examples/original/textures/textures_logo_raylib.c similarity index 100% rename from showcase/original/textures/textures_logo_raylib.c rename to examples/original/textures/textures_logo_raylib.c diff --git a/showcase/original/textures/textures_logo_raylib.png b/examples/original/textures/textures_logo_raylib.png similarity index 100% rename from showcase/original/textures/textures_logo_raylib.png rename to examples/original/textures/textures_logo_raylib.png diff --git a/showcase/original/textures/textures_mouse_painting.c b/examples/original/textures/textures_mouse_painting.c similarity index 100% rename from showcase/original/textures/textures_mouse_painting.c rename to examples/original/textures/textures_mouse_painting.c diff --git a/showcase/original/textures/textures_mouse_painting.png b/examples/original/textures/textures_mouse_painting.png similarity index 100% rename from showcase/original/textures/textures_mouse_painting.png rename to examples/original/textures/textures_mouse_painting.png diff --git a/showcase/original/textures/textures_npatch_drawing.c b/examples/original/textures/textures_npatch_drawing.c similarity index 100% rename from showcase/original/textures/textures_npatch_drawing.c rename to examples/original/textures/textures_npatch_drawing.c diff --git a/showcase/original/textures/textures_npatch_drawing.png b/examples/original/textures/textures_npatch_drawing.png similarity index 100% rename from showcase/original/textures/textures_npatch_drawing.png rename to examples/original/textures/textures_npatch_drawing.png diff --git a/showcase/original/textures/textures_particles_blending.c b/examples/original/textures/textures_particles_blending.c similarity index 100% rename from showcase/original/textures/textures_particles_blending.c rename to examples/original/textures/textures_particles_blending.c diff --git a/showcase/original/textures/textures_particles_blending.png b/examples/original/textures/textures_particles_blending.png similarity index 100% rename from showcase/original/textures/textures_particles_blending.png rename to examples/original/textures/textures_particles_blending.png diff --git a/showcase/original/textures/textures_raw_data.c b/examples/original/textures/textures_raw_data.c similarity index 100% rename from showcase/original/textures/textures_raw_data.c rename to examples/original/textures/textures_raw_data.c diff --git a/showcase/original/textures/textures_raw_data.png b/examples/original/textures/textures_raw_data.png similarity index 100% rename from showcase/original/textures/textures_raw_data.png rename to examples/original/textures/textures_raw_data.png diff --git a/showcase/original/textures/textures_rectangle.c b/examples/original/textures/textures_rectangle.c similarity index 100% rename from showcase/original/textures/textures_rectangle.c rename to examples/original/textures/textures_rectangle.c diff --git a/showcase/original/textures/textures_rectangle.png b/examples/original/textures/textures_rectangle.png similarity index 100% rename from showcase/original/textures/textures_rectangle.png rename to examples/original/textures/textures_rectangle.png diff --git a/showcase/original/textures/textures_sprite_button.c b/examples/original/textures/textures_sprite_button.c similarity index 100% rename from showcase/original/textures/textures_sprite_button.c rename to examples/original/textures/textures_sprite_button.c diff --git a/showcase/original/textures/textures_sprite_button.png b/examples/original/textures/textures_sprite_button.png similarity index 100% rename from showcase/original/textures/textures_sprite_button.png rename to examples/original/textures/textures_sprite_button.png diff --git a/showcase/original/textures/textures_sprite_explosion.c b/examples/original/textures/textures_sprite_explosion.c similarity index 100% rename from showcase/original/textures/textures_sprite_explosion.c rename to examples/original/textures/textures_sprite_explosion.c diff --git a/showcase/original/textures/textures_sprite_explosion.png b/examples/original/textures/textures_sprite_explosion.png similarity index 100% rename from showcase/original/textures/textures_sprite_explosion.png rename to examples/original/textures/textures_sprite_explosion.png diff --git a/showcase/original/textures/textures_srcrec_dstrec.c b/examples/original/textures/textures_srcrec_dstrec.c similarity index 100% rename from showcase/original/textures/textures_srcrec_dstrec.c rename to examples/original/textures/textures_srcrec_dstrec.c diff --git a/showcase/original/textures/textures_srcrec_dstrec.png b/examples/original/textures/textures_srcrec_dstrec.png similarity index 100% rename from showcase/original/textures/textures_srcrec_dstrec.png rename to examples/original/textures/textures_srcrec_dstrec.png diff --git a/showcase/original/textures/textures_to_image.c b/examples/original/textures/textures_to_image.c similarity index 100% rename from showcase/original/textures/textures_to_image.c rename to examples/original/textures/textures_to_image.c diff --git a/showcase/original/textures/textures_to_image.png b/examples/original/textures/textures_to_image.png similarity index 100% rename from showcase/original/textures/textures_to_image.png rename to examples/original/textures/textures_to_image.png diff --git a/showcase/src/example/audio/audio_module_playing.rs b/examples/src/example/audio/audio_module_playing.rs similarity index 100% rename from showcase/src/example/audio/audio_module_playing.rs rename to examples/src/example/audio/audio_module_playing.rs diff --git a/showcase/src/example/audio/audio_multichannel_sound.rs b/examples/src/example/audio/audio_multichannel_sound.rs similarity index 100% rename from showcase/src/example/audio/audio_multichannel_sound.rs rename to examples/src/example/audio/audio_multichannel_sound.rs diff --git a/showcase/src/example/audio/audio_music_stream.rs b/examples/src/example/audio/audio_music_stream.rs similarity index 100% rename from showcase/src/example/audio/audio_music_stream.rs rename to examples/src/example/audio/audio_music_stream.rs diff --git a/showcase/src/example/audio/audio_raw_stream.rs b/examples/src/example/audio/audio_raw_stream.rs similarity index 100% rename from showcase/src/example/audio/audio_raw_stream.rs rename to examples/src/example/audio/audio_raw_stream.rs diff --git a/showcase/src/example/audio/audio_sound_loading.png b/examples/src/example/audio/audio_sound_loading.png similarity index 100% rename from showcase/src/example/audio/audio_sound_loading.png rename to examples/src/example/audio/audio_sound_loading.png diff --git a/showcase/src/example/audio/audio_sound_loading.rs b/examples/src/example/audio/audio_sound_loading.rs similarity index 100% rename from showcase/src/example/audio/audio_sound_loading.rs rename to examples/src/example/audio/audio_sound_loading.rs diff --git a/showcase/src/example/audio/mod.rs b/examples/src/example/audio/mod.rs similarity index 100% rename from showcase/src/example/audio/mod.rs rename to examples/src/example/audio/mod.rs diff --git a/showcase/src/example/controls_test_suite/controls_test_suite.rs b/examples/src/example/controls_test_suite/controls_test_suite.rs similarity index 100% rename from showcase/src/example/controls_test_suite/controls_test_suite.rs rename to examples/src/example/controls_test_suite/controls_test_suite.rs diff --git a/showcase/src/example/controls_test_suite/mod.rs b/examples/src/example/controls_test_suite/mod.rs similarity index 100% rename from showcase/src/example/controls_test_suite/mod.rs rename to examples/src/example/controls_test_suite/mod.rs diff --git a/showcase/src/example/core/core_2d_camera.rs b/examples/src/example/core/core_2d_camera.rs similarity index 100% rename from showcase/src/example/core/core_2d_camera.rs rename to examples/src/example/core/core_2d_camera.rs diff --git a/showcase/src/example/core/core_2d_camera_platformer.rs b/examples/src/example/core/core_2d_camera_platformer.rs similarity index 100% rename from showcase/src/example/core/core_2d_camera_platformer.rs rename to examples/src/example/core/core_2d_camera_platformer.rs diff --git a/showcase/src/example/core/core_3d_camera_first_person.rs b/examples/src/example/core/core_3d_camera_first_person.rs similarity index 100% rename from showcase/src/example/core/core_3d_camera_first_person.rs rename to examples/src/example/core/core_3d_camera_first_person.rs diff --git a/showcase/src/example/core/core_3d_camera_free.rs b/examples/src/example/core/core_3d_camera_free.rs similarity index 100% rename from showcase/src/example/core/core_3d_camera_free.rs rename to examples/src/example/core/core_3d_camera_free.rs diff --git a/showcase/src/example/core/core_3d_camera_mode.rs b/examples/src/example/core/core_3d_camera_mode.rs similarity index 100% rename from showcase/src/example/core/core_3d_camera_mode.rs rename to examples/src/example/core/core_3d_camera_mode.rs diff --git a/showcase/src/example/core/core_3d_picking.rs b/examples/src/example/core/core_3d_picking.rs similarity index 100% rename from showcase/src/example/core/core_3d_picking.rs rename to examples/src/example/core/core_3d_picking.rs diff --git a/showcase/src/example/core/core_basic_window.rs b/examples/src/example/core/core_basic_window.rs similarity index 100% rename from showcase/src/example/core/core_basic_window.rs rename to examples/src/example/core/core_basic_window.rs diff --git a/showcase/src/example/core/core_custom_logging.png b/examples/src/example/core/core_custom_logging.png similarity index 100% rename from showcase/src/example/core/core_custom_logging.png rename to examples/src/example/core/core_custom_logging.png diff --git a/showcase/src/example/core/core_custom_logging.rs b/examples/src/example/core/core_custom_logging.rs similarity index 100% rename from showcase/src/example/core/core_custom_logging.rs rename to examples/src/example/core/core_custom_logging.rs diff --git a/showcase/src/example/core/core_drop_files.rs b/examples/src/example/core/core_drop_files.rs similarity index 100% rename from showcase/src/example/core/core_drop_files.rs rename to examples/src/example/core/core_drop_files.rs diff --git a/showcase/src/example/core/core_input_gamepad.rs b/examples/src/example/core/core_input_gamepad.rs similarity index 100% rename from showcase/src/example/core/core_input_gamepad.rs rename to examples/src/example/core/core_input_gamepad.rs diff --git a/showcase/src/example/core/core_input_gestures.rs b/examples/src/example/core/core_input_gestures.rs similarity index 100% rename from showcase/src/example/core/core_input_gestures.rs rename to examples/src/example/core/core_input_gestures.rs diff --git a/showcase/src/example/core/core_input_keys.rs b/examples/src/example/core/core_input_keys.rs similarity index 100% rename from showcase/src/example/core/core_input_keys.rs rename to examples/src/example/core/core_input_keys.rs diff --git a/showcase/src/example/core/core_input_mouse.png b/examples/src/example/core/core_input_mouse.png similarity index 100% rename from showcase/src/example/core/core_input_mouse.png rename to examples/src/example/core/core_input_mouse.png diff --git a/showcase/src/example/core/core_input_mouse.rs b/examples/src/example/core/core_input_mouse.rs similarity index 100% rename from showcase/src/example/core/core_input_mouse.rs rename to examples/src/example/core/core_input_mouse.rs diff --git a/showcase/src/example/core/core_input_mouse_wheel.rs b/examples/src/example/core/core_input_mouse_wheel.rs similarity index 100% rename from showcase/src/example/core/core_input_mouse_wheel.rs rename to examples/src/example/core/core_input_mouse_wheel.rs diff --git a/showcase/src/example/core/core_input_multitouch.rs b/examples/src/example/core/core_input_multitouch.rs similarity index 100% rename from showcase/src/example/core/core_input_multitouch.rs rename to examples/src/example/core/core_input_multitouch.rs diff --git a/showcase/src/example/core/core_random_values.png b/examples/src/example/core/core_random_values.png similarity index 100% rename from showcase/src/example/core/core_random_values.png rename to examples/src/example/core/core_random_values.png diff --git a/showcase/src/example/core/core_random_values.rs b/examples/src/example/core/core_random_values.rs similarity index 100% rename from showcase/src/example/core/core_random_values.rs rename to examples/src/example/core/core_random_values.rs diff --git a/showcase/src/example/core/core_scissor_test.rs b/examples/src/example/core/core_scissor_test.rs similarity index 100% rename from showcase/src/example/core/core_scissor_test.rs rename to examples/src/example/core/core_scissor_test.rs diff --git a/showcase/src/example/core/core_vr_simulator.rs b/examples/src/example/core/core_vr_simulator.rs similarity index 100% rename from showcase/src/example/core/core_vr_simulator.rs rename to examples/src/example/core/core_vr_simulator.rs diff --git a/showcase/src/example/core/core_window_letterbox.rs b/examples/src/example/core/core_window_letterbox.rs similarity index 100% rename from showcase/src/example/core/core_window_letterbox.rs rename to examples/src/example/core/core_window_letterbox.rs diff --git a/showcase/src/example/core/core_world_screen.rs b/examples/src/example/core/core_world_screen.rs similarity index 100% rename from showcase/src/example/core/core_world_screen.rs rename to examples/src/example/core/core_world_screen.rs diff --git a/showcase/src/example/core/mod.rs b/examples/src/example/core/mod.rs similarity index 100% rename from showcase/src/example/core/mod.rs rename to examples/src/example/core/mod.rs diff --git a/showcase/src/example/image_exporter/image_exporter.rs b/examples/src/example/image_exporter/image_exporter.rs similarity index 100% rename from showcase/src/example/image_exporter/image_exporter.rs rename to examples/src/example/image_exporter/image_exporter.rs diff --git a/showcase/src/example/image_exporter/mod.rs b/examples/src/example/image_exporter/mod.rs similarity index 100% rename from showcase/src/example/image_exporter/mod.rs rename to examples/src/example/image_exporter/mod.rs diff --git a/showcase/src/example/image_exporter/resources/cat.png b/examples/src/example/image_exporter/resources/cat.png similarity index 100% rename from showcase/src/example/image_exporter/resources/cat.png rename to examples/src/example/image_exporter/resources/cat.png diff --git a/showcase/src/example/image_exporter/resources/fudesumi.png b/examples/src/example/image_exporter/resources/fudesumi.png similarity index 100% rename from showcase/src/example/image_exporter/resources/fudesumi.png rename to examples/src/example/image_exporter/resources/fudesumi.png diff --git a/showcase/src/example/image_exporter/resources/parrots.png b/examples/src/example/image_exporter/resources/parrots.png similarity index 100% rename from showcase/src/example/image_exporter/resources/parrots.png rename to examples/src/example/image_exporter/resources/parrots.png diff --git a/showcase/src/example/image_exporter/resources/scarfy.png b/examples/src/example/image_exporter/resources/scarfy.png similarity index 100% rename from showcase/src/example/image_exporter/resources/scarfy.png rename to examples/src/example/image_exporter/resources/scarfy.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REF.png b/examples/src/example/image_raw_importer/design/raw_importer_REF.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REF.png rename to examples/src/example/image_raw_importer/design/raw_importer_REF.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV0.png b/examples/src/example/image_raw_importer/design/raw_importer_REV0.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV0.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV0.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV1.png b/examples/src/example/image_raw_importer/design/raw_importer_REV1.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV1.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV1.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV2.png b/examples/src/example/image_raw_importer/design/raw_importer_REV2.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV2.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV2.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV3.png b/examples/src/example/image_raw_importer/design/raw_importer_REV3.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV3.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV3.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV4.png b/examples/src/example/image_raw_importer/design/raw_importer_REV4.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV4.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV4.png diff --git a/showcase/src/example/image_raw_importer/design/raw_importer_REV5.png b/examples/src/example/image_raw_importer/design/raw_importer_REV5.png similarity index 100% rename from showcase/src/example/image_raw_importer/design/raw_importer_REV5.png rename to examples/src/example/image_raw_importer/design/raw_importer_REV5.png diff --git a/showcase/src/example/image_raw_importer/image_2x2_RGBA.raw b/examples/src/example/image_raw_importer/image_2x2_RGBA.raw similarity index 100% rename from showcase/src/example/image_raw_importer/image_2x2_RGBA.raw rename to examples/src/example/image_raw_importer/image_2x2_RGBA.raw diff --git a/showcase/src/example/image_raw_importer/image_raw_importer.c b/examples/src/example/image_raw_importer/image_raw_importer.c similarity index 100% rename from showcase/src/example/image_raw_importer/image_raw_importer.c rename to examples/src/example/image_raw_importer/image_raw_importer.c diff --git a/showcase/src/example/mod.rs b/examples/src/example/mod.rs similarity index 100% rename from showcase/src/example/mod.rs rename to examples/src/example/mod.rs diff --git a/showcase/src/example/models/mod.rs b/examples/src/example/models/mod.rs similarity index 100% rename from showcase/src/example/models/mod.rs rename to examples/src/example/models/mod.rs diff --git a/showcase/src/example/models/models_animation.rs b/examples/src/example/models/models_animation.rs similarity index 100% rename from showcase/src/example/models/models_animation.rs rename to examples/src/example/models/models_animation.rs diff --git a/showcase/src/example/models/models_billboard.rs b/examples/src/example/models/models_billboard.rs similarity index 100% rename from showcase/src/example/models/models_billboard.rs rename to examples/src/example/models/models_billboard.rs diff --git a/showcase/src/example/models/models_box_collisions.rs b/examples/src/example/models/models_box_collisions.rs similarity index 100% rename from showcase/src/example/models/models_box_collisions.rs rename to examples/src/example/models/models_box_collisions.rs diff --git a/showcase/src/example/models/models_cubicmap.rs b/examples/src/example/models/models_cubicmap.rs similarity index 100% rename from showcase/src/example/models/models_cubicmap.rs rename to examples/src/example/models/models_cubicmap.rs diff --git a/showcase/src/example/models/models_first_person_maze.rs b/examples/src/example/models/models_first_person_maze.rs similarity index 100% rename from showcase/src/example/models/models_first_person_maze.rs rename to examples/src/example/models/models_first_person_maze.rs diff --git a/showcase/src/example/models/models_geometric_shapes.rs b/examples/src/example/models/models_geometric_shapes.rs similarity index 100% rename from showcase/src/example/models/models_geometric_shapes.rs rename to examples/src/example/models/models_geometric_shapes.rs diff --git a/showcase/src/example/models/models_heightmap.rs b/examples/src/example/models/models_heightmap.rs similarity index 100% rename from showcase/src/example/models/models_heightmap.rs rename to examples/src/example/models/models_heightmap.rs diff --git a/showcase/src/example/models/models_loading.rs b/examples/src/example/models/models_loading.rs similarity index 100% rename from showcase/src/example/models/models_loading.rs rename to examples/src/example/models/models_loading.rs diff --git a/showcase/src/example/models/models_material_pbr.rs b/examples/src/example/models/models_material_pbr.rs similarity index 100% rename from showcase/src/example/models/models_material_pbr.rs rename to examples/src/example/models/models_material_pbr.rs diff --git a/showcase/src/example/models/models_mesh_generation.rs b/examples/src/example/models/models_mesh_generation.rs similarity index 100% rename from showcase/src/example/models/models_mesh_generation.rs rename to examples/src/example/models/models_mesh_generation.rs diff --git a/showcase/src/example/models/models_mesh_picking.rs b/examples/src/example/models/models_mesh_picking.rs similarity index 100% rename from showcase/src/example/models/models_mesh_picking.rs rename to examples/src/example/models/models_mesh_picking.rs diff --git a/showcase/src/example/models/models_orthographic_projection.rs b/examples/src/example/models/models_orthographic_projection.rs similarity index 100% rename from showcase/src/example/models/models_orthographic_projection.rs rename to examples/src/example/models/models_orthographic_projection.rs diff --git a/showcase/src/example/models/models_rlgl_solar_system.rs b/examples/src/example/models/models_rlgl_solar_system.rs similarity index 100% rename from showcase/src/example/models/models_rlgl_solar_system.rs rename to examples/src/example/models/models_rlgl_solar_system.rs diff --git a/showcase/src/example/models/models_skybox.rs b/examples/src/example/models/models_skybox.rs similarity index 100% rename from showcase/src/example/models/models_skybox.rs rename to examples/src/example/models/models_skybox.rs diff --git a/showcase/src/example/models/models_waving_cubes.rs b/examples/src/example/models/models_waving_cubes.rs similarity index 100% rename from showcase/src/example/models/models_waving_cubes.rs rename to examples/src/example/models/models_waving_cubes.rs diff --git a/showcase/src/example/models/models_yaw_pitch_roll.rs b/examples/src/example/models/models_yaw_pitch_roll.rs similarity index 100% rename from showcase/src/example/models/models_yaw_pitch_roll.rs rename to examples/src/example/models/models_yaw_pitch_roll.rs diff --git a/showcase/src/example/others/mod.rs b/examples/src/example/others/mod.rs similarity index 100% rename from showcase/src/example/others/mod.rs rename to examples/src/example/others/mod.rs diff --git a/showcase/src/example/others/rlgl_standalone.rs b/examples/src/example/others/rlgl_standalone.rs similarity index 100% rename from showcase/src/example/others/rlgl_standalone.rs rename to examples/src/example/others/rlgl_standalone.rs diff --git a/showcase/src/example/portable_window/mod.rs b/examples/src/example/portable_window/mod.rs similarity index 100% rename from showcase/src/example/portable_window/mod.rs rename to examples/src/example/portable_window/mod.rs diff --git a/showcase/src/example/portable_window/portable_window.rs b/examples/src/example/portable_window/portable_window.rs similarity index 100% rename from showcase/src/example/portable_window/portable_window.rs rename to examples/src/example/portable_window/portable_window.rs diff --git a/showcase/src/example/scroll_panel/gui_scroll_panel.rs b/examples/src/example/scroll_panel/gui_scroll_panel.rs similarity index 100% rename from showcase/src/example/scroll_panel/gui_scroll_panel.rs rename to examples/src/example/scroll_panel/gui_scroll_panel.rs diff --git a/showcase/src/example/scroll_panel/mod.rs b/examples/src/example/scroll_panel/mod.rs similarity index 100% rename from showcase/src/example/scroll_panel/mod.rs rename to examples/src/example/scroll_panel/mod.rs diff --git a/showcase/src/example/shaders/mod.rs b/examples/src/example/shaders/mod.rs similarity index 100% rename from showcase/src/example/shaders/mod.rs rename to examples/src/example/shaders/mod.rs diff --git a/showcase/src/example/shaders/shaders_basic_lighting.rs b/examples/src/example/shaders/shaders_basic_lighting.rs similarity index 100% rename from showcase/src/example/shaders/shaders_basic_lighting.rs rename to examples/src/example/shaders/shaders_basic_lighting.rs diff --git a/showcase/src/example/shaders/shaders_custom_uniform.png b/examples/src/example/shaders/shaders_custom_uniform.png similarity index 100% rename from showcase/src/example/shaders/shaders_custom_uniform.png rename to examples/src/example/shaders/shaders_custom_uniform.png diff --git a/showcase/src/example/shaders/shaders_custom_uniform.rs b/examples/src/example/shaders/shaders_custom_uniform.rs similarity index 100% rename from showcase/src/example/shaders/shaders_custom_uniform.rs rename to examples/src/example/shaders/shaders_custom_uniform.rs diff --git a/showcase/src/example/shaders/shaders_eratosthenes.png b/examples/src/example/shaders/shaders_eratosthenes.png similarity index 100% rename from showcase/src/example/shaders/shaders_eratosthenes.png rename to examples/src/example/shaders/shaders_eratosthenes.png diff --git a/showcase/src/example/shaders/shaders_eratosthenes.rs b/examples/src/example/shaders/shaders_eratosthenes.rs similarity index 100% rename from showcase/src/example/shaders/shaders_eratosthenes.rs rename to examples/src/example/shaders/shaders_eratosthenes.rs diff --git a/showcase/src/example/shaders/shaders_fog.png b/examples/src/example/shaders/shaders_fog.png similarity index 100% rename from showcase/src/example/shaders/shaders_fog.png rename to examples/src/example/shaders/shaders_fog.png diff --git a/showcase/src/example/shaders/shaders_fog.rs b/examples/src/example/shaders/shaders_fog.rs similarity index 100% rename from showcase/src/example/shaders/shaders_fog.rs rename to examples/src/example/shaders/shaders_fog.rs diff --git a/showcase/src/example/shaders/shaders_julia_set.png b/examples/src/example/shaders/shaders_julia_set.png similarity index 100% rename from showcase/src/example/shaders/shaders_julia_set.png rename to examples/src/example/shaders/shaders_julia_set.png diff --git a/showcase/src/example/shaders/shaders_julia_set.rs b/examples/src/example/shaders/shaders_julia_set.rs similarity index 100% rename from showcase/src/example/shaders/shaders_julia_set.rs rename to examples/src/example/shaders/shaders_julia_set.rs diff --git a/showcase/src/example/shaders/shaders_model_shader.c b/examples/src/example/shaders/shaders_model_shader.c similarity index 100% rename from showcase/src/example/shaders/shaders_model_shader.c rename to examples/src/example/shaders/shaders_model_shader.c diff --git a/showcase/src/example/shaders/shaders_model_shader.png b/examples/src/example/shaders/shaders_model_shader.png similarity index 100% rename from showcase/src/example/shaders/shaders_model_shader.png rename to examples/src/example/shaders/shaders_model_shader.png diff --git a/showcase/src/example/shaders/shaders_palette_switch.c b/examples/src/example/shaders/shaders_palette_switch.c similarity index 100% rename from showcase/src/example/shaders/shaders_palette_switch.c rename to examples/src/example/shaders/shaders_palette_switch.c diff --git a/showcase/src/example/shaders/shaders_palette_switch.png b/examples/src/example/shaders/shaders_palette_switch.png similarity index 100% rename from showcase/src/example/shaders/shaders_palette_switch.png rename to examples/src/example/shaders/shaders_palette_switch.png diff --git a/showcase/src/example/shaders/shaders_postprocessing.c b/examples/src/example/shaders/shaders_postprocessing.c similarity index 100% rename from showcase/src/example/shaders/shaders_postprocessing.c rename to examples/src/example/shaders/shaders_postprocessing.c diff --git a/showcase/src/example/shaders/shaders_postprocessing.png b/examples/src/example/shaders/shaders_postprocessing.png similarity index 100% rename from showcase/src/example/shaders/shaders_postprocessing.png rename to examples/src/example/shaders/shaders_postprocessing.png diff --git a/showcase/src/example/shaders/shaders_postprocessing.rs b/examples/src/example/shaders/shaders_postprocessing.rs similarity index 100% rename from showcase/src/example/shaders/shaders_postprocessing.rs rename to examples/src/example/shaders/shaders_postprocessing.rs diff --git a/showcase/src/example/shaders/shaders_raymarching.c b/examples/src/example/shaders/shaders_raymarching.c similarity index 100% rename from showcase/src/example/shaders/shaders_raymarching.c rename to examples/src/example/shaders/shaders_raymarching.c diff --git a/showcase/src/example/shaders/shaders_raymarching.png b/examples/src/example/shaders/shaders_raymarching.png similarity index 100% rename from showcase/src/example/shaders/shaders_raymarching.png rename to examples/src/example/shaders/shaders_raymarching.png diff --git a/showcase/src/example/shaders/shaders_shapes_textures.c b/examples/src/example/shaders/shaders_shapes_textures.c similarity index 100% rename from showcase/src/example/shaders/shaders_shapes_textures.c rename to examples/src/example/shaders/shaders_shapes_textures.c diff --git a/showcase/src/example/shaders/shaders_shapes_textures.png b/examples/src/example/shaders/shaders_shapes_textures.png similarity index 100% rename from showcase/src/example/shaders/shaders_shapes_textures.png rename to examples/src/example/shaders/shaders_shapes_textures.png diff --git a/showcase/src/example/shaders/shaders_simple_mask.c b/examples/src/example/shaders/shaders_simple_mask.c similarity index 100% rename from showcase/src/example/shaders/shaders_simple_mask.c rename to examples/src/example/shaders/shaders_simple_mask.c diff --git a/showcase/src/example/shaders/shaders_simple_mask.png b/examples/src/example/shaders/shaders_simple_mask.png similarity index 100% rename from showcase/src/example/shaders/shaders_simple_mask.png rename to examples/src/example/shaders/shaders_simple_mask.png diff --git a/showcase/src/example/shaders/shaders_spotlight.c b/examples/src/example/shaders/shaders_spotlight.c similarity index 100% rename from showcase/src/example/shaders/shaders_spotlight.c rename to examples/src/example/shaders/shaders_spotlight.c diff --git a/showcase/src/example/shaders/shaders_spotlight.png b/examples/src/example/shaders/shaders_spotlight.png similarity index 100% rename from showcase/src/example/shaders/shaders_spotlight.png rename to examples/src/example/shaders/shaders_spotlight.png diff --git a/showcase/src/example/shaders/shaders_texture_drawing.c b/examples/src/example/shaders/shaders_texture_drawing.c similarity index 100% rename from showcase/src/example/shaders/shaders_texture_drawing.c rename to examples/src/example/shaders/shaders_texture_drawing.c diff --git a/showcase/src/example/shaders/shaders_texture_drawing.png b/examples/src/example/shaders/shaders_texture_drawing.png similarity index 100% rename from showcase/src/example/shaders/shaders_texture_drawing.png rename to examples/src/example/shaders/shaders_texture_drawing.png diff --git a/showcase/src/example/shaders/shaders_texture_waves.c b/examples/src/example/shaders/shaders_texture_waves.c similarity index 100% rename from showcase/src/example/shaders/shaders_texture_waves.c rename to examples/src/example/shaders/shaders_texture_waves.c diff --git a/showcase/src/example/shaders/shaders_texture_waves.png b/examples/src/example/shaders/shaders_texture_waves.png similarity index 100% rename from showcase/src/example/shaders/shaders_texture_waves.png rename to examples/src/example/shaders/shaders_texture_waves.png diff --git a/showcase/src/example/shapes/easings.h b/examples/src/example/shapes/easings.h similarity index 100% rename from showcase/src/example/shapes/easings.h rename to examples/src/example/shapes/easings.h diff --git a/showcase/src/example/shapes/raygui.h b/examples/src/example/shapes/raygui.h similarity index 100% rename from showcase/src/example/shapes/raygui.h rename to examples/src/example/shapes/raygui.h diff --git a/showcase/src/example/shapes/shapes_basic_shapes.c b/examples/src/example/shapes/shapes_basic_shapes.c similarity index 100% rename from showcase/src/example/shapes/shapes_basic_shapes.c rename to examples/src/example/shapes/shapes_basic_shapes.c diff --git a/showcase/src/example/shapes/shapes_basic_shapes.png b/examples/src/example/shapes/shapes_basic_shapes.png similarity index 100% rename from showcase/src/example/shapes/shapes_basic_shapes.png rename to examples/src/example/shapes/shapes_basic_shapes.png diff --git a/showcase/src/example/shapes/shapes_bouncing_ball.c b/examples/src/example/shapes/shapes_bouncing_ball.c similarity index 100% rename from showcase/src/example/shapes/shapes_bouncing_ball.c rename to examples/src/example/shapes/shapes_bouncing_ball.c diff --git a/showcase/src/example/shapes/shapes_bouncing_ball.png b/examples/src/example/shapes/shapes_bouncing_ball.png similarity index 100% rename from showcase/src/example/shapes/shapes_bouncing_ball.png rename to examples/src/example/shapes/shapes_bouncing_ball.png diff --git a/showcase/src/example/shapes/shapes_collision_area.c b/examples/src/example/shapes/shapes_collision_area.c similarity index 100% rename from showcase/src/example/shapes/shapes_collision_area.c rename to examples/src/example/shapes/shapes_collision_area.c diff --git a/showcase/src/example/shapes/shapes_collision_area.png b/examples/src/example/shapes/shapes_collision_area.png similarity index 100% rename from showcase/src/example/shapes/shapes_collision_area.png rename to examples/src/example/shapes/shapes_collision_area.png diff --git a/showcase/src/example/shapes/shapes_colors_palette.c b/examples/src/example/shapes/shapes_colors_palette.c similarity index 100% rename from showcase/src/example/shapes/shapes_colors_palette.c rename to examples/src/example/shapes/shapes_colors_palette.c diff --git a/showcase/src/example/shapes/shapes_colors_palette.png b/examples/src/example/shapes/shapes_colors_palette.png similarity index 100% rename from showcase/src/example/shapes/shapes_colors_palette.png rename to examples/src/example/shapes/shapes_colors_palette.png diff --git a/showcase/src/example/shapes/shapes_draw_circle_sector.c b/examples/src/example/shapes/shapes_draw_circle_sector.c similarity index 100% rename from showcase/src/example/shapes/shapes_draw_circle_sector.c rename to examples/src/example/shapes/shapes_draw_circle_sector.c diff --git a/showcase/src/example/shapes/shapes_draw_circle_sector.png b/examples/src/example/shapes/shapes_draw_circle_sector.png similarity index 100% rename from showcase/src/example/shapes/shapes_draw_circle_sector.png rename to examples/src/example/shapes/shapes_draw_circle_sector.png diff --git a/showcase/src/example/shapes/shapes_draw_rectangle_rounded.c b/examples/src/example/shapes/shapes_draw_rectangle_rounded.c similarity index 100% rename from showcase/src/example/shapes/shapes_draw_rectangle_rounded.c rename to examples/src/example/shapes/shapes_draw_rectangle_rounded.c diff --git a/showcase/src/example/shapes/shapes_draw_rectangle_rounded.png b/examples/src/example/shapes/shapes_draw_rectangle_rounded.png similarity index 100% rename from showcase/src/example/shapes/shapes_draw_rectangle_rounded.png rename to examples/src/example/shapes/shapes_draw_rectangle_rounded.png diff --git a/showcase/src/example/shapes/shapes_draw_ring.c b/examples/src/example/shapes/shapes_draw_ring.c similarity index 100% rename from showcase/src/example/shapes/shapes_draw_ring.c rename to examples/src/example/shapes/shapes_draw_ring.c diff --git a/showcase/src/example/shapes/shapes_draw_ring.png b/examples/src/example/shapes/shapes_draw_ring.png similarity index 100% rename from showcase/src/example/shapes/shapes_draw_ring.png rename to examples/src/example/shapes/shapes_draw_ring.png diff --git a/showcase/src/example/shapes/shapes_easings_ball_anim.c b/examples/src/example/shapes/shapes_easings_ball_anim.c similarity index 100% rename from showcase/src/example/shapes/shapes_easings_ball_anim.c rename to examples/src/example/shapes/shapes_easings_ball_anim.c diff --git a/showcase/src/example/shapes/shapes_easings_ball_anim.png b/examples/src/example/shapes/shapes_easings_ball_anim.png similarity index 100% rename from showcase/src/example/shapes/shapes_easings_ball_anim.png rename to examples/src/example/shapes/shapes_easings_ball_anim.png diff --git a/showcase/src/example/shapes/shapes_easings_box_anim.c b/examples/src/example/shapes/shapes_easings_box_anim.c similarity index 100% rename from showcase/src/example/shapes/shapes_easings_box_anim.c rename to examples/src/example/shapes/shapes_easings_box_anim.c diff --git a/showcase/src/example/shapes/shapes_easings_box_anim.png b/examples/src/example/shapes/shapes_easings_box_anim.png similarity index 100% rename from showcase/src/example/shapes/shapes_easings_box_anim.png rename to examples/src/example/shapes/shapes_easings_box_anim.png diff --git a/showcase/src/example/shapes/shapes_easings_rectangle_array.c b/examples/src/example/shapes/shapes_easings_rectangle_array.c similarity index 100% rename from showcase/src/example/shapes/shapes_easings_rectangle_array.c rename to examples/src/example/shapes/shapes_easings_rectangle_array.c diff --git a/showcase/src/example/shapes/shapes_easings_rectangle_array.png b/examples/src/example/shapes/shapes_easings_rectangle_array.png similarity index 100% rename from showcase/src/example/shapes/shapes_easings_rectangle_array.png rename to examples/src/example/shapes/shapes_easings_rectangle_array.png diff --git a/showcase/src/example/shapes/shapes_following_eyes.c b/examples/src/example/shapes/shapes_following_eyes.c similarity index 100% rename from showcase/src/example/shapes/shapes_following_eyes.c rename to examples/src/example/shapes/shapes_following_eyes.c diff --git a/showcase/src/example/shapes/shapes_following_eyes.png b/examples/src/example/shapes/shapes_following_eyes.png similarity index 100% rename from showcase/src/example/shapes/shapes_following_eyes.png rename to examples/src/example/shapes/shapes_following_eyes.png diff --git a/showcase/src/example/shapes/shapes_lines_bezier.c b/examples/src/example/shapes/shapes_lines_bezier.c similarity index 100% rename from showcase/src/example/shapes/shapes_lines_bezier.c rename to examples/src/example/shapes/shapes_lines_bezier.c diff --git a/showcase/src/example/shapes/shapes_lines_bezier.png b/examples/src/example/shapes/shapes_lines_bezier.png similarity index 100% rename from showcase/src/example/shapes/shapes_lines_bezier.png rename to examples/src/example/shapes/shapes_lines_bezier.png diff --git a/showcase/src/example/shapes/shapes_logo_raylib.c b/examples/src/example/shapes/shapes_logo_raylib.c similarity index 100% rename from showcase/src/example/shapes/shapes_logo_raylib.c rename to examples/src/example/shapes/shapes_logo_raylib.c diff --git a/showcase/src/example/shapes/shapes_logo_raylib.png b/examples/src/example/shapes/shapes_logo_raylib.png similarity index 100% rename from showcase/src/example/shapes/shapes_logo_raylib.png rename to examples/src/example/shapes/shapes_logo_raylib.png diff --git a/showcase/src/example/shapes/shapes_logo_raylib_anim.c b/examples/src/example/shapes/shapes_logo_raylib_anim.c similarity index 100% rename from showcase/src/example/shapes/shapes_logo_raylib_anim.c rename to examples/src/example/shapes/shapes_logo_raylib_anim.c diff --git a/showcase/src/example/shapes/shapes_logo_raylib_anim.png b/examples/src/example/shapes/shapes_logo_raylib_anim.png similarity index 100% rename from showcase/src/example/shapes/shapes_logo_raylib_anim.png rename to examples/src/example/shapes/shapes_logo_raylib_anim.png diff --git a/showcase/src/example/shapes/shapes_rectangle_scaling.c b/examples/src/example/shapes/shapes_rectangle_scaling.c similarity index 100% rename from showcase/src/example/shapes/shapes_rectangle_scaling.c rename to examples/src/example/shapes/shapes_rectangle_scaling.c diff --git a/showcase/src/example/shapes/shapes_rectangle_scaling.png b/examples/src/example/shapes/shapes_rectangle_scaling.png similarity index 100% rename from showcase/src/example/shapes/shapes_rectangle_scaling.png rename to examples/src/example/shapes/shapes_rectangle_scaling.png diff --git a/showcase/src/example/text/resources/AnonymousPro-Bold.ttf b/examples/src/example/text/resources/AnonymousPro-Bold.ttf similarity index 100% rename from showcase/src/example/text/resources/AnonymousPro-Bold.ttf rename to examples/src/example/text/resources/AnonymousPro-Bold.ttf diff --git a/showcase/src/example/text/resources/KAISG.ttf b/examples/src/example/text/resources/KAISG.ttf similarity index 100% rename from showcase/src/example/text/resources/KAISG.ttf rename to examples/src/example/text/resources/KAISG.ttf diff --git a/showcase/src/example/text/resources/LICENSE b/examples/src/example/text/resources/LICENSE similarity index 100% rename from showcase/src/example/text/resources/LICENSE rename to examples/src/example/text/resources/LICENSE diff --git a/showcase/src/example/text/resources/bmfont.fnt b/examples/src/example/text/resources/bmfont.fnt similarity index 100% rename from showcase/src/example/text/resources/bmfont.fnt rename to examples/src/example/text/resources/bmfont.fnt diff --git a/showcase/src/example/text/resources/bmfont.png b/examples/src/example/text/resources/bmfont.png similarity index 100% rename from showcase/src/example/text/resources/bmfont.png rename to examples/src/example/text/resources/bmfont.png diff --git a/showcase/src/example/text/resources/custom_alagard.png b/examples/src/example/text/resources/custom_alagard.png similarity index 100% rename from showcase/src/example/text/resources/custom_alagard.png rename to examples/src/example/text/resources/custom_alagard.png diff --git a/showcase/src/example/text/resources/custom_jupiter_crash.png b/examples/src/example/text/resources/custom_jupiter_crash.png similarity index 100% rename from showcase/src/example/text/resources/custom_jupiter_crash.png rename to examples/src/example/text/resources/custom_jupiter_crash.png diff --git a/showcase/src/example/text/resources/custom_mecha.png b/examples/src/example/text/resources/custom_mecha.png similarity index 100% rename from showcase/src/example/text/resources/custom_mecha.png rename to examples/src/example/text/resources/custom_mecha.png diff --git a/showcase/src/example/text/resources/dejavu.fnt b/examples/src/example/text/resources/dejavu.fnt similarity index 100% rename from showcase/src/example/text/resources/dejavu.fnt rename to examples/src/example/text/resources/dejavu.fnt diff --git a/showcase/src/example/text/resources/dejavu.png b/examples/src/example/text/resources/dejavu.png similarity index 100% rename from showcase/src/example/text/resources/dejavu.png rename to examples/src/example/text/resources/dejavu.png diff --git a/showcase/src/example/text/resources/emoji.fnt b/examples/src/example/text/resources/emoji.fnt similarity index 100% rename from showcase/src/example/text/resources/emoji.fnt rename to examples/src/example/text/resources/emoji.fnt diff --git a/showcase/src/example/text/resources/emoji.png b/examples/src/example/text/resources/emoji.png similarity index 100% rename from showcase/src/example/text/resources/emoji.png rename to examples/src/example/text/resources/emoji.png diff --git a/showcase/original/text/resources/fonts/alagard.png b/examples/src/example/text/resources/fonts/alagard.png similarity index 100% rename from showcase/original/text/resources/fonts/alagard.png rename to examples/src/example/text/resources/fonts/alagard.png diff --git a/showcase/src/example/text/resources/fonts/alpha_beta.png b/examples/src/example/text/resources/fonts/alpha_beta.png similarity index 100% rename from showcase/src/example/text/resources/fonts/alpha_beta.png rename to examples/src/example/text/resources/fonts/alpha_beta.png diff --git a/showcase/src/example/text/resources/fonts/jupiter_crash.png b/examples/src/example/text/resources/fonts/jupiter_crash.png similarity index 100% rename from showcase/src/example/text/resources/fonts/jupiter_crash.png rename to examples/src/example/text/resources/fonts/jupiter_crash.png diff --git a/showcase/src/example/text/resources/fonts/mecha.png b/examples/src/example/text/resources/fonts/mecha.png similarity index 100% rename from showcase/src/example/text/resources/fonts/mecha.png rename to examples/src/example/text/resources/fonts/mecha.png diff --git a/showcase/src/example/text/resources/fonts/pixantiqua.png b/examples/src/example/text/resources/fonts/pixantiqua.png similarity index 100% rename from showcase/src/example/text/resources/fonts/pixantiqua.png rename to examples/src/example/text/resources/fonts/pixantiqua.png diff --git a/showcase/src/example/text/resources/fonts/pixelplay.png b/examples/src/example/text/resources/fonts/pixelplay.png similarity index 100% rename from showcase/src/example/text/resources/fonts/pixelplay.png rename to examples/src/example/text/resources/fonts/pixelplay.png diff --git a/showcase/src/example/text/resources/fonts/romulus.png b/examples/src/example/text/resources/fonts/romulus.png similarity index 100% rename from showcase/src/example/text/resources/fonts/romulus.png rename to examples/src/example/text/resources/fonts/romulus.png diff --git a/showcase/src/example/text/resources/fonts/setback.png b/examples/src/example/text/resources/fonts/setback.png similarity index 100% rename from showcase/src/example/text/resources/fonts/setback.png rename to examples/src/example/text/resources/fonts/setback.png diff --git a/showcase/src/example/text/resources/notoCJK.fnt b/examples/src/example/text/resources/notoCJK.fnt similarity index 100% rename from showcase/src/example/text/resources/notoCJK.fnt rename to examples/src/example/text/resources/notoCJK.fnt diff --git a/showcase/src/example/text/resources/notoCJK.png b/examples/src/example/text/resources/notoCJK.png similarity index 100% rename from showcase/src/example/text/resources/notoCJK.png rename to examples/src/example/text/resources/notoCJK.png diff --git a/showcase/src/example/text/resources/pixantiqua.fnt b/examples/src/example/text/resources/pixantiqua.fnt similarity index 100% rename from showcase/src/example/text/resources/pixantiqua.fnt rename to examples/src/example/text/resources/pixantiqua.fnt diff --git a/showcase/src/example/text/resources/pixantiqua.png b/examples/src/example/text/resources/pixantiqua.png similarity index 100% rename from showcase/src/example/text/resources/pixantiqua.png rename to examples/src/example/text/resources/pixantiqua.png diff --git a/showcase/src/example/text/resources/pixantiqua.ttf b/examples/src/example/text/resources/pixantiqua.ttf similarity index 100% rename from showcase/src/example/text/resources/pixantiqua.ttf rename to examples/src/example/text/resources/pixantiqua.ttf diff --git a/showcase/src/example/text/resources/shaders/glsl100/sdf.fs b/examples/src/example/text/resources/shaders/glsl100/sdf.fs similarity index 100% rename from showcase/src/example/text/resources/shaders/glsl100/sdf.fs rename to examples/src/example/text/resources/shaders/glsl100/sdf.fs diff --git a/showcase/src/example/text/resources/shaders/glsl330/sdf.fs b/examples/src/example/text/resources/shaders/glsl330/sdf.fs similarity index 100% rename from showcase/src/example/text/resources/shaders/glsl330/sdf.fs rename to examples/src/example/text/resources/shaders/glsl330/sdf.fs diff --git a/showcase/src/example/text/text_font_filters.c b/examples/src/example/text/text_font_filters.c similarity index 100% rename from showcase/src/example/text/text_font_filters.c rename to examples/src/example/text/text_font_filters.c diff --git a/showcase/src/example/text/text_font_filters.png b/examples/src/example/text/text_font_filters.png similarity index 100% rename from showcase/src/example/text/text_font_filters.png rename to examples/src/example/text/text_font_filters.png diff --git a/showcase/src/example/text/text_font_loading.c b/examples/src/example/text/text_font_loading.c similarity index 100% rename from showcase/src/example/text/text_font_loading.c rename to examples/src/example/text/text_font_loading.c diff --git a/showcase/src/example/text/text_font_loading.png b/examples/src/example/text/text_font_loading.png similarity index 100% rename from showcase/src/example/text/text_font_loading.png rename to examples/src/example/text/text_font_loading.png diff --git a/showcase/src/example/text/text_font_sdf.c b/examples/src/example/text/text_font_sdf.c similarity index 100% rename from showcase/src/example/text/text_font_sdf.c rename to examples/src/example/text/text_font_sdf.c diff --git a/showcase/src/example/text/text_font_sdf.png b/examples/src/example/text/text_font_sdf.png similarity index 100% rename from showcase/src/example/text/text_font_sdf.png rename to examples/src/example/text/text_font_sdf.png diff --git a/showcase/src/example/text/text_font_spritefont.c b/examples/src/example/text/text_font_spritefont.c similarity index 100% rename from showcase/src/example/text/text_font_spritefont.c rename to examples/src/example/text/text_font_spritefont.c diff --git a/showcase/src/example/text/text_font_spritefont.png b/examples/src/example/text/text_font_spritefont.png similarity index 100% rename from showcase/src/example/text/text_font_spritefont.png rename to examples/src/example/text/text_font_spritefont.png diff --git a/showcase/src/example/text/text_format_text.c b/examples/src/example/text/text_format_text.c similarity index 100% rename from showcase/src/example/text/text_format_text.c rename to examples/src/example/text/text_format_text.c diff --git a/showcase/src/example/text/text_format_text.png b/examples/src/example/text/text_format_text.png similarity index 100% rename from showcase/src/example/text/text_format_text.png rename to examples/src/example/text/text_format_text.png diff --git a/showcase/src/example/text/text_input_box.c b/examples/src/example/text/text_input_box.c similarity index 100% rename from showcase/src/example/text/text_input_box.c rename to examples/src/example/text/text_input_box.c diff --git a/showcase/src/example/text/text_input_box.png b/examples/src/example/text/text_input_box.png similarity index 100% rename from showcase/src/example/text/text_input_box.png rename to examples/src/example/text/text_input_box.png diff --git a/showcase/src/example/text/text_raylib_fonts.c b/examples/src/example/text/text_raylib_fonts.c similarity index 100% rename from showcase/src/example/text/text_raylib_fonts.c rename to examples/src/example/text/text_raylib_fonts.c diff --git a/showcase/src/example/text/text_raylib_fonts.png b/examples/src/example/text/text_raylib_fonts.png similarity index 100% rename from showcase/src/example/text/text_raylib_fonts.png rename to examples/src/example/text/text_raylib_fonts.png diff --git a/showcase/src/example/text/text_rectangle_bounds.c b/examples/src/example/text/text_rectangle_bounds.c similarity index 100% rename from showcase/src/example/text/text_rectangle_bounds.c rename to examples/src/example/text/text_rectangle_bounds.c diff --git a/showcase/src/example/text/text_rectangle_bounds.png b/examples/src/example/text/text_rectangle_bounds.png similarity index 100% rename from showcase/src/example/text/text_rectangle_bounds.png rename to examples/src/example/text/text_rectangle_bounds.png diff --git a/showcase/src/example/text/text_unicode.c b/examples/src/example/text/text_unicode.c similarity index 100% rename from showcase/src/example/text/text_unicode.c rename to examples/src/example/text/text_unicode.c diff --git a/showcase/src/example/text/text_unicode.png b/examples/src/example/text/text_unicode.png similarity index 100% rename from showcase/src/example/text/text_unicode.png rename to examples/src/example/text/text_unicode.png diff --git a/showcase/src/example/text/text_writing_anim.c b/examples/src/example/text/text_writing_anim.c similarity index 100% rename from showcase/src/example/text/text_writing_anim.c rename to examples/src/example/text/text_writing_anim.c diff --git a/showcase/src/example/text/text_writing_anim.png b/examples/src/example/text/text_writing_anim.png similarity index 100% rename from showcase/src/example/text/text_writing_anim.png rename to examples/src/example/text/text_writing_anim.png diff --git a/showcase/src/example/text_box_selection/textbox_extended_demo.c b/examples/src/example/text_box_selection/textbox_extended_demo.c similarity index 100% rename from showcase/src/example/text_box_selection/textbox_extended_demo.c rename to examples/src/example/text_box_selection/textbox_extended_demo.c diff --git a/showcase/src/example/text_editor/text_editor.c b/examples/src/example/text_editor/text_editor.c similarity index 100% rename from showcase/src/example/text_editor/text_editor.c rename to examples/src/example/text_editor/text_editor.c diff --git a/showcase/src/example/textures/mod.rs b/examples/src/example/textures/mod.rs similarity index 100% rename from showcase/src/example/textures/mod.rs rename to examples/src/example/textures/mod.rs diff --git a/showcase/src/example/textures/textures_background_scrolling.c b/examples/src/example/textures/textures_background_scrolling.c similarity index 100% rename from showcase/src/example/textures/textures_background_scrolling.c rename to examples/src/example/textures/textures_background_scrolling.c diff --git a/showcase/src/example/textures/textures_background_scrolling.png b/examples/src/example/textures/textures_background_scrolling.png similarity index 100% rename from showcase/src/example/textures/textures_background_scrolling.png rename to examples/src/example/textures/textures_background_scrolling.png diff --git a/showcase/src/example/textures/textures_bunnymark.c b/examples/src/example/textures/textures_bunnymark.c similarity index 100% rename from showcase/src/example/textures/textures_bunnymark.c rename to examples/src/example/textures/textures_bunnymark.c diff --git a/showcase/src/example/textures/textures_bunnymark.png b/examples/src/example/textures/textures_bunnymark.png similarity index 100% rename from showcase/src/example/textures/textures_bunnymark.png rename to examples/src/example/textures/textures_bunnymark.png diff --git a/showcase/src/example/textures/textures_bunnymark.rs b/examples/src/example/textures/textures_bunnymark.rs similarity index 100% rename from showcase/src/example/textures/textures_bunnymark.rs rename to examples/src/example/textures/textures_bunnymark.rs diff --git a/showcase/src/example/textures/textures_image_drawing.c b/examples/src/example/textures/textures_image_drawing.c similarity index 100% rename from showcase/src/example/textures/textures_image_drawing.c rename to examples/src/example/textures/textures_image_drawing.c diff --git a/showcase/src/example/textures/textures_image_drawing.png b/examples/src/example/textures/textures_image_drawing.png similarity index 100% rename from showcase/src/example/textures/textures_image_drawing.png rename to examples/src/example/textures/textures_image_drawing.png diff --git a/showcase/src/example/textures/textures_image_generation.c b/examples/src/example/textures/textures_image_generation.c similarity index 100% rename from showcase/src/example/textures/textures_image_generation.c rename to examples/src/example/textures/textures_image_generation.c diff --git a/showcase/src/example/textures/textures_image_generation.png b/examples/src/example/textures/textures_image_generation.png similarity index 100% rename from showcase/src/example/textures/textures_image_generation.png rename to examples/src/example/textures/textures_image_generation.png diff --git a/showcase/src/example/textures/textures_image_loading.c b/examples/src/example/textures/textures_image_loading.c similarity index 100% rename from showcase/src/example/textures/textures_image_loading.c rename to examples/src/example/textures/textures_image_loading.c diff --git a/showcase/src/example/textures/textures_image_loading.png b/examples/src/example/textures/textures_image_loading.png similarity index 100% rename from showcase/src/example/textures/textures_image_loading.png rename to examples/src/example/textures/textures_image_loading.png diff --git a/showcase/src/example/textures/textures_image_processing.c b/examples/src/example/textures/textures_image_processing.c similarity index 100% rename from showcase/src/example/textures/textures_image_processing.c rename to examples/src/example/textures/textures_image_processing.c diff --git a/showcase/src/example/textures/textures_image_processing.png b/examples/src/example/textures/textures_image_processing.png similarity index 100% rename from showcase/src/example/textures/textures_image_processing.png rename to examples/src/example/textures/textures_image_processing.png diff --git a/showcase/src/example/textures/textures_image_text.c b/examples/src/example/textures/textures_image_text.c similarity index 100% rename from showcase/src/example/textures/textures_image_text.c rename to examples/src/example/textures/textures_image_text.c diff --git a/showcase/src/example/textures/textures_image_text.png b/examples/src/example/textures/textures_image_text.png similarity index 100% rename from showcase/src/example/textures/textures_image_text.png rename to examples/src/example/textures/textures_image_text.png diff --git a/showcase/src/example/textures/textures_logo_raylib.c b/examples/src/example/textures/textures_logo_raylib.c similarity index 100% rename from showcase/src/example/textures/textures_logo_raylib.c rename to examples/src/example/textures/textures_logo_raylib.c diff --git a/showcase/src/example/textures/textures_logo_raylib.png b/examples/src/example/textures/textures_logo_raylib.png similarity index 100% rename from showcase/src/example/textures/textures_logo_raylib.png rename to examples/src/example/textures/textures_logo_raylib.png diff --git a/showcase/src/example/textures/textures_mouse_painting.c b/examples/src/example/textures/textures_mouse_painting.c similarity index 100% rename from showcase/src/example/textures/textures_mouse_painting.c rename to examples/src/example/textures/textures_mouse_painting.c diff --git a/showcase/src/example/textures/textures_mouse_painting.png b/examples/src/example/textures/textures_mouse_painting.png similarity index 100% rename from showcase/src/example/textures/textures_mouse_painting.png rename to examples/src/example/textures/textures_mouse_painting.png diff --git a/showcase/src/example/textures/textures_mouse_painting.rs b/examples/src/example/textures/textures_mouse_painting.rs similarity index 100% rename from showcase/src/example/textures/textures_mouse_painting.rs rename to examples/src/example/textures/textures_mouse_painting.rs diff --git a/showcase/src/example/textures/textures_npatch_drawing.c b/examples/src/example/textures/textures_npatch_drawing.c similarity index 100% rename from showcase/src/example/textures/textures_npatch_drawing.c rename to examples/src/example/textures/textures_npatch_drawing.c diff --git a/showcase/src/example/textures/textures_npatch_drawing.png b/examples/src/example/textures/textures_npatch_drawing.png similarity index 100% rename from showcase/src/example/textures/textures_npatch_drawing.png rename to examples/src/example/textures/textures_npatch_drawing.png diff --git a/showcase/src/example/textures/textures_particles_blending.c b/examples/src/example/textures/textures_particles_blending.c similarity index 100% rename from showcase/src/example/textures/textures_particles_blending.c rename to examples/src/example/textures/textures_particles_blending.c diff --git a/showcase/src/example/textures/textures_particles_blending.png b/examples/src/example/textures/textures_particles_blending.png similarity index 100% rename from showcase/src/example/textures/textures_particles_blending.png rename to examples/src/example/textures/textures_particles_blending.png diff --git a/showcase/src/example/textures/textures_raw_data.c b/examples/src/example/textures/textures_raw_data.c similarity index 100% rename from showcase/src/example/textures/textures_raw_data.c rename to examples/src/example/textures/textures_raw_data.c diff --git a/showcase/src/example/textures/textures_raw_data.png b/examples/src/example/textures/textures_raw_data.png similarity index 100% rename from showcase/src/example/textures/textures_raw_data.png rename to examples/src/example/textures/textures_raw_data.png diff --git a/showcase/src/example/textures/textures_rectangle.c b/examples/src/example/textures/textures_rectangle.c similarity index 100% rename from showcase/src/example/textures/textures_rectangle.c rename to examples/src/example/textures/textures_rectangle.c diff --git a/showcase/src/example/textures/textures_rectangle.png b/examples/src/example/textures/textures_rectangle.png similarity index 100% rename from showcase/src/example/textures/textures_rectangle.png rename to examples/src/example/textures/textures_rectangle.png diff --git a/showcase/src/example/textures/textures_rectangle.rs b/examples/src/example/textures/textures_rectangle.rs similarity index 100% rename from showcase/src/example/textures/textures_rectangle.rs rename to examples/src/example/textures/textures_rectangle.rs diff --git a/showcase/src/example/textures/textures_sprite_button.c b/examples/src/example/textures/textures_sprite_button.c similarity index 100% rename from showcase/src/example/textures/textures_sprite_button.c rename to examples/src/example/textures/textures_sprite_button.c diff --git a/showcase/src/example/textures/textures_sprite_button.png b/examples/src/example/textures/textures_sprite_button.png similarity index 100% rename from showcase/src/example/textures/textures_sprite_button.png rename to examples/src/example/textures/textures_sprite_button.png diff --git a/showcase/src/example/textures/textures_sprite_explosion.c b/examples/src/example/textures/textures_sprite_explosion.c similarity index 100% rename from showcase/src/example/textures/textures_sprite_explosion.c rename to examples/src/example/textures/textures_sprite_explosion.c diff --git a/showcase/src/example/textures/textures_sprite_explosion.png b/examples/src/example/textures/textures_sprite_explosion.png similarity index 100% rename from showcase/src/example/textures/textures_sprite_explosion.png rename to examples/src/example/textures/textures_sprite_explosion.png diff --git a/showcase/src/example/textures/textures_srcrec_dstrec.c b/examples/src/example/textures/textures_srcrec_dstrec.c similarity index 100% rename from showcase/src/example/textures/textures_srcrec_dstrec.c rename to examples/src/example/textures/textures_srcrec_dstrec.c diff --git a/showcase/src/example/textures/textures_srcrec_dstrec.png b/examples/src/example/textures/textures_srcrec_dstrec.png similarity index 100% rename from showcase/src/example/textures/textures_srcrec_dstrec.png rename to examples/src/example/textures/textures_srcrec_dstrec.png diff --git a/showcase/src/example/textures/textures_to_image.c b/examples/src/example/textures/textures_to_image.c similarity index 100% rename from showcase/src/example/textures/textures_to_image.c rename to examples/src/example/textures/textures_to_image.c diff --git a/showcase/src/example/textures/textures_to_image.png b/examples/src/example/textures/textures_to_image.png similarity index 100% rename from showcase/src/example/textures/textures_to_image.png rename to examples/src/example/textures/textures_to_image.png diff --git a/showcase/src/main.rs b/examples/src/main.rs similarity index 100% rename from showcase/src/main.rs rename to examples/src/main.rs diff --git a/raylib-sys/src/lib.rs b/raylib-sys/src/lib.rs index c70982af..f16d5ea2 100644 --- a/raylib-sys/src/lib.rs +++ b/raylib-sys/src/lib.rs @@ -13,10 +13,10 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); pub const MAX_MATERIAL_MAPS: u32 = 12; -mod color; mod camera; +mod color; mod math; +pub use camera::*; pub use color::*; pub use math::*; -pub use camera::*; \ No newline at end of file diff --git a/raylib/src/core/drawing.rs b/raylib/src/core/drawing.rs index dc6afb9e..30d55234 100644 --- a/raylib/src/core/drawing.rs +++ b/raylib/src/core/drawing.rs @@ -188,8 +188,8 @@ pub trait RaylibDraw { /// Draws a pixel (Vector version). #[inline] - fn draw_pixel_v(&self, position: Vector2, color: Color) { - unsafe { ffi::DrawPixelV(position, color) } + fn draw_pixel_v(&self, position: impl Into, color: Color) { + unsafe { ffi::DrawPixelV(position.into(), color) } } /// Draws a line. @@ -207,51 +207,76 @@ pub trait RaylibDraw { /// Draws a line (Vector version). #[inline] - fn draw_line_v(&self, start_pos: Vector2, end_pos: Vector2, color: Color) { - unsafe { ffi::DrawLineV(start_pos, end_pos, color) } + fn draw_line_v( + &self, + start_pos: impl Into, + end_pos: impl Into, + color: Color, + ) { + unsafe { ffi::DrawLineV(start_pos.into(), end_pos.into(), color) } } /// Draws a line with thickness. #[inline] - fn draw_line_ex(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { - unsafe { ffi::DrawLineEx(start_pos, end_pos, thick, color) } + fn draw_line_ex( + &self, + start_pos: impl Into, + end_pos: impl Into, + thick: f32, + color: Color, + ) { + unsafe { ffi::DrawLineEx(start_pos.into(), end_pos.into(), thick, color) } } /// Draws a line using cubic-bezier curves in-out. #[inline] - fn draw_line_bezier(&self, start_pos: Vector2, end_pos: Vector2, thick: f32, color: Color) { - unsafe { ffi::DrawLineBezier(start_pos, end_pos, thick, color) } + fn draw_line_bezier( + &self, + start_pos: impl Into, + end_pos: impl Into, + thick: f32, + color: Color, + ) { + unsafe { ffi::DrawLineBezier(start_pos.into(), end_pos.into(), thick, color) } } /// Draw line using quadratic bezier curves with a control point #[inline] fn draw_line_bezier_quad( &self, - start_pos: Vector2, - end_pos: Vector2, - control_pos: Vector2, + start_pos: impl Into, + end_pos: impl Into, + control_pos: impl Into, thick: f32, color: Color, ) { - unsafe { ffi::DrawLineBezierQuad(start_pos, end_pos, control_pos, thick, color) } + unsafe { + ffi::DrawLineBezierQuad( + start_pos.into(), + end_pos.into(), + control_pos.into(), + thick, + color, + ) + } } /// Draw line using cubic bezier curves with 2 control points #[inline] fn draw_line_bezier_cubic( &self, - start_pos: Vector2, - end_pos: Vector2, - start_control_pos: Vector2, - end_control_pos: Vector2, + start_pos: impl Into, + end_pos: impl Into, + start_control_pos: impl Into, + end_control_pos: impl Into, thick: f32, color: Color, ) { unsafe { ffi::DrawLineBezierCubic( - start_pos, - end_pos, - start_control_pos, - end_control_pos, + start_pos.into(), + end_pos.into(), + start_control_pos.into(), + end_control_pos.into(), thick, color, ) @@ -261,13 +286,7 @@ pub trait RaylibDraw { /// Draw lines sequence #[inline] fn draw_line_strip(&self, points: &[Vector2], color: Color) { - unsafe { - ffi::DrawLineStrip( - points.as_ptr() as *mut ffi::Vector2, - points.len() as i32, - color, - ) - } + unsafe { ffi::DrawLineStrip(points.as_ptr() as *mut Vector2, points.len() as i32, color) } } /// Draws a color-filled circle. @@ -280,21 +299,30 @@ pub trait RaylibDraw { #[inline] fn draw_circle_sector( &self, - center: Vector2, + center: impl Into, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: Color, ) { - unsafe { ffi::DrawCircleSector(center, radius, start_angle, end_angle, segments, color) } + unsafe { + ffi::DrawCircleSector( + center.into(), + radius, + start_angle, + end_angle, + segments, + color, + ) + } } /// Draw circle sector outline #[inline] fn draw_circle_sector_lines( &self, - center: Vector2, + center: impl Into, radius: f32, start_angle: f32, end_angle: f32, @@ -302,7 +330,14 @@ pub trait RaylibDraw { color: Color, ) { unsafe { - ffi::DrawCircleSectorLines(center, radius, start_angle, end_angle, segments, color) + ffi::DrawCircleSectorLines( + center.into(), + radius, + start_angle, + end_angle, + segments, + color, + ) } } @@ -321,8 +356,8 @@ pub trait RaylibDraw { /// Draws a color-filled circle (Vector version). #[inline] - fn draw_circle_v(&self, center: Vector2, radius: f32, color: Color) { - unsafe { ffi::DrawCircleV(center, radius, color) } + fn draw_circle_v(&self, center: impl Into, radius: f32, color: Color) { + unsafe { ffi::DrawCircleV(center.into(), radius, color) } } /// Draws circle outline. @@ -361,7 +396,7 @@ pub trait RaylibDraw { #[inline] fn draw_ring( &self, - center: Vector2, + center: impl Into, inner_radius: f32, outer_radius: f32, start_angle: f32, @@ -371,7 +406,7 @@ pub trait RaylibDraw { ) { unsafe { ffi::DrawRing( - center, + center.into(), inner_radius, outer_radius, start_angle, @@ -386,7 +421,7 @@ pub trait RaylibDraw { #[inline] fn draw_ring_lines( &self, - center: Vector2, + center: impl Into, inner_radius: f32, outer_radius: f32, start_angle: f32, @@ -396,7 +431,7 @@ pub trait RaylibDraw { ) { unsafe { ffi::DrawRingLines( - center, + center.into(), inner_radius, outer_radius, start_angle, @@ -415,8 +450,13 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle (Vector version). #[inline] - fn draw_rectangle_v(&self, position: Vector2, size: Vector2, color: Color) { - unsafe { ffi::DrawRectangleV(position, size, color) } + fn draw_rectangle_v( + &self, + position: impl Into, + size: impl Into, + color: Color, + ) { + unsafe { ffi::DrawRectangleV(position.into(), size.into(), color) } } /// Draws a color-filled rectangle from `rec`. @@ -427,8 +467,14 @@ pub trait RaylibDraw { /// Draws a color-filled rectangle with pro parameters. #[inline] - fn draw_rectangle_pro(&self, rec: Rectangle, origin: Vector2, rotation: f32, color: Color) { - unsafe { ffi::DrawRectanglePro(rec, origin, rotation, color) } + fn draw_rectangle_pro( + &self, + rec: Rectangle, + origin: impl Into, + rotation: f32, + color: Color, + ) { + unsafe { ffi::DrawRectanglePro(rec, origin.into(), rotation, color) } } /// Draws a vertical-gradient-filled rectangle. @@ -510,70 +556,79 @@ pub trait RaylibDraw { /// Draws a triangle. #[inline] - fn draw_triangle(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { - unsafe { ffi::DrawTriangle(v1, v2, v3, color) } + fn draw_triangle( + &self, + v1: impl Into, + v2: impl Into, + v3: impl Into, + color: Color, + ) { + unsafe { ffi::DrawTriangle(v1.into(), v2.into(), v3.into(), color) } } /// Draws a triangle using lines. #[inline] - fn draw_triangle_lines(&self, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) { - unsafe { ffi::DrawTriangleLines(v1, v2, v3, color) } + fn draw_triangle_lines( + &self, + v1: impl Into, + v2: impl Into, + v3: impl Into, + color: Color, + ) { + unsafe { ffi::DrawTriangleLines(v1.into(), v2.into(), v3.into(), color) } } /// Draw a triangle fan defined by points. #[inline] fn draw_triangle_fan(&self, points: &[Vector2], color: Color) { - unsafe { - ffi::DrawTriangleFan( - points.as_ptr() as *mut ffi::Vector2, - points.len() as i32, - color, - ) - } + unsafe { ffi::DrawTriangleFan(points.as_ptr() as *mut Vector2, points.len() as i32, color) } } /// Draw a triangle strip defined by points #[inline] fn draw_triangle_strip(&self, points: &[Vector2], color: Color) { unsafe { - ffi::DrawTriangleStrip( - points.as_ptr() as *mut ffi::Vector2, - points.len() as i32, - color, - ) + ffi::DrawTriangleStrip(points.as_ptr() as *mut Vector2, points.len() as i32, color) } } /// Draws a regular polygon of n sides (Vector version). #[inline] - fn draw_poly(&self, center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) { - unsafe { ffi::DrawPoly(center, sides, radius, rotation, color) } + fn draw_poly( + &self, + center: impl Into, + sides: i32, + radius: f32, + rotation: f32, + color: Color, + ) { + unsafe { ffi::DrawPoly(center.into(), sides, radius, rotation, color) } } /// Draws a regular polygon of n sides (Vector version). #[inline] fn draw_poly_lines( &self, - center: Vector2, + center: impl Into, sides: i32, radius: f32, rotation: f32, color: Color, ) { - unsafe { ffi::DrawPolyLines(center, sides, radius, rotation, color) } + unsafe { ffi::DrawPolyLines(center.into(), sides, radius, rotation, color) } } #[inline] fn draw_poly_lines_ex( &self, - center: Vector2, + center: impl Into, sides: i32, radius: f32, rotation: f32, line_thick: f32, color: Color, ) { - unsafe { ffi::DrawPolyLinesEx(center, sides, radius, rotation, line_thick, color) } + unsafe { ffi::DrawPolyLinesEx(center.into(), sides, radius, rotation, line_thick, color) } } /// Draws a `texture` using specified position and `tint` color. @@ -584,8 +639,13 @@ pub trait RaylibDraw { /// Draws a `texture` using specified `position` vector and `tint` color. #[inline] - fn draw_texture_v(&self, texture: impl AsRef, position: Vector2, tint: Color) { - unsafe { ffi::DrawTextureV(*texture.as_ref(), position, tint) } + fn draw_texture_v( + &self, + texture: impl AsRef, + position: impl Into, + tint: Color, + ) { + unsafe { ffi::DrawTextureV(*texture.as_ref(), position.into(), tint) } } /// Draws a `texture` with extended parameters. @@ -593,12 +653,12 @@ pub trait RaylibDraw { fn draw_texture_ex( &self, texture: impl AsRef, - position: Vector2, + position: impl Into, rotation: f32, scale: f32, tint: Color, ) { - unsafe { ffi::DrawTextureEx(*texture.as_ref(), position, rotation, scale, tint) } + unsafe { ffi::DrawTextureEx(*texture.as_ref(), position.into(), rotation, scale, tint) } } /// Draws from a region of `texture` defined by the `source_rec` rectangle. @@ -607,10 +667,10 @@ pub trait RaylibDraw { &self, texture: impl AsRef, source_rec: Rectangle, - position: Vector2, + position: impl Into, tint: Color, ) { - unsafe { ffi::DrawTextureRec(*texture.as_ref(), source_rec, position, tint) } + unsafe { ffi::DrawTextureRec(*texture.as_ref(), source_rec, position.into(), tint) } } ///Draws a texture (or part of it) that stretches or shrinks nicely @@ -620,7 +680,7 @@ pub trait RaylibDraw { texture: impl AsRef, n_patch_info: NPatchInfo, dest_rec: Rectangle, - origin: Vector2, + origin: impl Into, rotation: f32, tint: Color, ) { @@ -629,7 +689,7 @@ pub trait RaylibDraw { *texture.as_ref(), n_patch_info, dest_rec, - origin, + origin.into(), rotation, tint, ) @@ -655,7 +715,7 @@ pub trait RaylibDraw { &self, font: impl AsRef, text: &str, - position: Vector2, + position: impl Into, font_size: f32, spacing: f32, tint: Color, @@ -665,7 +725,7 @@ pub trait RaylibDraw { ffi::DrawTextEx( *font.as_ref(), c_text.as_ptr(), - position, + position.into(), font_size, spacing, tint, @@ -679,11 +739,11 @@ pub trait RaylibDraw { &self, font: impl AsRef, codepoint: i32, - position: Vector2, + position: impl Into, scale: f32, tint: Color, ) { - unsafe { ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position, scale, tint) } + unsafe { ffi::DrawTextCodepoint(*font.as_ref(), codepoint, position.into(), scale, tint) } } } @@ -830,8 +890,8 @@ pub trait RaylibDraw3D { /// Draws an X/Z plane. #[inline] - fn draw_plane(&self, center_pos: Vector3, size: Vector2, color: Color) { - unsafe { ffi::DrawPlane(center_pos, size, color) } + fn draw_plane(&self, center_pos: Vector3, size: impl Into, color: Color) { + unsafe { ffi::DrawPlane(center_pos, size.into(), color) } } /// Draws a ray line. @@ -943,9 +1003,9 @@ pub trait RaylibDraw3D { texture: &Texture2D, source_rec: Rectangle, center: Vector3, - size: Vector2, + size: impl Into, tint: Color, ) { - unsafe { ffi::DrawBillboardRec(camera, texture.0, source_rec, center, size, tint) } + unsafe { ffi::DrawBillboardRec(camera, texture.0, source_rec, center, size.into(), tint) } } } diff --git a/raylib/src/prelude.rs b/raylib/src/prelude.rs index 48ccfe8e..6c485425 100644 --- a/raylib/src/prelude.rs +++ b/raylib/src/prelude.rs @@ -13,5 +13,6 @@ Permission is granted to anyone to use this software for any purpose, including 3. This notice may not be removed or altered from any source distribution. */ -pub use crate::audio::RaylibAudio; +pub use crate::audio::{AudioSample, AudioStream, Music, RaylibAudio, Sound, Wave}; pub use crate::core::{drawing::*, init, RaylibBuilder, RaylibHandle, RaylibThread}; +pub use crate::ffi::{Color, Rectangle}; diff --git a/samples/3d_camera_first_person.rs b/samples/3d_camera_first_person.rs deleted file mode 100644 index 56314995..00000000 --- a/samples/3d_camera_first_person.rs +++ /dev/null @@ -1,86 +0,0 @@ -use arr_macro::arr; -use nalgebra::Vector3; -use rand::prelude::*; -use raylib::prelude::*; - -const WINDOW_WIDTH: i32 = 1280; -const WINDOW_HEIGHT: i32 = 720; - -struct Column { - height: f32, - position: Vector3, - color: Color, -} - -impl Column { - fn create_random() -> Column { - let mut rng = rand::thread_rng(); - let height: f32 = rng.gen_range(1.0, 12.0); - let position = Vector3::new( - rng.gen_range(-15.0, 15.0), - height / 2.0, - rng.gen_range(-15.0, 15.0), - ); - let color = Color::new(rng.gen_range(20, 255), rng.gen_range(10, 55), 30, 255); - - Column { - height, - position, - color, - } - } -} - -fn main() { - let (rl, thread) = raylib::init() - .size(WINDOW_WIDTH, WINDOW_HEIGHT) - .title("Hello, world!") - .build(); - - let mut camera = Camera3D::perspective( - Vector3::new(4.0, 2.0, 4.0), - Vector3::new(0.0, 1.8, 0.0), - Vector3::new(0.0, 1.0, 0.0), - 60.0, - ); - let columns: [Column; 20] = arr![Column::create_random(); 20]; - - rl.set_camera_mode(&camera, CameraMode::CAMERA_FIRST_PERSON); - rl.set_target_fps(60); - - while !rl.window_should_close() { - rl.update_camera(&mut camera); - - rl.frame(&thread, |d| { - d.clear_background(Color::DARKGREEN); - { - let d2 = d.begin_mode3D(camera); - - d2.draw_plane( - Vector3::new(0.0, 0.0, 0.0), - Vector2::new(32.0, 32.0), - Color::LIGHTGRAY, - ); - d2.draw_cube(Vector3::new(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::BLUE); - d2.draw_cube(Vector3::new(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, Color::LIME); - d2.draw_cube(Vector3::new(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, Color::GOLD); - - for column in columns.iter() { - d2.draw_cube(column.position, 2.0, column.height, 2.0, column.color); - d2.draw_cube_wires(column.position, 2.0, column.height, 2.0, Color::MAROON); - } - } - d.draw_rectangle(10, 10, 220, 70, Color::SKYBLUE); - d.draw_rectangle_lines(10, 10, 220, 70, Color::BLUE); - d.draw_text( - "First person camera default controls:", - 20, - 20, - 10, - Color::BLACK, - ); - d.draw_text("- Move with keys: W, A, S, D", 40, 40, 10, Color::DARKGRAY); - d.draw_text("- Mouse move to look around", 40, 60, 10, Color::DARKGRAY); - }); - } -} diff --git a/samples/Cargo.toml b/samples/Cargo.toml deleted file mode 100644 index 76b4cb45..00000000 --- a/samples/Cargo.toml +++ /dev/null @@ -1,90 +0,0 @@ -[package] -name = "raylib-examples" -version = "4.5.0" -authors = ["David Ayeke", "Teddy Astie"] -edition = "2021" -license = "Zlib" -readme = "../README.md" -repository = "https://github.com/deltaphc/raylib-rs" - - -[dependencies] -raylib = { version = "4.5", path = "../raylib" } -nalgebra = { version = "0.32", features = ["mint"] } -structopt = "0.2" -specs-derive = "0.4.1" -rand = "0.7" -tcod = "0.15" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -arr_macro = "0.1.3" - -[dependencies.specs] -version = "0.16.1" -default-features = false - -[[bin]] -name = "specs" -path = "./specs.rs" - -[[bin]] -name = "rgui" -path = "./rgui.rs" - -[[bin]] -name = "arkanoid" -path = "./arkanoid.rs" - -[[bin]] -name = "logo" -path = "./logo.rs" - - -[[bin]] -name = "camera2D" -path = "./camera2D.rs" - -[[bin]] -name = "raymarch" -path = "./raymarch.rs" - -[[bin]] -name = "font" -path = "./font.rs" - -[[bin]] -name = "drop" -path = "./drop.rs" - -[[bin]] -name = "texture" -path = "./texture.rs" - - -[[bin]] -name = "yaw_pitch_roll" -path = "yaw_pitch_roll.rs" - -[[bin]] -name = "roguelike" -path = "roguelike.rs" - -[[bin]] -name = "input" -path = "input.rs" - -[[bin]] -name = "3d_camera_first_person" -path = "3d_camera_first_person.rs" - -[[bin]] -name = "model_shader" -path = "model_shader.rs" - -[[bin]] -name = "extensions" -path = "extensions.rs" - -[[bin]] -name = "asteroids" -path = "./asteroids.rs" diff --git a/samples/README.md b/samples/README.md deleted file mode 100644 index 42329065..00000000 --- a/samples/README.md +++ /dev/null @@ -1,37 +0,0 @@ -cd into the samples folder before running samples! - -[arkanoid](arkanoid.rs) -![arkanoid](docs/arkanoid.PNG) - -[camera2D](camera2D.rs) -![camera2D](docs/camera2D.PNG) - -[font](font.rs) -![font](docs/font.PNG) - -[logo](logo.rs) -![logo](docs/logo.PNG) - -[raymarch](raymarch.rs) -![raymarch](docs/raymarch.PNG) - -[rgui](rgui.rs) -![rgui](docs/rgui.PNG) - -[specs](specs.rs) -![specs](docs/specs.PNG) - -[texture](texture.rs) -![texture](docs/texture.PNG) - -[3d_camera_first_person](3d_camera_first_person.rs) -![3d_camera_first_person](docs/3d_camera_first_person.PNG) - -[model_shader](model_shader.rs) -![model_shader](docs/model_shader.PNG) - -[roguelike](roguelike.rs) -![roguelike](docs/roguelike.PNG) - -[yaw_pitch_roll](yaw_pitch_roll.rs) -![yaw_pitch_roll](docs/yaw_pitch_roll.PNG) diff --git a/samples/Web.toml b/samples/Web.toml deleted file mode 100644 index da5af22f..00000000 --- a/samples/Web.toml +++ /dev/null @@ -1,22 +0,0 @@ -# The default value of `--target` used when building this crate -# in cases where it's not specified on the command line. -default-target = "wasm32-unknown-emscripten" - -# This will prepend a given JavaScript file to the resulting `.js` artifact. -# You can put any initialization code here which you'd like to have executed -# when your `.js` file first loads. -# -# This accepts either a string (as shown here), or an array of strings, -# in which case it will prepend all of the specified files in their -# order of appearance. -# prepend-js = "src/shell.js" - -[cargo-web] -# Asserts the minimum required version of `cargo-web` necessary -# to compile this crate; supported since 0.6.0. -minimum-version = "0.6.0" - -[target.emscripten] -# This will enable Emscripten's SDL2 port. Consult Emscripten's documentation -# for more details. -link-args = ["-s", "USE_GLFW=3", "-s", "ASSERTIONS=1", "-s", "ASYNCIFY=1", "--profiling"] diff --git a/samples/arkanoid.rs b/samples/arkanoid.rs deleted file mode 100644 index c5eb4233..00000000 --- a/samples/arkanoid.rs +++ /dev/null @@ -1,347 +0,0 @@ -extern crate raylib; -extern crate nalgebra; - -use nalgebra::Vector2; -use raylib::prelude::*; -use raylib::core::text::measure_text; -use raylib::ffi::{Color, Rectangle}; -use structopt::StructOpt; - -mod options; - -const PLAYER_MAX_LIFE: i32 = 5; -const LINES_OF_BRICKS: usize = 5; -const BRICKS_PER_LINE: usize = 20; - -#[derive(Default)] -struct Player { - pub position: Vector2, - pub size: Vector2, - pub life: i32, -} - -#[derive(Default)] -struct Ball { - position: Vector2, - speed: Vector2, - radius: i32, - active: bool, -} - -#[derive(Default)] -struct Brick { - position: Vector2, - active: bool, -} - -struct Game { - game_over: bool, - pause: bool, - player: Player, - ball: Ball, - bricks: Vec>, - brick_size: Vector2, -} - -impl Default for Game { - fn default() -> Game { - let game_over = false; - let pause = false; - - let player = Player::default(); - let ball = Ball::default(); - let mut bricks = Vec::new(); - for _ in 0..LINES_OF_BRICKS { - let mut v = Vec::new(); - for _ in 0..BRICKS_PER_LINE { - v.push(Brick::default()); - } - bricks.push(v); - } - let brick_size = Vector2::default(); - Game { - game_over, - pause, - player, - ball, - brick_size, - bricks, - } - } -} - -fn main() { - let opt = options::Opt::from_args(); - let (rl, thread) = opt.open_window("Arkanoid"); - - let (_w, _h) = (opt.width, opt.height); - - let _game_over = false; - let _pause = false; - - let mut game = Game::default(); - - init_game(&mut game, &rl); - - while !rl.window_should_close() { - update_game(&mut game, &rl); - rl.frame(&thread, |d| draw_game(&game, &rl, &d)); - } -} - -fn init_game(game: &mut Game, rl: &RaylibHandle) { - let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - game.brick_size = Vector2::new(rl.get_screen_width() as f32 / BRICKS_PER_LINE as f32, 40.0); - - // Initialize player - game.player.position = Vector2::new( - rl.get_screen_width() as f32 / 2.0, - rl.get_screen_height() as f32 * 7.0 / 8.0, - ); - game.player.size = Vector2::new(rl.get_screen_width() as f32 / 10.0, 20.0); - game.player.life = PLAYER_MAX_LIFE; - - // Initialize ball - game.ball.position = Vector2::new(w / 2.0, h * 7.0 / 7.0 - 30.0); - game.ball.speed = Vector2::default(); - game.ball.radius = 7; - game.ball.active = false; - - // Initialize bricks - let initial_down_position = 50.0; - - for i in 0..LINES_OF_BRICKS { - for j in 0..BRICKS_PER_LINE { - game.bricks[i][j].position = Vector2::new( - j as f32 * game.brick_size.x + game.brick_size.x / 2.0, - i as f32 * game.brick_size.y + initial_down_position, - ); - game.bricks[i][j].active = true; - } - } -} - -fn update_game(game: &mut Game, rl: &RaylibHandle) { - use raylib::ffi::KeyboardKey::*; - let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - - if !game.game_over { - if rl.is_key_pressed(KEY_P) { - game.pause = !game.pause; - } - - if !game.pause { - // player movement logic - if rl.is_key_down(KEY_LEFT) { - game.player.position.x -= 5.0; - } - if game.player.position.x - game.player.size.x / 2.0 <= 0.0 { - game.player.position.x = game.player.size.x / 2.0; - } - if rl.is_key_down(KEY_RIGHT) { - game.player.position.x += 5.0; - } - if game.player.position.x + game.player.size.x / 2.0 >= w { - game.player.position.x = w - game.player.size.x / 2.0; - } - - // Ball launching logic - if !game.ball.active { - if rl.is_key_pressed(KEY_SPACE) { - game.ball.active = true; - game.ball.speed = Vector2::new(0.0, -5.0); - } - } - - // Ball movement logic - if game.ball.active { - game.ball.position += game.ball.speed; - } else { - game.ball.position = Vector2::new(game.player.position.x, h * 7.0 / 8.0 - 30.0); - } - - // Collision logic: ball vs walls - if game.ball.position.x + game.ball.radius as f32 >= w - || game.ball.position.x - game.ball.radius as f32 <= 0.0 - { - game.ball.speed.x *= -1.0; - } - if game.ball.position.y - game.ball.radius as f32 <= 0.0 { - game.ball.speed.y *= -1.0; - } - if game.ball.position.y + game.ball.radius as f32 >= h { - game.ball.speed = Vector2::default(); - game.ball.active = false; - game.player.life -= 1; - } - - // Collision logic: ball vs player - let r = Rectangle::new( - game.player.position.x - game.player.size.x / 2.0, - game.player.position.y - game.player.size.y / 2.0, - game.player.size.x, - game.player.size.y, - ); - if r.check_collision_circle_rec(game.ball.position.into(), game.ball.radius as f32) { - if game.ball.speed.y > 0.0 { - game.ball.speed.y *= -1.0; - game.ball.speed.x = (game.ball.position.x - game.player.position.x) - / (game.player.size.x / 2.0) - * 5.0; - } - } - - // Collision logic: ball vs bricks - for i in 0..LINES_OF_BRICKS { - for j in 0..BRICKS_PER_LINE { - if game.bricks[i][j].active { - // Hit below - if (game.ball.position.y - game.ball.radius as f32 - <= game.bricks[i][j].position.y + game.brick_size.y / 2.0) - && (game.ball.position.y - game.ball.radius as f32 - > game.bricks[i][j].position.y - + game.brick_size.y / 2.0 - + game.ball.speed.y) - && ((game.ball.position.x - game.bricks[i][j].position.x).abs() - < game.brick_size.x / 2.0 + game.ball.radius as f32 * 2.0 / 3.0) - && game.ball.speed.y < 0.0 - { - game.bricks[i][j].active = false; - game.ball.speed.y *= -1.0; - } - // Hit above - else if game.ball.position.y + game.ball.radius as f32 - >= game.bricks[i][j].position.y - game.brick_size.y / 2.0 - && (game.ball.position.y + game.ball.radius as f32) - .partial_cmp( - &(game.bricks[i][j].position.y - game.brick_size.y / 2.0 - + game.ball.speed.y), - ) - .unwrap() - == std::cmp::Ordering::Less - && (game.ball.position.x - game.bricks[i][j].position.x).abs() - < game.brick_size.x / 2.0 + game.ball.radius as f32 * 2.0 / 3.0 - && game.ball.speed.y > 0.0 - { - game.bricks[i][j].active = false; - game.ball.speed.y *= -1.0; - } - // Hit Left - else if ((game.ball.position.x + game.ball.radius as f32) - >= (game.bricks[i][j].position.x - game.brick_size.x / 2.0)) - && ((game.ball.position.x + game.ball.radius as f32) - < (game.bricks[i][j].position.x - game.brick_size.x / 2.0 - + game.ball.speed.x)) - && (((game.ball.position.y - game.bricks[i][j].position.y).abs()) - < (game.brick_size.y / 2.0 + game.ball.radius as f32 * 2.0 / 3.0)) - && (game.ball.speed.x > 0.0) - { - game.bricks[i][j].active = false; - game.ball.speed.x *= -1.0; - } - // Hit right - else if ((game.ball.position.x - game.ball.radius as f32) - <= (game.bricks[i][j].position.x + game.brick_size.x / 2.0)) - && ((game.ball.position.x - game.ball.radius as f32) - > (game.bricks[i][j].position.x - + game.brick_size.x / 2.0 - + game.ball.speed.x)) - && (((game.ball.position.y - game.bricks[i][j].position.y).abs()) - < (game.brick_size.y / 2.0 + game.ball.radius as f32 * 2.0 / 3.0)) - && (game.ball.speed.x < 0.0) - { - game.bricks[i][j].active = false; - game.ball.speed.x *= -1.0; - } - } - } - } - - // Game over life - if game.player.life <= 0 { - game.game_over = true; - } else { - game.game_over = true; - for i in 0..LINES_OF_BRICKS { - for j in 0..BRICKS_PER_LINE { - if game.bricks[i][j].active { - game.game_over = false; - } - } - } - } - } - } else { - if rl.is_key_pressed(KEY_ENTER) { - init_game(game, rl); - game.game_over = false; - } - } -} - -fn draw_game(game: &Game, rl: &RaylibHandle, d: &RaylibDrawHandle) { - let (w, h) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - - d.clear_background(Color::RAYWHITE); - if !game.game_over { - // Draw player bar - d.draw_rectangle( - (game.player.position.x - game.player.size.x / 2.0) as i32, - (game.player.position.y - game.player.size.y / 2.0) as i32, - game.player.size.x as i32, - game.player.size.y as i32, - Color::BLACK, - ); - - // Draw player lives - for i in 0..game.player.life { - d.draw_rectangle(20 + 30 * i, h as i32 - 30, 35, 10, Color::LIGHTGRAY); - } - - // Draw ball - d.draw_circle_v(game.ball.position.into(), game.ball.radius as f32, Color::MAROON); - - // Draw bricks - for i in 0..LINES_OF_BRICKS { - for j in 0..BRICKS_PER_LINE { - if game.bricks[i][j].active { - if (i + j) % 2 == 0 { - d.draw_rectangle( - (game.bricks[i][j].position.x - game.brick_size.x / 2.0) as i32, - (game.bricks[i][j].position.y - game.brick_size.y / 2.0) as i32, - game.brick_size.x as i32, - game.brick_size.y as i32, - Color::GRAY, - ); - } else { - d.draw_rectangle( - (game.bricks[i][j].position.x - game.brick_size.x / 2.0) as i32, - (game.bricks[i][j].position.y - game.brick_size.y / 2.0) as i32, - game.brick_size.x as i32, - game.brick_size.y as i32, - Color::DARKGRAY, - ); - } - } - } - } - - if game.pause { - d.draw_text( - "Game Pause", - (w / 2.0) as i32 - measure_text("Game Paused", 40) / 2, - (h / 2.0 - 40.0) as i32, - 40, - Color::GRAY, - ); - } - } else { - d.draw_text( - "PRESS [ENTER] TO PLAY AGAIN", - (w / 2.0) as i32 - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20) / 2, - (h / 2.0) as i32 - 50, - 20, - Color::GRAY, - ); - } -} diff --git a/samples/asteroids.rs b/samples/asteroids.rs deleted file mode 100644 index 7fa47fce..00000000 --- a/samples/asteroids.rs +++ /dev/null @@ -1,644 +0,0 @@ -extern crate raylib; -use nalgebra::{Vector2, Vector3}; -use raylib::{ - core::{ - collision::check_collision_circles, drawing::RaylibDraw, text::measure_text, RaylibHandle, - RaylibThread, - }, - ffi::{Color, KeyboardKey}, -}; - -use structopt::StructOpt; - -mod options; - -struct Game { - game_over: bool, - pause: bool, - victory: bool, - player: Player, - big_meteors: Vec, - medium_meteors: Vec, - small_meteors: Vec, - shots: Vec, - destroyed_meteor_count: u32, - medium_meteor_count: u32, - small_meteor_count: u32, -} - -#[derive(Default)] -struct Player { - position: Vector2, - speed: Vector2, - acceleration: f32, - rotation: f32, - collider: Vector3, - color: Color, -} - -#[derive(Default)] -struct Meteor { - position: Vector2, - speed: Vector2, - radius: f32, - active: bool, - color: Color, -} - -#[derive(Default)] -struct Shoot { - position: Vector2, - speed: Vector2, - radius: f32, - rotation: f32, - life_spawn: u8, - active: bool, - color: Color, -} - -impl Default for Game { - fn default() -> Game { - let game_over = false; - let pause = false; - let victory = false; - - let player = Player::default(); - let mut big_meteors = Vec::new(); - for _ in 0..MAX_BIG_METEORS { - big_meteors.push(Meteor::default()); - } - let mut medium_meteors = Vec::new(); - for _ in 0..MAX_MEDIUM_METEORS { - medium_meteors.push(Meteor::default()); - } - let mut small_meteors = Vec::new(); - for _ in 0..MAX_SMALL_METEORS { - small_meteors.push(Meteor::default()); - } - let mut shots = Vec::new(); - for _ in 0..MAX_SHOTS { - shots.push(Shoot::default()); - } - - let destroyed_meteor_count = 0; - let medium_meteor_count = 0; - let small_meteor_count = 0; - - Game { - game_over, - pause, - victory, - player, - big_meteors, - medium_meteors, - small_meteors, - shots, - destroyed_meteor_count, - medium_meteor_count, - small_meteor_count, - } - } -} - -const SHIP_HEIGHT: f32 = 10f32 / 0.363970f32; -const PLAYER_SPEED: f32 = 6f32; -const MAX_BIG_METEORS: usize = 4; -const MAX_MEDIUM_METEORS: usize = 8; -const MAX_SMALL_METEORS: usize = 16; -const METEORS_SPEED: f32 = 2f32; -const MAX_SHOTS: usize = 10; - -fn main() { - let opt = options::Opt::from_args(); - let (rl, thread) = opt.open_window("Asteroids"); - let (_w, _h) = (opt.width, opt.height); - - let _game_over = false; - let _pause = false; - - let mut game = Game::default(); - - init_game(&mut game, &rl); - - while !rl.window_should_close() { - update_game(&mut game, &rl); - draw_game(&game, &rl, &thread); - } -} - -fn init_game(game: &mut Game, rl: &RaylibHandle) { - let (width, height) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - let half_width = width / 2.0; - let half_height = height / 2.0; - - game.player.position = Vector2::new(half_width, half_height - (SHIP_HEIGHT / 2f32)); - game.player.acceleration = 0f32; - game.player.collider = Vector3::new( - game.player.position.x + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), - game.player.position.y - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), - 12f32, - ); - game.player.color = Color::MAROON; - - game.destroyed_meteor_count = 0; - game.medium_meteor_count = 0; - game.small_meteor_count = 0; - - for shot in &mut game.shots { - shot.position = Vector2::default(); - shot.speed = Vector2::default(); - shot.radius = 2f32; - shot.active = false; - shot.life_spawn = 0; - shot.color = Color::BLACK; - } - - let mut correct_range = false; - - for meteor in &mut game.big_meteors { - let mut x: i32 = rl.get_random_value(0, width as i32); - - while !correct_range { - if x > half_width as i32 - 150 && x < half_width as i32 + 150 { - x = rl.get_random_value(0, width as i32); - } else { - correct_range = true; - } - } - - correct_range = false; - - let mut y: i32 = rl.get_random_value(0, height as i32); - - while !correct_range { - if y > half_height as i32 - 150 && y < half_height as i32 + 150 { - y = rl.get_random_value(0, height as i32); - } else { - correct_range = true; - } - } - - correct_range = false; - - let mut vel_x: i32 = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - let mut vel_y: i32 = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - - while !correct_range { - if vel_x == 0 && vel_y == 0 { - vel_x = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - vel_y = rl.get_random_value(-METEORS_SPEED as i32, METEORS_SPEED as i32); - } else { - correct_range = true; - } - } - - meteor.position = Vector2::new(x as f32, y as f32); - meteor.speed = Vector2::new(vel_x as f32, vel_y as f32); - meteor.radius = 40f32; - meteor.active = true; - meteor.color = Color::BLUE; - } - - for meteor in &mut game.medium_meteors { - meteor.position = Vector2::new(-100f32, -100f32); - meteor.speed = Vector2::default(); - meteor.radius = 20f32; - meteor.active = false; - meteor.color = Color::BLUE; - } - - for meteor in &mut game.small_meteors { - meteor.position = Vector2::new(-100f32, -100f32); - meteor.speed = Vector2::default(); - meteor.radius = 10f32; - meteor.active = false; - meteor.color = Color::BLUE; - } -} - -fn update_game(game: &mut Game, rl: &RaylibHandle) { - if !game.game_over { - if rl.is_key_pressed(KeyboardKey::KEY_P) { - game.pause = !game.pause; - } - - if !game.pause { - if rl.is_key_down(KeyboardKey::KEY_LEFT) { - game.player.rotation -= 5f32; - } - if rl.is_key_down(KeyboardKey::KEY_RIGHT) { - game.player.rotation += 5f32; - } - - game.player.speed.x = game.player.rotation.to_radians().sin() * PLAYER_SPEED; - game.player.speed.y = game.player.rotation.to_radians().cos() * PLAYER_SPEED; - - if rl.is_key_down(KeyboardKey::KEY_UP) { - if game.player.acceleration < 1f32 { - game.player.acceleration += 0.04; - } - } else { - if game.player.acceleration > 0f32 { - game.player.acceleration -= 0.02; - } else if game.player.acceleration < 0f32 { - game.player.acceleration = 0f32; - } - } - - if rl.is_key_down(KeyboardKey::KEY_DOWN) { - if game.player.acceleration > 0f32 { - game.player.acceleration -= 0.04; - } else if game.player.acceleration < 0f32 { - game.player.acceleration = 0f32; - } - } - - game.player.position.x += game.player.speed.x * game.player.acceleration; - game.player.position.y -= game.player.speed.y * game.player.acceleration; - - let (width, height) = (rl.get_screen_width() as f32, rl.get_screen_height() as f32); - - if game.player.position.x > width + SHIP_HEIGHT { - game.player.position.x = -SHIP_HEIGHT; - } else if game.player.position.x < -SHIP_HEIGHT { - game.player.position.x = width + SHIP_HEIGHT; - } - - if game.player.position.y > height + SHIP_HEIGHT { - game.player.position.y = -SHIP_HEIGHT; - } else if game.player.position.y < -SHIP_HEIGHT { - game.player.position.y = height + SHIP_HEIGHT; - } - - if rl.is_key_pressed(KeyboardKey::KEY_SPACE) { - for shot in &mut game.shots { - if !shot.active { - shot.position = Vector2::new( - game.player.position.x - + game.player.rotation.to_radians().sin() * SHIP_HEIGHT, - game.player.position.y - - game.player.rotation.to_radians().cos() * SHIP_HEIGHT, - ); - shot.active = true; - shot.speed.x = 1.5 * game.player.rotation.to_radians().sin() * PLAYER_SPEED; - shot.speed.y = 1.5 * game.player.rotation.to_radians().cos() * PLAYER_SPEED; - shot.rotation = game.player.rotation; - break; - } - } - } - - for shot in &mut game.shots { - if shot.active { - shot.life_spawn += 1; - - shot.position.x += shot.speed.x; - shot.position.y -= shot.speed.y; - - if shot.position.x > width + shot.radius { - shot.active = false; - shot.life_spawn = 0; - } else if shot.position.x < -shot.radius { - shot.active = false; - shot.life_spawn = 0; - } - - if shot.position.y > height + shot.radius { - shot.active = false; - shot.life_spawn = 0; - } else if shot.position.y < -shot.radius { - shot.active = false; - shot.life_spawn = 0; - } - - if shot.life_spawn >= 60 { - shot.position = Vector2::default(); - shot.speed = Vector2::default(); - shot.life_spawn = 0; - shot.active = false; - } - - for meteor in &mut game.big_meteors { - if meteor.active - && check_collision_circles( - shot.position.into(), - shot.radius, - meteor.position.into(), - meteor.radius, - ) - { - shot.active = false; - shot.life_spawn = 0; - - meteor.active = false; - game.destroyed_meteor_count += 1; - - for _ in 0..2 { - if game.medium_meteor_count % 2 == 0 { - game.medium_meteors[game.medium_meteor_count as usize] - .position = - Vector2::new(meteor.position.x, meteor.position.y); - game.medium_meteors[game.medium_meteor_count as usize].speed = - Vector2::new( - shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, - shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0, - ); - } else { - game.medium_meteors[game.medium_meteor_count as usize] - .position = - Vector2::new(meteor.position.x, meteor.position.y); - game.medium_meteors[game.medium_meteor_count as usize].speed = - Vector2::new( - shot.rotation.to_radians().cos() * METEORS_SPEED, - shot.rotation.to_radians().sin() * METEORS_SPEED, - ); - } - - game.medium_meteors[game.medium_meteor_count as usize].active = - true; - game.medium_meteor_count += 1; - } - - break; - } - } - - for meteor in &mut game.medium_meteors { - if meteor.active - && check_collision_circles( - shot.position.into(), - shot.radius, - meteor.position.into(), - meteor.radius, - ) - { - shot.active = false; - shot.life_spawn = 0; - - meteor.active = false; - game.destroyed_meteor_count += 1; - - for _ in 0..2 { - if game.small_meteor_count % 2 == 0 { - game.small_meteors[game.small_meteor_count as usize].position = - Vector2::new(meteor.position.x, meteor.position.y); - game.small_meteors[game.small_meteor_count as usize].speed = - Vector2::new( - shot.rotation.to_radians().cos() * METEORS_SPEED * -1.0, - shot.rotation.to_radians().sin() * METEORS_SPEED * -1.0, - ); - } else { - game.small_meteors[game.small_meteor_count as usize].position = - Vector2::new(meteor.position.x, meteor.position.y); - game.small_meteors[game.small_meteor_count as usize].speed = - Vector2::new( - shot.rotation.to_radians().cos() * METEORS_SPEED, - shot.rotation.to_radians().sin() * METEORS_SPEED, - ); - } - - game.small_meteors[game.small_meteor_count as usize].active = true; - game.small_meteor_count += 1; - } - - break; - } - } - - for meteor in &mut game.small_meteors { - if meteor.active - && check_collision_circles( - shot.position.into(), - shot.radius, - meteor.position.into(), - meteor.radius, - ) - { - shot.active = false; - shot.life_spawn = 0; - - meteor.active = false; - game.destroyed_meteor_count += 1; - - break; - } - } - } - } - - game.player.collider = Vector3::new( - game.player.position.x - + game.player.rotation.to_radians().sin() * (SHIP_HEIGHT / 2.5), - game.player.position.y - - game.player.rotation.to_radians().cos() * (SHIP_HEIGHT / 2.5), - 12f32, - ); - - for meteor in &game.big_meteors { - if meteor.active - && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y).into(), - game.player.collider.z, - meteor.position.into(), - meteor.radius, - ) - { - game.game_over = true; - } - } - - for meteor in &game.medium_meteors { - if meteor.active - && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y).into(), - game.player.collider.z, - meteor.position.into(), - meteor.radius, - ) - { - game.game_over = true; - } - } - - for meteor in &game.small_meteors { - if meteor.active - && check_collision_circles( - Vector2::new(game.player.collider.x, game.player.collider.y).into(), - game.player.collider.z, - meteor.position.into(), - meteor.radius, - ) - { - game.game_over = true; - } - } - - for meteor in &mut game.big_meteors { - if meteor.active { - meteor.position.x += meteor.speed.x; - meteor.position.y += meteor.speed.y; - - if meteor.position.x > width + meteor.radius { - meteor.position.x = -meteor.radius; - } else if meteor.position.x < 0f32 - meteor.radius { - meteor.position.x = width + meteor.radius; - } - - if meteor.position.y > height + meteor.radius { - meteor.position.y = -meteor.radius; - } else if meteor.position.y < 0f32 - meteor.radius { - meteor.position.y = height + meteor.radius; - } - } - } - - for meteor in &mut game.medium_meteors { - if meteor.active { - meteor.position.x += meteor.speed.x; - meteor.position.y += meteor.speed.y; - - if meteor.position.x > width + meteor.radius { - meteor.position.x = -meteor.radius; - } else if meteor.position.x < 0f32 - meteor.radius { - meteor.position.x = width + meteor.radius; - } - - if meteor.position.y > height + meteor.radius { - meteor.position.y = -meteor.radius; - } else if meteor.position.y < 0f32 - meteor.radius { - meteor.position.y = height + meteor.radius; - } - } - } - - for meteor in &mut game.small_meteors { - if meteor.active { - meteor.position.x += meteor.speed.x; - meteor.position.y += meteor.speed.y; - - if meteor.position.x > width + meteor.radius { - meteor.position.x = -meteor.radius; - } else if meteor.position.x < 0f32 - meteor.radius { - meteor.position.x = width + meteor.radius; - } - - if meteor.position.y > height + meteor.radius { - meteor.position.y = -meteor.radius; - } else if meteor.position.y < 0f32 - meteor.radius { - meteor.position.y = height + meteor.radius; - } - } - } - } - - if game.destroyed_meteor_count - == MAX_BIG_METEORS as u32 + MAX_MEDIUM_METEORS as u32 + MAX_SMALL_METEORS as u32 - { - game.victory = true; - } - } else { - if rl.is_key_pressed(KeyboardKey::KEY_ENTER) { - init_game(game, rl); - game.game_over = false; - } - } -} - -fn draw_game(game: &Game, rl: &RaylibHandle, thread: &RaylibThread) { - let (width, height) = (rl.get_screen_width() as i32, rl.get_screen_height() as i32); - - rl.frame(thread, |d| { - let half_width = width / 2; - let half_height = height / 2; - - d.clear_background(Color::RAYWHITE); - - if !game.game_over { - let cosf = f32::cos(game.player.rotation.to_radians()); - let sinf = f32::sin(game.player.rotation.to_radians()); - let v1 = Vector2::new( - game.player.position.x + sinf * SHIP_HEIGHT, - game.player.position.y - cosf * SHIP_HEIGHT, - ); - let v2 = Vector2::new( - game.player.position.x - cosf * 10f32, - game.player.position.y - sinf * 10f32, - ); - let v3 = Vector2::new( - game.player.position.x + cosf * 10f32, - game.player.position.y + sinf * 10f32, - ); - d.draw_triangle(v1.into(), v2.into(), v3.into(), game.player.color); - - for meteor in &game.big_meteors { - if meteor.active { - d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); - } else { - d.draw_circle_v( - meteor.position.into(), - meteor.radius, - Color::fade(&Color::LIGHTGRAY, 0.3), - ); - } - } - - for meteor in &game.medium_meteors { - if meteor.active { - d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); - } else { - d.draw_circle_v( - meteor.position.into(), - meteor.radius, - Color::fade(&Color::LIGHTGRAY, 0.3), - ); - } - } - - for meteor in &game.small_meteors { - if meteor.active { - d.draw_circle_v(meteor.position.into(), meteor.radius, meteor.color); - } else { - d.draw_circle_v( - meteor.position.into(), - meteor.radius, - Color::fade(&Color::LIGHTGRAY, 0.3), - ); - } - } - - for shot in &game.shots { - if shot.active { - d.draw_circle_v(shot.position.into(), shot.radius, shot.color); - } - } - - if game.victory { - d.draw_text( - "VICTORY", - half_width - measure_text("VICTORY", 20), - half_height, - 20, - Color::LIGHTGRAY, - ); - } - - if game.pause { - d.draw_text( - "GAME PAUSED", - half_width - measure_text("GAME PAUSED", 40), - half_height - 40, - 40, - Color::GRAY, - ); - } - } else { - d.draw_text( - "PRESS [ENTER] TO PLAY AGAIN", - half_width - measure_text("PRESS [ENTER] TO PLAY AGAIN", 20) / 2, - half_height - 50, - 20, - Color::GRAY, - ); - } - }) -} diff --git a/samples/camera2D.rs b/samples/camera2D.rs deleted file mode 100644 index 897d9a04..00000000 --- a/samples/camera2D.rs +++ /dev/null @@ -1,130 +0,0 @@ -#![allow(non_snake_case)] -use nalgebra::Vector2; -use raylib::{ - ffi::{Color, Rectangle, Camera2D}, - prelude::*, -}; -use structopt::StructOpt; - -mod options; - -const MAX_BUILDINGS: usize = 100; - -fn main() { - use raylib::ffi::KeyboardKey::*; - let opt = options::Opt::from_args(); - let (rl, thread) = opt.open_window("Camera 2D"); - let (w, h) = (opt.width, opt.height); - - let mut player = Rectangle::new(400.0, 280.0, 40.0, 40.0); - let mut buildings = Vec::with_capacity(MAX_BUILDINGS); - let mut build_colors = Vec::with_capacity(MAX_BUILDINGS); - let mut spacing = 0.0; - - for i in 0..MAX_BUILDINGS { - let bh: i32 = rl.get_random_value(100, 800); - buildings.push(Rectangle::new( - -6000.0 + spacing, - (h - 130 - bh) as f32, - rl.get_random_value::(50, 200) as f32, - bh as f32, - )); - - spacing += buildings[i].width; - build_colors.push(Color::new( - rl.get_random_value::(200, 240) as u8, - rl.get_random_value::(200, 240) as u8, - rl.get_random_value::(200, 240) as u8, - 255, - )); - } - - let mut camera = Camera2D { - target: Vector2::new(player.x + 20.0, player.y + 20.0).into(), - // offset: Vector2::new(player.x, player.y), - offset: Vector2::new(0.0, 0.0).into(), - rotation: 0.0, - zoom: 1.0, - }; - - while !rl.window_should_close() { - if rl.is_key_down(KEY_RIGHT) { - player.x += 2.0; - camera.offset.x -= 2.0; - } else if rl.is_key_down(KEY_LEFT) { - player.x -= 2.0; - camera.offset.x += 2.0; - } - - // Camera follows player - camera.target = Vector2::new(player.x + 20.0, player.y + 20.0).into(); - - // Camera rotation controls - if rl.is_key_down(KEY_A) { - camera.rotation -= 1.0; - } else if rl.is_key_down(KEY_S) { - camera.rotation += 1.0; - } - - // Limit camera rotation to 80 degrees - camera.rotation = camera.rotation.max(-40.0).min(40.0); - - // zoom controls - camera.zoom += rl.get_mouse_wheel_move() as f32 * 0.05; - camera.zoom = camera.zoom.max(0.1).min(3.0); - - if rl.is_key_pressed(KEY_R) { - camera.zoom = 1.0; - camera.rotation = 0.0; - } - - rl.frame(&thread, |d| { - d.clear_background(Color::RAYWHITE); - d.mode_camera_2d(&camera, || { - d.draw_rectangle(-6000, 320, 13000, 8000, Color::DARKGRAY); - - for i in 0..MAX_BUILDINGS { - d.draw_rectangle_rec(buildings[i], build_colors[i]); - } - d.draw_rectangle_rec(player, Color::RED); - - d.draw_line( - camera.target.x as i32, - -h * 10, - camera.target.x as i32, - h * 10, - Color::GREEN, - ); - d.draw_line( - -w * 10, - camera.target.y as i32, - w * 10, - camera.target.y as i32, - Color::GREEN, - ); - }); - - d.draw_text("SCREEN AREA", 640, 10, 20, Color::RED); - - d.draw_rectangle(0, 0, w, 5, Color::RED); - d.draw_rectangle(0, 5, 5, h - 10, Color::RED); - d.draw_rectangle(w - 5, 5, 5, h - 10, Color::RED); - d.draw_rectangle(0, h - 5, w, 5, Color::RED); - - d.draw_rectangle(10, 10, 250, 113, Color::SKYBLUE.fade(0.5)); - d.draw_rectangle_lines(10, 10, 250, 113, Color::BLUE); - - d.draw_text("Free 2d camera controls:", 20, 20, 10, Color::BLACK); - d.draw_text("- Right/Left to move Offset", 40, 40, 10, Color::DARKGRAY); - d.draw_text("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color::DARKGRAY); - d.draw_text("- A / S to Rotate", 40, 80, 10, Color::DARKGRAY); - d.draw_text( - "- R to reset Zoom and Rotation", - 40, - 100, - 10, - Color::DARKGRAY, - ); - }); - } -} diff --git a/samples/docs/3d_camera_first_person.PNG b/samples/docs/3d_camera_first_person.PNG deleted file mode 100644 index 89235fc67fef908180f30f744251dd04367409a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33157 zcmb@uXIN8N+c3I85X2V8jG`i-*rG7VC?ZG*s7OoTgBG_eIJkQk`Ag}}@i6_1&`R9sEcOI9!a84Wd zM%7~{C0+B{<2!e2yUblx4^xtE|AKu)*;e1Hx$I8Gx<#*&1|z0-yPmI2T)&}F^^AdY z=>@COt+=5J#`mNC>{`4`A?c|7fdRf@w{YSa!+X;1>SSkM?sJXY(GQdSJaNSg4bKzK zgfj(y(gno~QEGdN$_=j5%`G!_R2mV4L8obe2Vue7-4_ zjM!C4{nDz(G15+2tdwey7Cxs-oV{Hwd}fE4S&Iu9Pmy$u+^qg`+ZH3*j^WR|B1%q^ zz#MV(+G-|!E@yxk+Rm1Yt{wiV)0?L^Qi2a}ri*zr44+Ks9I*+XOst;iri)HWQ`%2U zDx_mG#5s(FOco2SN(#zIlC%MFX}fg7w}wCCQT>HMuKvgnRkZufkJoVDd)ItgO6(b7 zNUzgFXBk57Bz|5acsQG}t47EQn;5}JUJ+;BvsoBoa}95UiNI+CSg1!Wkw@ zQrWH{WX^Q+$;x>|jpM@Gi|!t2)(M@Je-A?>-< zpO4YXh#zQx7iSah%rD>>{5V|rOwdT@Weo_uZRyfaWWmc`YG}U6wyG-(>6eEF8L*}~ z&xkHHvqFOx(=#D8(_C^kM(SKM5om{-F~@}o?~7AO>`zX=e*?#k zE`DGaJkGHt&;IE$H&2vK-n=%S(M}H?_ee9D)M0V`3<>=nRkIKATdS^I;RKeA=lkKE zQ$0-l2)Tj%*MJIfQVvlJSSQZ!l1ixLILw3%PLPD-dJ}!a#`O-(wuuXg)uRT)>6$>{ zy@C1J_8yn%gfdBg`{dj?zXOD6KWQIrKwKjw(8|OlT`@(Nq&xR=U{%c<^<`&P<3#m1 z(U^%2PDsTGn^K7Fe(Oa>jY*+IX;-Xx?%9qxZRPbh&a3|OQ#4?2HZ_EqImD1;rE6aN z?#X%80~$Xna4=eucnz_hS?lg)um1U&HQA}ml(x8v{Zv$<{(%M{7jXf=Lj(K|?Z7sM zqSC)dc7BX-0wL;O8UFdbRLSkXKwbeL!w2!z{P)Ct|3&4S77N9?NlC4et%l^S#SO(e zKRmmPEcufq>U>wtn+)$6kqPw=y4%0#f3rR_YH+@W^PDW6R9>MHg_B;b7R)@34Ie9* zoR`F6xW@)&C)y1peQZhNRnd4mL)63w`Q)jiIwC|dSF6}F zy3$S}rn^ik2F_lGnNuRq?fjP%-dzd%d`M$GrEEHx^j0c;w~K@i6!s`Fk%`}aKIKP(I-yMG)QmzVZ?vbNPKA;!pG$O;!Lt&q@BpU zj}bI6L^F0|$w!0msYml>Q_i-2gl2YX^~VOxbc0=tGdFSQi~Ef*(Y>Mm>9ZPqXJGi> zQ}(7qZ_6xCRe_Tvv5*c)t&B_Y^kW-;R2UGG_$Kp2?Vq)ktLLj|8scf9e`pU`nAM&b z_Q@bMd=fX;L(>(H(lLbhI1s1!L}@HJe3&ME-fk!Pizsd~R1W8rg_|P6JkM&B{mYQ1 z->Ux5>~y0fLF;It(_5hysOmj}DX1K?;hK-R5+oiJ%$;0-wQUTqF zFnwBF;b8_MXvb}{DS9=#idG}3tI<`i-dhmsjM)2~H3nZ;w!|ZU$f+@49i%I*;svi! zsNwd}fWh#WEsYwO{X=tZSXVmQPM>!t&dzL*%#ck860&qPaPfM~?8^a!v2^<@B1fs3 zH**&wI_4WS7)z`l33TBmdq|sSyiL}%7QE`tk0myb@8{KYR)-G`<6;KL}^HGYT$=QH0Qir@$c?-@pb&rgqCNRvn@F3ym=me z&CpLKn7gN|hrL_K$8pj?6ZYzXOcSwal3zW+WwnsGB8DJ%lv6eJjL>pAwT1l4cXnMg z`!;R(7xdjta=ry`nO+^!K^qi^LuB!4+Q7_7>Bz`Z=_K*5nR?v3Mq2p%z}&U9#6we^ znsWovT%w@q75Fmh_X*9-D>!FS))-5i_Uo&fGk{(_VF(T<%_o#qe+jDoBw}k|2=(k` zf=U*qp>z5LLi`hE_90z*>R)a@6ko*C433H9F&c?}=xs`M2GRk^=aDkWLrj>^mpG0w z7WYif)ue{A1|%5t(kP7BK}x#Equ@&6CnIj!;NXzkiMx2 z5Z)gUv22OL8ew<)=`ao}wVID74xW)23LpU!Bz#X6Z>Nz3kI0@=HJcoz;R5myse#w< zVs4teEW+U0$J;{<9L(}+q22WXA(KlaogM0DRf#0}mo)4MeQTwGpJ}np|Af6ylT()`%STIuNvGT|BSe*S=>f*aew~5o zv`KUo2R(@qSAkG?T~IU2k`9k(NL~@={-8gd2o_>C?)whd?mL8-cV<&K(QV?i_E_h@ z?1oGen#oo12fv|p-$$l~jhWZ}oh?**HvU)sP`jx7FKylkNZ<7Dg!U%##=nBkc~zzL z|GxmyRjgx)p3{{;9S^Oao0oEN;le)*BriRFk`j(ZX~M%ze;K{uAruus%@09Ib@_8; zSCB{rIq)UDh?X&sY=0a9HVjb28|=* z_vCvW5@No7o3iY3{u$(2cwVb%wBI3LEoBKFvs8O)-!(8~YJd&i;GMl=?l>Zh^W3(! zNdYF}vvXry*8f$!q2Ii%3y-nx^CP)N>gp&8zFg5Z?mA}+f#yd zQ9iXIBVAKDZ8gkBIwnx+QRNXBreTIK+72^dic5%&G)Mft=m*(zUDVU&>>y-V&HPM!Y}jGM@9Iln&RTDlxDB4k zoy6b~Va?tytJ84LC3Bmy!qwY#0$Oxy8t$>m>-ovtV3~wJABy(2={|ut%8hmWdChdM z1N((b%>$ERR3h1c=Y90uM|^Y03mMyae&aP8gP9-qpIRQpW{r|rH(JOw%#y~~3Q zMoP`5U~zYd1pEly>F0<|pV%%o8pJE&B6jQnDfi3JL^JNW0dd@z$RV?S!qtEWe3PHV zf-l^b0=6!O-TjGGDJtg(II&ij2u*R{@McQH-GUMnU~TyF3jEgVHO?*M`_B1KQ#rAQ z#NH|ahhe8dHkln0x-&EqCE~VEEL9tXf@{vHY28%{auHgVdie$p8G~bH{yMQoRNn+t zv$d4vcfU?ucwCk8LpSs1Sw}^)WPjNcf8UY0#MBz1c+W;HsFq2MV?NWf_b)R;%pOE2 z>@N)z9Z)KFNsXmR9>r{cTpO{6Ip@%cQ~|K)7GTj00V{~?F6OgF_oJAlQ0=L^OT4Sr zg^opOUbaOjbkPFmo-gxu{w<_;gbi#d2iaPB!SZistu^s6lxzjoTWE2}t$U3zFHkwE z)zA##il1F0z1K*lOVDXbP=rp%&J5rGIACrsxTx^dO6SCYu^m4VhlTvhmmsKg%k^hE z&)5F#@U5|#Z)%)>VwfA@AjmmDm*o3CpKP;0DrbK~P2=bK+dnam8Qla={dXmgn+pXB zvPiMJ1}62a@%Wc8Dpv(6RAd$T_$iomX__I@b*AZQje(9*Qi}m(${1ZYY?Ltmj>kYL zA7m?-MU0HrvB!SC@b1m0kbI&Y3&aqQ#CV^{(U5V`fx@Ji+x>~-k;rBJ zgqau%m5A7lMAEtNrV_4qVgZ{$tQNg^wgxzsA(1oSXQi=+$Gwpx6o-OncZ*n6S-p+N zzAT2I(EA79+xz^id}^@bGRJ*FJkMhvO9M_fT_y<`3H^!C#1rKcYed{u0qtx!{43RD zo0SG0MX;6q-xSB-q-iRvH5*FKHEa_G67G&NMv~>BnJwl|GY$We-WcR@4h_@Kh4;P> zkz^BHDoHjPfh5dxeWE}pASY^EogDJ32op1F2JV^s`j)-bhFC*Vj;ba7LG0NE!m_gi zV;3rJ<6X^Q9(zWQr9o`uvHOK=DyIT`Y~A zqum{9CfdklzeH&ku9f^cD4}>e1&#<8L3!CEd#vh#oo4>DovG(+G%TbFX0Eylbz<0q z^DXVi-Y%Hs*mccv4D2I{ysUGYm~F4DEs%%6DaT>E9Q9K_UI{Of|Z&2GM~ReB8M z-_S%iRWM|SP>>CcpF-pbia`f2;V(a>{%ta=b=Af0ck2N$G5xgLAmO|9V6wL7atPAi zYQEcL>%!cX696y>F;FM~U~)|6O||OEQS)$yM_bF?S^GCxi_HAV6X#f=I{AuFgdugV zzVUA^A~nnH02i(ILnW5ew-f)Kehqo2tD1Ju&uJ+H1zLT$?UQIW#l=Xu7R{5*S{Swy z`T31}HM*wqm|3*B4;hGdX0y5Or5<0zix{-$CAzx6kR|NZ_xS{prRz$pw%a_+kCMdU z!}OJZxdEIwcme!jI!4;xfU}|FTF%v68Tm~j9AeP>QZU3zLhdI~Nj8^F4-v2%V-Gwx z7&riIT}76zPl%6|gT6^6>+cBK9UOOC!+pEgQF9IPJj315bC} zt~`+lB$|i1{?iRZAH)mhZy@oSfXE>T1X1G)1J1C#0M7|y;yB3qu^Wwu5~C3Yh$$@q z7M@fy+acny2j=I#BZ%2R36g`RZiT+Fe0=--m30c|?SN5pfKh|eC_?{MWbA5Ll~x#p z`k`ngY}7Z9<*F77=ES60zBXC5Bx-B^QYZo?8n4~AU^+hMR1S|_1C(l8E%W&{*A&cM z9tG(0g`hj}FW0m$q>iqqkLzyv!q})C+`}r)N3|9VxKW{w0Lr@vD&|YNRlgp;|QR*XjKW^`UdZ zOT_#ppx8j`O}F={t3=fvY(py-%AuAOX}CwZT6rr#n%V3-$fpzV!VvnBxIv}duz~e!PfYM8l z^ozi;pwfDjC*Rw~fT0EN}sNsRz zk6c)Q!wPlo2=Hk!*AvNs$^SM$IbQ!WOrN3Ilxmg>Tlk{*5)?6H86W)##vT|o_;fT3 zXRWd4X7)g?iEjP|Xi#g54*N-l+Ybx~Y{8=7-VW2^lRPfzTtkI^ zYOK~qj+%N!zb8nc^A3!qDC;71;vs;3G~Tr1x$u2U!J)IdEe)j|LBW5`Q+SJ@F*_A( z9vobgopv5>&JT}y#`(;A#-08tXrsEogjeCYTn?JIubFg+b2|s?<%9|boqMz68K=C| zJP~6d3~|n#OdP)XgmKJU8S1(zJV$mza$sF$VdqB7(GN)HjufLSMDIrj+Cwgm#829j zQ`4LRkdcQ@C*Ov9h$@>FeSGE+On%7T73fcDl7h^&^hy(h5#!RC&-!$Ro%a%` zs{on)8PspkUhYLTqg;C6m33vo-8@6@pktRpW;iT1tpwn65MQ#Bi^neUkpshSj~AJ zsXeOVu201hRy`xu&Do1@_t!=bg zrF3Kc4{?B$-@(_0&B_ySKu%NrA#jkCuT&>=8tI21;XV1)Js|X$ZdWi<*T1m5WLdB| zLLp)(d*J<7RBo0{k@y=0kC8)JAT|vq{Y~ZP!zu>5Zvcqe)Nnsq>+5|WVzmB&yySZ4 zu~}izYa6Zu7%0@q7`y_6D|@gEu#N05P~ON9}(HM|C4j<+hheK^;5)0+39_E9~C=5e~zQMEbaD!!T_YEFoeA#dVSU zU675;D~ezT=$M@T+q!mb*bp$7P~@F$-sC;4-!ke=#VbHvH-zU%A6LW0o9i#`S}S^g zzM@ldD@3RI%^5=em7T{vkZj`BlPj?chydPucg!j0Bq-7w62YG&MKfGhi|}v-x+%= z1J1E|mI%sLz}jak^mdABy%2EY7_Vt*I;h3U2LAb- zmDZ0Z)&M|BJFo9d_}~YKRKflpX#ohYP3V{uBXg7BjJ?Zp)nfIMBM5DsOwdSz8tyG* zOV{)H8OzVYp*TN#K#X$K(*=;$Y*YSuElgSlGA{|Pz?QC7cm#WykG)u8_byrh+j=3= zHC+*&wA0@I3{axBwxa4qGa%Jc?d!XSf#uY`#70EQOuKQ^P_uqlH^Aa*mLIiz3z!Y+ zE0=d981xSckJ{Bi6~bQu`7h(0jhA2J3u{`_EY1*SL7fs|?hJ$9QNQ*gFhXcHouq?( zov{(7^TEfZ#c(Bo-=xw4f@6dtbxuAXmNJPFXTAYmMLC%l=?tvI)oyg1R=u`5tiyu} zX2bCQ41eEk4Jh~ITsHx+!y>4HtDxfGJ1|*R9~7Nn8%0~2-EM&SjYGPm!$#Vbi!4b3 zeS?VWlqq=~m_(OO?h#oXCtoY?bbWm}9QlWpw zNcj6xWK}uX%|)yOxM1bP_DKuK0AI=f-B9yFIE4Eh2=G^PKN8o3Ex zmq=BGgZndt!kJ|78AsK;0%~xm$rN$H6MUMUV(dgkZ#8ieh?YFMzr?L4IiyykS<&BJII$Iq(C3yWS>JQD(u*5;wn( z2eVs`H||*EE?d_5?1;)Q7Qp>X4@GHu1GPhMtR9c;0AyXXL|o8;>D(e*{<5xD!k-a0@r0jB5Z{iyd~+XNtgosk?mVfoI70Ry7^5*Jy-Toy$Qg8S+b zTd5aIJz!EdD?i-^1FH<3wfx{iho>G!TsVeb8nw00L$-Zh7~FFGM@Kl&P9=qstfqZp z;fdeI$}qv|3!%R;^#fybgR;^92L2=EAu4eGX9ivxF1R$L$5T(>%lDJm(zMzi)1s_-0 zSqQt4s|hdf{>$!D@T7F)30F`2vM8Q@J6Z|eP%=wlqfnxz%iF-j4<~-?UIR~zNB}V! z&bdu=k{#ByXFW^@Cbp$YKVI3 z`v*M9QcqE4SK2g^1NLH%3V689Yn|&LIAwrppO&h@rz1%q?QVy^f5H0n$ip*!P#A$% z7rqE}v8v0z3Z5N(a8M-=_H0KBl}lByUuPh(t}-(+8hy0Yyo>}0-)*mgDuh#zD;ibF zI|_JP;`C32^s?6h zpout5Rfbz>&=J59EVNcK@?$8RlPse&t6--PIxs9yZ+NBvd_30lZ}8T71+Y2Xc_9Bc zcn3Ps1{@asGevA|b_uqxJFP}9OqYUROlw9BQRWpedAp-DEn!oRsHW~HgZ%)|KJt!q z&6Uu1SyvwNIi?Z_`=jgcNIO@VjY>x=w$)d_-oE=_^!CDiumCq;Q=Q?$bx}#oPpz00Nuhnr7<}A)Iz9aQ(c(h@f>yEvyZ+S2r}p35}-1el-b858n)IO zPB+^ruJUMDjk8*cFJL&q2UWJU!U}iAB!H{|qu8Xl`m@ZKbptKnfHHA$qm%0jSbP#n z919lhRplrjnP@OPpNDQPusVA;DL(~87*uOQO=3mCb107TGJ~1TCeg92_y?NGg#o;! zAKP&AWHiyirLAF)ZS>aGl*)m2(FxR_%k3NDhczBf9D^bU+2!Ng1J272QT|i0N4k;7S&u?H|=DFD;sXp3&5q7A#KtP@>yQdza8ob zpa?A9zk;A{i4NdD{c&h}=!j91&IcwxUvRmp_Y_;Z{)f-UI3>v$y@((+Pl^4kE)-EJ zGkDePeIIO4)%hd+dY#@Q9-D0*D}S^c^>mom8(3pMEt>EyNQL+W&nnACwb-Y68Nxt9r^0R}WGtq=Y;J9FzS{`&bc5&Uu zWBkDUA(f_lUh+3}<5$DAhZSlL4P19${=OPyY0Q((im5lwhzocp`g`Q38&8HTxv@`m z<)GeE3~Q9I5A>>1PHn(NJ6W^~jn%}>SH&XKJyZHWlXWQgAE5{~b_OmX_vzHx9)KY6)EsynL?ty~p%(y6%88V-(Wfkm|EhR0`LLjY)WJxSUow-&t2|~V zbDDvJl{h&l_ze0!RXG?0u6?NboXnhNlV%3B8dtduAOBH#2Gr=#AT~N85ioKe`@|@N z>OT0Ml<69+)e1W2P=pQdY{J1oP}BLeIIYUF@Fv|B_KygC&VlF8D>Yzuek*flXG{Jr z2r8o@f?>k6l&ihQ1B=Q4YdN)8CwkvE*6?efh@R2++V!=dGD*4rvctY}F?l%gL_=Ib z`A>+i z*cxpIunkiNFP|uhrwP=l-tRM+W{L?Nq2jE+u|2N7Qh8MlQY|2511;_GYPT*Lc~W}C zq)mVPSoG$?A4|4VfQQA&Jgn?E?m*vj&`XCcJbrV#y{~>u7N`3@(%f|yNCD7|95!eT zbp4J@it)+?m4|oFHKv|o!rlg<%xDt!4jd$mUzW;4yTQKmvR|W|&kARZ#>jfQZwx5J z9=R_NWs~d&6Ga3>fxTK~84qH1tG8HGwsJ#7LU;JyL6nV_a$ zK7qd#=`rF&H%DB6D?#YZ4+@b5M4}M?GLz}^trA7y6}CJ|6A$kmWWyeQ)47Uf{_0??)d8gSBXyTG z7A**WyCS?|Ssr=&IlevxA@2+~*ky~h16ZpS*!K@A`@nUZ4C%wFdiolLI>Emtnj^yA z_qSM8PIxD2Wz??!CUHu{b%;Jn=jgoDeO{hz6~0F(pU(N&M^Rw)hGCL0|}K*I#0IscyZ;gN!|^uajn1f%^%-MmswY;}Ti%4V#Z+r~0eY zOYsME(N%xY-L2#lO1)zA)BXYZ!vgM;ohi@1;hqlChOsvnWjWm0kQ1}LxvaI_MII{r z1*DZ6WNb`9|5TPhhcj|4ELsB|l(|Q(*Q{!_Q`b<46^p2Y3a?Grhyra$+=4Xojv$&8 z>O!bXVW}ZANG0G<=QQkVRm;If8c-aKjOp?KwhyQZgHJs{ zd;+ofc8~jv*Lga7Ykp)2Wl9d5WG>jZwk@J*HrQpR-wSL$D4Y3T3Ou|}t;42N zSpE$(a3S~v3HA_euh@6F*Q-d0#fzC>zYXsPWL#w^)B(rDMXMLWTbP9*>|QsrSz&k< zn0hZmX$-D)Wq^~=N9d=3Ls37=;r)v>yL$S8_(1|LgdeP#4RvW-@7SnTrx2>wAhg}I zV7%4@@ntd)H@Kpvz0F)pp>C^k)EL|lkwLswC0lr@&FKHS(2WjgN0U49N$5kir^$(x_qvmaVz5MZLa9h|e91yt)FrMde#@=mZV z0vu$%g)U0uHXfK4T5aCj0qyaDuU85$H$mX*9%w?^DYN zAfMj`-nNgIr2~tZ+A&Q56#d*_WcRlwu$2QKI)Lit*ZWbc7)zoWEgvtM1$#|dJWr~3 zxpsON9*yzT0mtSmx;A|E-ZfE!zIYRZ|1pdLSN2@4xr)z%C%?p4%FC_@!gMD0cu#r# zLTA&$3yRg5KU-{xRBtX~I{d!ivJWOgK*j}OWq5Y|3#a!SK{k0;{!O48t8|ONJRb7H zLQtjR)uD(FAV^gpZwFtZ>lIQ;3bT-guJArtmLaod)m}Iu6cX=mRvP;jLmy}c54bSw z08QvTl=+IT6hk*xt5uhF0AA9;*;DI@X!94=h_i3bg0fncIlwMt??bm$jB)+Npbf!< zTPVBXv1e=`Y7)cFX(i|>7{X1E2yn+P{Sh)c_@QQbDssPTY|MHE4xWP7fFjQS{iG9! zBi66UVK4$cs;8V#kqI{#rc})k7v1PZxew7~a({mkYnoCkhu_NzwOe)Rj#0th0c*c` zU|me*DAU!vVeR_Oq#mwdWc+T(MmrU?LW{tBKJvqxCqvfU{F%~8kY_-0+Z%sy6+Op* z?is$aE!6S8=3BUv2OR~(uj~mN^ZJFs-jV-@KDAtK!S?|_#zzq^{1|LngTW`%CD3+8 zCxN}@=3dpHv!2xt)%ifwAcaTXq#l2rt5Ej~yi)%(LL2oO-snIxVB@U*l-+82p9us)bubGQRGQ z8(t}S$`0%p+VBOb@5&f8Im*?cz@`tQZx93YHo)|sBL4`E*DTM2r@(fSg;0q64|dDP zllYj(tw1Er>yD(Kwpbpub$k&7EdvH{e++%4L{s@E8^m9?zAmuBYJN1wuZZG3qXrdi zGmC?pt56cyVsEpGzXk3BHCmf3nuWIru7F@wU&iCyhgIav;-8oaQH#gGr7)-#2_i+Z z=GoY@E zc(lJvVhL?75L64=L%aVZ9RkjYvEXs3B}G|=naVRhEhXg5AXNhmQj6C@{LZS7M%~aM zT@ghXC=7#U!Kw8TtH@hxI}cq>9=HvY=eAhQY}^23cA1Y^b9JayP)ycDiStj329P}c zHok%@I1hI%4BdSctQ!{_15~BRJ%h?#HK59&C@)AGHLh6rOVB{?y{Nw4(fO>Q|F4T$ z?^mw8WChxAL8&8b`2|eKo5A*IW167q^K`S>Mu+Hi{tAHw(r@I6q2Uu8VFI$Fv>?3T zvO3fSj`UTv6*s$_Sjq4V*9{E|JPz(|ELN*aR-d*6rw=#)Y{WJ}X7NTz<0Q;jnYgWc;i`Og^)oimXs=AuKM$ z!E2%qy~tBfZ5O#vU^)CexWkL_ogA#5Xj<9d9_jUf=7E!3qwELZ)fd?~ZSc0)v?%5v zqG?{f;e>YvrLcbQ#GVMTp|l#Q5V^hc*Z7YJ-R}92(dlD=W0iIO$iV(ZU+EYPuyZ?C zvdtQt2@RPn`pgpWUB389Uf||H7dja0y90%o&Zr{Ogn~Aqqr?AgHQQxT5?Fou-a(gL zQJPZ}Am}r`T|j1kvk#aVexZbgL-MZXvJ(SZ<4e^}=l^jpV@-Pn3%X$_RR_nF&Y*YK zdotxTki%zXHYz{1gnCQP0*eQg=BBUW=AqlFYXdrycc8rV((ua%tGl=FDom4BfX#{j zX$HLG#-ch=X*w*(?O>AhJ|M}5d;QF;FC+d$XnBEAlA+UHo+ zkH3@%V9Ve&n?|epZwd0t60G@3a0jRQbtty!W59%dL}F)u(&nCgfjY?I$4VZ7iv^9d z;RT^#dw^{Koc~GXn|<}B(B4Ex)-Sb{%bbi`#EYlSj^9KTq@j7Cb|4^SbvI$vKAKzX zxAP?A<+tEroPqsHUo`_;$l@5z&o1ZQXsffs7X=$FCM_42m%vC-%ch@pPqm9k6kbuO z(Im>PHohrD{ZG3WIUIlf%UA>0@F`rfK7T8*^9FgC zpTRPaL%G(z>kvO0cD7svYA28zoc>vQmd*h8uxvK@-s(1J4+A7?<}BB)-{ext5A5Wm zL?Cw$UL2LcQ4w13Q=ReUY7Y4o;BFR;#g>aO>>wp>?miwHF8Kj0m0>*suu@nC&_7t^ z{=u5%6v&z${lYLVfLAAY(QT%Eq7!i5pbv_m?tb0qb>EJQzsGFo9(_TJkh9psu8Nai zh(;yF82_Us!{DSf&8T6dchQ*ncpxhESf`Lv0%~mC?7O?JZ*sZvd*DOn+y8ZO!BFQX za>&`V_RAA;r3JHP$R?*Gt~UmB7F@6?r&JET@R?-iux?6?3Shp6U#!JOESPe_tWr!i zvp48PrD#uVZeVf?8thi86AqrSu?dR>or1xwGHvw&ZOsU$$R8Ee?E5ldqZ|Zf2gtEh zain{W{?(22pQJ}ORGF-W?wp)I6MZ4j@e3YqDC$0G-nl@1C+8Y5daeKApjg;0zr&8Y zp35;*XK@1MYLA!1Quptp=~uH6zzL(e^I)sC*nisd?u=&r()}6TH`~INqG}gnkj?y} zh6f*i9Pg}3Yr)j6q3kGq(2Z#qf$TV_h*AN&Z%)#lh+1Y-2<9IRuTpb}K3#m8f5k`& zp>wNtDHd(z`7dLECHKAVTif4C-1y-vPuPlUcnBDMm&!k+vXEDpZR&M;ebJ{qNewd~ zSNP}8<|1D*+j^!!LfYQB_~A>0?tzyTqrAwPm|ZZThLbnH2?!nKZv7!TM7Az_HV0Y9 z?C8-0Zm^xYuo+lI!yR8%`TZvMSa&{0F#yeqrTQbW`o*!t&`B1)*AJ5#z3 zwTr;+eeh9t5*7*MYIxc+ZASC@()~HzvERuxck=%1k{BwpF5my*aLAqc6`zldgWImW zoW!9Y6(T*bh|RgnjhiQ}=qu-g&Z5rN+Bb*TeU)%Nt19}JP9w_?(SmY*gnEa|gM+6h zLk%y1XuJ&&++8a(qjVr&Ky+s+|L|A&hW6z;p31+5%ukBNuXJ=CKZN?t*G#wJCuMoY zJ__>s+Zg}qP(mwx$ohkPj8_YOv*JSb@~)aVsh!I-i$3+K-}@-Le-RTqZx`+C-2RFI zjE}J|6L~%Oy?x6`r|oFVck(fLvlP%9_=CPxWc4nmW4#sE_)V3PcK&P{vZOTU zCK)sY+yI|<4>V66`~SE$do~qWTzY97e!bvY?y((;GX1z{eBqR1izBpBxYd?&pnfgg zJAkFn|JZ2rH`*4lQd9oyBjnRrw{f!F!qNrRx@b)OFH7qdD2A7!6!XwIRePJkU6S9g z*_hqR+sD~kV^C!>$O@odl(X2!CdA8ws?`V7JTClQ38%d`neQ4Nk}MiNj<<{5Oi**Sba3IXJF+G!WsvQ9pxV3sPAlY2)IRgf@>r-*?;mBeNI$PJLn>2#9rWpu8} z<2_p%7j@CVK z%{p)V%`ScAEHGim+W2My4w&$fjksh#o$+;Q4l1XpOt)lqK$VFBB+em#yGNwSY|n6T zpr&>Lra2`rc_5|uROoRwMsex>rxla8kpp1QVFThJ`kK2nK&o-^>`h!<>K!HEsu&|%m)0b_>VoRL1CWNCB=UJK#C8YVnKN9tT@J!-=EdJ8XM+T zPHlM%h;~S^0W!PtATWVx^M7BxZ&Z}UkyEo6UxYH!YyN@l0Q8)FcWb@oQ>`>Q5ZG~+ zX1&V(%8JRm-vmauHe_9t(-C@x>DpQJJ`B-8F1)r^EfJ*W6rqOG(&3cNLe{da7;cMwsw z@lz^K1mPMI076m!v411{wwy%X9^pA!ZM*4@Uz&q90+HSVBBk%^mx;8NW+`WUnt$m# z8$?f@&(o^U!Fq3PZoh$FHJdrXM#ecZ)L7sJu|-dswE(jR+6-;Hv(}=p5TnxsY$m?R zl|U{g0!uojhv9D?JJi>RQZFhnECA;=O2<Ha3_r4mS(8P1) zhjOoD6xVuDZ*1YYAZgac!x$%AW@6Of$TfP%HXVd(3RdA`b+?bq0|s3h5;iMN_4e{D zqy5}Frl|sEXn%vFMgAYi+&`;Wpz2&zN}K3G-u`UI@ebMp-U3>x)OAC~c#n+na#j)b zzi1%w^_ceFo9lCao74vd@9)0Z_9gFJBRr*mh7}cw)nm1tyr>Yxs@M(a74s zzyYnV#>ffLa7Uv~J#^CbB<%xCEDxe*nI4upxjeTrn{sk;HPw(YaG_nKPStO}jobll zV7dI4^ltk5{0-qs@BP*?YX?6Oo}mzI=ZR{8>f{xt zaw;b8e~kgW7l}nAr?r4{JbijUf6L6)>zcEVXM6TyI&xsqy{O$=VhFQtVdUr8H?z5Z z$)I@&4zyRkqCYjTeOyb;Isdjy`xjpkmWZFs>(y(PPQLT*If;1jV9n3F&-$)_nU8OA zb~32443H1DA3yzF0PW;k%_~!mpY&>`gmees4q`^bkLukb1pg(xvO$4Py}rCRK^|e3 zyIda>6q74QQMQn7&iwvwvJYS3sS%0HvCePaYj>au<5Bw#yr^N)5uP%9vkP>h9<13v zmD7!c#h{f|M$+iubYW8=m%aR|doN`%7_8U*wjK@Euj)iUibBlq<_RzT3~Nt4CU4*G z$jI_ZOLjh6iDy)b+#a#EnLwvZ$$|{|P`8aHxYOFseYRN5UghA}q46?L3F^5ru-un7 zGp*!q(K?SL5A%2Ar?@n2G<4M+u09Q3zlN2^*fhTNxc6?b*q)6!x7Kwd(EX0rCPyo( zpD&GKwcUmAr#6_Wm>Q2;vVY1?bD`{(dyzMr2fBDF3!Z04sZ#J-o^>1)2uC&q#k2>> zG41&mzwojouw*GZ+Vv%( zRupL*q8DlIH>=D}S3*gqio18iz9VrZWhlgTic>+z{UA$an4869)9j$6gK*yWossm) zSv>rRn77CKCD&|I-WPXix1&?v3<{bq)=GQcuhHc20D4+UhBN33Sq5dt&92^2vcloX zPQFX#-G1_c!6&2rpch6^4J9bny=iM+Z1W_=L{XCjA~$RPT1fN{rlE8;6jV$;`bTjp zsZ`68UU#!Xx^uXx1xpJHDh(XAxM|!ti!<{-KXT-Ei_T`!$CY*mx+`or{|5lz&cp1F zJ5bn%P6nQ&(q3{aO|~9Gs(ceQ7~OVki9^R-+4{B$jyUo~jIQ|-&6Ii4H~IDR4VVwX zmGS`M!5ZuqH;k9`7}q1p)uL^=$|1_!tKB75AliDu3%Kh*vIY71tFKPZZ{Xzc;y1%u z8!xwbjDr`KNV5c+l`kEx40znJ{NF6cL6<;n{EcRzi>F^CmZN13r>gFN*n>5o4^nhX zTpn~+v2MAwfgaeMt$fw-CTWPZSpfYWfX=pxbCU=6t zaeQ4(@fHmmfGhhJlD8U$1VJLPLbKdre%eX(G14Pf|yo>_#=vB3Zz<~o_ed_qYu5n%eQ{G$t)(`pMz^HoF9rLmFPeI|0&i%iI zHXP^=5Z>^cTWmJSck-W`OO8%a31B zR%4Y4;rTL)F^BP2Y$B24JRsCw9L^~V&((aJ+cs>9lgUa!CabA)|0}2`u-;)%x%io% z)r;)d9MM+Xm#s8EK?3+=U=3HpZfd^u^?c@v4qEgNr(3Qo4|KNWBaguUDtJvei~ zeCjF6>@X)VtzczqEGPK2q{HQ`RD`Z!^Hci;EmukX;)$zEqn6#@w>;sbfj_XUz+!G9 z^SB-M7DPIQKLf&vd0Ek@YC8zS68S`I`py#DcH{BR3R~9V&lY_&mfRoWY>sF?d|>iG z73bWf5rK7;kf`}~ujlIXE-2ydqrPFD;f%KRqgE=bYTLaqU=v6AyzkUT_hgV2af4Wu z6WY16zhCx^2=5>y%l|NsWeIF*W^C*xLl}750WNw#OZiKA@#EH0edPdJ)4LYjXRg-AK)HMyHf~T(UPsUm5 z8L;>>(`x!PDuL4g_V)3`_cMANgYI~O3?Cb5Q=;yW?sldMlL9gLjmWsJ#IhRkI1Rud z&{h&YgKOwq>kZ3?sGnc?^BQ$vGd+aP=ENUVm@2NABqRIY-@h0 z5)yZS6Z6XACDR$95!UZ+o{tHZv>AruQI13?#oA8*WLUuTDPZp@{E%O`u~VD|365XC*`&TRhpO*u`%q zj@l(Nj#^g{{hqJ)r0jk_-|x@gp7VS@AJ50@`MRF3=ljGuKUYRhDR*`AyluwiyyorC9&zAPP;PbT==)QbnS=pPIWF-7z zV1aPQ{mS}jpJbK}T5&N(>^m+KuXY$1#nh7JpC4!yr3pQ5pD{kM+C>WDMd>moaWCz! zztKO?G*fA+_zzL83vDlI9I$MY-|-6Eh(UA!cMp?z9-qy0lFQbJu-ix|B?{ z4!t1beH=c5w=^`mEtyfACA&q@%TKy7s6r{TPCIpWN3G68*p2?F!%Jj%Bt7gEs>F7j z4~~S*X-#T^ZVu;K{|#g(+HEIvKt+LWK*b;FNc6(@4WrK{bon+&Bc}?^A?Gz3?Q^~8 zpiZ)a?cP%+$dbg@mqG>0GTs@RDE*};TaP7#*iW(YDM*mgMOldJj+oXUvjB7wbE-TP z%yo5#+S}LrK+IMq4rYPUHyTd$3HL=co_sY$jXL7N3rK%|hZQVw#UY7g0s1tfbq5A@ z39#PTX0pE27?k2}EwlGQ7}|KAMg{gKbJfAq>%EzptQFu^3lx zi9&s40y|g&{*#~Eb|leLL6{B>OdXN3JPeN;lFia01NbXxi9L76DO_!mF7}FN04HAy z?5kFT*X{~7vZbVm^`&r%{Djq1t7Ez}+%fRHvx;lAjcR})yH_|QD4mSnIER#lNWcm} zyKepT2FYEX)FHQ<)9h<_z@O4DB3)|#r|c}H=-0W$;Z3o`Ah`^M^>8xd*QX4`G?8$< zw{9eZ*do7qg%-oD%&>;;@#`Y58!l zxm$FKwXrS;n*QVyZ@z}B-PH)p%W`66f4{jIE~;?}ps$b^F|z^a{S!S698aYaoDWR- z<8Ow~S|J!GC>t9_U#w7I0x^za>Gm&~Ux5DzeIv}1dDE6-k3E+(YE}D@bf3a0zHaO; znOCjGhah5VdV1}e>0ns#@A}unVHE(WWwZCk(+t?|XrS|SJ^sxMf!JZ=7q!AS?Lt}g zRIRF$gYg0W{7&T6Lg9(oW(Bdb)2ZDV(&usazYd0+Bue^Q!%ANdHfYcPV|*-1y81YM z6lI5_Fuy}~Fd@6^vd_JC?X^r`E};|dF)FI zH#DaZ*>=%0a;55Z8>ZJt-v1BvPq%wPffi$ovWUoj-3LVZu)(m!*OlF|JDXHa~88UGlGG!A0g`55xG#(O%n#i0fj5HLzsdsW9Nb~CnlC| zzEFxAPrK+2|AT7nT?RvDQ<>Tp`4O9 z#9pFKD^zT7rC&4^DV%{jp7}w36WMtOEu0rFee0*&HHfoyAEE-v^uUvFu|h`6~<6=;|5xOL;pZDZPufRd&rEma|++ zDzXGuk;&^u3W(2zIn8`#xgNXC2U>mP@AK4^R zPrpg}0gHBgIcHwv7p2>#Wf)(gSR+d!C-Zcz#vc1_YSh!XAj>Pwg=2OYFG`Y2C@459 z%^^5>daE+3u@ajZ1aVy{i4P~J2f=J(c+Njv`gd3DlZfiNKr}XuWLLz2yQ{ZLK8U=w zj15A{lHGBWYvfewGK(GRy_xS9hu>4$y}lHk=BL|1$C@SP0g>MPcr#G*?r3WoQ7&wo zj|>!3usgPytoBVzp>#&Oo_EM0krBrWbf*S`o}QNdrI*P~p}`U(TnXNouTIZ$Sq~%Y zrKr6pzza%?e%Ft4e@>+5qC96EuI!VSu7sG5$ENPOtV^n?urmw1Mql=dcg78OlGq-Q z{{Iu^ab%6c2H+GWAnLEh;qbuxWI}q#uR#2c{}>0X_LN$>Q=Zc0K`OPhsfRnlE0b&G zZsE}xO&ds&T^mMc>(u>?Rzp!cENC(j$mlaiBB=*4=-J~>VSKgpx_j#l*K($(k;ZOu zxM{fQehOS%3odT|S@xc@?O=n2%)kCysT@$BWRDEOo)Bt{myq2Mo~DV0Q6-g6n&p!? zta7Y`#&BC0I;NO0TaJFfcYDK@D%~m4_t^96BB&jX8-X;W(GUxzr9(8jYV^4_-lg8I-{V&w^Kni@;5ZO9mVrf@?dGYgO>xYwF=iUm*0%5MCEGP5Rm_j)oB(T%`5*Cosx)M&xA9)=^V<%Fq&-EIo>M2vf2uyg z#w|&(mqH+id(Ulbp7v3$e9PD=wPdFwM-guHsE3noUEbQz_?NwwB%>w&toHsA8^MOU zjcrpy-OJjScI0ylXqoQchATZ*jX?C0gGli`;SOin+lB#2+!AKY0!xrPiI#z9YD*EW zf=z%cvct?X7O9;H_|X7!6mhTg3nwJt{Oildd^%E@||s>=eHyN zaKTqV%XJR{LpFjTIW8-NzuFyP0>~2iG+LwtVKv4yJ+e@tTQKA8TLf;13H`#oxSy%J2CiZ zbgco@>_9QWaxu5{z+B7OpUGpUHin@N9u--yENlo~{=d%r1Do$O_DI=`*XS>sxh@o2 zMB-~W>Az#YzfJbdHKmA2_1;-GQZ~=^$b4tiLi7JH4 zrHRaZ8p4IraHa)*WozYshf$fHoC`1k+(@ zG%tS|T;~2iz?P(pv9-V=A z3emb24m#As0nv%E40_vb-8LdIY%-49L-m4zs@>2?s<;zYL_M#YLr?Cvx59mcm*p2q z#f-c*;?b!1EKB@4>{M$vQ04fBP@-J=CT?%?XN9gQAIp zXN9>Y3g{)MWFU5?XTE}LY3{EI>(;xZ-CqJa6RWaf82ZYQrF1Q9Wlnj|k(+e|HcmOn zZdH0Cy9p*fcy>w)q7giJot6Mq>x5ambVoF|k@oPGw2|z0W=4^NK4aEGs(b2Zdsu?r zdU)u7nD7>7!Z#WR@?H>cJz)kVzvpcww=e66hI&NUXD-4G4vQE1+ZMF1J`s7$9=Y?y zhQ{H>jL4W_qQ~KAP{qj=>ύ#C+=<$hb+#uU16l_PR(Eg})c3FMQ zyx?o-b5RHyQ8MvG2rCm38mUuG^9b{%Ed19)WGQIfJhfw$@e2W}!$s#ZC^)wvIMe~9 zJdOhUJoY$e@;nrK{1;Iufz=&5R#mGBM;cH745wIO#AAULe&dJ~4ubtrlGXQoQY@et z=o2Zf?u34kyOMbhlrhzMus3#rlzuB4aP`fzC8=Oz*})5O6(Ojx0astOhGNwzJ>1yC zn(&+fT24gPx2{iFKn4{NjRN*a#XK3ZM{jhKtBItYLY2=_De;#(z%t1>r*w&CtGU3!B?iDlgRpyL-of^Epbi0N7Ir7O*rvl>g zuv2RE(Rn{7hIJR&% zF`p;QR;98XtRW~Xr}S5uMmb*GAbDSm^yi!MpctG#js?`6Siddf#|4S+EWsgr;u>_u z3h2QViL87j8LnX@1^#WD07dj=%|U|wQj*mld>78pCL845F#mP@KzMHrPp+**En|)WN0TDjB)j+0^nO zmNn6q!*wPpVPlT`IZCWB`Ie3M6VkKkH&yVllI0;&wXbl6X31wt`h%{&BotokR7Z*TH(}z9>(;8?$GMDl z(DdZy3DL=%ks0FMKxp=Z%ldo`gX~J1V*x*i9f+v{fEp&ksjRCxX;I*AslA?@CoOu9 zvO(+WLKk{ZMn_$Xn30@v#3}`vd|;wsVo7(<{&v+mQP*!NFU~B~x`rACGYzxf-r4EG z@!7Ch^P&qGz`eauI(qpEoy{MfvbMJ8u-(OC)aWwl4~6;KF{l=cCchobZ9A3dd5W$! zZ}7cxD119j{k<=Ma|#k)*0Gqjg9TI_ERM$510*yl&EhBEvoDyO_llT`Chr5d+F(k} zg&8n-BN%Ke;|GM`uR@B6%fkL@WyZn;7wea;+mGhdp9l&z0v+*<)6{m7lc8%5_03D@ z-n@vsJhGlA>WEzJ4~n}_C|qT9Gy(nd+kLXX@ad4;PjAWU(VhK>J zMOSF%Le5-N{hLn@8mAAp?O%N?G3BaK^{W3<&bwhk)kM_Qo)d}^$tQEoWL=kW@~L6B z3@0(2bnX=G!%KMAiVRh-g+fytQ9uaEQC?h_M`&Nq7UX6t*Zl3Ta~-0+Zx)-o#gJ#$r7K+Q}hT>&2*eY8o*L!5yv+~sHv`axckTtKiIWusBbX6rsUHH#mgI zZ9cS5=u{wdTrpMuteJnHBk?BF!4VxA&R{XS+$b`;{fw z+D)DEh&oK;X=c3Nj^_BKu)!&%{&LHDQbebecpsjio>fBrMg9hagGj2@iMX!jz)OTL z#1V7d3?hNL3>aWPs^fOnX^0sGnnh`s*dzrc8r~|I42p9n6khJ6wBXqeA6#oiG%|?H zCqBdMQ*CbQ7yHc>$Uff2q_6Bvz4es?DZ-jgxV&4%F`$ z4ZVg)TtTecb8~@*AP?)rLsCKy@36JSVXFec=x)&yWC~*Qm5-{D&clmw$(7W5X~{uK z5Pd|sDg>$>mJ2!d2XSG->S~r3@k(nu4vkZ@@@=`7s{>eg|FwhUx97I;jZ_;HZ5$Z- zj^7(#wW?6aRV@snV~{bX)|zP5hm-t(Q}prGr(b0TE148Q2Z6p_2qF2SpAgzbC}eh8 zBZLZt=_jsR7OK9}X@R$_=@rd%vCHeeh$%}N*n*)IO!i(ZH)Aput+zfqDcZCvZxBF& z#qf{333B^#ow&{=c$aip1LZpT&MYXJRkTcwESU?6!?l{CS?IIYrO@P9FPWEUJ(io1 zZ-!iLHHf+2VS_FmN!?9*{O)_ROv2X9NvOK6~OTWz6K4&Oz!$Y zU6J}L3uN`fV9{poTi{8FfLk;+6l`?}6CTB1EcH4u`H4>h1eVsm*2%Qj&PSabFa)n9 z15Ko~OK3?)5KwbL2iiABh`8!gpkC{<$&x!aaq_s? zXY$HFpe8h#=Lv*R|Ha#C*8UX^wbG97;98i{ckaYz@ft)a_yNdbTmGdz$_i=!8?MQH z7q7CGI%K*=^5;O@^gslbpum$pj7;aWR@@MIzK{OcJLE|Bhb?6Ytyvg79@f|sA478N z5E-tM)gvIjm$o4~hU(||#;Xtt^VuT}^DyU(CUuKJe0AXhg)){~&%_Rz3kB6oKrk|2 zD|9z~bMtpY_N$LYiB)ss?rFn>b_-2td6oV_qA0k#dxn-kb-e`X+Uf|UhiUAi#ye1L z?3(Ojv2Cu6)K$#>DADR^AAi_GlF{l7rg?4u4>uh1iipXtlHsckL~SeCFLMydfRRpj zi4tLSwP1gIRdO;hB}sekabBCzkf~bFw*ZJ{HRnqC%A0^*$rnnNF%Hz7 zbu%nnfM5#m(%253KrvVY3knV49fyms)#9=Zz_IL0TK}swg)H*{bdC~lqTEGqrJJ>X zt&`umlB)9@I`-6>p$L90jNmAhh)wTh9EKBfNPNiTbu5VxFEw$9!AFPz4`jcBDeTFl zx$K{NsfB53MsG~KS5Iy>A*9NL_XZBSDLPPU1}$WVptxWyN1GK`Y6{W15-#n>TZE%h z+s)pHji*g^z|{c^pUhWQV_@G*lY^AixHVDi3bApL{Q0N%!=TX}de&S-kn z(=Y%=w5raIr^@8r|x_%4^WUH4n9yD0%Ud@<$sqBmb(4lddUPo zf5;DO#32Nc*;=9d5E$ZwR7FlBVpKKGD3@J94$&yu9J zCTA$7oy%-?7;=&l*=gvL0)y4;v#l{Q$H+B9xzS^CEt!XS9Oi%iPT%c@1y7d1#87n^qB&03-c+n>&J42^;qqocR*Y zTK&gqZKtI0gdGG<`br^uyrH4cZw$cafZr9shyM$U({Yz58dljlcLgp*MBuci%R6N8 zV4p(&UV&a+IwFHU-LHA8_(oFt@M)!oBWzb=#|hc%{n6P%lr*u|lwoxtO8e`X{R91% z3@BNgICtD;g&DD<)y=*O?=Y@P*Li_$IhxP4Vne9zI!E3&-+^FgWlkE4R^r z0A-pS=+*R$L-h5^QAmZu5H`5Vy-Zq!1=~+M1H{?7lPGhK+f$>UkfK7QJY(`akq2Li zI8;W>OsnXW6VhE!bduinFR8NW%E1~0ks1_6cosmHY`lZ%&;cNjt&Fu0*$F^aBy6r# z;VO=-(8umSi&+l-Kq8cJifl1!VXM;7_qDp~QdG|!a-%1o1w(Xh`@J%yHPXWH>fPkQ^-CDZ}jx##Y z?l8CBnXq)Bq>PpK+(V?(sUF#@8eD}hkr-%-datU6!U3 z-ujdImv{UZrA@U5sb22#Lo2IgN%?-UN)I=)?Ti@{P1l6viLRh5$6nKhw=5)&v;l>Z z_N!l^3uerM&mDv--MzX?dYC6l1MhS|c#r`A#*j?I84qZww(U zwPBb@9fl5AzwIEkLKc8~9q_FyoQN9fcf*-6aQsswdW%aOj(v*6Z=Rs9x^(NjzFO*M zG?6|^Pw^)-Aqo8HwwcpL^Fq6bw*BoJoNQqVwPiglT?fKfRHVl;r8R_UU_HaOK3N58 z%3zN^Beuih(Hf=Yzcu0=1SBn-0NH}8`J1ZYBnLW(9kNBN3)%}q`oO^2yg#~m0U7Z9 z8}C8JwmME0zoX^DSIx$Hk4X{f#oU$6dcm0>OZwkr*%&sSGnt6ygU^cJ!Y&5?j(}YD zZ-y^H!G5sQ}&E!# zrMggh%1HUJUtpq4+UsV;>HY_ZYwJp(%fYhjnkE8r@8kofy4^Dd7 zi3bjn(`smep$|Afa&n>vH`B$*c+1@wCvxn$Q>~&XcEA-UM9cr7xO;(O+xCr4jh zVfD7{F#06^6C4iW4*JiXuH-4e;mVbTn&VVj>|e-uGecUpnzw(WBy8-P6fYt@CM#N8 zvbjvD;=RQ5dW2$^+YwZ_|PY_B>XT@W7oSLdY; zFsxvW5amnb72#`ylL?Md7V&&0c?`ez$;Zs_-+=@*hR5xX1t7H~g{JybdhUKf7}Rt6 z|ADY0^|;`M(!+i>xmJ%~v#~+Z-r=g_-u54m#iipFUjR;9-4DAWA;7`(OU)c{vQHzq zFVA*PTkKg0(JR5!?}+!@>t=3OIF~utVAxc~9(^%Sw9L_DaNUYCLOp~J5zkTVfjP)R z$!r{;lqqpbEA+Ux(-EVfS2E)TlP?!=^i4W*Yb%!$i*G?wDn#XSCgBxm&_1I#qKfaT z2X8CRW-2|LWbLfg^YMWFFB&F~)X4rHPS5cwQIegH(?ms!@s7u8CXl(}AyOSX!iwPB z>203rH)2%-jLL!W*`ANH;Y!c1fIV54;9wO6VH+B)-S0$a9jE6k1Mu0Q>MZoI1Tf-M zzJBgDilqyG!th;<3=_UQ4xa@+1 z3C>X#XyY|KqzDK8)o|h48)^6fzC}ITB(pdiK4!AzafZTKIQ(RD?ugUj;v_URl+sf* z&xKxTecvojyb3-e8_Y;(m<+Eb-Jf8EyUvbE%sqtfn~y0yw7J(ePAa%NKHcJL_}4^+ z_4{kqgPrPgbyaeh*PknAZ@G*=7Px$z_LPahuvPW-hI4OQqGvmzlby%1Qsy36`+q2D z)UD{V{P#6MEgARb?zC6VSstzt7)*#)4blE1 zZ(TLc`Aa&(DQ)) zLDL=e1}CPUD$YJ_vHtM8^-bro^u~8XG?NF|wJiTe zm63>crpJiD`RyM%@6NTTzyHx+r(%**Fx;vBPP_`kEe zsBa5?`E!lpsTBml$J<9|^Qsl+`V>PZwM92An)?$zDLwd6W@(LC^|FzEM-2YVOssb2 I?{W?Qe-pOaRsaA1 diff --git a/samples/docs/arkanoid.PNG b/samples/docs/arkanoid.PNG deleted file mode 100644 index 405ab5ae26154925be6bb04115511ce0b11e8ec9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18324 zcmd6P3slorwznO>%5*HU=K5KbK+@Yef{v$c_nZU||0`+xuIRe*h>ZE5A0q4uh&)-Ym`xkVu5B~7shWaoPMOokc zR#apPolW<-Ebo5t#f8ak0&VmWCXNv&EWjldXtOC=9ZjM`*G+ZN7yi=YQEA^t<-cf^ z`qRuN-Kd;$Gyv=Pj$UQl1sj*rba!=grRJMD6-Dzc@o{VI{FTB;;qe0tf0?Z0llh>H z2hDU>&TYVG^-JH)a=>>l>oD8GG?x(wnkBXO$Hi&i9KE_7UNDW9zHb}-W~sULzjo`f z_9DDW&CeUSJdAnxH{U745$h0!As=o8W**;w!LoHoa(ez89${@a-xZLFCau*XL0C81 zDFmNBg?v)j%crXArM|A^QRKtb^9LmJ2O73w>uH-zXC%58g9Z#`Hl>gK@)ph$qi^-e zf5D@CWg4cLho!Vji!>{4`sHft5FQBKZ5|JgF-#63yfN05oB+!#MbD75(~J+0RE(hx zlV@r@W}jP(Q5f$;vopR-&3+t{6q+WSBMtKIzNmLq-!@``#;i|EOL$=xJ{ZXQqQat8 zb#tuNVwW(}CDr3nlPTvV-kQ-fvl@dMvrHnX63Yx`Eya>V*=A8-+}%2_V==4)OqCaIEh^N+DTy7^u9jXx zSVnV(d6ZPs1c6+TTx{a0iYPkDCUh`1%;b*?V-X{_;nc$9@@-v>Hcwp+g4 zbS~##m_BsyXZ;U9Jf}dzy?tn#hjs1QB~8ja-jIsz!c(}ha;L3B1wf2xCZ110DPL&O zHTGG?64XC#&baeg412XyT7`c$ey}o3@$lb?FKV{^$8M9}r|?cx)bc|fL4BP47M4#K zPpu1@7li6Ft4&M>CZOcUJ+N*&A^yjGtccqb#Nbx!Zl&dVZ=&dZ0s@UFm>Mz;RdG)s zSV^9Sy9XLV@alUBYMix?60gy^mQS9rTo!zV<&f|A!=p@^Q#i%}j}M}9`9k&cAbmyo z3huE6Q(o>rsy#pQNzZ#MyJ?-1=!0_Jkt;2NY=?RrYnc6$1sggc zaVtN7$nP7{4xp$fY5BcO4G)K=nr=3p1rlK4TS<4o-XxmtNlf#)K924?PEsY-O-<{` ziVB*KDdC_up8b?RvWM6AAT&9#+Hhs1S-)pR#G+_ascQO9>ikuIqP!Ck{&$ObqXNC4 z#L^D7!9{vqVAbV_06>^-M-^oB%+jpSbDk%K1zKh}<|bJ}hWb(*#o$BPVtK)^WavxQ z(6TDAf{c*K?bc%rZ0uC5+jq$yhp4XbFVm88zpggG9okT0-|B8#mWiG`zzrs(BT211LXn4@=E zGEDP0vtB16m>N_#%dCWIougR}=l)>2g)`|}8era09_|gJLRwC+aM1O;)ypStzME^J zH6+E>&f$w_3IS5AUK_06cyBO&^dsczsVa$M{~Nj|uNxNeM+gNb{nYcodT^X>!qIpbu4s7@n$5 zl;)e}iueGsB))FNlf$J1-ds{WM&z&>2eQ?*0a&;(a0%JPSLg{39AArX5JuirrY-`< zfsWfGwV!_f;wDaY=_QwY#|PX{uPjyUwVJiw%Cw~(OaNzSI9Ztk5c}xT>q^pBl|9yQ zsTpB8^6TNs3;9JJ-irof(-XGLPtQfMPp^+GTc5c(?R!M7E>wD2OZg?C47^I*3}mr; zEEJwAap4-nbf*hJv&b?%m{Wwv)8;Vkt-jd(c6kK1S6Oh?(JPN@8;^ej0N?fOkPvvD zz*r$Mv+Un0fK}jjgapBJjN#H5WnNV8LSqwXT%=@Y_dG2jz_l#>^`*IHve|i~`WM2I zXvy(kwXToF1*UgP&q!sA{9Q|f6jr5sp~M5q7B8Gxhr)3vqr}-ZiKn+#oJ||i%!nTSH2nATyI%JL$YdLdS0bG8 zVvvWM3;9?6-1^qms@MI%!p5I(?dA=HcXQn&M0{`JzSo_1p&i&9-On@9!b=GmyiLNb z*u&qxKH)zNCjv2=7WD+|ZZDA*Md>H94W*keSl6yT8hGLG>wc6cpNwNE?-0d%tGM$; zyYt^qVsXOky_Q&9g;Ea1*;`Hsa#KD0y*YcRxCjbz7F7Woi`&Ha~5gk+! zl|ZPx`-j)xfIqkLuWnz3=*ssD?IC+|$l*?G!6Wuc-i1bAxX`QX$Am2#Ag+A4Bk5ky zFIE$Aes2oQyA=Z09;Rk|Re9x05AR0aBNt%+^xY?AG1eNj3{Mxvmyi6;t%11j(<6FQ zbGBe5_k=kK1#$8p6EX^4S4S4wVPT0{g*(-3+*jPVs(KJAwX%ekDLq~?=1yJivd;-l zq1&xbhFByIALJ3};?+(djSaQUy6|enn1@g)2befE|4lPNFf6@hiNCYeAEJ1j8{4nC ze_^Zie0U>N>DrR^eJnxj7oRtEMye47I>9zZ-mQLBmr&tF$T6RA0vpd((LJ-rn$t`# zQ?j6n7(h3prW!>LJ@%BTdJe1!WKdDm$cvX7qf1j(HKjq{^;K}@!Q>y}0#@NjMChQ> zlBCU*USn^SzG%$jCLV@p6uH-6eHdNsHfnxs=qGHFjQD%bj#ozH%FlTHEfoU93 zO&AGl38a@f&{wXe7sUsT%_`8mIwk426aCLeD`D9z#kHK?DYrm~xCDeo)E+{a9<|(P zCJF!Pgvef8$sxt5FDlm|+2bS+hrZcZ0xa@S1JAj4ep$<(2jJLo+AF^LjE*VRL}cJIB^dX)Sd>YeH)V9R{IU>qIeUV1mKu* z!7cCtvK@ls1?)cP-xGjs-_<+r0u>p7-8GdrAM)@PMd>fcIpgtws6u8%A>XZd25pIi zD&*jVBQM@0qICyg$^U}tae$e%z%^FlJiH|msMct8@Axo&_OZM;O+*tx?VNn_iezrO zIeAK3(j+25N41Pw^-3>TM;Iw}*irx$&yy>w{~eO)bS?LXa18iq7_v)K?dc6WTgab) zt~BH7UDm1n92tqnO%tR;*Yd|{ma%4X@(-z_1ODFr;jizfFL<0Gq_|GAk;|!rRE{pEHg!8Ays4wA>gGd$Ya$~! zM?>}|>SYOPGu~(^CtS>P{F}Zpu*f))NREYypVkcFF2726{5j*dv))l zib>HW1up$gm_m&*7EKS!8DLJ_zvaYspPqVL0xL~li}I2TL1kO=$51z||aqE<9N{Gf%yZPKYh#qLq zJUg129rkiWbz2k<*+_w`gXzf>ug*=3f|CSQPDqYhsQQ|2AcB&ZZ)nbTBCJB_nvzM= zwCtm%+c2CHUYzGxcdjSvs4*z(>jPLN2m999G?C% zo9qPR<{xD8sD06;;^-?**tT|D*U{u3uE0r*ROm3B70*689mC0+mfYXjdAJZ_9B*(Z zQ$t`LjBC40Ak&~~+jK1a19xh8EE2LSaVnuDE3Qp{k$6P(ofBsrR&*_9RqB^$`q%^5 z#(t=VEsKHk*AU{+tJ2xOIAPb?(hXl+mzOTzDFs2h_aV84AY7@Eek0uITE5bWReM#` zeU;Mf_{U0*#K%9Q0oH7L0t%m|JPAj}Tg z<*JFk67TVWywqG}xEu$$cPPx)(}?06@f^*9d`JQ~NEo~&{kf^4I9!B#0M!P|61IfK zwgh}mAI^<|jwBfeMLW3{E`5>6T*5-SNKzk=a-;MYlS%HUXE;25icb^&zU@eaUk5Mc5CO1!3nNE zhSA|j3|X9W3!LrGK~10RDsn5XfQMcU*iCmL(n*bP%^n45r1b8mFQAfMozER_uPfsA zQJp!^RgC4_V@l7yFWrj_9f7LhgjMBJKtMl+a{L9Sisfh&HJsF5oT9abte~cvd}A^- zW$wP9=kFl`_&$s^cqf}stqphP$RF5q~9k|rjP4X?Y1DQVH zl1>HX9qeNgC#@i|3e`CyaTHC4;oP=6$b`U9062kCw+t>Q~PyFN1%rf z#tRQ1*YUIm!qS7CaV;a-f&CSmpAqww&LmOVM82LvWlxT$sK5ymo^fPWFMZkGCN+4u zJ8=$kL4gF&aL?i7>Nv=;3y^q=r6_`!L=PWlq=hxLuXy=XG_?^$KMEBl)c)Q(d&hqU zS^Xo@PN)t*4BWed^|falrJs4Y_YQP5Nwmt6N^L9t1PU-d@Cy!yn54=$DE=q$i1`jN zO@iNohUkEI9`*2!rh5wK_jDdEf_PYRVN}L*k1K+DCVQZ=2l(JJB@&zs|2HJ`K9#Vg zfWrTon3&lMIhU6)zh(pPIBZ|Z6bP7RLFMs1LniNOiM#|B$bfpfi|ieL88;vV3TuZR2>^+uUygdlcz8#207{`A<%MZMgg8#_ zd{Fz0$qDf+0q$SjYhT|1mOVHaTdzcR5=C!9MVkK~`#nj*9xjHc--E`=Y8~-9R6iI1 z=aj&!2(=3--zKY(OrG5J{JS(r*KvS%*vQx)Oc(ufG>)T(3@*S$dD688Apa=QTd=NdR1G0P6*E@bofN=38 zU1u89tx!*mkZsS|qDZ9dd?>`AG*)6Fzf=RG3=$d8E@bRpRUQu9ffVEAxK>EnHk&~C zVo07{&#H;yGaH~X26UgSkuX^5QDP!qX$pgScPRKO`B6|0ah^#YgnY0A!rbMW!gZ}e zuI05uKUD$@WghkfSKE0VILP^vJ+#f8#8?6JAS@Lm7wdM`jq5bdgfn5;Jx4}+jJKri zESrk}^=OzrlFMhN2`))xF1}7&Vx*?Vqp4|}Bcm--Wl-$~*sN39&BHzQPMm8F_r4(J z44xV|`hFGClh=MAgsOxbammQ29A%n6kxtY=MS2inYlA&5otI37=Jp9HQ@;dv@l%0# zK|6o~bqoR??6<&0xCq6$0GvJ!>&IE(d>E2D3Hok@)zj{5WmPvK+(V#)R{(Yu zq3d8Ar_G7porXJ)q+Pq@r9eQPxbnHm*R8xw`Wb*AsBwC#vNLrw>!6uwesTt?Lk2ju zp)?i2K(mv2EcGlWx;N4#TNPc&R;K)MqZ1LDSjI?DJo!i;b9SW3iP=v#A>k3(aoea$ z_H#Kv>>-K zf9|v@la_bP^h_T1;MHuo&*>EoiZPIu3lmflXR+*dr~PWSANf9UUR zD+YPz;K;jE`@#sR`{zx~hwcq8O}1g5>B&%zVkP(NBm2vherexth_>7xx_T72?!tv7 zv@8QxJbnrIJdgpdRmHYmd{y<)lAHW}Dy}1ockC4(2b9k7oGig^-w{E7@a!#C~_EX*6j zv@_~kP!gox*=gUpcVr+-8SuGgUiyu#q-Ns{wO=sB!&_d$a@Q2w7FPCVW#H|(ekB?t z*A(^vJ_!oOW;GoU+gY?WDg>W#J+}`jKWblIH@IgRo2eMG7xc7z2#QC1*l##0WQqjv)G+8q;p3HO%Qv<6`Jfg0JpOMBNOZ_3H9tQI-M z%&~ut+>78&yzvFNAfw;Ft8FVNwXelqOB2HcH{K85Qui@6nibzI$cc@c z4R&4=!3DxIfYl!kXMf??Auty2{9Z8lar=v}s<&Y^xO}qx$yDR%P4bNcbowsV>iC4> zGrn-J{cnID7=5U>JAJV}2;37KZ8m;0%N@H!bm&Sp5VZC@*-)-!?n)%)%mzRd|94>8 zsh`*2c@KhyS-&oCsuF~fQZdSE*{^$FRe#$jIG>6peBz)AFjg9j^sI`m4Q&rxkdKWw zKoJwj%kJ6`UEI{zzeo;XhC{MXfRdS8!vY-napG(z>jyg(;JCjA=?U9MUt8rU7JCm6 zCJx@fHDpFpOXM|+`v5Apj>-Pnoc`!ev!!S3piM7qYZz}u1_SkrM3fgJnk-(BqW_R@n5|%wm zbO?{Fz)e#z7N&^v_<%uv1mb-*A(;RbRM|Zys_YB(2!fopMDSil{-Ydm3J#?po5f3F ziXh)}Lzb42l&p>=dWBO84=wxYn5rJdzP$7rlvkA+B{|ldzADMD;ImguSgVy#tT|6M zxh+A1f+ZhQO`ur0A-c!lcJ2ag4EtD5!467T+D#M+Uj)yObv<>yn__)6}q2NiA)QdogSX$)_fn?0lT`1y_B*w8NR>PDeDbs2(@|F{FQyi^< zLJXog+EDv=UxC6&-RW#<1e~1MGj%}ezzI-^KbkEmkg`dNSn}f^?eqhD$WVrAK?=xL zN*D8w(&HPQlC zmEDw(mlMA-RXr9^HUBFfu-Cz&#YX@YLZoZC z(eWA&1cara6KyNt@V~NiWAr!dcIFZMGyz!_O+I8YFsugMh>*Ql>F2;chq?OtH;+;4 zyc?rIXw$}}bB(ojOZD4EpbsB2R8h-XF~IYV++kaaa&5^UcTfT&%l6oamHg4;-Ke6l zh_dxQjz`3=9|Jw$4JX5*%hs0zp%@o^S|>erU;cSnqD_qRMMsWRuQJ3%mSJt<5@03N z!R<7FE0KUV>a@B6;W}ud3XFe<+UW+2!lJ8 z|NTB~SK0Vq7s&p->*+lMG%)RgP#wOwy==X{Xc6SWoqHrJGt(iH|2^9QV=em2y+5M% z+r(=N;WrHYzdq&`22WjSRlEHOH@Kev49qdUt`MFopBoScM7HF-;{U0&p+o(Xb&TY) zMAdFDZ=7*NXv5O!=hw4#BMNqvum28MFC5?k-`{1aC0MZf?QpmDOvCe(^Xp@5?oUYX z{gX4*VTSYGk?+`4Uf?%(5ZzG9u8%Cc1$2h*|MvgX?hS93EA^%gU`_9Ry0oN*FnosS z0$A8T241a83HGBR;{%(_f}h~9`5@mq;DFh%s+`TUNi)AX^iZVa5MoN@IKsE;6I@E zokakv-G)s^J4%!nmTDNcZ4qcP@d8lSO>uYz>{>%H-^cMy%E-Go-3@oHJ4bg*bqQIJ z41TVW9QHMKYa%dn>xjcj&xF0R>xaDimMP0!OAxlwY zyh%f_W;t{gSSE?7isDb6MNu+M{YumBr7xl>^U*wl`7xnHVirr54k-Du4Y+kyg~Z&g zB5|}N>6N6=sTjxZZ3Q8}h&Q7oIJMGh<`C?-2<#A6g4@C>o^rE1abpKB*qOxIdcs`4guc9ERAX3Y;KxjpaiV70&2qDSaQenJ6 zG{##IG7yDP3#k`MLr79Zh#(RXHG+f)0Rjec1QHI(NpjvDK!lbAN5^k|-yfcc?6daX z>+-B;t-a%c4ZdCz$J>q{GiJ<0?=`D7jv4c&!{kR*uQ5 zoY@9`_;dJ*^()4Vxx{$K@XcSq&u>Sq`I07} zNi(M;ct@?o|Mte_V@{Ju4@if@7M3o*d6RkW(mONd@6VZA6;WzV>>{rLOAZNCp z=f@%BjA|-vi5%w2MHd2ZpP?19XKcFe3^OE$V`}aPhRWUx42iv8ombRV9u~5vRY(Dbp)i>R+k zXHeV2WMZPJQ$3a4d*gtcuIZTU7|yBd2Fh-oZ7lKPhsJA87K-IqZ&id1iH?QA@{k3y z(R1R$$!?uZak$pm^!84fpt&}Taa@IaC<|h#jO1o2&bZ$T5|xf)>%T^>k#X&n?ykQLi{4WA9VgtZyl^EfupSe8 z=1reY66sAger}qp7uEEC^1FnMJE0N*LW+{aK~P{__w{!wF-+H}wmAcZLpm80BcWEE zR`V7VTQ2j%9RjOU#0@r|G`nA}pMs4wNBv^54 z{64w166>yuJFH}jA{)P4;Dn)tt1^t=cVlo&V1k6F%FYR)nH0C+!c2bSe#Z=`dNsKj zCx~lbtzg`8=gX!0<#IBVN7P?3kR)MweQ))rhN!W)1w~KDUfRaphxq>h{wd|Ba^9e{gO*f1$$sg6k)#Q_QdTy+HP^ z+|8<^rwtwTW5Dv8%MfRu{#n2HdPo9eciw79foNmav;=LAVW;8l)^xh0)n{l#S(~X%7LGd zy0f9ZIP{@NO~81Py_h_Qkl)Rd(0-xF{M_@&5AnJ!NbR@`4s#5OAkou9u*xL& zqZOiS>F_RDfhiHoL2nUzPpIi=6}#Pp;IISgKw9%LW%A9)7`FZ%w?o5e@}jpKPD6}h$I1LiLj(O+I|nvav5#fw<-n?X z%{@x$3ramP%651sr5w)6uSqs%5797T-9UfyD7=#z(~s zcQog3tH+e86f%eW>~#>P-O7uDkuHX(A;O}W~{cT7O4 z@Vbh~!zSM{FS_w#S8*yc5i{LfXt*VjOinh{KyH`qrua=hDibeBY%oN4A+rSIFxh0= z8H#|h6-y*{jnBd;BVXBuUF)5GG?mlz^OYT}1Q{aAMk8sx$7P|tm*6&GC%dQ!&8C}} z*C3ya84g$jLXQmZfPD1V_H1$TN&5I}iI@X3gMSVhztH}v^v4X&rA4!skU3k_?$1In zH=~_%7H8iqZjkt)KiN9SpE69oh)pPVP%WY>pjb?ihJA|=Ma|g56sCmMg5eCExsn)> z@sa4hvBgICvl?a{_Pn*Q3m9ix@4AfB#{8skwaa0q$JmntZkxj+ulY^-4@0%n(v_{X z+s|y}G|Au&g5fA#CU}w?sU{f%up*RCG?uDSQwgz+gf59}%}D4f=KJ5pz+|+RB{CaP zZyF!l)@bsNHU;;pZ)`htX0l!;YQ9kP0Q+lhNE6aP|K9&H>TFz;Tejqi=)q$aC2B<# z7skoD`r)gl(b>M<&-JOFqTLRMl7iyjPhqmDQVJi_uuWk|iQJHY1lbsRBB`B4@^+f) z5E~Y1_@Zi~38tP$)8)Dj*$2AoHUts59X~hR@lRvvMNis9;nA9O7AJxc!}wI^>+M{P zh>5~wNQ66?;M{viBWRHO#kJ^hvb?K7t?b?_t^|$tKv&1AED;lf{xPFx;(KrE4=*5 zAb5(a*{g?O?ml0Y(@?y1-$=qGtfIn)^HQvrX;KM#-W9k&};eC?DS!MpUL+n$$P9`^oyiIKkq_0oW z2Vz}k#u6}?c=k~1WjeC5C~ta(A%%X<-gG<1lxy2Pk8RkpEFeXO z=OMoUuf7cTW}PkdKNI=h{?kwPux@yEUOa{0aolb{?USp^zF;s53{U9yN{x!iv=u4Q zti%4N&d>Jp-Z@Ql@IclVJpb14l|dYUa%$dv|Ey;GxA(_-l}#Ti=xwc>5Jbtt_Elyg zT0J^BU&Et%e9g|6ba+UPPmI>OOUSHk&IiBDzvjRA`98D1c?W7sUQk>`J(sZIhl7sNGc&=uCZ`Mp!FZ zf1jp43yU;Vlrgs_IUAX!ue+BiNpCWulw`mPp6mu{{O2Epj8*?TLb_Hvy82w5S@Kiu zWBd%x!T|SF=0iN~z3PQgNLw0%^eCr?T#Zhm?%vTs7Q55yQ~}BLL;)8&wVA#xUY;pg z57y*eFA_mF{j=`>L4ir%@%`ipnp#3WJFOmSB?m;XUDY}TiS42>wNZ`YX{bk^@F#ba zzFj7xzynym^LiR^u~gt zN2=5yxE*a|G-=F?)Z}As(lml!tMh=X{@zgATOUQK6&|_cI|Vu-p!u08L;T@XhD zvm%OnPqpXU1gP4z2`na4s?4j>Hc;GVT~g8s%MJ%OH~v02GEI+^SIzOg1gXpPRq;#; zV0vkgUO3>@ddB2s2!T9Fz-@(Rjd%C)jiv%GmzwlOvDoMo+p4XOH{DT@rLFp>?)Yto zO!-s>3M}LUW!Cw!+`mmTA#K_{2f_w1Q^09I1kkl!;|Fh`g@?kEq z%Ku^=Ub7@Kw_&7E9E5uShhs;A!>oU8+C5Ew`pyGDgKV69uKwxwAT@P$ZZzkP%%8O9Cgn^i_sX=Ac0x1a(^_A>5j6%i4|Tx7jeAyenvO(lQ41X;IQ=?q9r0dh zTD@cJP51l_73u&QmnRO>RTbd2RG6B~yvQW=*|HTt38jn!ojS!D9yj@e5&F&Z$>tT8pIzRg@QSz~@Qy~`&-MHxWHpwH;k~Z7HW!4`O=Ma?z z>%1bPN1#1}^bWAIxT@P$L&|^o%}tQJ5nmN;c_yoYb;-^Fd0m+BYH$(=_|#a7cmv!c zjzr-!H6-H*RodEA)Oh9r93e-4(k&~$a<<5G5yiF~t=3k@ETW}USTyR7l-;|?EKOAr zTwAi(5Zk8A(W12oAx9gb(IcEwx3dgO?!?a8Gn7CLg1MRS!h&2G%xXvX?C6b;+}D>1 z8)EfwSo@v3s%Edn0w{i$zLrpoW=m`ww)w^PCFTN=Z;QHvKC|9YK<_O~9U1A(W|3t? zuqJq1KE)50OL8RXn)pby={yjxt3!Vh5LSU;l@K%)3%8&Q2A=?hMyj<9+DwJoy{WL& z;)eC8WG4)>)`b$A^!J3SfMS)V8<03vfH(w}haDuPksculi;&sHM>>dr57toyJgHK> zphfMju_86;N-8sq>vvm54Bv+{Cg=%dDP@j;bSI)ZVh&X(B21_;DHM4UnKX?;Rhu@e z>pi#;6+@Z+bCij8J z(Y$I#0GTV1g|ejCfEe_WqFL)kC{4l~eP-{BVzoAA{+{Fy1~^EK$?7Pp!N~D%gkDqf ze1$;y|L#@KD}6!h83O}OngiFQ@lWRAHtS99g#}QZ%3}@>!u`GueC{3DUS%IjTiW@^ z=KUCxo^(h{vCFb((q|`^;79{_nIvsS}C{{a< zkW=S3iFY#392xQSUA;RQdF%()=2`0M6VqvJ8P zzhwl_=w#{JvPZ6J?T3Yky(BVaWX`dk!Su-M;LpBxSN^EP5T13)-B)Lv1q$kVQ0Y!i zZz4JSWIr!8htw6kD1nzWn>+EgEKm`z>wUMFk}N?^1hcbHpBot({j?C6JCWV7o;#U+ zx)y>nB@?)j-;KP4xn5;U-<{0MafIMKQs1smLtr8y7gbgWB$~b);N??v0!~uDvIuv{{jA?v7!*IzXGYP3)nm&6Kb;`p@a|?E(qtV9*3@S{@o- zta2dT5*Onr;t+N%B(ICmkk*1!I3u3%h4av&eNdB^PWvy0az%tyQoSkw&GSny)tZc; z<)mpLxvE`^PWOpRKL6+!?2=;8 zUOuKvceC6c}nI1mQk{l4Wi7(pNm>~KZZR>J`F2H_xDQw=NsYH=Y8A3qy}6GF!R`cI`-Z5gj*wGR$p84&HcI)BT&9)U_HM3 zv**p&K@S4SB2eD#_9{wB^(^~rpfa;S%7u=94K4dwJ?Q%28x=3TM@5YDY$iJM)Ru zM;MsNOb;w%20+4fhj#C^3j3E(-viicD0c;@zpMc7Z0q?8q|s5_1ehoE?Vqfe$6RoT zr}ouB7W8TzgI~llz{~XG)G^i-V&^c~rN1v>VI5{-mOMbrENI?3vH=05$r*5elhFcx z6vNgt4rra24-YIX(YmVkEcGD)dTMTQT9_T6R~jkdI-~fGVSYh4$K`>(fYxQEl=;;LNu}(xsmq5Wf ztnb8nHU?;69hXK~fprpWeQxXV;smaWl}^PruC(m1qw>>nM#u;6dG345XgSInY#pAp zGc3eB(4Xu}>wfb3RAfEi2TCam!ERl5*7@mc^a*nd=}ibgv6WQ&D%&XqlnClKMf1to>OF!UA@J?kz|ZRw$Eo z-!ZdPImmP7Mu-LHQ*2|^sYlC2;9ThTK$l}=ZU-g`lu<8Q%~yS=f879w%y)P!$8gCz zk$bEX1dx-+aABF%^#HC}7ss)_9FBidZROfIf_{{g(*q=Ccmr4^yUKy(g?ug{_Ib zfLED&-WI|gFt-}hyzlbO=cty4I76gS$lbubm64r!R7GS^lj%9ut|7h>EWApleib~n z4ke>1<=<(OY(FfdeY(l>?U2w!n&hjb=NCm=yRQsf+39b`EYj;QvHI_kJ!?rzB<9N* zmEeZt5FkmZk}}Q>zf4M{5o{eChovuD4i~r9dDx{=y#bKq9fR=Lx3K16cUNC%NyCUm zX{$=SvH!Z{vko1Bhy%`_#qYb8*^l*M8g1Cz;df5i>|4L9(yFIZjejrizXkfNo2U#2 zB^8OGtG>uE*~FEs!q)PmIWS?%O0$3HPDC1S4J$K7bT`CDPXF~r zD_A)?FoC0~=Z%aJclRGb$gPQnT=12;&b|}j6ZUOcbHTmjwajQvF5q+XM96XQErgAq zg2#@jy8zc9bzcBbV()zkJkGDbx(smT`{oe~`$vETYd_Z>Jn|2iFL^SjF~OsDRZy}2 zN8aPhz++dIS?xumk5}cu=|{O z;E>&Rr7r*rVs0K-)zCT2;*Y$z_@Npwf6-%q6aMJgJMW!k|DKa#hZSt0N>PWv9p`IPi2PtBN?#G(7lNQh6Rbj{JW*EZ{KF|qr}9EsMT$W zk5H}RUzF=Xmu=8cDV>mysoZg>=aq795QPrj~#Q;c;>Vp2EzWde^(%u zqqfC5f|zGN7>ET0%<2^v*n6)S@am!V{15GGXfO^Hf6PC+6zpL9wf=1^vULbFB}PK# zFb1(~#;ysTWrz3|>-Fo0>Lc8uvb~A?h`YJ|9N09U$g3} zLUg4gsiF}8UdiKrz?)9bX=1woL|QapJAibL9@Xz{fLTS2L1sW}ZECe&>o?Hk2XTlio)xN9pR(}2c F{{dQmQrZ9j diff --git a/samples/docs/font.PNG b/samples/docs/font.PNG deleted file mode 100644 index 3ff79cbf77e828fa6238cf2aa8051e5936ec9bc3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12028 zcmbta30PCtwvN>+*Q!vpidLpt5ikPQfCvbw6;Q$?qM#s&Rth2r3c<)2y;Kng&=5o! zEf~-u-~dvlP)CeHB1AzH0+c`qvk(Z7>FslpU?9Ht?tQP{=T}b7*?X_O*1!I>_F6lB zm-CLrUw`*C0)bd;ztd(n0x?$?ftbVo=X~&sPW9t1jhwOBAjbhm;2^U2=7<;2~TqLifw#A$n)Cj0IE z!~Q`(U=|<{8&8zQYBcw(*}>P|Y1ZFb;bAZbfmpYma3!{4{MPmg{(7LBzt~->A^5h( zc)a9$$~*+(dS%NtXRQq9P-aasnDO99h{_Gin5~9%y8P=+XjIY)mv6}=PE3b7GqGx* z=He)eZF8%vIzi1{>E8$+CkBThUi0D_K>e@Y}q z-3l}{YdQY(jUYL(%e0eZ`SK2zd-<15s0f3}_Bf)sh@~xT;_(CMS6>RyQ_yS@WMr<{?h^ zwdkKcjJ!sQ$_f&`NP8mK+`q2?Yd~x3!S2CW^RDs)S%RlLZ%I!xFH4w|WiR2PBMDQC zwy8p1DN%^ab&2{rbhRzJ?Ur#=hoql^!?31UI1da0@!r*LRZER|OQPEz>+Gz{+Xr>@ z5}oqgCSATt^u)w;h!}hftu6XvC^u4^N1zM|uWCEAiCu^$(Sk&AV%6@EWMiy1CPw&F z+a5i6UrisFuwOrC(NL$>aE<@H-xi5S{~U9$r@y4I%hWNnzL?C1yx;!9&In~ zjUo{3x|?4iB)b<)cD^L6B zB1VWliYt&5_C-ne9}IHTRHF4e2X6x!T3i3ys_c3kVeCGm>epjAQO{}$t<`|Kog|X_ zsDeOU4DASjoK?hzI%iEoW8JoqAJAm1AV;Djij?#bv#6qhwiMQ|8l8Ns!$ zH_|NQY} z$wTb-lbvWW#<T(5R57d$WE7-0-LzI1w)M6z_cx#iwuL zK*VcL$-sVdtS&Tz)1b~Mleya9lwbvr>`%7pCQH-gZU+_>=wzc&SuDFWXnAxlV5x%# zLR4tl_^d4J-^qYHl2R;RKH**3{S^X%&*5Y2hl+y3p();+Y1u}v&2(H?Qw6`%AzayE zY<)$`g18N)LSw>}JZ<9EszI6uWL=00N8U`n<4sUZl${?bTwFJm^XDrKV5Evpp7}7)WG`E0!;BlyUJv^(lH_ zx6sRQv5lvBXCx$`DqHn|NvSJl1w`GD3>#{-+Vt0n*KU;RqB}Q_`DB4M9{2<_k+9Y= z6XzvWw*(C(@nr^j7%FLtXgs?t>A5tgLw;U$8jdl}!498-G?B zOMzHhOH7h7tvRb(0ak&kM^d|*c?BGo&k8|hWSSEWz#1s>z&L9=xfnYc!1@7{(twX> zy)Yy<;^B*K+#9BCZV+SvEXS4!nE4*UF&TE!(^y$ro?HHq!(oK?7=MDUB3t;uX2Mph zKiShJrygHpRsP_%{Nv}7%eW(D|B!25YpWDG<@HG2JU?a*q?tEoTee+G)O1w$71+Szh{-ROcmpS+1!|6%s z&Up?Ot>qd^zLDb}9b`8RH@$@1l5kw+KY>2m`zSunu%eGs$QlmnFq9XT#ojee$D~~A zmWvf0C5npZeH*#+x44YRP5>#d5}ua`-!9WvO%;`OYWcAlwPF^?DC)}sn7 zh%snR5r0T64F)c%*^^9KCTJ)%yl1@& z(wZB{W4@_83f9yEqpqBoA+Gv!?9Bw`3@U+Sp zE_n`qLb-`+wOUe~H9y^udA8$FnVx1_WTM;`kW2w{vQuSRJ$1eDyblYf^&jOmWW<1N?1l6Fmk@7XY5If(Sy)y6y}I?xkLTwvU(&p4&h2E&mt}4> z4cj^7r3V*%9{wPv+b7};QunVdHq)co9b;X*2@&}6X4R2hORi=tIqm6zp$ef}l=pFb6}Y->zm+;ZT6&~j2-OOGIPqjBgWtDvGMVn zchh}Phr`HpQl}e1`>emYW{u?!@Gh+$k{jLK6&DA5NY8ZiQ(vL@qiFX7lOi(W@HdOs zuX%v_Y8R4lCG=t*^TPx5f<=nrT;r%Wl>LLabmhv}BfAV1yvaD?at*95NhUoU9hC}6 zp4a1CtmgpF5oe5bOffE$%CvjwP0RYs4GW;XW=06_^UCuw_rU6>to@0QZMA>tX-~k4 z-xGs1=QbEoXx1PaNOD>n~W%!HR4_+ zsgYg)1^|^P4$#_%b4f7a3k8(8th>xC$8%ikxYX2N`h*ZYv93uC93%PoFn0;2P*9qzx8 zg;8ITs4TD11}%sD&^YBK@)x4~e+A+7G=OF@3DFuq?qd%D`2p1=%cx+3!54OJo~A_{ z&Q{tV`|n;ZuZQvlBaS6gcz>N;uDlI1tErt4bxB3;%0?WmMR6AgPxO5O6528PR+Dd& zl;2QLq5l5$UZI z;|kUF%3ASGb51OBQN}4&&=WP)s0T72$a@uy%h-CtqDoBDRZ`2&p#d*-KV_Ks`SEj; z-NaK$m~+-_PU=n^lroW`E7WSSvYfR(VHV6rX@d6F>&_b1x0E(`gQc%q_5}w?7__{S zaLmSFj;Eq(0pA^IqT)}LGNhibfOd9!w4h-dW!}oTnY&gwIpClINKYeso1&!s9+=Z7 z;uWk0rWU@$TZ9R3DFcny!o^E^%avaU%Sw3d&%fYdul?MauNwYP8sT$n>=#e3GLWjw zGITim_nL-fiB!*7pc%s%ltpouDB0{~GZV>e5WzuWCLy@H54os$$NW5NB7nZi%1nBu zx0^Ed?}?9ldQ~YKXRk zftoUy6P%nVhj-*EBk*BOE|bPxrM!D#ZG7?ZU)*Qy(c3_mS*1+2-M$GyWD-aUpxC8I z_DM{))#hLD#vjABWNZo9IcxSV)lH}{eNA-KPs%T%d)n;`K6SnKA39V zGvGD*#f=ZdjhdG2v4cu4tfNfovbIo^5MquZSa`>@gCZ3aLlw#SY}Y9Fj@}m{Q@UkU zdZR~^G8G{67?hG^aK@WGl_;N|=YbZJXW9D|NLrf#(Qee5iM7USO$~<=D`$hYOO@0{ z9h>M>q7IPSlwEJ6qi-thF5E{HQeNEsdKr|mD8_}6CLBM5TfrK(Q{;4t<=XQsue6+;dxgRROS zX%20w@~;L7*>(k_=X+oV|I{0(7J#&QhQY^vF(?By(HYST@I>EuMFY!nNI6Kh5c)Kg zK`_{=uM4D~$*>|14ESk-BI$x0GQ*z%O)x8k8Bu8kGy z&q(Ul5_5qlFV-l01eUb!QN3iVU~!NPTjIhZ%LBfYdk&s@cdY7{FXW!0`Q}YD-mQ$X4F5_feH;3_7g@S zSMCOT{9)#AEiK4(zsR8>KswW&yf9*3Uu=fa_gFxB{HIEBLk{ z&`Z7okgfqI+p8c;AI5-2jD9`aS>GXbsd@8OrYMYr&K|-QMzUQ$8RtX0s8tv2G8_$IWu9zR%1K$avbg z)H?@03Os|vS_ky`Wc*w2K8;7$dcI4Bk6?t#-p0!vfBtvQ9O_k_}Kx-zs6m>oSA-^jUFV$*aRK4qEzDcLoR zPtw4_w>7BV@@=M^Mc<7HABW}mUOy78>g9mHjDZh$trdKVRphuVZTVk6|2Xt#zz^~y zht#*1w=X0$+qBNaHXy`qc}5!Z+X7m%WAUS`0L^Om9y`3DbdlA;l?JU77t&;$P8(Yv zvBBJ_KGheDHP5*~uk*jq$PQfR`H@kQfJ5ScC|@B}*=y{{!^Sd@vm=&UT}#hB;)DVN z(_L*j-O!?&mlX_fJZp-UmoM?Y2y6>jE2SD#++awASj7)YN;c_RWTN`tAC$@GpX-kI zG7mJYH(d`OWP^m~Rx^>*j^(mQ#Ew|nDhc>?7k;bX`}>bCt+z1CGw@_O7W6y{dGDDW zum?WlR*t;zxaCm=lFI*JA;}95o*a;c9`%Q5tKxc2hC*VY9E+(pmex-yh&5QweSzmY z$)bZ)(=Wa+Z-sZhXjwsUt_?m$!H$u^RD)IlMt-oDs<`u;)*$-r?9fnv5Hq(m7U(z` z908|99WD>8fCtL0`T3aCxX-)Y(_t}@W<11jx zt=fwZA|J{gQxN@RYn0oE0g&Ut5p32@|LAGae`?bgD%U0GV7*FX4tli8^UlxTLqao6 z`uDZ9ryha;vgkuU$C2J{dV9f7a`sW!=EnLd-_&!OeX9?kHb4m3mL^K4t*V@FI_I`L zY?NVb6LtMGvOm_XTIbp3$h>zrIyT@O#lSNOb>v|d$~?B|CSaWi3cLIA?gy@p0Ig7{ zgx7FAYEv3ou;@a987i<9ECmA*Z(ME!fC`j3ano|+I>3&wowDDa58`;P`c^a8_kB5} z8VKnvv3D(v?dBz%V|uZP`9LB$6+@c0xwE8|4q=*AdoK)9 zB;9MW60JEYIh zpFdD4JCDd9XE>z^4T2DaLqdOixDbT$0~~^e9v&t2e3CM!3Sj^fcXB#Ol7hsGXBh&K z6ToY=JM>5K@>X9uP+tu65U5w*iG+PHLDPbqtEMf_uy(DPBIqlvQABpsbYQxHBvX2B z!PrPtyTHst(3kX+ORcCdx3gb%+_|hFC*k9U_0?u|ivR-#9v|>+cFwNxfE^eV8H7{a`)dwo}f8KW~DL}$*1&HTQ^@%`I#39QT29g_N;tgqqk^EczrK$AG z+t=Qm3dlx<7U+i{77?Wj}{P>qnD8eDKdT@N^?V5QJoe0>-Mn zwD7tT5pXUX(#sw%k;aTPY)q#eC?-S2OY(2|wv2k1$(dU>UwAwQ1)S9B)n$M(dwAo> zF|@)AIPn9l+J;W728WF^)zNq>SF^@<+VhGbki}8Z zm<$_^{-_Ysqdq zQJ`ox0EBh0D6Te~v4_bv{33vs5S8${!-=^~)G5${P#CRYS621dv`%sSv?pI$V^Ne< zu(q5i4ckxE8<{zL+-@1NrTaca{SvEm$#GK_djLz+v5Mh7kexhX z;Gk4zXCb>K8BGlLrLEOc0=PQnAU~CDR=2{Lmt=o@1!DyQU2JxzE0lEr z_7XsvL|y2qoHqHOPTy-#MtTK$WuJGR2jvS8RzZ}u1`ywhf!yW4Sz8>M&wV@^Amb>h zyFsY~l&8Qvb+hLb8S)r83C>d8a~4vUBj*yx-}IsM2uQyfteSgcTm7dPS-zDG=UlF# z&g!ZBhj2rr?D&+UC(cvOqLA9Nq5Q=Upjsb_LGx{EAjFvfr;BfZ9M87S-1`WN(I9P- z9Qv^!1FLAX|6nw`rR9J{^*wnZZHObFwcsp<4|RqkFfSW;3==J1gae?k0TT7$<(7j3wO(^(8345FIKE8K@lakO?pjJiS29ZZ zg$n2o#?hx7l`B4e7^C!bSEWky28M=9{zK@%3`!8v&Le0SN3JQT0~b&f+nx^|ZOqcz zHzF;#%G;johLL7`cvreq$MUXVoY~j3r^we*>ExYDt$h|rS_fp#Kix}}G;s0$@{)TRLXeL z>7<1Q>2lJ{SNgqy?qB=lJzcQ-`xj*Eh3z%izkk0ge4AhdZW#kNLm+y^k}fbZHk!>#l@xcTn(Z+z~(7egHqP(cL~+?D*dXWKKVBPqvWqQcjJn@axw#xjah zc_fpPlR>)<+`iNYJuo0SNa&^41(5&YRR81W<>ll`ZUx+Q&jyb5KWM9Py>4XNCs3>f zyKw~#K5!f6|D@8RWKxoJ5|0#;S(WtG)gPZQ@$gNFq_8l9@Ln(Y!a+7zQotIOEeUVq zPCkZ~X%<}y-%oh^j`9q?|FQtSpYfks)f7XshZTGqOv)mT$kqXxj~)t-m9M~Vh4;EH z-xWi3g8=|8%lc(SZ?@vMgmTYSNuI!$AAGUnzWN=itb9lxLta3$CI8 z68wu#hHpjrNR1q#GC78mjPWe1M=fDxfU88p7r{cisb_kh@2}NZkKgCfTw*}!4*(C` zOiLsRJGlfRpTJxk$p_6w==RJj&9xHqc5sUounjN`n260t60(Lwtcw)*Hn5EkX_A+R z&Jee&iFI0`o5JLa_Riuc`ytf23Ifq8k|iu{U`c#)`HYH_1K&BEBueR zGb9@a1mfh0eXrkIHyZLas@{h8#}{*IsHOu63Es%3g>4R}j@hy?2^!`kmUz50FH6kL zaz>A$&`B|aoEW33q39upA)-XURIwgD!xN4&^3-C6W4YV4r*;`@i-+TwJFG{RELqar zJ=uj5ckz(bBgm@YV+`VynS@dxd_3MJtZVBRt!j6P?senxfoMz)S~7{G_}sf5Rh15~ z%RECM23rglN;YYp;t;QnbA)f(oCT7ON%gN^14#>r$N@>b`bf8WjQClS|IiBwOTc%o zyf=us-z-^H>m_+IF#gJwT6gB-sS^Y1_`kkgB+OI~ zwI1NMVd-938e1ACqMs%lV?XEo@?NBIl6B975gGjfH9T6E$-q+k#^!QNW7=|SFk0Is z)B}C*?INm+K0S2Rdg_b**uRe#iJfR}l9ZnR_Sd6F*H?{Z3^_8a1%VMmk!>H5Ka~B( zlN=^jugsTd=cFgb@N%jo`tj#qjysFLi8RtNpIo>!bP0{%Rap5bQ+& diff --git a/samples/docs/logo.PNG b/samples/docs/logo.PNG deleted file mode 100644 index 413d6dd9d4cebf15dad9d4c2418af1562e8e6bc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7393 zcmeHM3se(l79P;5R1wAPDk`L?m?|n=v1KKOtSp5F6e_j_tRc8!Q|-z#;TaQM>7rH= zB*f@aNIgJ-BL+2ABp_jRCHR0e(Gpn$QGyaoB!<`IH8VQ_-Nd!$bWeM>_3R<%_Wes(xbzI0YS&& z0rX%hW#i_J0C0{y)4Jm|^w=fk{kU`hn0?juc9JAlCj!9Y3}VQ}53}N*bnlf4VouI~ z+Wb4SYgU$I5g|l;pw*bS2&2*b^8L@)ZXGM=ij!vtbf>Cg&XNH)z|Lyq$nPDYrzQklrEQ~-2mSBwn#1Q zaRr;K{S0uw#Hm zLFSf&5;kL`oRZ-L01H-m>-Qnai}^@zOj!WgC{HH$|IsZdhyL^c;RZ7Yw6KyH!zEH3 zI>+0w!9j4_PKg`CIQ=1A_aKa2x9`d4aP_O!?SHM|Y$ zW$81J5epI&4|e9W$woH}As!jaX9ZX#Y|mu6;-Ext?a+Iw%#Q+C$msWV@%<$#W2@mb z#;T;1iSy`vSx@kw7l=39V!j6K|0Jm*p=m)x+xIx=90A7mHsV#%PYbw(VHg5@Zyp&3 zkNGh)MjY~ZibMr*K~JXsj2;ieI0j^t^U92=1|y_CO@{c2hONOpW|{OY6tC^Y$2LN@ zcEFoz{#-%EUH!nt)SmCvu*REU8Jo`Ln*vY+<`Pv#(<7cLt?AKf#4O6AYp<91^m(%J zj3#Zmo9~2?9gyw-yh*yoQwsMBZHV(%c-JwYPuPS}Q2>VdXmfHPZ1ocxvPSEg2V41h zN|QDgG2O)AgN%)szxjDbDKnM1QoMqx*R8CB+Wf_ghjD~Pu-TF{XrS|_0Q=|PZEJyp zXN^)sTZ7`Oozp5uu-;6wtC(u-BAc(N{j4{%Z1ISm0UJ*zBUQ`~gUhVYA|$dcnF;wS zPWpPsh~Zl2RMM)!+D4NQJJ<+Hb}dD8kNN@N(%wO<+fBl1zvba=C!$?U>B$VWVZLf; zri2WGh&8JnLi&u0#A8CKnN!FwE+iNqxC#6}3KrbF`Z?2jn{RCUoWEjzjLlm$7L(oS zB?Z?5KQ89#hvdv^Nz#eH~IAnwA5irl=Y67MH3dIQkl6s zF_w_~HR0+ox1itBReQ>Ps72zn9)9YEs0?>9n`w0LBwgPa1^r&NzS(l8o>hhDK{f`y zKcKd#kRF z>F)M+sT7Pyf!daS9Gy#xN{@CbOF*~IV`JDG#%k23!n_&{T0LEn%c^5STB&Zx`Dv9W z0HkPVaSN;X46|s{cBm%QCx+i(*3EqQSY^7@-zr{;sOW8 z0PbIG*yS@7P4JWAIRKEb!uC5h+y&MB@#tUx*k3t$dJ>bLMToB-GMk3^huglGmT=tN z`9j6tLqgUp1%$llz9h}V=>*!DR_}g$?y;LQT2}c?{fv0<@S*LYz^5y`{}8co zQ%K)h=eHwVoVLjmmMr1T-5(b|nZ6}UK;XI>J0T7m{5KYs3Aw9DBj5r_NStI1m@VVb1Gq;e*!#AHQWKG`^)weVl7 zA}ZU##8PUfLwC*`#>ZhxY4+aU(oK)*BvMHB_MQ@;;?U%AG4>As%b8IwAAqEhYeh+S zG>qNdT|~J^_5r8ktoyU|4<|f{GXhhv9;ARhRPlvD-Ll=?pH&knv3Bq4i8+Xnb5yYC z9T9n3W=7G4q;+>H{A-^tl`4wvExU|#5knOP3%mW!;Bdrk0SouYJ?!h5>wAlO5Z$tJ zZD_$Dud}pt*_lPI?+ncHeZF9;>3g?p6s8a|sbU$8a&J@_QQRSNbdaQHj-`izi%6Ll zNz%(91GT^8tr6M|6h2n7W75+~bSNf#+yo#p+DN5P;DAS>!or7?GDt46;a2YF$PVT5 zMih*G);JQ0RL^}s9E~j#3qXRUfuaxCGt%&?T#S<9(Tv+@A>brZNo&nr zG8(Qj(~%x1998{gXxeSuP!QLO)_6cVji^+PbL7Z*Ep$6w8d)?>5bZJ#67MJ@gW4TA z;Q1ff9%!IoiD*)aI%!2m1rebHoG7Vkgk_iHcy>mVLQVzEHZl;UrcXKFlT^PoM-u-0 zabV>E&yVTzV>XogUf$`T-Pyj)U;38GxIO3W1Wd?(Lv`&9sU}?Spo+6skLY`kP^gZf zy5HS#Ei?6+zsNB%mw-zDzzK+CwDM4t#b{vfqF9i2OYPn~_=Xxf5!QrM%e6%^={Gb= zmG2XW=LBVOhsLJRXKG6x#~Y;zwGwX!DX&ECVG|h+cU>deQf?`*VN`;`D!4$gN1C!V zuzUic3F*sd*EN*eBH?ZBm_2vyNjWuN$u#<%)b45-^bE#;$2v$*@xp}hD=F*DmIdQA zWZY1gq98C=?E7Mbyc-?`aL{<2nD89MqoYS3{!gJD>q`TbX`$s}wjC;z1Jy#XvFInb zl~KASXYd8AerU$s3Xe*Zo{2vasOTr*gipz4*`eN%%q;Pp$W`;;!W>@=_&5a#z;lT-6$VJ5!!k6^$EOoYWTtQnw zq;z);gy-68kIPrrGi#TZ#@NNta*{6DBhUWG-mrhlkd!WYX0Pt4@&!Y@)%&m=v!$yY zr~7#W|F3onUh#dLAJ`(A-0Ym(>HROaxofoUOU7U4SAtDL+`0{dp(8O(y@7sA)6Jdn zW9NC7`-X=2$Vv4Z$kV7+e*2>@?xs`X_lWuY2X0Jb*8Kz1S@~W$nk?gke0G>ucAxPd*r3!6W=**wTX#;vl3Y05T)191w@RB(jihbC}31jN(vA_iXxCG9YRsiBfUxs z0t(~^gox6m3qe{Sp`-vm&cXA2=eu*~&fJ;%-`xZA&ilf<_sZVudDgSm-if<<#gd2X zBo_+{3y-yx`E?c+c4-zC)+vs|`%gmBEAH=KSOczGnzEGkiZATn9Dix53HO5SXg-5|N3R^gueA=VcC0QZEkWS*nQ~-9{pzc;Sh~2LgrmWh5|YR5+`6R zaLCwH=px&+6zj$CNX1LJhXwKvU&_CGextTg)VXGgGxYmN%|>C5&&UFRdieZeU7ubf zvhEj_toQh|TGd&#M;t-wb?UT0rvAkI%2uQHbb=(aRT54W-E9L0SC{{{J&+`K@G(E~ z`5mkL*F$KzMOWK@TXUO;H1~ho7MDwu@_*ZylELF+>w7zcdpqn?|9z>AZAix3<3DZ6 zeJWvfZ+A7UP-Zr4m#{~>{NaDbh*B{X`A=Kn-|gJnmIOtsiZ!iuh}DhU=IL?!$bHTf zIZxD{80iw5U}gt(tUiT?E%rnGsr`w#jpZQuoReJ$fr`_6w!Ja9e-)*OfF&26M(IfsE+XqB6Ovf$_6f#~tz+8l3A@vc#a|2NVA{ zJ>(-D@JzS%8qb-Lu_Mv?N~ZUnp}Trb*hY2;Hutk?T@|*cW*^CvtPW|c@^~dm-wICer6g>!0vxFFVt;pyd3*RC) z`7e682;Il-4!BhD6d<@IM>ocs9qF4t-$S8^Emd`+n~3ezU&wzZTtdRYwhcLGz2j!~ zxs#%3{L$umR8#hOqh5?$b*gu$d;|SR505WY;ah;e>=&rqFQ~%TPWXcm_JG1Z=$Ejp z$%6U}A5i-0U}2D`&P2p$@X&P_kNoPW-gt9rK~jkFd@dr9fUU+x|89JT5mt0rc>3gB z^yYl>(1cw1>MKQ4`6~@YDyBHQ;4TlF@x+bOc;sd6;EAW0Rh_q@g{L3#j^~912_U{o z%mfM0>K>Asl`=mj7(iR~>0-dAzE2GAs;-`F8O+Hn>nZ2Pb*B9@Rt#%d=&|dp`Pn;- zQS^gpkse!<9kQ{E+ov{hS(F2#2uEeY;8TXFD6_$@z)qBo(_CJOheXy-t zBbzPjKX~tE*Xi%IlSeTGwnW_jji4#k_I}yLp!B{8;qrw-&zahqEp|c)$6ePwy)4dh z(8#>PuTHug=ZcaMW>w`l*sx*8auPcAMos5&3%glwW0=^5yYt)2b?l<_I={U+WxKTg#z4`5NYo``0T)kt(LVItw`| z(Em`m$JD~DXG!e)aQ*oY2=<{6tQYJbmWFK8%osiYq4tT`xqp~fS$T}tC2B0ZwWenD z!M{3r@_|z3mAwec53>($Szj4>A(&Ig{O`zvfLf0F)4}8GqW>|`U35rh_Qhn#7w~WF z?T_lVZ;C!@UM1{5Jx@K3aM+AlAaF^(T)q47KaV}8p6tKP$v@FQ{jVUkOz!@lFw}M= z;@^QtWJS1^!|6YxIeu{XzXUapXG#AxIT{wNjiiU|gh?XSpMjB(f2~J38UAnXwP2C40De?Rr+rOy$)&3>~RqdvmQSe_x!rq9(#EHM0qDhYo+3m)L zP>XiIVH>K$HVM1K+`sk~jCP7tf6o~C(E)Xo$=(Q5)Y_fJGBK$G4wbuqf@w;LyT8CY z?-O@NzzpBS-DxoM+3Ho*-&R~EcZ4yZdz}T~y^X);%AIFBAZ&%u{GMe^-h9#5F`oZ( zCwOl$Z0D<~1%B85K%Y$gL?HzCiHQ7Xcw2#t`TK41hEfaQn%|A^U_rK?Xs(yP*C3Vs zZ(j(O%dL~l)0P^+p>DF~ulB^WnZtN~JE^~HKFf|>~NalMeF=Seo?PJ~fwl;46`ueV+!UTawskvW+CEk5Xyk&^2^ zOq}v0bIe*;-?6L>%s`n5Eozy^t@Vz`Pxi=HWbhEIH=8+ZrO)dsTf5UO=6${}ER9)yOm%v-cw>1-?tlAxEflwGK=zvA0B3u6!!m4u2u0&>60SG=Vm8Zn*rm&~4CdF8ZF44G zZab#}sVTRAPsQ*7H;EoL+MO{%o;fchj-`Jqk`O&DEE6xV_ws?rkv=gll7Ez`am2L? zUo($In*w4h=Cj(`#rQ3(9tj;M!`a!COq)FN<`bF8Mvp>HvkB`thYnR7uosznz$e_% z*zGuMuxq%Y-klcD*PbkAk5_X&+x_}#+AJ@3l7!_uYn)-HtY}PEUBv4@Nf4h z#Ii+6te^Ffmxuf|7XQ090Mx7vhkjFb{DS>atMwYLLl#jGdvG)gA^hG`R>R(Wa^vu< z^ReqABJCp|gy#8I8ROXSs`rfX& z1z50NvS?m}jECtH$B-%{*6i-{g{f9mfNy-{0?>ZMBc7o~fG}H;&43+iOJm zbYt>9&?3Xge83dT6wPQ$BfmuCpYO>!jDejO=8XXS-(k)y=70zlw*#64clJqw<65}Y zG~?I@)7*)O8^^m_;%^>f>oEZs@2^TVe|9ZfzNv}F41xa3q0iAFSkZWrIr2*Lt3BKA$gmWjJZ)H;GFB)4S~U_zgv4q0{5BioCL9iY+!EWxbZ&flY)J;ihF$KXzY6Z>@r>0SlEOlq?z{+ z(0i~Di~HK@ub_H0Y0?aOQg)^J71{5XipA#$1_&2O?6`(5G!35Z3D+X6LefluWxyS#)p59B@;a*a2ynwt`!Ky>~UCkDnFlb9vA5 zt}ku*(;Qh*hsf8B_(3Ir0Q0kPh$ zEuO{?bCVQ9>Q+MJLQ+3%LEz06h9YkpNn+N0{ZH9l$S&#eVb|II4?Qpw8 zrR@5E966qYO3(3-W5#oQw(`0Bw9PorAPYS??*4uI< zxu4~S_8o4b`B?JH)Lb*fXDbA!-pS9;v<0`jjLlLt1L8SL>bUWxvBsEPu44h^o-Alq z#1EzMZRzaI!rZ%wMaxy&;XY^o6jI;mcq2K0f#xi2^7I_gSJTpOfX3{{C`{snfE88l zJNoXB!ftuRCwHRMiBx8R>bulxUtwM!W(z-F-#redcUHFAJ2xVjY;XQ@2@^*ciHlE- z7pDrYDJqg~GH*C`%g8n=eJsA2=2!*#9HXt`+%R-_*j`!<@lE{slfM~#>UMl}EdeN$Pj*?|DV5Yu zbm8;e#{VH#^r`uE&VB!eDxT@nge=W~U}9CL7=PGP$77E~PI^$vf!VVoF)g*<-K%sN zRi}S!DBSU4{57@vaw@qT`d7KiU5A=tJY8~CF}?KF^VAPwHY<5i&Zrez6R5=7?6aaAl8khBD6$Gq7s<#AHE z>Zzm`OKFsV?B)Sl+|e%8@jrfxTgBg=i<&MdJF{`P;LyoS9l~b@gxP##*9PE-KTKKd zUs{bfvtH;peQcE{R@R6XEK4KVY?qu-Bs+K7D7YKopGkrn*6foUAw|tMeTJUZB6a4` zpr_Mjt>k?&Mx<&>2NEyr1n?*%*so0=q3nD=hnwY7`wKYk@?<~f;N$-x65Mo-+bmF)<2ys+Ae>R`#L8#j9#V- z+{Xu-yf9F^!*(C}qNKoRUOtRs$EQ!K?A=5zdb&PL>gm&IM86Ba9;hhZ)ciK>p5$8e zcB!;pC6cg8GZZ~>RXSfTv&n}71z_s`qNm32oGC+SDDP(R!il%bCEIO_d{8DByf=&E z+!vR@(tR#TK-yUj6HYj||E%sxf)&7uwK&)Qn$$I;iZ=7G_549l-N&IUWL!(Vz^+e^ z1^Ah~%hH#y$5;!I20t0tpWhwC%Wqcn89ADZj=<<`fpgrU)m-Tl3|QD|v}*e7&DqON z!AsAuzO;tfzo+GHZr$J%^Gmql{4GLjPFarGfT5~kK(|WMIQgO|{O^g&(>{snQ8vvz z^r0o~jjBn?QJB4T7NkuaeREwk?R$QV+!`8M@)6=@6BgH~Yn7te)RW9vVj(yUJ?A7i zOz1sRB$I3GH|9_##8tkZ9bFOw>-bwso`hce8k1nkcx#d71+DoyS=`g_2JS69(y4rXpHqL>jh}H5y90XiS9BboqzwfGAsuh55vyEU z)|d?{?t~MBoE#NHa5reF{;pft)W(6LSvhs+OkBw!k(6#O9myS%r79p+O8!9zaKXiF zQ2o8JBdSa_ck0YXqKAQ?4`r6h;6MbZzx^f3B1VvMnk=r7NT~1FuIh1aKs$M$Iy2Zz zSf~9h!Y&-zK%c&iR>hI!D;BtlH2ebdH4KEXKqIO>G=h&G&7V!M^5p z6}Zb;^N_P4B*Nyr;HN`XXb;x2=8!8cVTUygIkRAEc*UN=}5M^R4bV;xF1#<(({jjLD9 zKY>=4guI}3rx9M!T)$r-Gi3w*WBIM%g7#LvWb!r%OGyJQQ29^0os16|I z%f9=*2dw;f0L02?WD-hp>Q{DhyrfSwvl0iVH;Tzi#Od#wa3U0GN(fkPTRZ~gxXw%b zONAkf<7z(Ut4`$%6>XtzMwEFw7)Q!&v!#V_J_4}UkDy#EP{4HW{(kW+wX?EqY^M>s zUvGkWyhMiqGZ@w3@`{ho`NGuh<>i~A!KlPe1Ed$h7Yc0pPAakT8FR%wcRzOhnq9>A z#~ejQg@j)-4wKY70JKqvja4r2F9DS*8v3-gYUu66_NTcYiwTC3Fz#uy*Bt|fN^=1a zU_h?!GG~qgLpj9oAgzZ*0wY9k91@>N7fRI`bdK!sIi%QxE0lYCg4;XT!>f|pbwN$F zKBi-!Pc*z_-;;fK6gXpgN4tObUK9_ z!)c(_-2Gq%7gihC=plZ_`NDd&m&k?D;ubth`&DmptehY%XE|X%psetX!3>Z57+v|E zQ)I{;D)D{)2b-q6{F(=r^Sy1mxN#3Q5Nu!mZvHYME5}G-(xQ%#GWz znf%CMR4pRiQq{O%5CXP{q0tv)3SLJjYq`V>EPWmwX9PZC|9-XYn;Q!y3VU)OHoN(AMWY7%0ZpRZo*FT?cy5A5~;n4M8wj%a0P9YAOCbV zzihuS^ZHZ!$5J-hwkCOnQHXhR-&T{So9*RE{G9(LaG7FY;b?zpIY<`1v8sctxWRB`;TS( z*Ax|jvd6g&zuiuX3NFaYjqS*)S@<$rm07mK8>QT0R=*5lcBs!^$(SSIaiu@^KU?$) zCXTYZfQzC4)%jo-O}8FOely-mf%%I_uXt?LLb_|_d8qJ=Xlp`Q9C6EFF=1uDW?@(~ zG#bz@G13V?=L2Oo;4TwANRr0#!sTK)&;lUVuOE!hvYbfm6Lqags6j#E%5mZQIa0V~ zYD)38!93S%xfM3~oTYf96L}9U+Kv{IN_@FrdvoGuhq1bg3-63>i#ApHj@;@o_||E& zIhLt4v2k&h$?dfCeZ6toOd3@y*|s$gqd@SNTiD-mBzJXt%Khl*Pgx>f(d!av5HeqG zUv(ilIR?k}?GT#{S2I^ia-szb(uWLA&{tqv{*qQVsEwV5UIqd3n@nO^5-CJ@Q#l$l z7|;=|fqJj2LCw?Ff}U$0PUtvp)L1io1It9! zJq%cg2*#gFqd2JH?-2s+4M+?`m-2CPzF9$E`P_RKu9Vf?l~v^6V7-tSm#|9c=LnhB z!G=rjcce|vbx%OTWJYC8z0rULsV_NQk=)#ToV~C@#-&lFtMAT9utCSl&8-Yrui+AI z1zEKc!VcTa+KDrKPc686)UY6zZMGA+)G1*^Ayz_0vP$NUpEFQC&?NP!kF)(3@Kv%m zJ|3&SR11-`HL<>a&-Q#j*Htzj&ht)vO%L%EkdsbxTu79M$wLvLz~Eis%aE%U>I)mg z7NzyG$sW94RY?7r;yz&SzBih@qjg%J%u06_EZLVKbdHq3%d?3~m(IDX(eR@@)^XEb z`D}$a)Em&%Wfe(ZytMwF@9?oZ4qfuNwK)rEPR2bBCwQb~W;3&~oU9iy@$hkr@fLbu zhv=%a3ej18Gt8%u2>Y}7r^MF9s(XnL) zzG1#>JLu`NAF>f%B^RET!Gd$P0)VoOjH6E`Om?UZb68AF$0K|;XLe*5>*3(-%cGNd+mYJB&QV{=GJYAOAUFrjos=3 zZ4p#D4c(9O_Ghig6)!R7=DyE{P2mZgGI23Ewo6LfCH?HN4Wp-=66Qo1(Z^B7^q#>S zPLlxV&DyZ0<#t!S;^flk zn|2~NT&5u0E&M3pf*O${5c22`9`4sm?{oX;Ei%Zf@5l>fjozxK{3`5^u~u1tUC@0e z4b_JRD$Q)3R1UGM{XC86n!{+*N^DQ@XM3Ar{gV=F<_Za4r~G5fylAu4vz(iE-hu2H zf#1hy_Okk2gO#k!z9`EU$$CiH6VFGvyW-jorj|glOXbBxf6(&i@pH;qleo?2B)^`3 zA*V>6eBV-}zeb5ZrT6YuGG$>bGpHr-3QRtFVc;ZIubpbLo{M9cOsy(8uGFs_+d8vD zx04hL&FMxg`ob;-BhwafYS;vNj+f!-{j8yMRJFNZdsz-ytMVWJ2$wod;yB+toYrcc zzv|!4w@2m!&&f?vR1OIZ9V$m<*^?>Ve?)t8J)xtVTR+?qEkmwP3+wD}2mMuBBBra% zE)-R1Qly*v;3mVtB1(Ztt>;V}*v?~;s2?{YT3GJ$styNN_qnQ#&M(;@tBJQQBaE=! z=DB6Jt=;cbMiqh{3-fbv1|lu5o5(D@J8lBX@$CyD4oCJXRPF1}?6l_LLmMt$+M{Rn z&~6nk$F_+!kK1lthTu;;zLS+FK*{VKjhk!id|u?|dv!vu zzV{96@K?*a8q#!jXwi$fftp?&-4#MPjNoix6=vVa<}KqCI43zXxBWtVXJ!6w`zI29 zt$W?$N(;Nj)9vBoVXzpyQ*hev5E!wqKolZU9l0-~{UfZuf**P=&q(fV&(ukE2m~`x zxwqsVyfRK1%f!6huaA|Uc%8@Mkfgl5AbNByN&3N8?%~e^J_%LWOMR(F&sbH{!pHA|e2y+O)jmyCK{q&s2fBC7t5UtA;6>RK+7FyG zj!x{aCr{^6_@6B62~zZa1?}7l%wFqFP`5h<8y6J>{qWH0e&`=cdcdc%)%%XN{fnS3 zQrO5SK+ccTR&Xf#vWagmg4FY7$7yvqQnGg9Zq)!>Z;ac}rf0#$a&YGY;s=FL^^Nj= zKbe{=D)W5>*E(l#`GA3XO>(&aQusi;?u`c=*AY9M^g}&OEb-b`U-DI(z(F7AqQ3f-pU9VI7deOvcrbD8XHrRa!^JH56-7g zR)ot^66VPLf*{y;(`sjYWbT!@G3`mYS!o@D6=zV;-(>)~ZSR z%vv&aqt?9J`l8eqtvl=@m2QBoZ<7Q z7OYbj%gN^t(lq@et$!FR=?H%~B-@G~<+X^ZlNNyE8_Uek+@P+7YE5my+j$=qGwz+Bt8eEY3&ulEk}L_)lT-8FXb;@9@>v3$$|QG}-MJY~ zg&<32l%(&e&MhdP@BnGu_JV!m>xuTJMLFenmImX~1MTk5^y$=lm%p1Oy%dyRbp_q= zIX65~8tEI%Lwo#Z=&SJNeu!IH-}vZWT!~5b_I$dmx-PA7^An{(b7JEw`W?$Vj)y;r zcF7~+S(S@~s-jgtJ<3YLIPcf~`j~}S)$v|%nq-5*4@ z(#^d#spPaC(6_UuUEiH!0H3Kuk7jLw0rFxdHqGC!&>=}9rl?G$ zoX^P3Pj*n^IkDoH|L049*vEn1_qe-921rl)dE-p1&Eg^}LNsP)RILAabz{g(uiFf< z$ZwRf$z>BiWXy-SD$~F9=lrTJDNmB`B)}4kM+H~8prjwF^>%JA+y%{zG-`Q+o}?=O z%mm&p#5UozY0_f9%zPKrYFm~#FcB-&N}n<();(r?ru})=-3IwozJcV;wFkv!0t{zj z@D`SmF1?5PnH1D!s3(lDTc5bpdq>438-w!!>9)4=To2Y!&dB$jrU#ZtIcrt$>5VQ0^6e{rmNP- zH+-uUChu*-(A)VTuCckaaH17z=m4ABSX!XX=t6kIcJn~T@ z;)y#>zv8-&~*Bxb9`Du6axnXt21C0zMzdF^Fi z@~8_xbM3PWmgl?^KHJA=dt)ZCcI}h5cJE5Ssah?D$F8sV-b)X6eg8qIxa#cb!IDqv zVJCu0XMWlZ(PAh~u4Wq91$SX;9#0^Q5dZe=VPQS7Y%#5VGs*g8L%-4|zx)kc^xPm2 z$Lo9xpP*1X!b>Nk#v)gkkK~UdrK}8m5MhX~IeWsde2#hcT<&yR^NfG~gp*tQxJG_i zmlW2I-b1uO0xoILUb=_H>rYgLtbEa2aTpj((d3k>acxQ927djrwd$6P~45`ZJ1+QPa|mojln$x=6DUp6J3SqPsSI%ca?!^?2C zw?=zgO$&wv$X)Ut>KqFLrop(07`bDopQ*@2taaJ|Wlx8FgLd;i0yQVhyTa$wCNi)F z7~GC#;$g54{Lk=y)s1!myz}5$$;NYev~7(3MxQ?6IfW(j%bid?zEXBsO0_OMxaW3& zZvbwfrW>i(=hk>9;Aq(b*2}84YSP~n+ShPD0E^MiY@Z`Pp4)C#_vvx++~0HbeJ-!( zSivg1QggN90^=(2stE?#P&*rhEFLbXeOxWPl%z}_iXYhU&P2d~8(EYlQpoqL3x?j) zTdwJnLMJRob$`{T5~_uz{UE2YP2g>putlgF7oR_()oH4?Ycl zBx8VNd(pai(&mX56##~B7C=uGsy8fwz+F%46%hEg%kbR!plD@D2iY{aPCH_F5i}!K9pneB5||=n2AJc1i$ctz(Dzaq-MJ{b;Ku?d&(AXUsZM-%-QPthL>FNCy1^$uJ}cC z#Fuhq1}1d^A1x({6Hqycg7^Vvg?`OxK8j(YArvA#J#yFZG))8y)O*Ii2~^oW2?fO9 zOwEXSWh`s@?SF4q&WpI;KhP;xCJT-2*Wat?$@q$P6A0X93< zD3P4W2als zc=+h34-@be%Sowe>#e0M#b8CE5#Y_j4rt1Rq?&D{re&MYsU+)15SFu2w#vDjRwxi_ z%WloRWLwOo|>vx$>G2G(Rn z6G9MH5UQLGEqp~FZ_|y<^IRzIy<`Wb2Y~S1C~|#LE<9j)`b_MTKkIt$#I`)H7QhH_ z#bNB%4>73qv)9=Ko6VOm1*;z5<6$YJhe!c+_a+n z7oZ+p!G(x<;C=L~Q+bQ?p&K{Pz}kX(_|AhbhmnGIhJLvQ+Ggi*WuZe2>~>!gL#%ii zQsccs>Ak$>{plCIRI`5smz>aVY@SMknq}>90f5F|Br0oYYGJ-Vp6zFN;H8KhKM1>1 zV3MJ~?fuG7-tPHtaC@hiCDdH#F42f#2-z6EP=>FOi8>XLpFa`cs-$<;pcqD3tJ~Y0 zzzr?vPJmsjaZnR?o&!LzM@}j#3V*!R#Qj2$DE#scc~JGlMY|+9*kKzDb#gvuk5i}J zEz@T&Y=tEfX0%g*0e#|^we<1+h{I!eb%co}uCF8VsR0bNtP1wY%T=)|z%EJ~^{#z7 z1I9jQ=D-7&iFydP)Vl?~=;h7Ze#l>^#ZqQtRRqrAD-QJmWlza@3&?VoXaY%h<$Ahn*Ck!;M0KrpOwO`n@ z?pgW79<)2Q*hXjgNi!Odue5pF6DZ!;uZzc=M>Zh8A{W1fo_=zk@jErGm;w80CX z&V{c0gy?YdcWDa??}NhX^7AJZ|F4Ll&LxUe(gh zt-}o$vT>z1%byM(Z)r|FS`AXEmVbC5m4_JBftT(V4_S+mlNVt1CH9*4XcB9Uo{Sv% zvDpU&SB8yTHxe5*b_YDw!T9@-lEYtq94?wY>W_EA@~5VykQZi>hblBrI5T7?a9!qR ziH3J1M~83s7-U{Dx4Brrx6C;m15YoeKcIWBFZ8qHc}tQn{QRW;Q}fDwCeuffc?YyS z3@mOfHAMP1$h-H8Ri^VTD6&G@@nP$&e%P4>cEtQA&BxhpW}6s%@9dRf+O0n;38i3I z-BS=2JXG?AFJY(eF6e5+1@6drRNO#c^7r%^F+D0i;FPnk5jCU0GTDSzf5@k7WU^?B`rC-D<=Wzh>o{OaIT-r%aYvC$7$_gudy>MnGys z&r+-h5;L!7voxGAU(Id=)VW>G!*?Rd zXgy$E|44i|6ICcvmtRoJ=3UFh2P8fBk#-8Kc(oLtI6!>zqS-nRV*u|P&jN2n!;0s5 zmuNqc0jnSQ3>W*z`b)Y6*;{gZwi7?qwQL#N9R??>-3FNxv<2sa&(Q7{E0F4eWk3gH z&n?l(Z~Mo^p{)EVbu6v>yQx>cwm2^S&Co|s-40_$zGED<Nl%JC_0? zxDq)pvU!@^D9@RDIeY6Q3x|1#bs0#24^J;~(%-7KgIxpE;AEZGnz)RF>3>rB5&c12f2rjm^l9iXU zUsl>7*}Ukw`{KnrbvFV2xO7eABxtv>FtxYp)zZsbG4P2K3(i9z6*u^$(v)I>tDL#! zNteA~x3L2sK=cJ7cBp7nF5Ox0t2$#-YfFLC7ex1IxKhN|h}*6qp%aZxEO>@t|Lpfr z(F?{f?FiyU>dj0H9~D}qf5JnpkS|v^v|C?c*0*HXZcr|;hZIBKJi1n2SejmwehXtF zKQVbX;Z$D;htfsU&oLoTl~9VwK>ZQeQvI#ffziz7e#@tAULv~L>;}F5Tdx?eaSV&a z`aHf3*e=h>*HVRFm_89%dZI=Sp#K#{zD%{^5O$>-v7d z4FE{=$$u}&qx?Z+j4OVQMDa4WuzF%eg)vwF>-`d~2I+HsQ>``^4XBfXv$xcSfb1H6 zymuNyS~DevBsK~(ugITT5?ESG_5jl6GAxU3+u<&VPT#%aX=;fKpQ|!syMA3!-l}kj z#jR@dxKX_aok~oK1W)&m(^8QPGYGH&E#&pY@fn!y3~Tq?gI_$$k`U7ISVe6->l@msqyRlr&Hc)vE3|5{&oZ+n2tbi{g!{U47^&iA;+l z!#S3e^eF6ZX&JD2GrMOQ10BA=t*Ns!+aOEPTFTmJitxKX=00>8Xy{FtxZ6EFee$f7 zka)9n>-)*8@ZbR@gA7Z^9`oC(3H=(Q?LF(kIYub|aez&PWw;Q$8kIbM$;3KW;Q67m zUaeKQeOF}fF$?tO)RMDjtH?c$mGb`KD7gvZ-{>hSYBR^WB1~+_W>BNKt}hoEe`*fQwqc z>|B}L>}~y2R&x967p=trkX!@Z8NM&lu5L@Yj3~T5B1!l2GuSHVk%-es_uiVzMOc?! z8kfB%_gXH|1JG3?TmM=|0$-x7G)r`0JF;M{p#R+FXjOr(_3My8zZyv&1I&G2x!vPug^7P$S#cZd;V*ruiI zM#x-mnf*qY zuXy*$X{CjYvG0|sKL+s0jzbQxx{m!U(gf)l21!aFko<3HQ9r0AYLyqp%NK9u zh=K1tIm$v*;^RB5^*Pwts_HfMH zsL?5(1}(G#NpLfs%W*nXvWR4-+9qokr@%UDq$ebuJ zdQ((uj@gZ2}e3keQs&CXtxw9a8E==j8n*@%8hU3iF}3=U4K{&%gla1_^!;jD2GAw z?WDexmtu>l)J#g&F=ei|&V+1K@X&`z@q7h7XsbHX7w{1UZ|!HkB=pi=DFNcb6}CAG zmp+>zt?9E^AD;ZoYB|P|r=*eXC?EiT7)$Dpt~HmU1=~1Y;;r@pi4|g{VCzSAguON) zhCl?|$HPm<|NKD8QaQFnt{R=0F6Fzd0wX^Dfj%;-4(`K3(RTUwE{kLVBZluwXc;B* z*4oVBF+w&PjEwl#)orbM`a|zk*IwnOl-rAUM>RdJM7Q3-aoI$b+>Dxizv+9<$xkLR zn~3fQ-p5>Xkr~3daAP8SHE&^?%|i40>z=IWdj}{cTekE0VK=LiCFl)@7s~HQOqcPe zSK_^GHg%NB17`Gsc7FtPxY?+j^2S&^`E0pmxAh3p5;C--b~hJCv1}2sowxh)bOp1* zKGZOf;rm6K)Ps%f%~@{U#XlG)&KOnf%((;%n}~eUuYi4NewR&PhtHCq&391+N467| zPd9U+kS*7ekDbh{ljvvK84um)*Yw<6!v6_M>X9)xZ4S9wHe9Z(6vyR+ zyl|&mnI=3XPY%Nnl=6_B?L)n6Ac}KfpfQ}p)kg>1*t}sd9C=HDj|_C@T8*&dKmy?Z3ZIbjsPC2Nds#$JE2*AX)6nf{LMAMch9xP@fha72&|HH zyWq9V2>ksk@i;kk6O9~-oYU-(pgY2sW(I!r3v-`SVV921V7}tHY9yIW;Rjitr3p-@ z=Pst6xB1r7D&T3|P=me`ZG!DsOzlGx-4`O4Vm60ss;`^_-?QmcdMY(Mr=)iaSCzPQ zpHG_6E0cG~y$z8c(m+m5y{rP>KdC@c`K)=$xpIi$fKg>M_RcBAkC>IzpMj0U6$Y5` zVokS>PW%c|)f*+P8)bW6hSiia8s_b{EVm*bZ?T@D4^$^zVVn+g-|A)iK_93g8pBBN z{Lc{hvY%MNm&7@je&w*du2wVRmlatS2L@arPoXZan&_m?j?@W~FW{n+L} zh=_O<=`C4@dw=&%s=3qwTBYPI@{g8F&+{IQ1iMTcv44<~R^;^ACps17BvH~#ggT1| zGcOl1=4?R91U-SHyd#K?`NTyStIY*Zqq#No_nfa6mZQ9Vl|=gPDd`p89GX;hY^N{3 z3(@Ljk>qh(K4aKt&{(O`@-+^ORaxfY)7#lJMmAK>(GL4JP;Ogu)%$Gh7brn;YJCz* z5P2^Ffw&<2*3t}76~8=|*6Hx5RO-Ct-Y2*&u?bND0IidhbPKBLSm{2_UNDWhOK6*y z5VnMl51Q5=WL-u_kCvFq!K7%LH$7FQdma4nG0wn;2v8wAYIhAzfI~^BxKaE?qwYzx~4%MnIMzT(Gbh z%2+$|la?C3@uH}+f+!d{iE-BOe(aC$5S(6aFxJ?Fm9VU77Vn~Ng3B_%6`|MHA}$h5 zd0~bGgZBQZdK~%J$G@x0ghK!bfoErb-+e?j%~_Oc!al0rN^y*u%L{3+F~1aL z^Q5oxz4l2tY1&CG`NS)=H_EFAH}4oWem%uET9xTqvLPT8`n+9$4^f-q+VkmCPWLOJ zS1+x{x~=cY^-<{e8t=;)qapYUE>ba`HXIJeMY`n ze`ux6Wt(wf+0EQ&^lH4Y#U-CHiRCYkADp7yp{MVEdj`D~pHX#Hs!m&Sxe<~4U9+ZR zydN2Bgy_rU3h-IiKGDA!;+_W#`{}!T9iG(bu7>~R*SQ}Cx#!Ke7fc50^Cq%@-w2Qq zKMia)UY0$hNOYNcEK~o8o7Z3>bo-;u#Knn_yM)<$c{{mP1DfT%B3t)?x4>E;my!j` zB9Q#>lDsxn?nnb~2kmfk%1U3xfB^&lCC2-S?GOOtwYoVr8b@Qipf$dTn=2KT?ig4@ z|D=5zb*tUz{gin zWlt7nQ@vdVJKx_HQ?9=y>9SE&d?xYA;y4?}gW+Tqzk$kyPoxn@v@Pp|_^|qdv{L=> z%WSp~ljcLHk^y3^sGia;Ns1eNv*MaQchY9m3+2%2IRrXZtFeaq6`GYz^-WlW1jIt* z9Xd7(Rjn~eHujfl7d(v&mrNYgz?Bf?`V{idMC#zQKX|zHsX*mj%k>`1#5!*qNrdlq zmTxVIfPhpzHn?gus_+%&50_`cU*Agq9I0y!4G>g1y8Tw>wQe-Kp&Vw(3kvjTQD;d| zu(j~~%o9?Ip&ZIq7|dTBYW5t{m8pZhoIsb=q|V+6fWZIkupEE4`t8}EIFhpMT2=~! zR3Zmk0x+QJQt)6*$y{|uHej&pu}#WGuLaQ0pn?*AxRQ{z4F8!^6XQ%Rv2LP((g?(g zgda5B>|qFEM4xyv3#NUASBz4j)ncL%Ovf}$*+yIX6i>b-ef&Q}y?0#F?c4ufrkR>j zj?9UcXl3T!3ORD*>be>x?li%`sN4#UtjyF@EVtsQtWQor&8=lBR}Rnu(cFZXmhD9P8#9Jn zV-13`?>82pwE46c*RwlO*&9LG$ZB8*c*3mBe~S)UH6}9~mUGk4)TuXnJY%3|5>jOW zO1UpiIctKpbfQpv$?M^oD8udlTt{82stB!S{c8Sfe{c5Nzr=2de2{?Ffg@%Qv%5eh zFK_1AXqXHzno8dRLl9CVJI{ME4DuUDTKqpn@O>oxY{F7@$k9bjR&EcWchDj%`a?CvxS%@I*cc*u?Xx8iN(hzc&V-?S=2RJ}FiJ>)?D_o|EHvHTnrTkPWSY&SEk6^O6z` z5_vt8miEUFR%^LoMVp*L@IG4nng8N8t`qHD2;W@Wh+l$o>mFAxzatDz)nW4af`!Oh zj#n#$5>bM^J&-db=*bQ(5sD3f#Tvt=kNL)a!$V^IV?_&xrAo#0yD@K_9I@7Sa=y+txcz@7? zjgaku@M4V&qd$ynNmS_aq+%z$(p%>bf|nXUxPhVh4Sk-LA243XuboZC7ZcXT@^4yWaihZCC44;=iLX=~U0`$L?bP!)8RCTdm8z=Xn0|0YSw? zR~1PEvAk-;pvVbO%au;srWvm}H?V=d9fB$Po%u1)%7Ae@Ih<2x+Y2?iZW47k=V;G+ zlu|j!6Q>-q^Yr;L{ZYyCq9b@fV^rD5^V593qV`wq54nOzx^}@*$qejOy-zud8QgDi z>@uU)Wk=i;*EJ{t>mSkx!fHG@@F%SKPfpj;c9{iv99r_bq_l zcVlB&ECeo5zHBk(zN<5Z)Tz;#1qwMh27`Zv9N(+!u#9lY4!(OUbhp9{zzbWPzunp} zbR(7^{C3)>`dfKA*qp7K&u~ApNN8S4lW+-$A&#n>c@{pO-vOO+AYQJyTqSt$ptp|Rh3@kv zBF_E>fklq;=kuhivO#tEv?gj>+yjn{naUnWfWg-q?v|8r4_OKi%3c%eMH&xFm^fVqw#B#d%*WlyBmbG~|t# z$-VGJ9IXhmn1sx0gfA${>wQGT_16UcTmXi^UDnn7xpp>xYesZWJvB+?te4q-)!=Pt zUzojgx~!%+#b_#j;2SJ^?`2T|02 zpu9G+A;^6?hPx^Pp=3>;bLg))O%IzGeoJPWCE?NAakm;_#%f~i7jOF6rrI6goGr4n z!cR!a@3<-(sB6bFG!lLOwsu=$ISI^tsp-{d1mKXr$XhC072a$VP9y^7;GyuN}p8T9zq-DV}|KnX4=B9ReePe+L z!<$26{O40PVn9g{e8?|={BLT-bl4f4HoA$J#A6Y&;jNN)B^4$0miFGsoF|<1d@9eq zl>9EiBWm;CVVs6_N`s$P^syqrvjH1S&afZ&(DmwO4?zcN>=&}48A?GgPx1o3LFlaq z8ongvr4!2v$Oe~esn<4;7V?iQ_Igg6DF|MEu=AqEGOw?8Mam4#71$g-$p7Vb*lcfj z;V{2GO>3YRh4ktGTfkTa4k)z2-|?71P-WhMwH(E)&nIp^{HTss1&1z&kBra@Q>m-) z;rn@Q+v)Vvi9Zn@lFi%^z?+?)*M*+W33@x~m~%GL^}A5Z8pWF=CXU;;Fk16VDD)UE z+5)@>Td@sAqSAK*ZFVz@;bSrC&lXHqjy7d*M@%mV8I6oih{UOkf`3*x`Yb4`Ynb<2 zO+*b*LI5(VymyvZvCZl=8(MF(fe{cmu-{wkrnhi19YZ)MUpf4t{p3W2?*3?RT?3mv z&g=|^H9iW<_E!#q$Z=zTvI_>6On93lxJ5Jx|0i4BlxlW0TisIw``8uY>smN&Z|2vz z!7^5c3iWv)qk_0eJG`S2mdp}=GYx#IWl8H)!nLpG+hYEe7^+qBbH-w3#H0n17M{%f zCE)HyJ5ef_`Y4VN?h7vjZ^WzxSz6o7c9ZByqFTs-0_qsH zn!#9ym(C(ADQ`~%tJE}X@TI{^6?kh2==4=U^p=c7pvQ`ZZSC}TL$$(zE9<|OpG1uB zFbh%O3%1fK+bpbhqs0=Kk5L+B}{)G^M0 zff$SgPsGO#)KXV}OsCL===Aok2n^bLo`YCZ*Pd2iu{8<|*jedd6$Bz0XDT4^7h5O; zdks0uEV{yU^9sW_cW9e5igIzPTpD67W;0v^6~6XmfIGW6m4{-!%%Ik?%&z;=y)zDQvC_JPbD0CB z<=S~-4_MpR(v+7-Ij>$YmOL|_cQ9GH5@IooC8yqxlA3u%0>!!oTLjEu=g>;FX<}0Jd~QnZrO}Zw)D*_qp~XGlS{J5s##ra@{!$#&%?udnF>yLp#q=jCAUe? zD}>eBVwgRD7;Fx2c*c?W*`(}i9$%dK3DWsPf zhSj)4Fq|5VdPn2@b{<`gH!By*PPdzAFu-B_AB_2Z2aiknhGle7&0xE?B(Rgp{;;#)sZ*UeG;F;%e|xNHBCmG z*S>lbW!KilWXil2&!MJ4;7u3w-tFHnCZ?X*E+kJLOD-LB#gwHQ+&x?~1 z=uX|k?33I(L%-M&>7MaE!u@xB z-SEn&n9{hDfPoJ5$kckiX{_V(HLuhBKb{OH&!KAB1Jr2C>`}S9!|*D(1;BR08a}CW z@$L|YU4-?Q(3Ye24=9IDDsWzXISGVfLen>S#*hfRITUVL8?5DHK>yY*qtt^_iLL?>SPJ)}bC`Z!u^U_gBKTN6uzTq#1pah3vw+2nJ}v z1X;A(yI2(a12}vSd^L=7DD-ji^oxssjBVG-3?m{)Ye&<3>hY_0{=L-Pt^AH%1GP&Y zbxb>O3O>*ia~QfLL=i}Dd|39%%TJPZ*-KDnSatcRAM~mHy0vS3OMOqLVL)OE81K4+ zAIuv-bW_F|hRJqaFTbuHG-$Mg#eOLvPkjt_3fWKGrcX|7E}BrxcxxI`?UrS_L6Icm zLZ^Nrw>;x85CcLj-c{}t>}uxcu?YO35yQ&PJSQQ2l+CG(7@Pofa0k_wwk{{E z^JADKZ~JbN-gl`^7v{tXKctnAJu+x*OV}aun9qoP{05!ga7UuC57`UBydQop3fdlY zfi9tQ(hzwPyY$EIUw%>3=}!+=H*k^7kZeO;v2j zB|LYDs&2BQ5zoe#CvC$CxoOSQTt!T5?XX)-69(&Ix8smQH6+z;lM=i&tHY}|nKlnR zN1HVESF0GOodkpK9T(t5>Y9spz66^DJ)qoj)S`bWr4OAim5^QK*6a zh*5Frw4Vl0{?o&tZo|n;wAn;zI4Rv$@$y(HIBq>CQD!cAn-Taa1^K#m#xg6NF74WS zd8R)vwjU)mxL^~p(b-`-&m=PDDNT_nuX!w$q>_Ycab#0lRjc78CPbnA2YX-xmS|ON1G9qtK1aj*Vz5KJw&&0J8g6{2TL7E0p!)o#PrF zj4n1Q5^BI&^T2JBXTD5x2_RQntFfDt%40neGRkgeKk)P*brPc1p>3^-mr+wgQKC zfNg(b{5Z{bR#{3VBlRJ_(@QKu>1raH_3)L&RMgL6li$VKt9K?^_n`ViOj6+<{PGjd zggt(3qwtjVnyTt4-)S(`kheMp1dF^Ac=JbiB>b$%%c^ayr#-SEdgOcpV0~aAa;Z2O z{X@Ru%dcJ9)P@_l?s-ld7qF4iz#Ym7w1ctttpk9}{(qD)8`a&&Bu-rluxfGsi_vZ% zLCIIo)i&1|0|(>QoGyJle{Q|Ae($ji5MEV*z->3Fnyt6wcxPu?Lc^9xMSCT%Q7_tH z8|RGOxQw5-Mr2hKFvW}eBMkQh_Qh`U#U zW+|@a&ISE3-(LD(c0^b-;$fO_=YeyXq6er!tJ1IJ-OjIRe~=do6M$M3R0)(vW3*!O zs^FYz*)ycmw8{($0wf6ioEW|*0PmJU=~YhzBo<+yDVetapt+z5!KY}edN&A(4Tty*mkVvzKW(f#U4@1geG$;C~k2PFAc19Pn94Okc9X=w}#9P z9r=DcZp`WOlm5oMxIX{%0fwEXNJGums(bBf0qnFnYsu_~m_=ZwR&Wlw%ru-2vOjQH z_5ix<5QnsRA={^c8mIGl|Fr3vv-(gMe7musv3D*gtU?Pz0~NAI=|jJe#5Wmnzl2=P z%XDK5*6b(pLUwOjB}|*e?Xe*gGy)p?4Fy?V>G9}430vWhX#yeUvlf-Tld#^&3TB0) zQ9+5)T3NMWuCke57-R17uSon1BbhUks=i+$)2lks;=`Fs)oA^MPLe3le_j*&3Ho47 z&D^rmVw;toQ%ot?d57D6*T-5uTy*I$Tg(3DeLb-gm!23a&z=WEE3$F2KEQv)1#guZ z>3%_lgToq8LjE^Zj>1Z{KAgxbl&vfM*!BJBn@vQuY^Fwt0sANYv+D*(7IbJUsOx;) ziNL{2NtFx@bJCgU*A;t2NGP8d-1rOk2!Gmh+-VFvwC5Z+VQTLNpZ3-;x_l3Gl1KZDE zdq8dm!)ITJRg5lZ?{WrXb@tLLz3G(j=TqoyN~7C8AvsuMpZnbh->_zw<_?UvSTtOb zZ~47-!IFwsa4|9(j*AT*h=@h~>HRhP%PD}vA)}Du?VC|NV(eoj)%@!0CHmpbY+PCx zegfUH1e;Fbb{n-+x^S{()*NI z^4)zWco?Z6eBwL7c&9K!VlD|QhTHx9CT}E*s}u zvBuQfmy>=;zM6VImhth{ekTBBQ}y!2-1S#^eGATGohOQWyhe(UG-?A|-i^3G9X}M$ zAE~W0B9dX-2j+Bx>|@e4QmJU6zt>mQA<^*Jua%!^o|(T6E<7*3GHv1c=6hZH%?xcN z>T*63{3^MFO~nRJZh0I-fyu5604-}MYyeZ?*vp_b$%ZYzU&;lp|3%BTpeX_55%8+d z!s)8G848mS7}L@GhjROn9I5BiU9DEUDs=uHIDo8RgNUO0bu#F&Vap0Z+VZ~>F$JGc zC21)2SELB|8D0}L+wn_ zN6=6qORMUHN-Z6mfRy>8f<}+lA1uyv#pS+oQXP6`Ca9CPUXjJY>HqQA> zsc2nxN7r+WiPdk(Y^%zb@GbwJyLWE%0~ep=4zGJYfYl8L?PY2q&&`s{vof8=K@4nD zwtCw1t_uR{04x}F4W*LrR2Hv&%jh+05lxhgs}^jZj;d>~^}e3K&sKX9YTG$2%25}Z zbN^5(LVCRBSPGLYPTvN#)6It~EQfo(o-Ci0wOC%^D8=BtaiLn1y9qQ4X9*v?s`vQT z+G1go#?ENuP>cIKEMP&xrDYUX6KzDX!t5en*_$s9oY+IaExn5isjJ=apEfOCfNIN` z;zs*iq(M6U`)2T;nqmYz!?Lj4@k9r>jTN`tg6mL~HIl7fknl01mlto3o6GfjYw!WT z(D7~Ri1DI-wQbGv%YOY@A12huC*!@uoj zz_CEl=R!wr#vgu-#S7eP+Z3C6D5o6oK#;)jbc@(s95tp{oR3z0-{m@Wv^4W*ghRpQ z^;Jim)!=IPx;lU_Q3}Lo5OdpU+IjQ0Q$N}tFF)yM-#FBB3b{hQSvW`^DH((Gg$`q{ zI5r1Py60HX2%0`o>*a}Df8XrGjntN$!D+9R?DvB|?q|~7jFDVRn_4aS!=-Kapul5;Kv%T#N@K;n?js$vC znDWFsGB4gQluBt{sJvTkh+i`m4g(E)J=Gq6*R=G;&<^1YMwVRIfEqCSRdP{0eI9k~ zQf@o_`^_(|dgB`44(^Gbj8A*-yjkf-s=D$nIXwOctv}}?vd6e!;q~uZAs~=mTB;Q# z6D1fFz<0o(c{_NKrjf8M6n(Jy07^+qPD;#rTgW>gYW(7JTllz?mb9X(0?37JTRZGy z)FsL%jg&6Osfm)&dAkooBaAi9OuRR3%+f47`!3j*esbD&=XCPj;UDbb9OS?o(>Dt3 z#;VvzEjbYEm{v^AB{VAWE^*+{+{RYau#d2{hS#G z^qcib^cd;HtIAWhsrHcRX62#G`;V=6R=`ht4Z}LT`$i$$6gS|smqy`Ty{gFNjpJYY zAea>8cuqCwG_M%2Hf%j0iL~-H;CyE8!-cP=e$&J=cI-j1Bj_vrOTg2Bhy8b$(954P>&z=IuYd z*&;OUd3<4pWgT2YOen~)N9KaX) z!19nHbJn^9yh0E{kTaPvHz+TU8qiOk$P*%oiY9)uP+%X*d763YuA>_!gp}F15SWr4 z7qTZ{+>@Q5qJXu(kz&GdyIEcetd29v%tGrCKuTB2wH$u~Nf;LqNQVws%an9vaFowT z)9q*-gT|2~Fhs<#<=`zVtWTC-N3HMmguEotEK!*N@Yh~n)e(MR(`*KnS5T~@Fc7IU zCSnfZeFtwA+wb5yT$JS(M)Q}(P2aC|p&wD32b19{+q>@#WnF$3fn!MzhQn%E=JU{# z7`^_1AdJPYL%(ew5DwPvt$!j~PI0r^Qka$1I&#!;Svk^TTMup!PWs14Z$iok4GraW zSibnWkwW#E-09`-_~@X1jM^f{fT=KH49CDYc%n9ZgSj36_E%8yCh(j`hJUetLYb-D z8bf>VKog}PRDwt3ZB;Bzu?J`xVi8YNi)EBxv$|_&F}-@jZQiZf*?(L7T-e1kXS(Rx zeokYebr1haq!##T)X7u{Sq3D^q?bZVp9sjeJoF4egi(#PkBq$jaP}TdVc_s~LH4z| zvzdHw#KLM)qZ2zSNyT1yI~*4ybh~=bI)=ztOkVt`k>KuE%6H;=kX#~8@(pe$z31WU z@v#UTSIz(Tgs6y#PsEFx&Zd>W#<|8nMr0ac8$7|EP19SI;KtPuBks$yp+hHdyq_-x zdbZJ{vu4*H_2?h(Y(zZm5J&>LdQ^W~iCMGSxdUWQB-LX|-F!PfBPLB58lijy7G2_Q zkU2f@Z3Q`REb9w?t{q#|+(d3RPMd^HqChcG{E2i<8`g`nNWmYnY~dD*tJ2Xgv?%$X zzNm-s2$qda?E1StxTEuIqvWAH7oLW~NF_?SIPQ1zpP@kj*=Jb_oBa#D;PIomblKES z-IKy$>*cyIRr9F>S?~FV70XE&B|9YD+cIM$)M?2EeqkQO$&l-#h;Pj!VKYp z$S0GBisQ%HUkonm@5!jNi>x(Nk!i$_Or~eHqnk2a4Di1#y~QEHL*0!RE3~hO)(B+I zT$^c77MJdKQWj+&!&Dzw`YkE6Bw#@&-@JJDXmz$`!knflT&swCl8`mT6dNyztZR3? zUa#ZZ+Lql`6IQF*hVn7Din^`S31$slJzi8iJ*9e!60B&$SaLkH(m8sm0;$xn>3hxJpy&Zs?opa5YQ(bGK{PjlNsiR&uM|^K4#Cgc1OVB63gy8-xJuy$?tY{Er@)!lG)xho z)G$O3pL;%(p7WiPT^K)4Sx*6IF;@tzDwTTsn0_7Kg94O=rm(WUzKHcj1DKa;Sw@a{ zRCRJqE?+jdK@(d!pMXdG()KmIYWbd6{NtC`801A_6to4DV+i}@I70n(3Ble@H`e`d z91#vki1CvaBnCd11wLpdKM(h7Wcl(tk~Wfbp3v<}Pje&?0@~7fpxS$fBVr~p_%#r{ z?EX4M1K>;YPyFzz!uAo6$!GZ`CP-P%gy>tiUv4iLHjke+NkqXOevea8LPkvDy%Abw zp>)0aO-8N`NYfN#gj{l4Ij1*}^#uh#SA-7#Px}uWnr*7^&nDTilRqOZHO)#*qe1}4 zk`C6?@Lfeq*DTGk9vuwrL zMP>bDoCKbbC1JoakEN={Xie8C@#RODH^f7=l{mQIOGK_Hqui+Lj}b3Xcp29zF0Oi$ zB(|Ik*?I#2Z>bVpCA@cU74w5|v-~mTyk9gb={~T~eDM<_I%mx3cchm5J`u3AOP0&; zc;pR$Pn!I(E9}G?*M54{hdUp@p%&3fVxvfYKuA3;u6EWU)a_%mc)!p8R$qsNe|IJv z5t8qA5EBx$a=0jYKIoo|v*2rexxC%YLD^%2S(h41uiv`ZnNSS^7WW*_uq_Wa6PsFe zM0Jmh6Wx#H%-qz^@R@m8I^pSfXYU#R*%oNBtgFCW#P>g1J|2Qs`^XuuovY}nZ6E)# z3(f5D6!=B=60k0L)m@l4b;^Meiy#+f98;2$+=~;VC=-!lPC-?#--9P8MCG8|J?ig( zC?a#~vll6&ea+Al^X*wW$c#7ag@T-WLuLp^;FEWeC0ZUV8zOV9RbregP>EWKbQ!FF zZ%T7qW1V+_+{`$PS$H3M@sI5`;d28O`$<`E_2)bYaYD9uX9!qGpI5Z{eR>~j(Kh7y z`)st14+eI;cH^mWG?kqg0!45ur@@p0w-Q4w<&Zcc5W%7gkV-Y;%a@_AN4;9;D7PA` zM!c06$toZ{UhQ*SY*(aZ0IQg!7t=UDtBKfV;M0rFDs(O!lMh%TT?%lcALBcWt0ojW z8QMDo5N-{MProh4Z=01M#ti-J^MJGO3Vq%Jf$hJPhQ-2|bCuKk>}A{7;-|mViMch! zInN&_i~ZMi&Ym^Yr)IFz&7YZPIX z(kvL)@r{MJ3=#{ICy)vrdFxGQe6YDBV$1gz4PaH)$AT<2tvJi3wiA3MzKaW;3v^9< zG}UG~dI>;huiJ!1jBA>qpQ*id@ONsQA00QQqhH41*RpXE#4Ycuv3>+Y%+oi`QQ0(~ z{_v2ZhI%PTI}ez(uN8M3^S8LMi{2$$?|A{k&>Hr8!c0D z>3`pzs4kTcB1I3={m%Kx$)*W`5KP3{3+IzfH!`V!^lI6()r$um?je-RrRvJM&K-M` zQN?yHi8yQn_jZcg!x|7tXA*`_*=tg&V!JC4Vm2hT_Fosv+Q+qdFhHP!9H$_+OA{KS@DTEXq3KK>w45PHbPR&GS+8+b8`aMYiFC=!K5x$V z1F5So@6}^E4kq^Q!dKv$U1O;w-dhOD&x%M((zgXSgm<>+IlQzbk}bb_kbgreW4|?o zg%r&X9Z>>xZfDo_q`3^uS!8Te$)&dmRC&u~DQ|GqZQyp)xP8jm{A>-S?Laq!WbJ&` z*p+f*yFPuYx~#h|ae8RXmth9Q#g9NMk;ch`4pr1Bh3(DBsj`EWIy=wbl zOnj5VxnTnVJGjyYI#}V_74Fh&B65uKZ|WLqfVn05i95{CMuhf_&*~WAky( zejuC}_zKt_4K98vF?|+xsvuf@wf?Mm0SsuqX)X*;Q&nzDFWXF6RQ;_U2nZxZ{BQLJ zkQVf`a?g~yC+HjsIwSB*<*ym7x+nVmS!IU4_wJ$(+Xr-ON!PK~6)!(u!1}rCWp?y# zM5$|7YqBwuO!7dv)xZGhWkp-oV;WN@t7dkk5%YdqD@^~84m zF3xJAZLUnv+xmI3CFnx?>r(w|7G<9|{;TtE_uGRXSYg)HezR6L-<-x_zkuWFAz`A& z@I-&qb#ks?lg3lyKd%nOyie3N-<$w8?^>zv$e3m-;++8n+m^3vwyeg{Ms!zAS2?4qd0oLVN-^YvumAM&^_|6!qNdKpRA0*%#V29sY-n z0`TX{$sDr{wu6rzyLkzAVP{>WogDy(!^H4He_oQ^3yy?;@6aeH+~5#CDRu+{o69!2 z{Wa*KYBWxJBG)KxeauaGVsr6lM^Qu;Kw(r$-F$oZ_5~g@J^TIelcA#f4(dBLJNNcR zP(#i7$yD@u|42cAyU7oiw8&H2+)KcGZnt*e@AKbQ_(8!F(>-SkJ0>!}M-QG*zVKh7 zbM>NC!iGrcLz^W{5%TXEA>r;y#+?%~gOA}t1gfC+Kr z>Z3iwF22Jwk-7Q=S+t`m^2#%7q-0=2+?(8B92AOR`oTUcP7`IhW#5>gd)O|j=jqg< zA=HAXlG0FG=yzV&B$53o8R$mpyuWZU)eh2Ah^hJWqOT(b6h{Zpk>ZveXe)^wy8rjM z&5cCFkUOaW)`gCsC}c#3fJf)5KfAf=sm8#ZAs(zx47+I$V_`~PMKPG4Pfh$5>r?%+|;Q=1gcJEa|lMB2l^P$9=*)oz!%QMcL->Pd{1mbp6A zKDm!jod7SfjJfQVb<39l6E4m~#+Vgy`)Zd{_av1!dc6sf!SFPR3=E6VN{w6p>|D;8 z<%grS+EL4OlL0LfYy+C1-Dv(O3dr&{e=r7D=A*NCQVEes!B?~|!3ZbBmFU<1hGp;$ zhCCRw!kjE_Tx$bzRQGfs(D#GCw?hFGBjb8RC8%@mkgMsvU+!OOc~0gSj878!eMp*{ z7|F>MzuKg{UVS3Os8p=_c7Q>;hNbCv4ILfSUD7~D4uuB(q&4OSM($hBo65$AR=auj zt4_<^Qz}RvjP$MqRy7±032pQ8ig*Gg;Kc+29pz(4=5&{p}dASO`PQjw!k?WTW@TxnDXFOKf zNtgywB?t5cL}|Zmk}65kSE8F|KOYwew}L8Q8o8DnZjg96%y_#-*mqUT6wZ%@o3#Nf zm(BI=s}+J?g3#E$DQkE;{Yo0kQ(t>c#Z93$I&Ak6*q1NAx;=JyEMtbQYXVB%ba=B= zIt=56WROd|^l4)2TCwD&jKDykC+R*$-It_2MIFd3HMI#V_fKkOA2F|_w%*uQEkQnE z=W%L4(=Bm>_1zZjY&}<>-9>*JG==Oj0_(6&QjAqA{9e;(XuzInWwro0gvYg{JgsOX z-cp{P5s#|!Z{VSs2cfWm(T=cojglOpQ;-0wNlD=K>0AEbMNx{jYoFAEQ_ zddm~YGE96wlUoH{hiV?VBNoNB8P$M=b+HG*^8(Qk<4KR+But`Xg36Oz$uekAAT|(n zIOwkj)hbzCFOk8EXaCA`5H2QnkZl?X8Oyt`hldu$o>o2@P^QeMcUqReu5EYRmN`JC zRrcG;0-FQ#`N%u9q`kThlA`J{WOvCC<$CTrYc`jEGW;wIl|cL9GC)#s8^mE1eHMc40BYzX#?FSRFCKyTa?Jb0=dBGPSy)7NzJ7qhPmbQFhw#evX zA+pdQFy;o=*=BTay2FVzn)>Ja#5)b=jJOv6Hd5Ia3ng!{1yvq}d$f9nRsF>J&^9#K zL=5oxi7|WMOYf_3-iJ@t7S=Ll;&WlIfOlDq|)l>E{0pRX&LYGc@t$48WJ zj=UQF#XyjX5`8)uHTy(Ob7(S_fHg3nfNH~8W_Li+OumA^!&3^{uZI!cF(G=Z3lr!b zTrahsvS7c?OOOa-kZ;%M z=kk#%16a|3&VKJUmwEJqw!Z^C;`kIZY1h;FcAJ$^*p)rOP<Fw|QUs~jUjdPQX#`a9KyFfpHq>yP06DVlOo18d=JVU)54 ziN(dD0{dx?vR1+~BlAtl>^J5Db6r25!J2pM)aRSLzYWEn@`=@raBcn5Z{s9uX3;xX ze;n{CHJ-Uy$WNQQXwb`~FvK3P&nheupBpJJk>v*fI>5pt2GOk_r{m2cP)wjL8}9qF zslV2!1S^Qb`thkiX!2$@h+aYy#&+99xcG!ItanEx#tQZs0XPKRU6;gPJH6|-NBr!? z^_{R8Gb>zLh>Z&InVu@*mls67I+8(H&AVievIv@8%O6HFDgR9>5c^rUlK#}PK6=*w ze<%%rv}lQdp9r=Y8_J@qT#-KG^aL##loj$D;yw9{jgUqo~+?Pkx zD=z{lqB*LbpB|q1Dtl9GS84(W-V4jpr03W=4K276$F85c-q}^6Jyz_-jy$|2nTUSt zW=AU9n}dB)OvWa2a*+j^S?>oMd#_;c`Ubi?z%|wSe=a9KEDsNrQIb*Ey=8HGK=&GY z<~2dE(Xzf4QIw7@!?~#zR?mVetbp~ZZ8{?MAvJrnS#?{v%UlH_m_oRk4N(VKzDcH{? zzW_1hRexA|4Vw%dwwp)$Ia9xz?+4EK+jQ9GDps4q2TpY40o6-ID6b-if-7B)q1G)F zm?kk1-Rz7v_w$e;5fnt#;9>d_hJbj>B?f~q7p^>)SIh~iRLa9>9 z9oQ-dNf}BIQ5c>%B9@tHiLHEiPFh9C*@1R66I_|eK1 zUyZLQwCS?mdr;|E?|b87pcvl4aYFbyq7uBm`iPH5EqzsNc~?>Xu|QW@tAr_!kP*7o zg|7JP_$`-*wNW}Z?p<@f2JhM`HN^8Nhihnq;asF2-{S}#9i~##c+NN%u9p8lc27@0 zpuWQT_D^(s`2Pdct~jZC>3a@?FYe&Mn%n|!t}4xX5_N&iF_UV znH_csUEGAVhf>X_=!_O3*( zYqGvxG-s_i&o!>Qa6gJj^$X>ck!V+@P2q}`@kPU9&oX%@7;mg!J*;Q~R%<%rVgL7C z2zFraC*JsY>dcXcLg9%+8)YgXTGB-Wv)Y-n+6nWTd5hVGNveBrq3<3ufurY-4FNCS zxaZ6{JE`cN_WfF>T9a-u$0oFw9iZ6?@|J|-c5#rKxhiXAjToD_dSAyt~uMkh;7GQee>-DBf zB>se!Mfw9@57=u48Y~`Z1qTMNEsj10xC~$4<=DZ*)9VdGEQ%L7Hv?=CS5XmkS!Dz# zEDrk##vLb&5%3G_?5QW$o?c5Ry7aVRw{f-Ze{z?FkAkKIG8ndgc_PVOKX@wl$~HuD zxboQRUFW)SLP;~%55(R`lT`=Ycu{0RgOwc*LN$K8TGJqT9DM98Xrd#C5%Sc!XGP#GlfWh%aNH)cS!GZ}qQN2>>OR#&k)I~pxl(ix(ryHzob|qJ4_L zAyqmNeaa4TjV7Mk-0It@%|k^IQ}e}rzc#rj%VN&Fm6I}tXWs6=qbeq@JYS-^XkhP- zAx2eIns)}}g5`J*PK`s?$sajG82)BO%B5^2_}C99{%kvS)g>(#(0_T#%jts0TA6-C z2{dTh%A1|%=iN5OcFGKYH?8M)h>d6!NqfBG9BG59LP*)>*0*4Jp}w(+0xm6keR1ai>5Z_W^RUW>=R zr^KN|+VvX&HhFf4LCdT?@6#bE-snu92b8+2ouTH7t9Ly0sVmc<^XMNPoc?<(sd>!LMw1JNK>JL=hd||YARq=jdfF212eg)7rWu<*$e_3HKmZ+z? zj0ZL~1>3X`08GujW|}E%ILfRkuo9rOLkt9Ix00-BV`d)SVo#MvZX^G|$AzJ>uF3Zo zjzg1}s#8eE>1gl%AFWZ8ti^&isPQi0l59-fsIb*WG$b`sYPbm~wVeO!aq_?GYP}u{ zyk4+5=y=O__OFi@`W?oFDj$xxyq(G8dm3}P;DZ+VFctG84@lG_J|BB3*V#yH^~#mk z0ppH7ZQF~4-d;&<@UbG0&y?PPu_^}i-r80r*BS0~cvZAfGC$w8R9Azf>WP0Asebqh z?kJ)+iaf8Gh#Itb@gmov!S#tLrvET)Y}4?B7z$ zgZgw`ZMezrn?Uu#8peFMcWVi2JPEPl!9x3d;1uS%RFa& znIUv4070lb#@`4h@cPE8)EIf|nz$vjo9_d^sv^}kRGxGf?p)br5Ap0*^SpQA>1DN% z$Irdi&-q}5)2kbdxi17osMr?l%}zs>w)G}JoWCnKvr8a`By|3-O!Dfbh|2S6*1TY~x;y@)G%%0x^2J3WU3u8nY{adjnbF0CmlOq8#2F3F zo$f5>zoqgTtsA5H{B1DXtnl8;Rb)>1`Sn#;=-a%n*iXWs)SBiv@L3V#T)_JA=BP2< zz5acE+$*i1nKd%nZu30!XPa3o=#$K0r~x-a7As83TX-3VF^H-j%yHR$p{3&uzg+G_ zCfN`7)hGbflJ>9W+=saoYHhRDnECPD$zhhoJsl+FSj`skmCM>+ROdVX}*S{#^I1#K-uLw_8CRO_p6rq^TUe z_-wnFrcPe|ELx^d zx1(Pve-h#0Y%OVIj97AT5-?~mGyjs>-l3?5_Wda| zvRK=Vd@c9UXTs3taky9bSP&2IN7}f=6v=yS-v<;XO7+80Qll{T&vZe^KV}Bo6>~7% zF;O2vFk8j9R~if)E!Gcr@1VJrc5Jn86-5B2P441Cdvq*3n^SEzdk|_8yF5v)x}du` zHm&vGyF?jK!zmhRx;Xv>jT*hUsS@#W!@l!W3+uzPMXHYORPdtBx*#rea*{2u?Go3w zzzE>sEje}3(EmT6r(EOc4Zi?oUaMOdOu0$VMLDfBUh`ZCdlcW@_Wu7+W4JQDJeUcCpWjzYr9Tr@1+4FlL+d08F~HOt*!& zL6AaDH8*EEWX*i5H>duW&aM(jo3FnO{N1hk17Qv$wnPjivIiiMjwCOX!e zvZ~QDzvY4`)*z4FRVN5Aml`6NkEwjryxnWI;9o6NQ8(DU)%{1LMdaaPo?Ew*sY{x% z)W^Zh9DLFNa=vWe$3vj^!bX?9-OgB`hFPXI9>*V~ik%#RD+@w$zR`*C49hL8jJr&9FOMlvE4u zQJSX~7Rz?J;%j{uui_-BKJhx1rTWNToaRcK>^YAJcz+HmXun+uRSbA^!h7MnR+uX#SP46#BH%uR`kUsA$ZcI@d<^PU-!d3H0**NREHGszRfC$m;XYr45wU*eL z8Xv``C+C_QCvr7X;gflBA3967eX_I(Jok&m?b+(MPc5KEvGcAFr@f?<I+p*#m4EoT)aDH2lG$cyVad1@ULd@{Bjy7hmlka(v-l8jwt_MBwY_z194Em~S zL|sLp&Oj^j**vMbH@MqL_H~6qWEXP)AN1sHM0eu_&K1vh(y6yxwd}Bu68#RouencO zdbaNvJJu9tAdl_xF$*lzkL**=hpTzehtBos%|34FG3fvTB=?qaIr*~-W_NunSTwPD+8U$r+HRDd2}71u!3&ZG{|uT;rtAM3R|cGee!S(OQ+-PBdNMi6!{3#1Zw&r8Ljmc!Nl zUl2WfuaU!P)fTO=u_kDNkhxDHITc<2ojfU~)mt&DJSsN32tMMPGnwjd$OFOm+$)xL zyYu@DFVCHr8_}v^PZtS%ilukrRAbz#Q`)20LM^nyO(@RU>~o{NhZhgrK%k zqOMY!vR~z=L8Xo+kZbSdJiZWvx)nHa9-s0cfW_`@r|*81D@8AD!2|o}1akb@{wUoC zJ{$KE#pKyei}LO1Dv9Duet|vO_GM`HH}L$HEjpz1)RGxJ_1L%^b5@(}tQcez6>Q}C zg4n$5eWEQme6{}!UOlpQhYp>JB$+hRlPxxV^F1rVV0hWLv-wl58eaW#ayQC$E8%n^g=FMiWa;C8I8QIOJnS@ByZ88PWJXgI!} zmZBa`9%Ov0ns-O2O(KW9rH0OIW-R1yO;gygXP8W&11A?Fd*J^UHP^qyetMsv;WVTr zkoqq}O4j^WyIX-KwvCi?m2YKO+xbRJX@PkE@z5YF_PJb-uF36GwL$S&$OUT+{sAE>F35X7IIsU{8mGZ02$8Q12PGWP*yMf~SX2U=rk| z`;{#PN5*RetB~WW<)M~B#FohcF>-l@tpnhX9xC)R40e?MtiN`4ka{-QsKTV)1iza+ zK&@J_+gT}IcroA+gnFRbTjwZpQRc^E&wOgSE6nMIBiKL5(14=Fsc2ZV&Qry%g?y(P(~ns#RKYgwzy5)r3u)+p8#LvmXVN3l&pV0cf&8TdG;xHq!Rv zYw}}B0{dgH17D$C623QhBTv)*8lIAVG31xteJD)q@aN-t`Hs^>Ub2yo<5Y2?yP_gg1@#m*9p zV;1}P+`Lo5tUh9G zb)i-rU2T*)95#dT!F(e-G(@<>t{m823;cL=wt!&gSRXf>yxZFV-ACGoC%lF6Um5)E zeXI{b%Y_MOlY?`&R{iJ{z6~4Phi3zF23tObH6!l(!&CW^^qPt7eB#_-&}Gz3;UNk% zbo4(Mb*-3ac@DlJt_=1a^7Si}mfPjMmQndh=gDbWmKi_=(D3X~^>RTSe;fgj<18)a z|ND6PpfgFPCcDQ9puof95mHk1iGP)t^B_D!AzGj^)~N9Sm(cdz{Ov-yk8!NEQ(}Gz zM@sOPLal$Sn4j*@DLD1&<>N*F0UsfzGNN_ivrS-u~9po{=VO#(+oKS|*i z9~&7oq)t*Lw1@3{e@51=TDh67vQO+Wko5kZzyYLk0kR%$tS9|ktE@>!}ls$DC!Z6CYZikgq>3~4Yl$__R_DnvT=g+y8jMvp2E1= zEq}fL5FMLYP!w>&BgVBLp2?$Q72P1um0K{|pIB3Hn{?y13DCfK)4c0=^7W`>fui|! zpCE)Nw@+`ZS5M^SBbpvOx1WmaHBYRUhKZd%FjT+gYmDAHNJ)tLOPNpiqRFsnuSAQM z6`^u1*ImSubZO5Y8v;22G4567e5P=dddWi1V2=Qu5z(vAQR{n9J5twsKCxQLo`s@Z zrUb3cW_I3>&|D#ukX^Uv6KBt?SY2dayl~OaYa0z~)%t9u_cPal>6m^gNIWWBoaM$zL>N3qAs9%q6UjL$kvF0;Vb6UH?5Twl03}VGU|UvbQ-LHNKH;8 z{1qG(EQnWwcIx)6I9R~+BB|L1iYVxaC)SFz5s*ij=*u@AH^ZWnc)yJQw`g{Jrpy7~@5stQA;!$KnZC>*|mG5?MKVDIw zpmE-yM?|?IcP|&m$o;lv&V9bUoJ-zi5#FmQ1o1gLoFe4dli8V_6aJ^apiHM*Dv|SS z``HwrK@{LtLFU8E(>_NsHJlq1Iq?Gnlg~2U_0&lwFOEeeUfmos)23TNw|0m9Y!-UQ z*)(u+8m{MgtNAf(vkwe{*f#CjCaphlZcvKWaNZ;ps5M{3uy!+@ao%spK8$Z6D&3UFQe>uJ_p1BI2dEfxyI- z-Y5CT;FaF3xtsG?Y3BS8abe>#?KRP9*kXP<@tHbgU4=i~Go)>!yCipKpjO@A<{0op zHmYUVs1VRTRcGIAu6tPsX#^3zDI-<~hN%G)nFvC^5+RJV8#DY?| z2zSW9tmer<1#zvyoR}82b97^D*r9r-TMFZuIq7#d3DL@!FHS+t%4OUC2f$H;xu_N< z!kJ?8< zP`)Hq?(l#-L4VbcO;1OxO`k01@T)3qnJ?eUT^`brCmZC-?9C9ctJV5@KHuD*An}E= zotHs@rFOm*k9tqlMp?!$zneOX_3u-ak=}SXd=d1sia5~nA50|V?ONlHIz_E~(TbXO z))Ix?u^2s3F`d^6y>qp<&a^~}@V~c}+iz9F*dR~i_qYu|a$%fo}I!@X>Jb|f|X;;um3xi9yAV8gSUXk;0V+Ho^3bnkaO zNlaEuMj>L>ShM$Hqq0VJiLX(yf@nH_kb>gkXb%Xjo8}UjfnAhv6H0QEgF?iyBM|HI zIXwdcIXtlM%aMv~!`y`hDmF^u&hcc3)uwtMA|4YZWlsybAfJIN)c*C7HLN~`8dc@%? zOIRFF52_LzAgn1M%-V1I-x2M6a`7_cvkT|6)(|bX#)~N{6sDW;eQY=uJ4bFi*tUQk zY-Xz?%uk+ro(A3j0&PACJp2XRe`0aC4m{|vXk(VOg`1#*o{PkkbNq2}6y{3eaSq>i zH2Y-s?L;CX#t~;LrciCJKTh4qJNb(T&1ZadK-D~4!W1X(EIfT|X!4n|sXXWYP1&OU z69(m^yR9X$7f~w~4*1v;(E6f#ZuLbm4%s^Bz0`sN_8?PN{;nbf>8BtgCL6k`AZ4ip zqK$abd`-uwL> zA_kg6Lfe=Z;!*fzHqZb2{E?YT6M8?KbNE%H_QS72q+kzML^<&gxoO2Cmiv&IlSk`V zdFJ40Pz1qc9Y<~V#-m=TvyCvjQp@RqmG=46=OraIjFY=ejd28|DZlSzC;<#t9oJ z(VH^U9dBCGg9WQv1SzsUGXJHg!DKcfIipM*t1m3_-vQko9*{L3ynS8S^x)4F>tl8U zkUuGkmU2LP!^^0H?$tpKC8l<}ila8|4|?ypUow4=SkCRRA@ge_{0fO&EdK`3Qt&lv z@Poe9rcE-BPdNVySJ>5rUuba|F{1@1{Qeh3P7iN$J4<^jeGe`I46jpRZu;4~wKLkN zYbO_jZJw2|5w=Aow{%C^&Mc zaBj>0b`$vC~}Cc_0{o9t}rn7%`rgv$ZC6 z1~S4}UA;!ZzJzgC&6$|hnn$ge0Je2|SW>Ufz{ShkOAEL#qnZ3#J(;t$l=Okh2=d>J zm8U?yKM7wO*H(&afW!*SbAW--k)OpATkB&^c&6Z_Et@T9`Grl#&{h3U$N!tN!$VAp zY|J74j$4!S21iEfYf+l~%Jqki*LQC)r}iSE*4VPDJl)_u*x|}e)c$Z3(;moTRvj|m zJZ;;MXnSBf(m$;k^AKr4V3y}f6nh`v|xDIVXxDh6Ke~@F4 ztCrC2A|kn_nTNXU{2aixmrhj^Ge+V|JBvXruC*(79emwyLh)vQY~+`+-TPUo_23Vb!KixsJZx)B#*lkGJZ8D;Krb zU->4q;g=z5k7URg1PvOn%T(sR$XUJ8q@z_nX+kd->MX^ zT*!2D8hg1glX>M*c=OoG>mZ6?g$IFx9V4HQny&qFx%FY?aY%NYoZ)s`;esI`D8N3gy?rcO$_U@}2v(iQ|S$j^oQ+*UUSg$VK5= zH{iCPZ^+2@IL1{!R+Og8#4aM(i;<|`@_{AtetK?HydnUHMT-ooAh+1_Lm_a*sTG%st?w^v^lOW_9X_=5i>g^hbPtB)8#63{&p&JthOr)u1 z`Ec5#C@GKp*QSz00Gy^Llo24A(%R?%Tc+l2%~p4~>Mn1+A;63d-eZhhw;U#a+9PM< zXE)#Ij`_g*BXq+Qn;wsPoj@Q=$~*pWE|Ywm_G*Ddej*=G@ir>&a+FfhubeNIquBrU z_3N)Y&|;EGyqaQC*h?*ZX%8Wv_n7G%?|ZIC?-qu&9k~&=zZG>rR9|h|J#{#JGc;6S z6Vt}PWJ{kvQw~^6;?`FD$i?j#9VY^0I~bJ%yfJZq%d4F1 zea&(%<(1xI=hImxcNz();0WR&^=^&$M224rYYVdW!5aH0;Ap@qX1G+ zcAZI8)mBigTcpA6oNNf~Gvi9Hk-snD&TaLY zl?Au-dLbh7kkxT&eck;HPKI>S=^{Cx>vH%f-|2fF55AM@zUz`vK~x(AbL`mng(=^< zjBJnIJiHl_B7RugvTS1C%qAZYvW`atCX?=eOWZKirrO{lYx}RllG!s=4_M68tbL`` z#)X8i@H~A`@&jzHe-GW4t@>PWFgyJC==>SGqw*cEwZ4%n7n)%gOv9gT8{ShgXeKFQ z0_Z;ouvS67Dlr*R71JJ{ng1@AJ{MQhPyitU415{ zCaZr%Rli+*bh#lV{Us%tw`S_ycsd_yMO>g-wamte~fL*H>?9zjo2zLF8ULO&-MZtx&O z?^5gRl~W1>3SS4^n`#I6&Vm9Dec3n)dWmh6!Qg2e-{rmmc>Nfh+;OlAeNjbVi|LZR zzv6O|8xPsH1zrpR`3PV(g(M0<25K0^X*mcu%I;+qyg&y*oJc|b)$dnD5wia{4nh0o z8?JWxEDm>&sqv^~{oBGrgubBih$CpWYNrxwb;{@$r5K>!_L{wgk3146E=y_sZ?Q$@ z_GDX5#d@*L5KR8qCUm+~FD1nov*jHRw5txqhEhmkK>icE>W6b}C>r8$wGBxPnZz3x=sBmX7 zX@05NF1pJ@i*H^0!iSkPK0MZUtRHgk&%5rF&pRFTm5O|INiar=*{n1OUCywHh+U9^ zalH#TPAusT&gs3;J7%*u7O#uV9j$H9pllSGNZ^CSW&M?^jB439V$3r0RVwKQCfVQj zrMiT5-%3&n>38XJZ9_dnq+xKhdHa1fN;AWI0=0?nHEih`G0;mzQ+x$=-|D&b%wz;| zSn5g?JktG69AJxdhfyRwG-ccVqeF6FJma9sOzM2h$`+$zn{?>>H2QU!&*HS} zsTRi|(u)n(T4!x>o~^gycDd8-w-t_VIsC~*4f1W27T1l5yiLc5yrz5>!OiAk5{D@9 zy)U!v0<6T$OLcIOcMZG@R$l;nf8kKyJxwD_5Q4UQTFKc`=w@H44YX$s={f@s>Cy^7 z5NB(%Me0R7?!u{lDWUF&Ab-v5wxKjTZ3-OQOj8h@`kC=a%>ccS2Bwj0fxmT9LdFI| zzv`3CG?nl;AVU-gUFRD^`YoI7eT8WN8$iO)rd>|#GW{N|%cuR1L;$&rEy54^W6LC^ zg3%_Ypdp}zv7Z7Z0-s#v~ZspcrkKJ?m2*H4X=!Ml!=w1|LmF9 znDF-z1#a8yxNoa&8kP-y5Tx{|{|}=4<=4H7?BsqkR`ldA74w&D(iq1c+xYqMdGmd# zPI65Fuy9A5n?EkLTw2+gE^b~_wN~cHW=!+E=M{FQm^a+{JXOY~y8OGg!t*!y1|n$wJ>B&)<2c?T}X&FeC1)Iy{^HC;*ffE+e`BHJiPQM$}TO zfcAkaZ?@dqbb>TIJoMlW*Y3jU&rU!!M}ITTAAc33=-+#`Xo{jF!p69V$u2px)u6As z&wNV3AD0%|5^3QFnKLHj4^?-<{)AMjI2LGm9~iv(jL=cY-rZ0DL8jjh)xJLn1Frd9lopI5jw&%Ko{8313b z?X9^rVA5ew?>(Qk&ab5( z6%IGH$R&cSdo(elN}j`MC!5rmx7#b<4k}|t^0dG&0Q&$zeR}dUk6xoo`701z4;iE0 z`YbhSY`(*?&qi7cNuq)Q@QB1VDX!M(oQ5vDZW^?OGM*TvuA)A5o$m%2ND%BJQCg2m zOX2A$({f%VS@&YsyCD*@+j6zRoJotvaz2fMf;H9$E=)s6EDyPfd*ejNimAD(RF z)v7}rXG8#6AKK>e5Z||^-}{M9UkyT3=4-9G{4vXA+*T!iW3N}R#oj^t`09U0`4C>h zV(1V46uwyYgeiu=OD*G!eJedL7zcd27u3u`0NU8q@5$pl!y-0cj_LCYx9z-J9K2w9 z5}3qui}P0MEian5xo{Cj;m4_`yG${I5IV7rA3IMd?mVx(5cU_Ct4>;-WQMTQRN=!| zStHC&$||&rM5lM8<9r$%HFe0eI)zhXK8mnS?UZLx1+DVtDjQyAD5io3vm)(Hz=Wq; zgClT22aOs_KS%prLJ&7{b0s?N1z+6FCSH;AeaoU>$zZ!@#M{*R_AQ8RRR$ydNqRUa zLCA=*>#;D<7HQ~Hz($HscW7N2TY0v)2$z~BPm}J$wp`h!$&7DCGltW-5%njwDDPFw zhnckm9ku*b{qc>QZ@|S-9rSnieWrIHBLJJY(sR*QP|zQ|UYk8xX?8idxN$zdQr(k< ztV{88(#$w@cBV#m0e7@FfA4Q1@y`>NxWQozjA)ZEqHn&8y&l)YHvyh!Pw>_DD1KE& z-G~du7fkQV1j;rF{L5f&mR~nGDXB#B%PrvH(Fo#lx|(1=&uta-oP(_yeAHZcx|`aX zJf|naW7_WYa8;03zBIO24>(A!zF@lO^@77$_$DV;i(pJ^tU_q`6SOV=D7%Zw+ZmP6mVBj=0Wl-s2plTyz$j}sO4@2wyquRHf=m2ZY)AeP< z38fe3FPy(pTe>gW`vNvV`eB5~tLj~K?Jk3gOre4%oVpewrO`ei&q`NEsNJxZt+iHL zM}xNy&?xGI%5Az|l+ls$+~QNv8I3*rGt7(zhLZPQEiPznf2B_%-hasqht2n8bcTI$ z*dP()8fo{y`m5utL4?UknFUPh_+Xf)^FJe#-#njH4LuvUxKF<0t`HHa_@n?}`q+7$ zTu1%=mUs6HdzSSL1Ni4h*RP+n4`}`f5D%U zej(yg6js7n2A+Q|d_`SKbC>gVu{sc6`nhBoQOO#&Cy#|PCA&Jhf&z-z5 zjhOf_mLJT(6@uFvC%iQ3zpCdqY}CE~e#)KJ%S*!67hhR0gZIXe;EeX%=j6P$F})W6 za>v=W4;TLc52!Apz=+i=z{|^Gz*KcHnFh2Z{0?w_@Z*18K1LlG{K-lcZPwCW=Pz0h z6}C1`#u>*5Rm>hPL>(-sM-`EwUHm+%%01Qv*79|`Vv^N*>~x*`g>NFZl!I!UpeMyz zcmK39Y{=7l##kV4a8!zWLFD@AIf>yn2!t!AyI1x(wrkZfKC{G5Rdefi1+67DAZY6N zxk=Z=C*n!L#GU8D+Fd>cFG8kkl^6=Li>p_sq-MxPY#yV3#WwxB`vHGa>Cbu789K3E zq;&tczjilKOghM;?}?ZiTIXs^EcPb~Vuw`tBXc%V%?|-ysoD*>DE}8(WON`QPW{SO zi%!H3B}_7{)1G`TzAFRdx?qdz|0BUvRG;wAC9{+B87w(yNatFIICHn(FrqfUco4Nu zXB*J8=3EY*hRjqe$tsm(uSVTlsb|!nXb(%=YsLW4Lu;?0fbEnNCK5 zu<+0fZ+}UToT?dxvZ<-yZL4cE0W4qi4(H{S_r*bJrA|;w(?}g{l0uO=x>L2Rz9W$7Od8`dD!3vO zlUu#uASn}1psV_O<-&J>^H$L!T!GdibzMHxZrt&NWTJIeoq_^6y>z#aAX+5Hmd7JB zfS^}#hFe`EJB9;H+vhS6bw6*7O>vmMYabCqUo*_SoSQLtMQQ%?$b}20Pve6YRa^-@ zmLbk2!#RRJ&nVvwu29@J9pPa5qzm%s`o<$TsszzCs3WJY4a@J_f304697P(kRWhRU zxplvYm+TcPJ;xe!hh1-LaW%uBnLgLbaNxmezSqlV+Ql^qSD1AE?TW`2U&E!0lWWNUsXQQ z(_%6rrZINj>;G&#vZvx`rD1Feu`-{0riN#PK+));3cHDGjlC``>uasd-NW^!zTiSZ zR>4VgG`@7LpKry%FyhXds%b%sm3hy)uEnL>(@#d4eqlg&dyNx$%Xw=M&P8SF?E$Uw z$E*!16|{G)pR@hEIz&#P6r6o91aQw}`Z@aR7o|S-?8q3#A-5L{I^oGH^parPavfs4 z2DBF88#Ryua!bk=O|1X?yX47y-9YMA90*!ifm0nFWzv-L*J}m)Yh9+AS?h^Ln>+>w zI`vRr$t5>?af3)|UOSr~ntaI>-%oJpgISQd(jk$khn_++0~~C(1~Ea(Y;EP#HUTSy zw}9t+bcqshFXw3stwVS1t^^k;HAM8GbPFJ*VKZ>eiZi8c!Jz7$ktA>3&N3bQs<05h ziXTF~iB*?Ml(70yNuJ}Abt4Awl|^`!n6!oj;m{=pxJ7_r?)V(&mNdv>aiAXRll+I? zoc~5f{6q57Zk-Q8l8^bw&jD5$+$O?Y3QxESr|v16vbzZkfD_MsO*XWZ=l$;PdOR3) zUb~s|{qEwG!NIfaVePj;rQrF|ZYi~K{+!r%UQ0=Q>_>fZbS5TNgZAT6{oW09)SXeV zC+$?*qTH0{^o#&gY18bfWv>H!DU9#ra?Li(s_um1V~^VJFBV2xDKX(WMm`1VRIB(J zmM_Dm?b6vGI_x;(8_G(g1ZSkM=YKD|u@MY!esKX1ca7j}7r{)Pl8LLBFd|Ww^FokipC!;4&elYB?9WO)?HzsYcW* z3WVqmenKHYxxIBGsL}Az?f!%P4o8^$cpd5KZe0+l(V>)q;?5|o;3)j&s#_arD`g(9 z*f_gL4Bo>v_nH#t|8OFac4zVB`7D22cvGZr(Ustl2GAU7LVwF}#eT~%x>NMfBL>FW zf1b6lV9sOpp_=2LDAiwQos)xc9*Q&Wy?3%KQ$VoA-QZg-4bUL2;9AI)& zL#>APKA0z=L5d#`H70&RvzhY-inoc!6WYM|M@ZuQtwlh&f*GhTBb7ud4Rfu(U_4qh zYFv8xZ(eEz?;dFnsMxmc))vfg_`LO4^`C+J#^OH<$GNDK-8Q*Mxa>N_X4m}F{IMXd zMCIJ~026h-d!@5+V48&6&hhSJ{o_jV7Aj}1iB3Q9RgjT!4Z!2o^82@-d~ZfTG)5<= zhb`vc5Z0{VOz))A$(R=+f9Sl$Rrl=oU7dg5Xg9_#3tTZ9DZKNkv0A)ETvEI8DK!p> zS0Dd)RO8Te#y^hsyrG}et+>ws>Fmj|%VQOr}ZFmh-KkxeCfxkvda$e$Y zdGVKFL)VDB0~5BBriF#lN>eW3nj-rTh9}(dthl|flc_tX#et7N&sVRQ%Kn}NZK!pvExgkRozxDB3h#j zxAfoTx0IdYF3T|oo0fk!At#bP?(}#)2@8VV!QtvWro!4@D|Min7q7q=7E@;>$LJ-* zNHuv;TYAl_pY&IgLB~n9{w*zYqME~1_Tm#v4Y&2+ma+K8`QDtZ?Fx1aBD_3PPJD--t9$q zlMhxkJYDVl$q$rw8qxmuEZR8z%6)zFUqM^pnSOp3HXHttB9DJjyayYPJS?KJEJCJpRGi7qWZNT-UdXN45xG#i?ae3L8GmeG z`JSLXUyyT=VND58$OGVUIY6j5O?gHSTVMU?>uW1iIQ3RS&Xa+p)5oq@Fb7gi<#Bzi zU*De5OH-2bDLA{)-P*){x>vGIvrlJ6t1G=k&n0OiEgLu=`n81UzT=#zcV=KOAh2h# z2@YAW%kNLW6F!Y2zXzT1ErwiU(g?)HkP-CL?qeK(G6p-(CQ{wW+0ZMF?nu zQy=}IT< zDY~egT-{f9teM8zi#l8bvgquo$(!vX$V0D<>?lSykTs;v8Y-@eVlAh%((9@`CS!Ni zR|vdmUT-=cm%=mwuV)0B7FPo-6EnlCEUaKwStF=r1;zg2w83dVwS#?Ob)0X~w#>No ztal>)d~wY-^2~Dl#?uWGlt@TGAndbPfRzD8+BML_;Za5K%yWL$^Y72Olud*(C?A3i zdgHrD@<-~c{O9#T=CtlE&*L9|EpdYz?!2`JHD-*QZKU5JuGX~__W$wO5Rjj#1y3-H zu1JiFelGZQFYS!uNgDn=qSw49tbwMD3_f z(thcTC?S^2@2Y!zg!`_#cM~sK>Q0R9YcH&R3EhnMoslE#Rqm0RBLlX`J}%2mj&Xfl z+?%3ke^=+ww0{R4(J-q@sLqEMEiJ$Ukx?+*MPBhZio( z9~^Fg54s_oMI6^(`ih--E_(I3o?`3$C#A8SxIeFUPxkOURQA)lU)=fT^CzYE{Hgx1 zDsFjJBtnxIhu_hN8J};HqtcPhwws+CC?v!x@v`f_@LE@w_QZ^2*@; zoBMqo{a7(+;Ye>{tG;eQyuWh$rFwC6(|zdA96tD{^D>k4<8t4mKSnKAVHBBfklrp% zFMO4dZ9e_TL#)#0vYV^#K(6S{SbSEVE7H|cug%AahV&!ksrKm;f-;nSV6;aRO z@r&PDstw9gHviPg-71A$-F74U1eX&_YFDdtljoL}ol6fg?>gY_Y=`}Q>Jr2_0Z%ik z+G6%B%gZcm&sD*rw=6zRYR)%gwjj5u=3edd%%SP+^S@wAVA@Ke+%Q)Wd zwaA^1P&<=UE+x^(t(Z7pC5@4kQDKn+&K?p1bA|Jz|8z8nOEwdj;OB6x9w4Zs&C6?I z{PXZz+x|B_szbS*>Aqq~MrzyM$F@DX->JZ2p}WWK(5i$&yo=)=(3Vy;KT6AR9-m1A zo=*344Hig*HKXP_kKB5danUpKlh`kAaSB135wjMsqdex|*)pcM^nev$*0@Rg$kDJL zU^Y&@?XvUPu6;L-ad&wr+6%2*=2;NBr%mtrJ1=tB$#CygmIMSuQQXotHZPGXZXq8_-t&b6AZvE4dA@ zKlUi#zC^I&5@z+3FX5xkkDzzW{ik#hLlqVq^EKP&Z+U{}O(O&Tni`uwl>`aHua?=5 zL^%#ANoLA?{a9uD$nR?@Asl%ZcVO9_4k%o34M@O|!_c$A>8V@HbaD#UG7;&4@2FcH zK00~L%0JKUBI=?vw>-y#Pb}!+HndGxNJ+Bi8kobvz<{-$a$Hz6uCvrRvLyLChb6}i z^G>bGB$vaFVMolTIk*ed<&hbcCqDm<-{g%Sef ziBkBGux0XYYIHo_KlbIIfH2=W=Y3ws=%dk`sGp)U^8OVSo8r}cM;>v0!o*?6HmWVRf^K8D?;)THiYOWP9J-2Wqws+ zXuAqG&Abu+hvH~>#St6n|3K=EpM%jH75dI!_gzZYFe>wHUih{Gc!GUSfd%fXqQNB< zl@v(McXiVJ!oa%oeUsy*nnT0(2V?kyGL;ItwbJxZT}=^cwaRn8;-CTXd0_r?IHY{l zXYEvulcW3V{gJm}mTO~K2=sHz;k*lDOsVett?WZ(NM|CAIll0UhP0~pkLfsQ zwA}_uP2siNftW5XgIh%9JB5Z>it-}UL8@S6O5Ev>pv4{#jmLkqc=+_r%5NICaGI1b z-!2~^AUMwWsBpGZ9)}_4hfhDBNeD?NE<^S>zeLMPr1Lm@<(p6`1xc1D)uny63tKvp zxnc&~7?LQ9Fj%x`Q~>g|2m^3$S4y3`syx!$ct1|4T<)l zQlQ~GOQ*9zFY`T3{gRyazGl=B3|GsFRndf32KI^JOM~#`D(zG9S5CJvnYs^FdtQ9d z5&Fswj&X`@P7mCFt`sU8Fqc#1$#N4wR$xDXGSjY2i3I^dPw8fV9!U?~D(@4CX9Aq+ zo2LDxD+AyYXX_tWl~#-m6RpuF|DGDNt5Sn3%H6t{PyJEqycYpbiXF;ya+GY!`@iU5 zOMflF|A`Nyd$`geXavtg4r2s%+(r~rI@q<6!HH4OD9i)H1V*m}tSce*j;n~oX6|}) z0S|Y(5!{^%F5G-3_c=rg-XBaHkwyL;RZ!S}In{)NcP{TQ=`(334jbY?6W_Mji(Dq(s}p?TdX<+us&O^VHyO`tYN_s~=qXQX5k78~b!+ zF1G_JLhZT{sVh%;Q7&{|sZWX3;aDo&J@rIdj_K&RhcsX(ki~x!$oonl4-q;S{vyc} zKCBxc{Yg>iWLPUlq%K&ZvcF0&%kmf?QE;Lq0}vJP)hgkz<#*IW+FlB%+td`0iiy|pB`>!-}?pfqu3q`GI$_pBzSZspe_PSHOc5tMCm6iCU3CCg>cz%D@GL$1l|o?9 zHxOlSH1e)P_ikcn6TmO2O<#=s81Co}+@!gMg$=<~th&Y6Pu8v5fM}&lQfG_pe5uI) zVFK>zS4_%ojZpV|U0qk}_eFG@_HD{=yz>neV%diD8;GF48u_4ySkT#f3)@n%1HxUD z`_I8dx0B`LlKp21s>Bnl&_7`V|HKRJpKKDoyId#DD1(x#hu<)DArjskF`;icuIje+ zT#cT(mS@>;gP!FYsU%~W03Ke>P*svC0jDf)smOQw@tTvmUE<{|F}xXOpD=tWNTMNZLHdCDr8^#wPZ zo4yW0JXXIFA16dmH(ym9FFbXq@yt#S%MM0MPK~1p+W{ygyD^Oso_EuU2SW`9d@ZA~ zr=4al;#!wBRCLKH^%C~K>#atkk!+!_5ao+iVX2i>#*dg8UsH?of4q;BwGY3?PnEp> zHY(_E&>o)zl=ZHGIRc$gP4PuseXVJc)*9mDw%qk$t|kH=zD&jWq?j7$EKEn>YA-fb zxzp)CA6E5`1)Te{jQL(l8*@V^v-q}tltePXva+@qCj0@GX_OE_zw{Vu;_3VUPNHX- z_g%`)!gd?EVnyUSKm=1hcvPvj=IH5wEY7$|fZ~v>OsmULjs5d(INji-=s22FwX95} zKy2uTo%30{>@paNK9a9{zlmgWZk?8Q#JOadd|xeDL;6Hde8x*V6IqEg;hh7~ri|Qw zVk#jcH6cN_mO(t+Cr(9*#>VZQR1pzL)375>81qOpW}lG0%Ve zDb1&Xjjo!OToE(_r2-B(UJAF~J7COOOD9j7>JIHBCk`e?${*fPoEXM|zm=iyl@Ri; zH?DklPb3TZNp=3{Rh(043tsF?NeKUX)KX>3@jW_Vkv&Qpk88n8VoqZYwmw2wuwm5s zkN1ifXjxdJ?{}e~cHEm`lboa!e2C~!-5z9aaqP5;N|O506_JPKP>Ch^G2f)Wp_nlh zn+v$9k5xvjaL@JNnGx*4%Um=dm1Sfp-)XS%vhG2D@j{Q4>AAR=X(PO z8+Ft&VuxrMJDwu(fWx6Vsj0s{NfS`)?`7ia;4X4UZkr;aAw=6d`EAX3ztJ=92xZY? zDL;Y6zV!YS)b@MHrp56V+wuAQNIN3~#>3bc^UFVsFQEQ<8odH@?g5~gC(DR6O!;rU zwrv6?f62)DnGZOP9<%}r&2==7rGddJ!-;LICQ=%cpuWaLcM%0t@Y!U%@>l`+`NSH-U)=#j^M z<`Hv^F!k*?38Ldy>Wf3(A8(#$Zo(Tv1C-`O(Mp@Og%v+=>sMHWT>9&&CE*>abS0Yl z)ra``>+{kVyN`|!S;O4!&L11w_J5y$w0L>+5s zS`uD;Rq5eZ2aOsUeZ1{(Evn156LVzl)$hGDKqLZPod%G(g!A+YO=gGCM8`ibv!>-` z3yy8I=-n1i@SW1^i@)9qKGOT5+n;b%;$44Q!nkxy>?gNJ(I%47M|;do{WFIS{=oo` zFW7tnZ~p#X41BZW;uuxwbncRgX(o>$C%0G3pv29?(cV?#$}|60k9uC{1`5r!myg%X=e@?CF_qbD#z zcT?Y@izd1r*!>_Wl2V%L)<7Q5AyBu!zU2wPyLTxU4y~NL@BLN!2&BNY`MEP~95wbX zAmsY9eCzQVs>SO^06!yvPI%eooA=qtuii)QjQ!H<`UWfqqDx^jw?fA4zn2QQk-#mE zPK7i`lSKBx*440WC(Hkjr*Hpf!jJ#m4O^0J3bnA!3MrRpLVe-$YpZBUvrt;Tsr%F&-tDo_6KaQ$NTkuzMr?vcy?!PASo)fM|Ub%6|C$Y0Ivrn!DJJY+aP*~5JTGQoRE`Y87PcdnN5+`w~gbg(MtLcWc4qDxF|29o(k<(=fRe4g&Df1)gokF!CqIRB=$3fgwZ%V>X%)-u$;YqHg4uDhqNAN1%5 z^hfqxc_gT!NOSnT6?byrYvW*FL`I?NkUP#a1%E8jw>9Ey3(27;kC@DQX|GM8_l9cR zB_**=c}PYWrY@m=Z0JSqNgD1abeg5bX9jL=3)}t{Tu)tWhX$g%Vqkf2U<4ZN1a=?CQQi|JP&R<0eM#J6 z&%^&-I`w}Dr?A3}W@;m0bsWLV#Udz-MAM7dXfnP0RlmALdd)^_m~wHtH|1P*OOx;j zd~ME7M{ZBHtloi zSd9B=q66sOE;=2&qb9JOy@5*X=sV`-%j+Kc)oZuj|Lo_~DeD8ql;>)q+Y6V5X|-IuB@}R!ADkQ8#0Pq0LAU2&4S`E3_vgKjv3Nm< zM_UJ9Y~}wk(ch3d!vAWfsf_SwTB)}0nQffjL?05-$&Y;(l4@CC4e(r)YkLb3Ul$R_ zwiy30_3^U1j$D?@eZanGF9qrNY_{*Hi?}PDb|Q2@q(#LF0a-l^)4Q-^YD%Q(c>6!6 zslzT>X_7Bw%evQQW44Wm4eDFGqNYU81G9t2Zz(!8g={CP2FSJBP3hI`G%nfglv>{K z#p_UTY=#1^MLx&eDLVVOwp;#wX0w=wS#IT@OREJe-C>Wce|S*DBO^NGTp83Fpis*xF) zfx$f?RnYk)**|vIJueLhb?wE#6$7_|>!e_#J3V55r!5z}Qy#tT)wccbI6bVs2g|JA ztRf{>-TP>rWQ(%%M12fIDJ(mWAMl26Q=x$4D}-ZMNkVyhG<7*d3}e>a(Jap$|(^HWsI=#IpflAbW`=PG@Jc{3@(>vD8h7pKIL1aJ}dZ_In*0O@FRjl(o^l zcKs^;$Q#AISJlZ@v)mg16cic5yt3JH-(eAo{kjguU<8(bBY}nlMF%7 zM4Jt#0OkRA1Yvpvy4n}2IQ;#hj&bMJ)GWx*%j9L4QQYt{pH&o?jF_tG;n zR$Q!ED%RHxg<NOJ zY>!;i$PcVELq4!mtK|(XKX~wQN_m;seTObLX&mJ@C8*)4n^XDu7O?7XX-P6EwDO~f zaOSAg-xaC)J<*$gR}Wj50lbsa%0yMW&2bP5$Z7Y_A zfX19q4G;q8oOWt(W=MuYhXQ{7+-Hm4%$8t2$}RaG8I}Ubtk}NowfM%1@*}np-%mVd z4~0&m1_hH;d?r6C=HnaIGd}MIkz6e?bL!=~t}@kG!c6SdJ53KA|azZ(mx9u$J60aq1!z`K{BY98c^(e_ecEit(=B zlQ(e*sPd?r%&%)XrvoX2d`oz=`=%90v5$+fc5+;*T` zQA9!GmG9}iIW#rA_9XO=9NC%n_s9J8(bqQ@|AT`+{s#_necaH&^YgVn^`*7!KKJ*v zi}5{;1Mh1I{LK3v@H69~sJ@+3yAtJ#}D#bIK{%Dw+WmEVPVpB}w$9xbw& zOzrqSE8rSLhpu+of1CUJSR5SFGZ2V_0HCU!d~~QRpus!tyH0KC<%i~P`Xu^Q6qBF6 z%AacO1Lf5+@Y#*F=if=)+M;P~3bMPK)g}<@MNYIH?a)h!cV0k>8Um$vkT6FTnrJ81 z-SuDg|dt9ZbCot?DfzCV~-sM(Dh#ZVCJf?iol?NIFXJa9UieG!KdV0xR z_?<0}I?&%)GbuQC*T8PQTe&{|V_x9otkE#V#pi^k)Rgg!wYj=or`mM{HczPhEPSZYzNr8I;O z-t;Eii;l)!is8IYC>Rdo4VHyyMv@vptsH?5wUvLoPBULqA`;ue4z=4mot*md_Lb(X zR$xa*bF8n1kg`}H60`sfS6005TGM~yx{rL$@#@nvmMJ{OTG1ZiV#3Xlv6W&)IpU}` zSd2dNdE1t#ev(JH$n2`LulsX)!3)ohcpWMxkiUCQ8f}EdtV&BD5S|;X1dA%wadd?C zK%CjJ{Hm$UBDb!kB!Q4T2|R8!KGr3ecs5?erL9oI-Ava93kn;|=#bl^SCmYd-Qb@4 z-k7HA;({fE<1yfwK#!Q;up<*hWD-?vzqy%kSV{^T@-U6^!mr25 zjy7%P^7(8bv19%Z?52Ip{|C@l=UYGK@D$y1KdlEow+$G%{d)ALN>FBIvk1!-|<240QbRxQQh}D zrqFkzhcoM=uN;RVG>-BpCk04fZt%G9>5?zSBFGrDggz1Hda&^^onzoVPW(J026IB; zXt`KSBUK&ps$cCsNx(}428;`HTKlTQi-v-aE|g=YhyzpKjP(c|zxmxGuJ1Go6H$Q< z7gHWAJ&EVL(<01)hUM~l@ScQb4?9YLQ! zA2=EE@AT|9Vo2r=FFEHE9yGS1?AFS$>I_=SwTAOV6u@_wZTh;b|(S*;1hApQI=3dl)QdDS_ znqAV7K)QwpI&~xlu*Iy(RriwAbetn6T$s7y2 z?S)O=7&+CkGx=v@ShQ+nV+7T(v9HCtd5FC^8(qHP{(=kuFsbL2NDMgj zxRRK_>6xR;mt?SyS~*rlB~p5jeR^4&T;Q={!09z!?b&>xQ}nW7oU?(eo7oR{*kIBO%GW^__uUkw{ASyR*Ub>;o;N^EEP}l0MR>E zHD&aQx`?C#^WeMEQbGUtMqYg*MUfilxX0}X+uIhczgUMqHPH9_kDth`iP_@129bd7 zl+{L3cdW;6ZUog&^15J;9b_FZ`m-)TxxTj;CVjaL}Zg9Kf3(>Gx+- zg#I`hz*&m7imLOzfy4?q80yof5lo@(oD2%>i--POKeR;1ho#ulf79SA==#5Vf9erO z>V*K_lp(x59;O5lr6D49wy{mn+D(HhWZLuyjDqT zO!D_Q9pB(hwfYw?G6pnq26{3PJ4bEfkAGs?CB;A+#MRbzk*fC#!cWrUg% zT>kVnXuaf&w|VF|55g26Rvqs#)at%{-@5X(Y*!J>%D#?3WMg&{C~3x-nL_&W7;@VARe%wQ2C`a_2Me1vTb%Z>DxmNysA`|}W=xty|i%06=TB zEs3cLStcsFJ+egj>$x-wEB)2y0f$jZNVrA#a{B;^qpkEgZ#${Qq6so@Wi7Y4^>oy+=_) zB}O!z#7P$1v5b?v7JUy~4m`86%&YX_pQGxd^SdJHB;vcSgPY6%fc8iv6%AtU{Ntaj z3YnXo_XmIOb9h*6NN~@@TQi%c{*m!1&9HUO9DahvjqPm@?LX>a(4gza?#o;dvZNf> z5Ik;;M262DZkTGftNrMrJ0dPer=ooc1?6#jk`1qt6syoN1W>^tRX;D-$SX|;h`MFA zN2R6^kjeWrNn=_>=l)eMEgWw*2i4&SqDrSE#c{g_prXPvuBc|ZpB72KPj;*`+iDwC zExA}tB>HD#=+GFK)<$8f&#{{+5#Pl7JH+D{3JS?XoM|theHnH)VzJ27?Sk#%v3!fY zrPx}<)WsO5{vbR1J)_BMSI-BidKf!g`7Pdk@oN1X%p^y`)p)Thj6(ODox7VDGFdEQ z8wk$#s6y!I^?j@>m074OVZT&8(Z=`j-ekPtqmnGCvUdU!af}q(nZ6)bX;d^PUhy}l zaa_ky6OLKT#w#Bz)X8U?&3Yidi>d>Xww5^%3ASCe}TIho}3h^ zN`1Z+_Z{WLJaUKc8c<{8C=|jEtT$65Gc_F!Wl96hu)jqb9((I!hU^R2HPqk{$&P|q zkQn7R-Wmxj3_F$)Au>q$JP^uJ`y32PB0t}_Zku6oj?=-)(t!`WQTOn1{vFHd;;T&pZIbq^o=%G z=d)PQedwCtMvvKuN%c3d0Zj9Z1#-$sf5a}>2XPXAl1E%NNQb`g1DMm7xP$B)8rCFo zYbY_Z>tx6me)7@k0){6`n4B3}|618@wk?>c=BTm;PQ#otv!aEWF2>9iBT#VHr8T*j z+9H>YwyD*)aWHSVcQ)r{L+2G8j>xpAHqHS)vDdXa1X5$J^8Qi&J@;4L+4vt;w7KGE z1^e-_Coc$7czSkKOQpT$XUVYz@~Z8;m5udo`?UnxofishF^@wet~cMj2H3uayeSco za4jPFGl#MF8ZMk zzLco17XXFTHN5Ai{`m;dI~5J1N;N&4L+6Un=_Jol2JMat7Ic_R9&o0#0)>-4)X%LB z4DW9Y_+|PBPD2DL1oSC2)VnmyAQr1HgTde2=oF})i3I@IrJbbP8bTOG6t3Vx1Nh&j zXVJDhhjWG>p#_p3bqr1kLtiBUKAndk!)PJGU}m5s_;`+d60n5|p&s;;#y0HEiNVsr zMeja`Y#9bWcT<7;9$Y&Se3JD~FaNNU6?5YRQa_P??`ufENHg6VjiK9Tn=ehu{cF{> zy`l=)KI@BjNQ9;o7Dy#0n-xA$K7Flqvk&5bo-OJcRbir%2#u=ZBJRd6mV9hy_jv4= z;xBYxG^*QH8r~(?`Ak^7-=UbG=2kI|YoxeXMa7ZN!JE#hQtp>*)4d&ZiWrwkHXqzI z;u0mjb90YOmbt$>tzBk6nR!k!J;2>CPCnl^&L!VH!I`vg;)1OWDUGejKeJhy?XIJE zy1wv^*G_KzlxdJ*K=9oGKi}4tWplSgMOTBmB4TP!xJ&f3G)P~|0E-1>)iVTOXXaX=Ql%WqR{)DcQ=nTzNN^bb;|WQCeI}TBXbU3% z2yT!@hFykAi|-vd1)-@wp}&N0fBV%X8WRmUJ9{rf2t9BIhP>&H-)wvq4Gq&{!qMJi zBa7-v)=3PE1{yQ;b)W!fniS$-Sj}=@@P6+1>yRUAbD=w1FLPLys9!TFyesgMH^?q6 zG=_QRCZJ|c&B94iJFvD;HMH@N7U%X`App|XQHJn!_pWeZr!V0=7UbOp?z2#gKGV(L z`4B+QUCUyTZ}pMucF2t;IGSl6Jr^svt5C%F%P=GKX@o;t)arMyYO)u)o5dq~D;WHM z7r`(4ul1Sz4k~!UYx3M+CRftwuaXu%<(`lr2YFIvEr;nRlRgjr7VzsgeM`48vU8;g z7n~@H4vDwQ3&_+MoL7{HJ7;%O+x3}H$&c@#iWY&QCrpnu#ml7Y*t(+0lGsB_Ke`m{ zW9@3aKmS=wm9?zEWpapBv35=|E}t8db=^^33;XmaX=BM6WoCbn8icmsuIdz0~OQ!~H5;gP_oSK`gvZqIqibf5$3l zGYn2?pAXG<>t8xX0c7J(_wvYlj;@)Iy9Pk5;LsMxn0ai3zoGv#fXTG;*p)sW+|wPd zpM8|6^$7F3V)!Oehh`>4Tcyn{d7LY;(go;_^iSP05M|#Fk2nl3#0)f0QYh@kQ}yLt z1a&Q}9AZcvC6gV*fv_#`hhQwE0#vdm+Mpg_ znQx!QpUzp}8`*gaIto0_oxs`l6M_jl&^K-8&w`ZZbw_d)*Lgckni^jq=pGi;gR88RK zQ_|Ppo3Dra1;pp2x|`2rcz$J!gQJ=s1je_^^VssGV-)n>?5 zSU%s+iTb}g_4UpEwM#b!Y17YN*!=EEyDq;)+e zgRvONbod{g)k0mU7}w-V($xUU!&61shwzt^J__}pJWf`U1RU=x7-g%1hnUjv2pd@v z^o#}>3Dnny);qGU~&m*@c1P&+yn-<MK8_ zSV%Uf8dG9cVet0)&nJRkIo)biLG+TS*K2Beni5P>Bl6>J*G`SI;c7pCeE;0_x$Opfgs|crE#W9!!)_pE^e9d%f34~}&p(tp5g=5d z-Q2X+d#>q=b)M9$FbsHuf^S&Syw6|2x1Zqd-4cddXcmZ}64A$2vB$nfkW}e`>$DK4 z-D@(vjFTh0iC_Tg+kU-wa}wo8x@R`(0S-9~Hs)yE2U>vN;_XKUp5{arl=smIGDN06 z^~`-kkb14ZFa-QlFi08=C=*HCg9wU8Pys1izS|68nR9!hIHbeDMr7LR?{j9(a>$#f zmw=XNmW(V=5=}(0L9&1uI+=J7f$>fk>j2*;*+gTUIyWB4mci$Kd^Ae6D#TP0^}9O- zH1CLPJE%>hcSUO7dJbPRncaTxw>?H2OpZE%NhTC(KX9mVZ#(JkWYg$a({eO)Bqr7H zZvRiMm7~aTm6H@{vBsxO=%dhZ@3r~>=o;T<*2)o|DCe+DbK(~*c~bqEVuH_?kDT4A zjU*FfbLrE*3_N+0-68ccBIxG8q1_l$#WT%yv*~B{Npl7_{D0-t{`xB$6cO-_s4)U}g=`H#rMcdnuXV;Fy{>w2H|*3@N(rrP_j-P!{^ z8Tte!FdasQpFROV)#|c&zbvv7zQMESeNhXicH7;Omiy+W8zTanji@mF#eYba-7ru? zd57=j8ynJMZ-EcuEtx0;5Jzck`QT>2&rGKEy_8mN0UQdWfLc3FME{n#7R)~(f@Z;> zBmFRFNBA=E{Sfsb2-M1I8+eEVjx4sF9*lT>i1~5_xYKyIb^o1J>Se$#fH)pS7k^e( zB4`5^;{v}*OCuOVLtu=Fen7^-%Y_lXPY@A2YIU#wmtP;%G#cXjLLH4+XsI(fOO*+M z>mBhuhSa;5XI}h9WG(EV9ar!=-GCM)d{j`P|NGXqpe<0(3nBZ0Mzl+$iCfY1b(g~Z zNlIJb7`;{DS?`PtRj!dkX@<@q*`d$omB7Ain}*W&c+9VhI%zpCcN(vp-#7eJ>)Ad8^t@GSY5lz_>q?|)N&ND8H~jFCBKu5-@7ZsC z3|2Q&q~&vSxR>jvANx*NKkoT7{kg2g3LlJmRypcnqFN&FVN7m+Ea9{t)(E?|9e1%eQiZlL$92DV2ZL^3wU8i$Pvmm?bqOc z1dtjz1iSW?5DkQcRoJhN=oF3C{nc6Wl4pfK0*=_{Dxmz=n-2H6 zX;e;zjcRUR#GUv%s>x9m+omvM>rbn@c(@8)XtVNfGu~{==IHx}xvpLF$LfBpWuv_x z3)8I2Ryo*TmU%kIew39XT`jT$Jx7sYN7|_kRrCwEpnU z;qB5?ZLCm(ct84`;=SFLPvb*1ur^F{PrpgvQd{@~_ue4EtiZB>gd0w~^uJg%k6~Ce z(#H;R&;P$wD}29}?`=r?`jMulT#Db~{0ZCI#q$0>ElLgEI_bp7ctlZK%X>pCngs{r z^m%^qQ&T_s#n=Oi3 zCzN~#Ojz7JvT)N&rbXcFfpv-PwRS;+aTxf=d14hasQtiS7_5jDG zo-Z|yTAoe=QVFtq>A-+Lu27VCzUS#{(mcHbWkdw^2B-WI?wQSa8=cyrm&DG~-eX9^ zVCcepoi;{AU4PXu6^$W3?yz~tJpv2|tnsbv5u;`Q_1Grih}FT8Vz6-d8?cj#S(!k| zD&IJ;1O9@L?w=Nzb|G2k``JXDO3*@U<#|!8u>PKr{uA#J8Sj>d(TuMxg3`sw&p()O zo-Bw91cOt)GVjz`N-}QiWFp3|7@?jJD_0xZ&ee}UX3fid92z3&v{>^Nua;7BefM9> zbz}b)*e`3UVs}cZyjer@M%L$mo{|;+tANo)_uSt11>A5A`K%n5T;lD|i5zYA6Nvyh z<}mhn|3$5fdAkc4+PC`Me-u%0nJzh{H?^0o=25fPkYi86Twc_sB_0k6*{q-5i046~ z%{rcvncYj$Qqn;owxKAyodB~?hfX8+HOT3(s}A3d_;v>>u!4+(gaTE^Oe`z?;Fw-R z)U8ah{qLc>-xVq4#y!vABQI$kFeXIR7}wC~1{N*v$71l8Q1vb%=t4~ROY!omx&HfM z9v-FA7CC{j86hShi*R57h+_KCAV>R$wPXzxDMb>t z(7=urvi?k_;-2`kmD5y~sFIN1=Jw%LhkMdB^e6sNLC{GwLft#gDgJudagEtOXR{ z$jKNMKG}RKb*WT@IkcKt_$#}jLwoNo=?$LjIh$D$KZnZp5%JG9$3J)O7T)U?`D51? zPjpe#v7}G;G>zBSC8?~pa*z4i7=Ars5 zjbG~M1oJagh*lsRc_;D;5fd!*y@=V5y`b$(H7UE8Io~^CVm(&a8C{iY!WP z2CnW7)BqfK5?(m*)no5*K`8&bNB1ktr=d5p4I9FH_C;|wsc~q2C|FmoVoN}mVU)Ux zMbDcD=G!bI7LS(hLc&UMY=C-~ayPigw zo%0wjl{?50_`2q`{w-cJA)d5q?HZJi?>7JK;eSc9J^Vq>L!F^x`L+7N*9>x{edhE1 z+7G%pH|h!Uy?~>k`Jjfx z$3#`EC?fJqSM38bG~ADDumA3|#?liyOahbvAqY9MuTe_y_DPjOUE0fwstt|qT0BR# zU|NZ%2sbdZ1c>f`jnLzywebP`=V3 zp9~OX8m2N4(IdH8%Gl$;ePTdS>g|s?LcVE%fTrDfMK~Bzcp`Ylh`MBE)Q1i(5=fde zunFa0+2H5c^O{D%09H`0dBGbe42vO*Ie`N`sIebz(tS%iUGN8odvNDoP~?+?M*1_* z`-QdMUZiP&>L8=UOfT;IKH7GNs|TV%f$uuP%`@p{tQo^h!#B`c#79nkU7+tkVdZov z+cV!DDVHwtpd018CJ|1)A=qes!+vZR=b)g#v&NEcGCV4+-tR8RUd~&;_ExbaXV2;S z_89wtc|+h+#9m&U%;gQa&b-y0XN9Yaxt8_u((E&}HQuLxiuM$&gZeff5p{cBoNa8{ zk0`}w`s4@uUSGA6@bog-%9)1kWhQ-3$?bXR^TjIq&LUPaMW!d$5)Pq7_B{6e92#7| zemBaPcUJHD@R+6Ke3JF=%?n17&5`9505)%-X0;*c{7@(A$0+5mc}TobrLG1^`ch9hjCQ1AaW(_kqtZ=`p;|HY3_h zi+V3DGZx}|pb7kJ$USiWH|jnF(y@M0dsUAcB#^ebZ9b7vp6Gp`^^PVpzut_1MVo12 zk9pVP2!^TG(J&x-L#b@2>9zTFF^1LxrGmF34xo&*`mUlH-QErs zOW3c$uHe4zDgYzzG_?z_!qV=-K2@;z_#8f%3Nh_ z@h!{zJk&zc(da+h%l`GOZtHO!ZTGRb2gKm59Wf=kj`6|FEAGm7zrMS$@ZH9~+3+H^ zeh^s$ZOA~RpI7?ccqHwdujkE_i8X;bC}GXe>uoB8-lpBjKPuhAmy#v-J+JxE{1N|B zgG{-ksOEh4TP3kGiFMk&>LR-E{^_-3f^&Ajc(^?&j_7wvYg zY!0kdwed_R4=Z&39jg^PyL!~!KUdJ9#FvtX*Ga;``9=V~!6%QrCWvFv`ou>N@hp<; zsf-A+apt(}I+$mr2gN{$VX7WKDS4DCyd#?Q`~3mG0Xi_mK}21!LQc^8vK^0dtMJ|N zDz9A>0}T1US9Xup#Ve6Wp2iV9Ne#r@!!wXO&eEQaxZ9yS$cqTk zUWL?NHP9pRTaV3L544plAA5+yF+y;d7QXx2;X6TS3n`03Xg8DVNX*6QGw&jO=Q1kl z6ynWqtPNzV@6C>-vJJAd#y7Z>@%DE}}IjEIa_Be5mv@jb3jYZ~_6mjkcb-I(Ap;*pdWn?^R`1U}WU za}aFW@o0G2#{dQ3{*W2i8K~kU4Un-gb}wOfiLS^oEcpp2hZ)N_Ky}28szCHl7&$bz zX~1U$4>y?^Jq(2YArk&_L5Hcw(I7ZbwZt@(DXc{I=Dd&5p)<|`Q8)LIo2!94pUyzi zyQ1mPiweskN;l0zzBIZU%$znozu0v}YdPc4ARNy6W74g%!9&6>I)K?J(Um)O-?HK( zozcfl^fiuR*dr+RJdOq!1BRl12c4H79Nw9CCiB&9>5Z_CzbU7OuQZeNUmB#G?=h3H z=iRK1LMOPH;CFfgO#4^nNFuffF-kZ~FT}Mh2X8l?(tVdzOFZw&H4K??Xyxe9u+sXj z9HXA_bIw1dG1{mtX#IrLyx9D|upK$lR%sB$wR$65J!$pX!v5Pk*29cLl#2SxC$-^V zjKnF_m;3frs&3T3tF!D_^NC`xt4%z{gm6sLGhe%1Xt6lm$Lr&M%u9B7TK8sIVnu#U z*{APQ+9tUeoqrX%!EXu!$~ZwQpBcCF+QQGdMGlR#wYk5u+vm^lq?tUw;4DKwH{K2E zzFnK>mQnqAeFpiTWLa&Wxi$)bdQ!(!!x2fDl8NGAHOr(9o!*`^|)gkw*UA0$Y8hzIafY zo2Pt-6v&l(*)5*9@#|u$d4~!>PQkXar9hLJ@wtp^`dnEW)i_}PH>St>D&TlDK7aQV z)46Vtq>$;8YJa#T(X7>T?e|CEa(n9bxe?Q7qlqsz=gc{0H~TxXuTFIaozvOZdw7ch zUyJbD0DFIx0__H4v;NS@RUKzoU-)+~-k>>sM;;BQk=5?`iu_TfbsJ3(|FWJ-OCk^$ zy_c+kfZ1aGHKDX5m$eqft=FpiZg%moWfL*0r^ASi*3fRp_MT%5ndFlFlK5AGEMA~7 zL&}F!IhiFBFZLcKr{Mmw$E3m5CN&;Y{hr+ZBi`Hel%l&tRc``5!uEsI0U!4LU z+gW#`+^g^-p>*y4&U-FJayMX59t9sG`v9ic+_ zhiaB4$N*fU!nx1OAP!a;V2#7w@10fxX6#QtReQ{K^*Z!H8Uv`^0Z<^B z!{Rg5vDBfWt|K$BEx-Y9{-u&^MamzP@hk#Nb^2likRud(B!vh1193iJWoBe$Z&?VS zps_rdr5K$du}2q3pmVsaNb~+JQ53Nba4eg^DuP+G?bC0C{IVgP#$qy6Lm0X^#N~a* zkhaQ=ww&$BuHX>b=~pV*5@w&crqIv>C7`=x`gtc!e?s{RI-YoRLIg4DLe=D%-M6Tr zY4%$0n18W?yV1+@^k;?Qf!UI*h-UTvG|v}5y50x*xS0=ZEvVWN36Wc}Y_O z^Q~BHShd&PF{S_Cnj4DS;@1gn_E~Z{Z&#<1C2|E~+I@$Q&A#@I+f9^;;RYMeoN!OB z5X(;Tb{gO8p>1Rx6?46?PO;f;zIY>X%-YQMox~pA%+qILRN@> z=r-X900AppIVMPTv@CtiCNdx+Cbd-gj*~Vc$DokkyOq|d&f8{eIU)wl|3Uf$;6(|P zT)#6D8ZuMe_BJI<2)|JSIZX}Ha8p@L7jEw+Q$2y8xi>PD#R_0m=00~KXV^)W)GfGm zx`HJD7d`r%M!ZBrAbr53r3kRn0rgV?eWzjR-x)7?f$z+=((`6-6#WsF#3#bUr)}v$ zEF1hY!1?P)R`xYBh3IEwsJ@{N;{FFm=H6haM1}(T5O0~E}wefIlS;!XL zUa7n%D@02snZ}X3+OEDPa=j*TzM}k3O6by#{SNPaDxdH5rDiGM%+d3U+v8%$o8!et z%Zx!lDt`e8!fwJIN`xA?W{IGr5W`ht@rbCj3ai@#I5u7VFn218T{=z~8~eUlzm@v-_u(*UfnQ&m_g ze8{4q76?Ot+y{08ZiSUM^l|tO%joRQt>y1S3U-gM z^gFw>!vKvKc-36e(9#o*(le&&KoV-?`tKT|LTmfa#NFMmHO*0PK|^GrPQ1gtrNAyJ z*vd}C{vCk6p1B5Vcq_d8oA<$)B9TCOx4h(-4^d5ba_Tj*guniITLYO`S3I=Pl`nFr z3iY^x!aE$5q_}A97|iu?O1ZS2plt;nW=u3 z}!QrpEk!@~JHGB#rcSw65mJHoY+eYz@F&B*cXi+ zFI!|iY@jb{7SazTiC0H^pT#QZJ`!~dr$^HTu0PTr-n(paM+-_r@s zWcg=g5K+tiwo^>L@wCUn8{xb=QHwlfjj0%p7g>}g{bSh}>}D(#9!QBF-d&O-2X~uI ziukkTbo&Ds;Vp>@B~LTmdTT36zuhkNG49Sc_c7k1|L8Kq;p_|TwjQ}?gicmNN%aCN z$Jb8JiCB0!n~IN~6J!E6_OL6~K{>?t!3mA@MY|1Tx** zqn1)feT5IN(3yF^NCpEaBIU4wXa*crTFyl?r%PYR&1=McWc$3OnBMM)MjH{B|^*kns68N?yHl#)Kd`IfK!IoVBR2mB0_s$9= zVo*FU^_u_qC9Bs>M;W}@nEsQRmt~UR{;VFOS-ot|OWyZBZua1qwG7sMPUTE$Md4%f zuFsW0{|2;Xw*|YM_}h}Vo$NqoNvp+_j)K9wV3#JOzreBFRa%U-dygo7N5+gCcM*@(&%|I;5_fvy>+t(b zF(v-P()?!E0Cp3Yn?Nm+PEDu42djTX?rFs!?~C@Hu6Wd(euy+;hp;&2Bx zh;(#Zz^3mY4Cq|qWW&rZYk0x~u&#FWZAv7_{M+`0k(vh$Hg5)YvFLVPfD84gpDz-m z1pYxiYmId#Ls@`YplzVD$WBb-58QpdUI_(pw)8 zeW2>$0j%w@G}#F8^3tvw4v%?0BNTi*;MkvTDy6dFr^TGErEUhiVPhH$*~aDIhlOz(Je#awfH9MRyW zJKX)giZy5=RxXKX54!%E`(JH<>9bXZ<~+g4yYtt?l;5R#VsE6>u6G@i9xxl%dLFQw zn5$*5CVEDi(X!d*}n>})G&QW@ibs~LIs$eA?b zK*C||ZUZxJb}&QKr}iU6qp!NW7#~EnMbQCcdK(i?!!^=J_QcB?^L4j`N@J)uDI@)!|sAue}@rGe;^*iij$WFBHD*otaDiXna5-X z`T4mc{m<#>v#EQ4lTL*sa-8e21)<( z`l?MzUH5p#+{ReC7&zC&r-|#gScjYQi##x&q4UK1NUxoLqwC9@wL){BPcr6GIZ1&O zj?IbPC(B|X-xX_}9W32ck*p|IZP4iWg5vIn`O3Y&SFHjkyaFfv2dCF>k(*}I$}8)> z=S_cX`qAsQc;NFU|Id@|DjU~f9e^f)9QB3inMb34gNc#}mx(72P^hcGw2kGOlVjwr(c{#`{HC$z0*-)w@(^t;$8Ybw9uu*BAR<2ex?)Wn;EuR8 zLDLS^kccx0!yDToq5QkE7edFC@#7K4#i#QGSI!g@4F=e;yl`kvuKwbksM;KpZcE(< zB}Agl4K9foeFoQ1v7OX)(z9&jnfsr*_R*rKB0_-7;i>de^u05$MaC+-k6H3~&(*OM z-8VAnRja=+Ebu~D(AW^yNGI2G?}K$RyY+j{=G)75e`l|!l)2fHLxaVoZBNNWC=6u# zk{5qieGhhJz;&?hk!?AZYX=?d+hy9Zibh-hxP~pISb_-*fD}HA&9-{Oo*l zQ++d;nl_&^)hW&s?fK>GBMv19>wkfF07pN7@a_(TD4{cBR8`{1%z@Fd%Jsm#KrfAgWT6_NWXYztmcknlXP|Xb2+{e3#S10>;yM`#I!M1S$$8{n zvmw(%PZGFKHAr=U2AbqwU|QHxip(EWt)QrRs_IV`KV)_^LE9fbQ9bO^xle)aW|S&wP~Ac=Kk2)t%NJGpEG- zx2yBLth?W}FP3eTPSm!|j~vp1_BgUsGUFKe@GqIXNxLmh_A z-h-xTQP%^3EAit2lZju=j+SJEP_>6ou;@N>N7428Zt2zSXInj{b1&#t<~&x>{l=nv zdv=NaaEnQzxr^(%wf3a-!_vVmn)c(s{Wrr?KLiCr=KZ_9?ilkxbI(T~`Ca-vN%>1| z-o~%;rTl51o%t?CbXVs+uR&Ixee%m)I)y^ydH-nZD8z_J6SM)KXrhWlCD)AA-V#zZ zR!m(ud6aSfIoJ8iMTd`S|A(S;@n`z`^}<~_CnZrGBpHWKsw`a#~sZ@iy+ zZR-|x)k|WOm!h6SI68y0;%n!g655aos_m>USjzECJGWBCkS4wzk;1?cBrKgACVQ@d zLk;5|A)*&wGTtMh+Su)4dHPYvdg@ZEX5g%ZH%~PCU3(Si`&4<^2Cb*J@B7KVSQmfS z2Ntt7x!{zkpZlAMFk5C6DtRjP*HrSd<8$-gGjDrO6+p}jaDwXY>jZW9@Hp^wXpli2cmn&|VdtRXqWo9YYE0Wus+}o%-FWHXrdihUN z^cW-S%PCZ(+Ym^MvtBi~SsRC8Jzry@rjuqpa*?$PeVccBOfZ<9{G77&Iyb6#km9_^ zDA!%^65z$PaKI%O?@aChoFV915SmV&si|6v1Q_%Uck?uYl9^;I*ZUKq&s+Q69nnCW zkRgxwkABG3eCzKs2Na#_8w3UsVEH2VZWyNU->(gNnD#|%kXw<=f0Kw*b5yrN#|q4V zfXpUV7~m%aV8s^;bO0!{^R#f!G32WKd3p981a=7@e{DJ%=~!lrIFLjq*8qAUEMpN; z!$}Z6NYd640jg4jTBk1j(Pt|Ag2;e8_QjD__kcfQw168a%AO41Y+b&RXzD7=oqEbc zZ*7Jo;BLRvl4<1D5?_5(M3V5zEkPiIn}C6Ya5Pv25=JtXS(aOeN6?WRfovDSQx&Uq!I30X`|O%CvF?c5a=fw`=h^ZmuY&<7Bv zhy6o?dp^xqvLlrAZZZ})n~0B+3@y^~iYXGiAJMib8^kWef%k*6{(pQuiz}i z(dK+^HX1}64%oYA^WchJ7Yty_8(8`q8eh@OmYQ(xAfS|6FIq~!!T z_c5Q*SB7mC!7Gb+)rs})2|ZSn-uL^9-y-o5dQ}q9jH++ehTnbnHihYuBX00?w*m^(2p@PrK?#XWdR$MU$_B+ zjg{;pQYr>|L$PjzbAW~_gZ==bD*LZIIq35Si>BD({OJA9jI_8&TDxiSTV#KOm}v`N z)PGBLL8Y_YS7oy!@SEBurCH80oVEEE0SEBcaZA$&4RH-Y<|xIw`C;$RMxbD>odGYk zivS)BrtTsXrgrUIDFKlPFMVMKxIu3Xh_J7kAQNFc>kkcg+M;1M&F)G-&w{@NO%Q5v zeId(UAIBFJJFOI2`G#8ghg$gp^+*Um(db@%$O!4}jO$f=a+kz)hlq`IE%%0qh1bcz zN4|)F`Qg_O!{nU*Yot^!Ru;SrIAl*#Nu;XHyA@+|h46t&hw1KP1utW7$Ru`ZYxrNu zQcrf~U=?VV0qJ!-`323X(KTWxF-D-~yP`_+zXB;_%fBcq_ul?OuNLmn2*5-nHkzcG*0nXb@HcS`$HI9LI6E6P8W3hj7y0dKxacTz$`EKnhN4=YF(js+G{+V zN2~-_Er07yg-4uBa=;oB7iO@xX??Z%r%6w5RY+LaSxHI4$uzzM$s<5>&d3GWB;NrO z(BJ{cal(*xTqnZ@VT;=je2sJgzE({6J7H~?M6=yU#9oG7Pjf{UU+s}cf`?M_E21cA zzTio4WgT@KCov8vM;jT+!FVe3KdX+))QMT9*DBXVoP}yPvEeK4@X4+6!Nb!|0S@)J zg+D)H4l!XAaeZasrP-mAPvKnS5B*EL235Am|CLOW7y_ooohsMNU7SpiW1Hi6^jmY! z;ty9l&5jG7Np$V(yrbK&maYTm?Tq;%Tc1cbm*9>wXo*rDiaXUnAbnX7L}1nUce}0@ zpLN5Xyj_}(n&s#?D~cIhm7cxNZ*iMDp9U`mwsA|!UWm*|=Vpf?alk0cn=^#`RLi;A6m zae$A2l<+>DPm6>UJaB(FYTzgkFJ_Z<1RhEL<~&IzN4zypbfunknd_uqOH@w|p;-mH zpii-m;@*}O$4Q-RM7wHmpvcgcTX*(0+JymOOp@*$-}Phpk|*HD)^!@dG`C`V>d$pAhyH(I+|X1UBvC} zv4dF&$4qwyRF*(!DF~peS8i@4S@J9}E0$WHFa*zyC)SA~IyF`!57q7jityEe!&tb9 z|4xeS=|;^wY*iL+v^^kW;E~;NZf68VpgW;YKK3S3osxs2*5XV?L~kot-G6;u#EDo5 z4LO{-W#JnqEZOnwv4_jm*@wq6IY6_%+qz7OW($V(-GUaOiFr(P+Apk-HXyfLuG3sS zg-$Ges}aa#koji(q)`GypJs$TW{7R%;`44b6#`jp!NB2cF0W4EkuZj%UgEC1(O?f= zOKQpBLRqU1S4PDJURt}ue~0IjN@jf!9F=O-#pbq=d0)~|x6tf^L(T1jHjg20D4Pl0 zzjACHzEwTRNwrU;Q}+K)zy8&dC;S88@XpIeRoIft#RAtm1=0Z0gY!je9z|^4+#qhi zpK9M`a988FcOHg<06BVeFsi`Ij0qLuTB%X zbK)Zy@DPLU)F)F@_34V78|>>Rm4(7}y5BXS`l2QcS8I1Ihi1gQhx{t97*K6VHR!7w zU=sWR*B6cXulorm?vy1CafYZ&G`0PkzA&WE6cl#`fA}ldm~OtfU2B$9j*{GUNYu11 z)Ez96bJE}{IFb+E2{$&gz|v77ITz^bk%9Z;WggpWy-xwjESS$6*;uc#5S#ykFk@s1 z=beqwue)8CQ0a^cAPlj5O!eW@r3Q)QK znVvyighI%Ew-5eoGID#&PM=A`oB7!10MWHI_xT!p^fOa_cS;t@rG@k`gdpdN1HkwzH}no71Yzq-Jhgu#~HtywIh^jkQf{?1Y8%>;?57 zn!VdEdo-h1k);JH-7e&(xOAMZGl%D(`3yMf6vLZ~SpBC4Xy4*)zq{7|pe8Zzd^J1t z(IT|`3*Yi`M*Vc_{9tMDunNLz1 z;4%`l)Vw2m+G?gVsriC?MGiy<-y`AQ%K--`2o#J>7k6QreI}4}NzEKF zJxya(LsRVn-M>12X zjl73Uc~z2#JX3bl-)G?YuBNlTySSSfqJE3wl)OWWvfN%E_?Iuzv6rDo&z3(`TnBXY)?}2g-v1|^= zZSCZdb-hshhDUe65hH1+5nJ|3{T^U+a=?rgjD7nEd%{2?;_=zUv#WQNc+!4Li;?*g zaJazR4V)~WOD0@`mwjlTNMx5~5>d2LRXi8`yJ%^hpjtkn`N4?|Cv@o*rjYcpL6&f3V` z&eDL*HXOw;Yr)Wn)0kV2bu}YsSUFaW)v2wV?Bzvo9|uQqWUT*J5OJ%46Z=DtznA$P zAsEyA-T)0Nky_ZW^Sq~ui0F*8b+fdvjkEB#Z_UzhA2gHW7*oSm_zuNpDTkOJeMzZk zDYg!&VLw4e=1u^gb?fCR;f2J&!tMPaOFiP?&-JV0Dzq!6agitpJN7&aV(o%(b7pu8 zT`|tX|CZ^OnM3Y<5bvy7qP=#ow9+Mi7v(Iw9PvcIqkNdq{dFk_9U{LxVDX!KM2NR4L_2GBdFTI5(qC!_`P~GY@4gy zI4dTKvw^%6xvP@JkO)G*Q9jtqc7}tZHN$n9-t7XT(fZYr0(8!$ZWpD;gy+v*Q=$K$ zwmA5!^8d}I#pe{h(eVFitHq{Wdi2AjF9zViBxeQhha%A!!^_OJd^PABL3QxAhUx+l zaN4y%Th2Qnv>5z?3aBe$k5SD~*cc{!r%xxZV5V%0%V) z*?0VlT_&G9F-Uzo9X9i6`QxE@>eVS+p)4gOaZkz>j;Mdu$I8@Y5&Z4_Xz)Ctvs zNj@e7^h2vfHE@&C90*?DPn#ACj1um9sXKa#qanxtzHr^ghjnCe!ZZV~05#vhgf(IN z(f#ei@3KF;OM6g%y_Vb3dyymDCejAsl)Uq_`KQ{fZg*#`yxi+D`7T^mS%2b($>&@{ zqQp=_Jgpk~a+1>lCg-iu)EY(hCj? zlrOrCLNj-2x5^@~rH7V6&m*o&_p4oLAgSUWEF0zn!VSj4HHpBp+dh2v(4hSC_+uo& zNe+Wv*2>neDWr!e&It7Otv-l^q$oM7TS3Eku7i`4&j1oVc$fUQBe{0|gYFa5cmK*P zd^@CFN%HSC_{S=z-4nqd-Fc-|^Tk9z;B8e!k3cOK1!#st`9FL5sUtkO_lDW)OOIS= z`VCyCc~1cwnZPKC5SRmRz`H@vKP)kg(x78H*8ew=6+^pIqrutjH|P{AA^M+O*pD=- z+LcJ}8NK@%msM|Sbq>uNRJmO?Y@Yuuhd#4lK`uBcs`S zV|EAS)A!qy(aDPXCMhE;A5#8H3F;rb2>WuWd5UkgqZ*Hq+}&siTQJf6*DO0;!@lT% z{hY{GTKe*nb?TWl+pHLiW8V5O=s3&i9OrX6Y3dUF(^8r~~>z?l#y0RI^uk{>1VzG648GB&C zWxoypOH;JNj#`<)d2oN)3Whr8Qh%EeUUR*Ubm3Wu+dPHig+SASAOP|D6Ha?u5>32! zI3N(X8;ai<*{`ZTW4Nt#?2ca;{g7!lg zks&$fr11ErcnOgkdQG}bPYdDvlkqgvBic88=#O7C26O#3se$HsbLyV0<~{Wk{S@c@ zxaAj5kRL`zSg_fBT?+<7pdyd9`OPvK11)&a@aKtT%HF1aWqbD8)B*>|t!?E_EaXL& z3hf^Xz*i|NW?NUc9>4ee(2_YXTK>0Vt6r~Kq0eV}`NFTSPhz6lD6zSIA|noE>+*SJ zQLKgi_oc^r`;WSm;xrO%>V8RcVy`$-qODbJ3{TpK`}G&8vQV)ZVoLw+-+73 z0SpJB$1iLzT-yo9W7JyPei_?d2uOoRk?2uT1nHYxw>mSI_gFWq&YzdOiWcr`Ov?4& zte9-kLtP;L@yEk~9Wo;qTya*y2vs@PqZ@iD^apOXXO6)@y#N)MAsS|YZ3bi6371lj z+&v@M`{@&{rs?1BzAaGpccZ+9?K0{9Fgp|ke$)qkWbsV8%NsxYPWj*)s&3;s)y=Wf z7WbUsutFJ0%J*l@w_Fbx0yznxWVy8&_LxtX+8XWLKPHQ$!~lbWVu`@_B))4gyO$6lMX zRkhUjW7@LPE7ETfzx{siZ@M}4Rb-rA?J$Xm@2VSl?BC#B`!R>=si~(cG4u=fr|vcX ziE~9F11q3T+%H`FxUL*>g=Y+QEKw{ZsduHyZQYifC~0+cR9-}~PE!*E9*YOqCrZE3 zp-z5-i`b^|C2wfMA~{zlo=clIw7y}Ga-A47T!3Kpg+RFRFGJ&!zn`%8y$te&#VA+7*&J>L4JzxY zJB0u62I$&>=>pd|s!{AsPTv!RE_lxBre?sKa8e@tsQcTYh4@&Kb0dV}kivye@?haYm9=L|%!*xl7{vlVxH#R=+zHtVwmpc6@Regan-1}TS%rdciCpyZI_$jh+ zTeHXD(l~4Tn;wTl?pA*udC5{SI!aGs@M7L}{uihD0ZSIE&1SwXDZEYkG}l=dv!xuW zjZW;HUDu2?z|F+cLOd^#IB4($G$tVeybiU3Y0rdTNP|MQaFyXB?~sIiYtZK)vTwV} zjXUoxsjxq@F-H$bM1;Q-9ATwpgHS!4v%!SiyN=?50M4czYXUpY5PP}k4l1R}3bw?6 zhl!_*E=QoX>aAP)$R~lSzXU&f-2d|-_Mc!3Kz2ffV=++Cz65xLKK2_p35VGNqZ$1| zdS1nTSjondy>Duj&|>r|L19u>jF7)1GC4K`1DN{|c$^WmSlIW1hHv2M)6CcF{hq*7 zncg?5txF7mp8q{ zGA!8k8YeItxd=yC+jVQKO0D-_;D*j_*!U9$D`(mDCTlLUY=l-}RZ9`WM*HINgO3L!PCfwbA|He8@T8GI_% zX?;ufE(uM@&TG=4R$(wtN!3!^a8{@OA`GBFKLMOwd`v&f2@iaK$FY>2MAE^_Cx9KAl+Z5W^`3G5F0HsLd(L zUM_s04u3&sc4d|=CI>{}1whQ|3gKN&WuyfHZFDkC7!->oSI6noT2 zUmKWf)=^;m!E74)pe3L;ER$&_{c|_>O3Jw2`6eP+*Nwz>^UU8~V=okB{6`LL3Hdp{ zUb-+mYn+8)ruisY9^e|(RJNxye+V$E_W!ttTlzJwyxEsSP6d*D@EH*o8+(dnb2epM z{BuiQ72`9rdqhhua%9?!+nS{$DJ>CwiekE>y_C?2E~PYU?B4DK@L zzp?IKKpGAK8f5`WTlvd9(ddzP)5a*Lfa4(y$gK5$dPgb2W1W-++*L6x@eSEq09Om|;?rLR{CZRr{* zFI396-QVTE9#a>&A4mTMLal$5=(m^ipNXm7&=+ubu6c>lB{G=M;IWM>H9p3Q9fo#Y z3B@O%Kv$60>`YAoVAoK1R}0z4TAUP#^ldy<(5q^dC?&J@*(6ea)^4Bj<{usVxFAcx z14VGQ<6=J|g4=<`hLor%Lv0wGItV`o;v5j_+)1QUmq=uQBT7jN>JiG@|CDV+5S%$a zWdI0F(>kYUBsymL+D`^G=N$iU*7);gdf;w_iSV22mg1XT@{ivfWyzS=Y#17E$S8_4 z!v7>>I603KxBG03!ZQp)+o3@eQu@eX{w5-Z+?4X{EcCBQgQn$OtvJ`5yO{mwma7-> zQkH$)Z~WS@+Z64vvg!DXr$1@kv=|%qm0?A7=UlW8zh@lRga4pddLfn4(9_%SLDFXV z-hzl@t7!IC&N!J_MP_=sx6XH3um|zJ79)YxWtvYUmaP?P_nyyAZ+cBv#Owb%(_^~e zPqoWv%?WSic~InpDfz;E6}-CSl7u5T0S^y7KAi7oxwgj4$?-;QJsXmK&hW;gP#gfu zf;tHy5IDUlVrcVB-uoEIjGE2MfR^1XcYtXsBvLRz3R#aYnVks&K@uBP>9 zx*0`y0;JMH0la`jSOVx2r|nEzE#F#$Sn8lG!(L?K##mDPE57m zl&&%Q5A-$p8Q>pr{g(haO|)H_tqV#5zpB@CdT++C`>A+N{#In(52Ml)wGF}MP%B4E zF?P=0|GSig-%2XTzm3KBpH{%m2|9(3B$TAOj%_&RG*S7XEJVF4-3u!)8}qU?Gco?~ zeQ*WoJi9R(cvvUHM%Rw1jM0AGFEIRsbk21MDnH-+@oW6feJm$nK^A?!`93e@yXJRt zTlo|1XbwZXZy1(ODg{{n%l2-EZR~Ywti)!)Klz!X5#rJs;=UDU zi~5+Qc-o733{qLzXX@Q!Rye8hoXuNtyiLo71D_YL__xY-6VKxyZ_;@VA#GQoXUH%l zFlkn}&LF0D*RVfza_{W>OZ2OBTRRN2nD^#-Xs5{ze?D?Y3juk{?^%LL8G&YgD8fny zKZ=#l3d3h!zFwS}RJB3W9n6Y<#5p3~Qcx%T?uwsD_dviUA!b=u$-MR2y*gpZ~E@_+VKJ?>{xF79t@r`CiUaM^#)YJs(F7ko94fT? z{xhHoY(o-Axk-nS-^K4PWo}91t+R^GOnJ1`vL(Pmmjh|HGK@75v5_sb0 zhv!zQWe6KZFYvRj6ItQ;7_>`ws)6~y;`OcwgO=%9sgg@^BQap>REyg+ z_+sIT_sh+YGA*BtPgMW%yki}ACdjEJ#wlCq{%~2Xwquhd>-0>{Y zwym-GB=W#7Wz~2Q;+I?MI&1BJkJ{Yr>h<#uEkY5EVlo{V4sSP;a~qvoIY}O8oZrc= zi@DB=sf*uwhGVqGHz8XUn>5baz0xBuGh3x#xoo|@jmF^4C0^w`Qyi&+C*A|#faIK^ zI3@&ECUbPIAL7ECThi@&AQIHUgCJ5oI5L;h+=fBAVxOaW0WQyiEEgAf#J#VfB{$O2 zTkjy3X5T1Q_B;9`GWZi$Se)Y-)46GmA>tRH!Olxa2Y)j{Av4cg)o3^Rh==TFvg%=Tm6(Nsy#i7Y9 zvIjG^5wlq32-=I~-(_lz5*3#aQQSf7h}DNNGkRi^*@?q-j#-iiLR^1my3X2>W;Vdk z)t<^Ifi$5e@Jf|E?=HYnvi-A+WD{@xS*`XkCRYu32l$vx$6EamKv<<{kxlMszEQ40 zi$hMViA+pr{ae?n{bP#yr0DsQF+qikZZ~&ws@2J7R?`ikg-? z(T}^`WU^8u<4&B(qb#PuqH>Un6&AmWqB z>Z4>6+hSb}fojNH=6?Zw+7-xZ*NW#g-|+{`p7eg(>2*=tOZrU$W=7Wj2dSBqi?<8P|N* zZCp7x+s3f013903r-#fIe5Ayz&H@Kdrd`(Q94B9#WXb@5Au~OB*(n zAaA^|yQRCwe&nBJJborzf@oi&jr5OKP%wI5qwFGR4-+W$oQuUbUvX$-T5w%g#Ws96 zf#|d}(^1axTu-&MRO6N;b6Zm6Wo@sa&a+^XJHmehiQ}$UJ!Hb|FW0!iY=61VJ@`)w zo#M_3NZjzZ|Lq`XJC(|ot=9aRqd%T$I^O*(=C5IT&d9=QdXL{y=Hd{t;Q7eF=Do&$ z>F&PKQOo5PwhPP2oUXv#O5Q|^7$#R8ZT%`GdU)4IP-r$E&j-{Ni{!r}l6YeD^f6d} zU2N!eN1ee3r;YBRTVI#W{z%v1;%)z}OKmI>r(=W2^e72JiB~ai@k1T+#jPI^kL`k< zP&fTBMl$}JF9l9+>Ec(M-FxtaBjja)ZYVK207tb)3&)cVGmA+>{3T*2@C;{%=FX3j z@P>v#t7mVyF6sqZ{kW@U&mrfm!L}D4I8hpN;g{WytJ-BV89tr35nv_47F0}53wP;F z*pQ9S_gN`D0bGqQX+dhXyL)I6WM~BmO5VrgGQF z!ObVg&U4V&M4bhnjQvpam}G`O*!;ln^^wZnUFHgjptvfiJ>^8vqajjgo8)yRJZ!}) zHE>lVz(sRawx0Uwf^%@~1}%p&$v&0rbJEG2S(O+TWtO3lQ=)=aXqGCl|80E zQ+rY^Mx3`zEwp^k*i`r30=)p5i@gm$(Zt6DX3?v{o2JAPcws{W#h_;fB)a-4M4LJZ z$|(^TZ8lxAS-&NXa{7wFk<`u@`}?-*sn@;L@INxiZKv-GqxXByx7Ja z3o_En^gM{tu0ptKVoxTGN8g%K?GU;SxDL3_A$GV<0?&e?0D7~{+=N00n?ne|m9}4h zw=Y;3Ns&`loRURES2u(UkG^P9kd!^<@k-7`QUbuQF1QG5$or>a6A|}EX6;3OLLxJC zxBud^#^TX)PWagL|5PWyjb9aG9V|0+KX>Ynw~gcg7w^e6hA?(cWslIk{S2%0m;VLB ztlAPEylD%B5XX$qQq%W_^r$mW>5td1Oz;I6x_@??Z1F=G`}%YSd0Nx|XkJHZH&Gvs zCkUN9HahLhAu2Zq*HtEG^ZqrT&P%FX<8;McN_N&lkEb+6(th7z6Auc*4~z3O4!-qC zIhm1?P;@d95qt`bCNtZnA?RSn-EkVW-KBbAy-9S+GDVB_O>IoE`Qt!p)SU;ZMf*QA z&HG+tIM~WG>UWyIUtm>1#B68#bTmLVgZq(rXtR{rZsn0I(>BrZ^ei`7+vGF0{Gx&L zOM1C}UuCw-M@GhW7sdyir#CvwjSy=sn@N9%ADgF#=Xq%cx7Iul1KbX(2duchs5^b# zN$^CxLwZ;_z^(ZTA4)Mzx_`KA3VEi}>nKA9(v;6*8E|gbZm0Q=B#-j{7WTl8=6dZm-q2Lv-hC<&%m%B8V zf$H6UTj8{$kJT+SuJtb;__Tq$BnGrjF4jhKJJT8dT3vQ0HZrR??nQCphTpfJRsPh(yRb zlxTvl``4FUVq3F!mJhxv794;C)uGW%y!6mVBs_h1%>O0#Nndp%z(cEoJ;N(P*Athg zdi>X~w3KMb$TWlBCf_0*j{=|-YAZ{I`~jEh(_AVi4f^LB-l<{plgQb**K27P#iRG* zGpL?VJ)(58b{~G~3nm-1b%q(JkF7=38m1%#lZY)MYmO4Fvi~kF(=toOQY`O{(1O}l zsckX=+~q&FgX^d7676$r-^#n(9hfasL)f++_PsgZ8n`|72NU-pf)-%^snL;QI6Kp? zws6nLXudIF#>tFUYYbC#osp3JH#|SQ-E*!EV--|pmg;nN#9e%P6D#@LIoy45UdScj z-Tcea+R05(PL-P!u9XvZi)d}&ab7Q0V$pGc|6hU%cL$~nY%m;Fzyo(4AQ;7UT3<#6 z=PH(ZJut}I6R7>S=1rOEkw3zD;`W1rZSlh&fA$z+e>}TFpBvr)R^!a*x8D1g<|~Pn z6|{$5>wQ*(do&AYNnyezKWob9jcLD5@`N|n)?JqR z!uT~)`*_?)xCW?LQDQ}`Ly`fJ!DVHe&HL%4-ix0-Jb^#TK&9*(p7ZL-8C{<_$NkDJb`CDn1&Kv++F}2&Ow>B` z4rXE&pyX|+Utvki>4~ozkk;EAXIcIBCssGKZ(2|*-!RCNGxj}#mr+bzF?%%PyX4dF zYiAH0o?&n5r8L#aC+6VxcS>e$M^J10NkAS0)zu|B@o%HBhLMw;aWWFJ%Ff!}Q3GEF@6K&J!bXRi1YF?wG|`>amHh>h zMZ(EqmR=dz8gx|z0$ySFeL4f@Y$8U9_6MA*qniVM)QJIf0L8;*V99Ub^T3yMGs1Nd zlJ)?>4`*v&^)$Tq2u#0MUrn5K%!=={u!GDvw5mglPW@H<YHv`3d~fjR-!ze4sPh7-JhQRM4byC0Ch0!>E}Q4jlh8d|7$ZIjd$t_=qBdq6bz zj4rV%DAF4x3E?Gn%G~3?DK{Ym4CgN?Xw_8u-uxu*C=#{QT6>6gF8-pJNS9-M#9>`}P!EcbhtG)@ms&XP3D zZ4pESo89lB$)2xnJMEKm&-r`NGwO<`(}9Zr{96anz>bKh!wp-5)yB^_m;zKbP)eOM z)%=_x2s@mK{iRlX_^BeroMFhw?T%7f_YcVXhy((o$J z$8hiE4ZtNJIZ9xhyPUjE8BUb(`Yp8ArTN(DaDjX3tJ!-?bKeQUx|oVvZDyyxDzJ^v z{3k!T9Q+C3YLJa!Usi~U3*X1gKQ!M2tPuW2ltAN1u?A${2<;)XpDm!=a8T@IM_-e-5 z+LyXK9NEROtP<;=F&#-9M|2jrWg5F}7H3l@Y<^~DmDA8#h{D>>ZX-ypnKDVp+Yv^B zN^1YT|E6&0)*g0>r>vsZGeGU&Hds3jyqj-&zi?B?5eeMB@o_!&(=nWSo!6K2R>i`soZUH6&h^lD{S*P{8w=&)<}vZ*JJyshvRB~D zA)1fhupObB*k$+#bsCFJ1p}5Fi4Bv^IwClnH179H8qQ(akRBWJ&i|lLpdEY5L}XW& z05kA?Jw7G!ey&JeMlriUIlhN_>E@Pjeunz!m+Z{m4YhRxb0s8J8 zg@|YqAXZ_t1Wc)-ycJYKkZ}LCk85sAR(Zt|BfWxCs8Im?`SX4%pL7~g1-_QBmq#Z6S zFTS3p^TQmmO~KQ_;o|Rggm&dYAxy4_A@C#%M!1)P^L5X?W}lfopwBEMNLk6Z>V771 z^=>>E z1(sM+rB_2FmK50Zyn;2NF)iHc)&K?QkN{`h#a_*9pEe*xGnu}e=H_~#My2E{@-J?Q{^Bhmj9GP zC(IX(hh^pZeL-6OIaD-HeaRRM9k1T<#hP3C`8O(=R{~TMkF=K|m_<;~7hDoV8>O07 zbyE#`oyyKy(_gfV=FSY7;#f_DPL_o5K8P!D5<|kES9NtM@2eMeB|xcblmsSE-4(!S z^O+t_-gpaWT-Pmau)$41V^}bvi7)WD%NWsS-HS?Vtn{+ZUP$CWGoSK4CZ{y4Tsh-E zf3(R$p<2GwBZ2n-c_0B)3{dL?UjhnE2EA-13-Vqmk+i(Gy+*SVbYF%~5BswSryRlR!PRjc8p) zAlBz6(!Cj2mUN`iN+j)iB1xkVR9C?L=6Qt;UoCva>1CS@z??d~7v!sDxLhX5f|W)j zC|gd+5Da54JZ~-Y8HnNW{22dUxcv6B@*czOwPLAiwN07Wcai;VJs-1Mrl{uIo5tck z8Thy#ChJ-VZDR4phX_G_`y+qs!Je5H6*gn_2+XPgvEbvn#3y{42>#T6scjg2hT||G(LJV^&n;qg-dp$fZxI*2ji@fe(gH z4Paf+z&=76KeveFlFM5{q8h-AIwz+S!LS2v8sDsq$C^|6`SSmtz*FlR1xEre&ARNm zL<8(d4UPQ+ON3nI(cYqOnpT`itPq_uE*1PvM&`G!LBgx?YBu;t=o|f$y9S=mPLF{TRwvbOrRD z+Y$75tWFg5DXfx!(&k(*LuRh(*#bR8BmLIt8uCzUEiB{T1F#EuI+aNO-rF1d-qLi} zDxIu9VJo%Qly@})TdUNw@XXBHAj~mg9{&xYOWIN^EQD6Auy*X*&M=bS3JcYal zW4Uf@$eu`@cus2?eDyU&FUM&9-r#yH6)j2o<8YUp{4SG=a^>W{DR-Y&p)$zC#PpD&a{6v z>A$SJ=Q5JZe+kR}nq%Jhfm2mmh5G#`>8gpTWp21Dvq2+uC;&yL*r}gFk*-Tw!%6xK z5B6P(XPkvtba?$W#rkhJU5K#iJr&cWw;fl|Czt`GZ|p;^g5Fj0>!C6}#~Wr~L|L%a zPS^?RZgILRmaF$@!jYiqI_1P7$pg{vN5sUa6XT~T-;V`}Y=?L3+h=5r;pBXd(cIEI^(#1|K@&_!Aq{zUdmHtPkb9NaT_-X91|JY z&o6nT&r}lCQeSfjkZtu(J0^J#QQt_hR{%fnKe{0332Pi4o-#2tw4{_Xxb9vUfwyal zYhRt1R%`_(?|erfW}EeNe|M>fZ%_?`Zd0?XeYS=A2X^rMFQQOE3&Re^os5R61Rb|Y zP}Wjr%v6zTyosvQSSPqR$gCcjbZJ6`{&@>#USB&mO(qJV>5{QI2=Np#e$L*-(l{2hGY#@X>6&FmTC%#Ea93+<`W zTV@MIw>&jX(6;?Pt(zydCy*8ON%8i5`bvi6Zc0S8muKQdQxlJ;w z%x^U|_XqsNT_GqE;SequMiS0D+pIu7d&}~!xywNLH{f@?0f3HC!|fb+ERbJ!Cg)P@ za$hpIe*YOLV9|m1KDYB-=NX)}p?E0W0Y!<)rL_sn@FsE4rgH!uE9eZ1TNRL8+|2a| zKpH)9*IfW2Sf_Uq>UQSsDS!*DQD=kSe<#vE z)-?DHvc49B0m^bfY2Oa~=h@HfWyaCInIicyem5**h<*D|Z^5ZV#ypYe$wmYh1tdqJ zuyyG%a6*D6TyyI(fl*haYHeGXdScV*h8^}smbYi?8y}VFDOEHIxzp-UTvBu0wE32y zHx`La%ahQ$WtciA*JIgy<)LwkZ!?D?e7eSZE2T&hKj=^q>(H+D=z3S+Y{I0k7<(<< z5@5T(7|nR`Z!MESEh%jkL6+pQCAH2k(|%MtNUtVMIX4^hM0kq(p!%-%`rF>l-R$$8 zaQNOZh{=OM&|jw6g9w=Ky1Fk!zfD9Yc~0+{rUP2CKVSO3I&CX+K6~kBPo>bvK2yHU z$NSLtG~zM;bMJ=v;l{la)1%&fJAjvmYgagtJ4ecK9C4H*^I8R5GLT>x=u*ybzIix+ zWeg9FDtn#XV+YOH%{>64`5@Kek$f#ECPc7Y15Fj=cK4QYfiyY zQxiyMdrmIP(9@-AEcsb)6wsMTx1VVL1tJ0A025^^qD!QgJ^gL^kW z!%BHBeQS-c0KJDFcNbDR`ujCzou{0)UM|mdy_L7ct+oi&e=e`zm{YRWWCZ#-w<5JI z*WaaU-*x#u{+psYoRt-}HA7aMT@pNKzZmG6)cHFz(QELhQEW#_!9*S>>Fs?92;ar> zMQwjbauC%TGc_RYNc@XiR&^Za{Lt&CIAl7!_qlEI+B27ba<=)UN2^8Oa~IJp<(oC_ z32_%BY!u?@?cdy6FB}cYm-g+RNu&%`+6&-TK1~!}U}kE>OY>26Vh+BYrFo(>=n6F@Z9b4*v9%K+%twj0l*6i~a{2+eF^kWY;b2 z4jH80HeHr5=6lUJCBpY50!cYBh2dvgzlurd;1GM!G01D{%s%8zHHWY^M5Va&J)u+EYAND|cDD_z0f(!So&d0L^*gc3OYp1=T>RbrNsbzJ*Va%fmUq(pH96DM z){L?C3pB%4*3Wiv{2Y5H_ELNX0jIY>lZ**nzqHri{rn=o-JA!mX@iwaT!f_FIGAd` zYTugn>ypx-9xBfto{&7!kI^31MhvO#K;$Q)GSWi!Iz*-aNaB-s6Gr6P-bDxRdg2aN z5@=Rt|JM2bt*>eZ={)307#f^=TMJwhKv>=LFzS*b7imqN0M5%5GI+P6=D9mys|IYW zjhAKY^%?!O7b87B5&q0O7XRL#&n?<)Yb#FrFW)=?A6~ZE`l~Oc!t;ZhRM6~ueR5-P zN+9G&B2TAJ6#B=kPzK{*(-r4vM#H+i&VKC?-1b*n&WL6=YqdOAv*F;T5moLteJa%e z-CWn^ih;xY_bf`Z)b{7h!C{`+jfGZWsXc?ab!HUUPF8(S5VLA%>g_x+sOM|vkaa@* z5UWkvI6f*nuXVV{(GIR464C6o6IRpIj{$E@%Bvf&LQiD69|_;RAt(i_8;Y%oVWk7b z)04Xg=T1r8)Oja`LffQgnp|sUCYdQxC=vK~lJ8;w&AYv8Hg{RkWd#}>0ec-`54@7u9X#@4HOYC+L=@k4X(FP;++z9X=m zBm&3ZW#Zuw8+z@5hhx@Qx}?`NX>7^U&<9c%hdMsaWAvzoGw{U@2#cUvrg3ODFkq4$ z=(PN+*!^sx(lw>HaqcmOye6!5N7;p2lPcESJIjvX&3TOUPFy$xv&BXn-N^SL@ zN*zqNJX~IU*~yhLlMp{B5n@5eh;7qd_$e$pG-6EGW8k!>Z3$r$&X-39$uBR>x3WX5wB%FbPLtl`LL$)bL2pN-r-<@n?v8Q9cPtA#{tg#w;WF%~ zNakY|K|!uqGxAM5fRIu?EA9)o;5*9}7@)6YEjBz;O@Z0vNoq3$VT$(b$Ie|uksNc2 zcGp9BN{ZVVf%I#Hgno_4u=atX27J5B+pkRa%^!U6>;;1TNU5gGdASJuR=z6^rxR!} z%#`uW6Zm~c38|#gve#AXhyFX5EmjO-# zDfpwXSd&mcaBHXFu4~Yy((*?ydyLlBz3f4opE$S{bRsY@W|bb|v0Q*7I3M8$(kC9vGV@ zOh#CSz|PT7<*Ikjw}Dh1+SdtLuFtHQSQybc2kSlIyE=E*pJh%!%afEuN<*WJr8lLe zM=C+p6ex+>!4*52M7j;Kr5agnRv5AkPIaV=AGy9E9iH!KAN2=60kdc}!%3kNGE&%g zH{Ph|(GWR(qZq&OL-`@AC+Y4vr|_#Jb;=#9rQWyh{j`00t=eXHj30FSaXRk~sP~#< zHpIqTL19#8#l6C4kN%W&;wP91AP@@c9$>vtYEbS;D%k!!x7f~0s|K}7ih#!#&PA#q z@rU3PwOXZ(HlHWrc#MbH2Oa|>wrPyz0jaVrcAf)RxN7aK0@pefbP_u zdTLw5fbjQQO_}N^#Xb2oR~2Kw;O0g5GHR8+5P`SH{VTkPnLG$`TMfd1!`KFhuDmJs zFzkR>l$v4a4G)f*bp5w=-;&{*pe?Zn$r8{7`@E_oa|8U$tp3`sn-+A>_Ms%HHYtMk ztc$TW$?#m>&TC75bPDr*wnhw#*4Y&5SGAldivkO?%8K6#_AO|aXp+mFV%wi*XmdXg zKMFzr1Tc!LS_fhzTBM=y1Y$y-X5*0*L{4&hN8cag!xDq3Wm@?RO4mCQR__*=j=;u_ zZu%Dl5qmZ2Ju?ILj_zv;{rTTa!|^r~#{bl`eWysWa#~$Ti2$U=^gMdVem~v|taLs( zG6y^y`!0j0v#mD!E{7*lnpt4H>Qt^~hpwiU`rD7ftEF5ff)KC8{t6s%ni+#Jk&>X3gc_LINM~*DK?ydx0sY?~IWIOSmYiY(<+eH*al9K27ylG7v9RmuYJKZ|$!ELmg02Zar`F>$LLIiDm;EeSUZ zo-$7_O{e8s2jypbM^s4<1e#0y2$6Oei5GK)Ge<6?OznpKyD4kMcV3=FW4Y*v4t zRSq*e?8?CDjh+7#>%H$@x1BLUl=<}y*??-)uVqt*P6w&@O)?vzKl=>s~s@Q(=cT?=e zNxG=-q-xHmlj2(3JD*seuz{Ubz=_|f21^!jU=8*g zfH)TV6D-#Fz-yvz?cbRvnw6Cd`KLl&I?)1I7Ewk@Rm5&wQ?8=+Or_}rl0v}@Ezzmo#|^}P z9%0>$m(}>lpI{=3tzh98oVWAa0lkS~|EXzO2U2YG4)W?)uQ0_p?>E zsAiQ?X4<5RxqgaiOd?+3nq189k%!VAj;r^P2&VM*H22QpYiukyjCW*?d&HCZmB3&m zz?NB>?CDCshMva5;G*iTt5+^CqJ~V2+AY-90tiZUW=34KHTrydq)GP~DRd}V4oep$ zIHcI#=XXe8J*i&c0+<|+iLDg)UTY(d>0Mi%8|=g68ktKSA0$C=q|_8?B=nKPZ$d(c zlgD&k-H%em-?7wNc;M>Z=AvSEey1XK>X`*n{KX25y z;Xl-GfR15&%*4i(0$OxJ4G#C_%E1Sr^(!OO@*saeV-iIcZs)E^=54?e$Y)QU1*uL^ zGd)||j95cn1Z?IjApki=J$2(n#0-tdeu$7{A=KDLVkq5=ds_p6g>mykYqP22_ifhmyRs$NU-cAn(J@UQ+Lf-Z; zUi$YZ7xyd)M1B;Xo$X63-q1x7m`f#14PLVrDZ)bO`+1QFsbj6O%PBF8doC19$1Jr% zU57$_5B;%#p4XT5I(7qxFY?#DFX$Z}>{-DYZcTx~r4^=!-&C8vsil(hvX2*v%xG-R zBj`D%>v%ji+q-Y{(k1?PzwuR7(N_-wG7lI*);cPZ1bD7>W?0}=>G4soiX(N&2_H~6 z=zh8gjJ*q}L8pyJS;zwU#HpqV4i)ZpHeDlXVYj(XUQCJ&TJ;F@RL>t|OM#PmotF&_ z$axVlf$1nX-zm5IguJJ}MXR5__?2j3t*6EYQ@j!#7SXAOX;CDO<+DmM#SszR!@`|P zJuiVr=trGP_@UIMO#k7r->(7&T&JrSMIFiC?{kZq<>fMfXJhkx^mD!CRle7N91c%C z#0OQXLi|G0X1@`_3`5PkK(@kAhviUuQ{hz8tIXz;5x{|n&~G|q11Jhbdh0^+%I)4= z;K#mU_xQHP@W5obsmU!Z4@p#@aFV;STl^qUdskc{3>8MI>>JzC_Lw}S_xo@KueTJ} zYb3guT(szW>e!LU?EJT%rg~fz7G@UTuG2_%nLI6`d!6j&HmLbU#R4ne{{SPfB}zW6 za}D+2NE)y{!bx`Q*gbV_+0i`uuq*+MY;ZD{n25qU6YkZ`r7qr+T#G5MJN&7w8y)%t z1*Yy9Ax5w2-7_xy5j4ljo&kB1&Ess7 z$lb`A4IC~appIRaXmv)jB+grrZhy6@x(67`B7+y$6hbw!N5R{97O{X&=(#;=;ZyJ; z;15E&O@Yp5bC>eeKQeBT5N0c5Zd9ut%k%`VIN8we-p}$=_5pbu7p?|s>9{E@yfT}S zJVf$8+eYZjy;L;)c<6Nj71mwR*#>U`nkDzyqR36&(g@~bak-J4&X=B;YfUm;YV^*- z6IKU>dzfEH&neNsuyIWN+uQ*-s#gn`o>MFX?ML}2(Hb^D4|`tBz2Or(%9kvuFTRh_ zOOooZocI{-zXVKg#s($l^X!Z*6U2|4bIaa4TitDnAVY%QBnj*2wMoo%LleAOQ&t}T zUiDw8wOidDyJ4dNpXWaOr0QW$8hEu9qZAO~W9DY}l(x3LtcKX0HX9^YK4@I$cpJQ6 z=!Tif%9<-YerzGhRQZeP8>kAo-Z=z^9gqLjy=TD~tF4}x_v%!4?$H@-_y>bBJ{$PW zEMJkFA8R-&E2V1@{n3J=QQaqRu-zlWuvfKm+@!&(VM}0YQlXYDTbC0z1q%FUV1qrI zgDT332{-jD{}Uz60u7d-2EAEPAnsG!2=y_`1`VBk=jAXKSPJZ`L0j@Y?J{z!h^+pw;Ggah+$wMhQ_#KTfA9DyF; z--Refgq5T-95jPZ4ht0U0OIjV+o_-8DQ$O~4^ae)X~oc)Yu-VE)v|?uce+peCErzP zu_=UB?b_`gU($r}E+E6_xc04)Q{#uA!q5ZLvt5PT)S`gkgugR7tR;ju*;1S&RlS7Z z+1&iZx@44eK#ERzew5tn@Fu)b){b#8g6O`?Y*%-l)FGZ)ubR8_xq6V5j-MJIDd+4i z_Ws!y>mQ@0dHRunl(lGct+LXQP1IlCD%P6vja#td8iP92U0>5=6*BVcQNLE&B{^Nw zj*4!xSe8MR{;Z<7dLsMa@H^qJI+y0(ILw}#tW>tcWcH%JvuO{*|L9l#qbh zu}0^KzijF)8`?>PS~`YM2S zTMjH#7<7)6AHnh?43o?qb+c9a{SU4une!po>_MMazCPOCrR^_tuC0I%*JXmae)iF{ zCmfV)q0X;PvO5r?K9_uw6cSC{cx{1*C7^{eZ=CWuG3A4p3twlk#oWSoc7#GUgeHR1 zOdYp+nhxos9wFnWZmjHaKq4lDVZe}_&UlsRrMG4-zL7=@Bh*Y<+ns}#8iZNtsqN*v zy3E_Jdg=GVCNPn>b&@ueN_ z$DG#r<+&9E!##&A7L;@6VK|C6ia^JQvJ+vX?2(Nak8R{BI>KrXi>{RvsYtFkbYdI=QI z7QGoNio#iwmbuc{7KriNI|g?(CY@qFnaNF;-Bg0V{p*^)Vw>14n2I9%$y*1lw)+t7 zE;4=B-o3im|11BK)>}du%XwM8()ws+#U?{oQxsH}`7G@@RblZ|n05Ln)A_=vPSECQ zzd&ln$G;K~72YZy;lh~Mz4PRIw!Al_un)+J@gg}N#b9^+sD?GTt9QwA_3PoD1{lB_ z7bfZT?u++q=XA&>tlCtDe+Hq4+)j<%7iRm)8-(O=+SMlo0XB1n5vqG~evBvf7x~}O z@DR~-ZtvYWG0@_kAldGjF9LD2BZD+?(rQhkOP7x4B{#P`dI1&P5IOcYnvwrnknET% zgK7hOZp-D{n*=7ZJ_jYUjk_h-*@?VucwX59g*^>&IZ>$gh zYlZENksz(WCu;}Q&1>ClajJV}thW7`R*U*zdz&8h#z2m9qmvOa+%RWzAgwhNDVokx z6w@aQvIXQqHL)yC&29P(mf*gF66Qpx@1RGJmC|7)ko#7-@B|>Qrj9JCEv>cWtYl4U z+a$$@D%6QelgF$AugRc1!;t44MKasSn&()Uxmf(uP;VP zpTS-TaL{xHS^H5HA_GfKZ&*EF{bZ8O%RD9fTa;TntRvmWyQga942&kLWQ5@G1>YKD z_c(ZYrUW_$@=m@>WuN5O29VxJ3ao_?)8}~oNLes+x;%__-chkDa#L@2#>yBsti(#l zy#qbAo3c8Z6oyjdaJ=!7YzsT`DVO`jq!wE5v)1hd@4tJeA$Zb3!?#g~sepjy7aRGR zKp>R$N_0#&6EQWIxPEpnO}otK;rQ0;u(%cNk3^ENd06WeiuSIGkZB_M=?o7X^fQJF z>lz&Dh$#s(uS*QavdUzKQEux34oMb-Hxtjm(ToJoY%-L6p@Spmy>kJ&n&f_*-u%B$ zN*Z%!@qmOt0phyc|q zfi{Stusiagay)mHHEAlRoAZ3i!}H4KFnvw z#|PZm{zMqcO81EU_qXgdkZiA}o-U~Z2m??wSI%Igm)$_A`dJtA6A^4mWHG7>`%S?o zdKyT{7M2`%h_$_3=d|59D&B052*8?&2EBP$$iK=yv~(@*J}lh=)%qyE!ILQ>nVDQr zP{X51J$Y!){mwL5)+QD3YCbj$K&j|`{uWdp7ms+FiR}C3+qDxs zXx}5?7kE|&5y+tqOQkvP^Z(oO=`{k%NR*M915Fy1bu~^H zSe{?`T16b*dOvSO$QE!qYL7(`n6 zjL`&=?T5M1B|nsG@*{+dcXA9&Et@>D>DUszk-cFUhje@xCsfgVOJ( z^R5fQz$f1S7;x3|$+`ZT{9bwL=OY6%moZu5^!AhTlpF+JHQ1R!4Pj1My zBE48a5H%MdOje`M{dvWY8@Sy6lB92{zGM80|M73R@1)gorW~7;8-9Qxwo~AU8 zn8nNzZh6<^MP~`%nlmwm)i(q>jCbo$Ak9fg1Ust)e-7isp`dw1`cLyZYL5>x4a(AmevTP9G4g=*FAb@65 z1G36&809qT%bBvQ&!S{8{A~mA9I?LMSQu#0Try9;PJquF6c&1wEC7$p_)rji!+-Z- zYWpE29%nFUF@A2zihJae5+gT$UDEq{SF-y+a#q_?*q0xMWDQBkDXwP>ZvM`=b3znI zn$Vox=02j&;8?cVzcP1xkX67dv@m?@=j0j>+p0l@iDl~?+=tuT(`?Q7FV=+qT4FIA z=uO2%EwslC@A88pVUL^V!)gbbo_vrxHcTWB2mYW1^kR z#ce5BXirfmH_Oqy_pe3|S@(50nuwD0Ll6EN5Y-Ra*6cQ+ivIOU(0C9FO>APg%IP2J zTYzZ20&*yjT0Ta+_Kq5$-uDAEVe&oyNOrBm$iEQ!i+@sr zVXMPwaV~Pr0{4tj6IYRJv_ojSo*whhl}-3Q%XGri`VES2UPW|hEZ(pQ2ImJluSM>X z@l>%IeJt=5&jkuIULMGq!hX=eYU^Hyogz8tPtW>jYx1MJ-9m8t&9#3F?SDl0J)i}i zDz$Umy%;?6(Onu5qpuZm0(d1Y0H_0|`?vi-+l8zFCFIy5@T!PcO8kXITSCkD8a*SJ zL1t_-5-+z1t~h55g8yAmWI1XAWM2!st^AP%hF&!ILka7Bbp(?Fx8D2HnF_(vR5k8# z%^4k44&6)%gCtLfxBXQ!$ugg_Bru6e@uqtadSTICn|SsgCb5bMkz{p4#jXEpGXjF_ zCnWvoPHY095I%oV30B#8NfrEdLEtPo<^u~*FGs$x34d}UrN#^?n`aJpNaEVBAZaR4W38AR_*;uwyp+^Brb75@TlDM~_xfh*XDN$W~RGtU=ZIfa{q zex_bzp_3L2h%2E-yaH_KiHOm`@@t@-5>vp@ZiUMe|%mn~uCeyP6yfZvgn(fmpo zQu3@C+P%ubf}COU!dUBP-^55!6G+hZ1z?JLA~d{+$@y9ZvUETGF=)hKuu)tkZH11x zS2nZTFN%V$4n9{o9KT;uUYY=rI`H0vLpSCm7+73}Es&0#KbB?xvCvebf;W&uPG!Ei z%}eH((fAfG%j@g21Ol_a0nyf8gdGjvX}Iy*^cE6nYBww(;ykuiesPp7+Bh#;;MiS0 z^FwjwTtY<=!(}-o<^}nJUdy9AflP>zw{kEG`QGuqKDB2aDS!)>lM6JJU_&a{iu*0* zDTX)<1=e7eQ;%K{UtQ^^YiUADIsGLnBv_Kb??tbZ`{~AG8V-hAi5Sm;<^a36lTtO1 z2*!5TWar@o)0)3ugC;a=k#0N{MmJ15t3S-{{>R*g&C+7d%P3<0wfmO*TlePgrzQ5I z(k2y#9II$ds={}_;MkonLjl(}t%{20xPUY+Evj%@iJ#x(XhRs;qCkqmg{8`JOtRVI zv2rl7ReGcbC>$;1oSA^YViZ1_Fqqs=3^nd7nKula3hIYPg7PwpoCt&t7O*C>+V4zt z%+HsP?RdHXbYrdQ$odP?wqYbyY(Pl4MDB(zmp9sb60Iq>%{}?4TJB7n-Z17M!q_fE zYV@PDXK~iNSOWje#jwckh291zyEurK$u$W5eJ4*ou~$U+>NQ4kz;1UN@I3+MRUy5S z^;0NEFrM9$?d24}3(DVLrI0Ty0K;v&rt@4hvjbL4IIXX?l^4I<&&;xccn8N2{-}h zpMP!L=)tH;YRc50Iql^jjDC66ub@F?#8&61@0DtE_r;JYM|>IM71>vUbw5AXJ!Un{ z?6aAEB;;-v8-{10ID5}f zuns^L`~5C=9cm(;l~_S1Q!kc&si_9x^oYCwrr&m&YY->~Bkokipja4tqw-SX8H8@d zklfvo4bE(_NPG}#^B0TLs?2l}gpIz)@qx69e*7?zBMJ0++?JgJ#Fp?J z%inB{VM1Wr0>U}$PfX>!0V2yNWE-Qsk)aX`JefhVMZK0F*SZV8X9 zq6^xdi?Mg{+vXTA^TC*H{xQW3E9e=P=_t?VeHCVlH^nh;R?=PqesX8Vf3j~bAx>th z!pOI63Z#};D1VGP61ea{ZmQ7RkL*MC(7gy-z)XrGk`0C{0;%GbKOJpf$F7A2l+j{Z zX85HZh$b}q5Z>IV+rL?n+s)h_L$H_}z64GLxg8SV^Ar~{{lkXwpIuDSEMaOTWi_n7 zEY&yI^6u_wC8hLq?yZ4_g$b?K6PWs~1C*WZdGASmy*(D-Vf5bO>+&i3yV#wy-wVck z8X_)r>++a3(=20nJn`cZ)5+u>E6*E35-E2#P%Zm!?>zmQwl}szo3CqPO}wyp?tb$& zW8r+@`hUtT=0obo%llulgJO4n@dR`(-%H%J8M0XCNLL4(^XD;0Z36R z>g!W9-q63}pJhp#9UN?ThzZ=!&Q+trtVxqW7=vM4R?MBdIfKFnc~Pu6qWi9hlx9SE zxo=CX@on^H0*Qb3lFXW`Hz|;6A->ll*h%j( z`(gu*g>1nYK*qS9p=|8Tb8w*1q=lv5;z+?(tiDK{58Jm##4ptVD!9vlAun1kLmiF# z7Sk;ZgYAtgv%hYt7E-JQqNI7IutBW0>qnC5?1H{))I&nU&ED-ktq^K8k zax!pQK;WEJa7vV#UP)Y%^Lc4g0>brx&;9#TPb?Qb_ohLf~Lvs&`}NI#1MDidTm&8+@HU+{nK7>%yt=>1*(+{E_>LC;J|QKi zf^JnJ2#{d`9P-vXUMqmo0l2Rq%@$0Wm>n)Gu>_4KIlYnd9kyZJoqg47?!LSy%AEslo87)Xi9!)Q9h zR?tz+?$N)F5~EJbv2nuoeCTqj`=cDX0tEm%u{6P zv-#6aq4%rh8#RyFEv0P8(&*Nga&qJT(|6iOrI)o=pd$pfgkprqTKV$>)V~h&%J+X1 zeV6|YJf%s|G6(N5MfbD`4_?rsh3cAGghOWhUnyxFeBB=CWs$fX_$B@@qnm86qXlfM z1)ia+0Yr}NKxrxa0kyGr-n{8`wUMRH_?bOv>&cUN&i{cbuq81Z@(`y_qHiI}>^?^j zD{-lKlU8>6x8%2RJl6x(c2*NF)D6a|A~4j#CU^QI+m%qU7G5-gs=j`bio=a$#9?z{ z>NnpT>Jjs){ONt%)YKkVPZe)>?*h3g91_}5{$NIN^jfEl3vKgTdF~&195c47#<I$|v z7TI!yFTzu4oM5tt5V3n&u%oJQUufT(xq!JYu{WZ1$gu66 zW1@KbBknz-YnSou2(86rxfN7qVbbZLBK71p8_F#?sR+tIIq^ZpV2pdj*41OWhsM7y z!&m2(?1fmOJ4FWj(@vqxlOpx=FXuZcWSGkzdA4Uih24UslVl|}VEhGF`)3DU&`N6k z*2SX2D%`fU3hHYwj~muvM33pqmtq%FhL|lfquR!L_Y1yEcxyW>(4GXPl&)SG873)H zi%r_{f5{pqm42iLvJg1g`>4)2I8+|oABN@!1OeWCgKJ}nWVI<|66aYL<17um)gOF# zq15mvfY7gB*$3?j$AEX;@FcN{>|@Ih>EJcOem9U{KpIf}q<;DjZD?92_bC?AX@z)l zn{6GGkH49HSW>8E|3!EtC+4fidHxoIDZ05ZRBChQTYksKPpc6knUrTTl98;glSHd< zG^>+kj6?R8+4U5671uo7Dag9<#+#9$0=bw#y+daieycQ3q;rheBo@bEA7j1#Myhly z)w^$Sd*Jxcy9%1XE8G1n2{H}~XfB%Su%&<(r2EO%SlBSfW9SXeB>zjikb1tA6Vk#{ zfGrL|kz_!y?1ALBHG#IuPsA**vn7V&NOcz93D5o)=+H0s?j7GA;9Z~=lrMv8iuER> z*Q?P|=Typc$EppCFlBx$FJUpGvL~)UIxs_W>q~H#saYPNt}MCI&3Y>_v@0=$H}O1z z57 z<0628?IruLBDBTyr8#@uSXRdo8YqV*u@Y7PJ&J5+V|M_cq-EpmHXK1?#FO5^xl&tE zg-u(iW&J-uN+ruoMIQG5Jbk7bJzRXT&pOS-0&SuVa4A1bU%F~g7P;NVQ6W6PatQwlbEbACr@R)8c9g}jyQQ_|kza%TP)e)c@yhur{PH}}S?oOv*K z4lg|-K3@9>F%=ZWF`0l>U;`np39va+V#%!AJ}_J98q`*vr-t1(IhCNz51i%#hwANt z?43K33atIec5WrV6FD;0UL4il+nFgyJw9V5r$Y@Yke<21iu0lgdSxCB%a{IG4O$>r z8sEo;>6H_gr1e@Hw+w?EPfL-vuI$rv%qg#Jr_`J=EM4XuTlBCEwkjNn-se| z$Q7wANiT%)M+Z!K#fo5#W5z}hS zeD;iSceYK6Bc7ECTkU>WZ6ijv+1>9j{-jd{e`C1&(9y$oWd)>a0O`uzz@1~u>Na0Y zMOjJe7JKjLM~7#9oBhw`z6AEfjXgop2(Sc&XDW%kWb@_S3?L}j2Z0&^s2RS%!U#X7 zWvB%h_nN9S$yFnDt_5rBmMYD^BrprIX4_^9Cg*4@aqkFR`45Bm*v+!q@lA{@Vt~67 zxTBFGv!JtPtspmtGr1cP>derRc@a>Uw6vZ* z_@ipI=H83B3!?n!ABuAwTIgaNeeQ)qv~@im@{G0G87bjhIM<~(c+KwAE>Zo&ztz{j zMsnhgGiq=Ng@!Z?&B!I;Low;$?}h9bBm%Aw{6#KoZ7VbIvu~5RzXQEJEoMm0J!>HA zPa|Sc#@J;jOl|7U>AD5tWVda{ zfB zI8ESeas{-yAr|Zf8agt+|5qzLq&SY`y z?~mb$l=krIvCLm$Nw@{}r{d5ZZ9uv71s)kV3<41TZf&D|fAuqfur1+d8F5FJV zv%}uAM*?O)Gg>EbG`KNut-K+w}e)$Wn8Qk5S=xhR_ zC^)I8xb19ScImahwWYN5-1VV0qv*t}!-|Qs8(uUMn&Il8xA#wi#{-2K3;Uy%47oW? zNqAgzU1|~U%@m%6>8-112RE7v&7C%vm9X?RMnZMZ<>M8um{dG3p$UZL+-S_YPvWyBci8cQ@#bM^e z)}`jYYERk{mkjN@G}ooGN$JMBMIl}lP@(}Q<~g58@x{lE^VlQfD(=>+GlIna;-9s`{eR>xi-w}X|h>cz*B&-H_z$P<2J&y&ynG^CDcmk8b9u#Hr;g~bbS z9m7MZnOB|&-2nSmhN^;vzjc}cxSZ0baNg_($wQ673-8=k`$T$^!pWY`_|N{=)HGnB z({a1Vec-Z6i$v;N;bo;GJbpi{@{3%`3^$|W8S(g5lmAG+_t6CrDM*A@?}#^Fmvkn@ z#DnCz*kjNp-xbouBbxTLEmG{mtKloU1B$<+&r9YDY440)@ef9AMhy@|R)y2i@%GI( z+4fV(Ft0%y<}b%8v`(O`j`Uo213H|Q5otb7G=oM~RT#+?AlkzRgaaZIUz_@A*T1o1 z`e6c-KWQJ1Kl$co{m=gr)IBKqN6q&aPiU+b(_+9}hpa>SJ?Bf+^6=&70QnmzAm{f+ zZ47%_Dz6xLA>!#0h=CS##%4YFGI5jqW%~4fr8@|WF2J&rqwK*KMx7RAO{?2a-57Pe zi*9I{Y9kJmm$LsrJEw<`W!#%*fwhj*L1*#->PB%x00}i}m_yAFcJa_}ofWy1h@{xk+(;^@f%0k;Wn~uxgs_1!<`BsIW zt8YB|xlg|20T=GHp+~UXI*3&2=PIZU%g-87^E6M5PL=KrV@>Mh_iB^v9Gjp(wzq2s zl87nr&B#Cmss*#yr&#hoYX=DRe?dW9PM~VC0u*x13F#|EXMXRFUMjC!Jr3}0 zx~1_W&O6gtTBpZC@yM%iX^Y^t1?QI&$@J_S9fMCR7Z9mFU6rb{kP!E$a{}_Ts%_XA zA?pQ4(n@)xFoBjnwOwFU)%&vQs1&?R^B9GC7a&FkioEhBh{m4_0z0%W|LacQ-rP4@ zoU3BUY({9UmcF{&l5!*ghL&dg^6s^SuC-ym7yDNhhoGAF+naO_cC1mYJFn$tbH$G- z#d}rOM?r4cq}!>j`Sx4f?Xqx=bdIN>6)Qt@3|W`T+iPyvRMvqve+h(!>XM>9xk#_D z;YioGW7)r;tsE*{p7Y=yn~4WKwy;6vRWCF4LN>>-}`p=qa0Xqe0;J z`xi-_0wmHuR8A7{AL~?I)JxD7@W?41x^Ji{;7s}0j-N$J_b-Cm)1J=>#4AheFv4o% z-2y9J0$1LOJFx4w@rV9rk#+pDZ;0svM%lip;j`qpka%d4rIO5^5-LN5+v@ScII*vB zXJC9(^Vbl3_7E5k>VX*Su#K#}2z4bHVzvzzfCY~A&^nXcPcUqBG!V7M9@GLn$hn1~ z+_7Gyz`Vw!FR-L(lFdd(E`;W7i`{t^6Ir%n&@AV+I`d3=8TF%gN_<{*siPe$H~Ot= zD)2|f+WpHu-SsMmWF1S%K$oG@&6GP00dFe;jWkE@htLP$n3{gV(9{3@QSCY$&`jvK z!}8T5^Kng2@e$@HmP2`W-0mNaU-_)$*VgZmH~+P5vDxLh>9Nv@jOXNSQ4I%r>u~Y_ zVHZVo8h?|!bGk(*Z1$=KvQTdk4tuAt)iD&*^ua9zn@984WQp=pO+9nx{f_p7|1}N; z?Cm8N{gss}qN!e#oE>AuEi1)~FI%8NqW47wOF@FEjsgwf$1K2XQzDFfliq&y;a19! zsNzmCRE&+6YWuE1i*!{ODFsE`g8-IaQMT`RY%Q!^GK$ucL4!u3;$%@NI1)L9K9phm z@l0gbXslCn5Cj8={+tqFGwR5vAKi}lw^H(6UF^#a@@YcGEj7<-@WWf?+WLfBrBM{P z-8+k5>e^f~!6^5Y>RxxjZgg&yw7?vpHyqgWI!FlZ_PY#XWei^BJS z?aI{?8rBP2Qc@2=_nEC>+bN>M|Fg*!0S)NAQ$U(%GVdxY#+bsNwZ9B>&oQfmt)D00 zf0`3m2}1ad?~7Nl395HiJn+{T>iIH?^5R|)hDF$!!ac~{;+wTA`la-^DKTHYL9Bh z+N4GRGp6T$R<8}b#T3f1_yBq|xcdWlfAq_&KkbzHY*qv(Z~m2c@=Z4qi`vsqgh^Ak{Kl#GLuQv9KI2jl4x8Tp^S5N-)@$$*k)Vmkeb*0F% z6ghpMQdSrD!nmsOtDI596KAd(PhZcYzv}l}s^(n>3{FLm1|CnZVpQNCc!oJ=Km^f@ z7=3lo0uu$YP^9iz=4aV579Zb2vj5lV&QG!3&_3r}E^mQ7&$8Ic|I)FaRKXEV9oLaa z>w|4{Y+FAko{d2|HXmt~dmG&(m!!sOUlPezXPy2$(O10;ffOeBZ7- zAxSZlVz{P7rMOY<$+g zXu*h334~EOV%gShU{p#Y{yqpC-T=;?RjR@~#i#9K;MoW(PUQuWz z*55u~A6aS7T2qTI4 zCJspDHTDlN3X|732SenRJ66e~XkP4BKOpyc_deh%17 z(bF@(wN-sxlxkSN+w}z6Rr>WGucNe7OQYGaddAc6xEFCF#|a*fo|o0q)AGBz1#99E zU?Mc6E#M%oRZMx;Rm;%f$rj|*7O`HH@JL9TPee7Kx{ssY=Da)l$48&9KzEv8Sd zl-GOfh~8mK@OAk(0m=4L&TcdPH}|6^W};zTH28fqI(i~)@pUFY?vy3yLj}#PqF8de za{?(imo@Q&&z=%!uFk*D6&vA_bB<~Z_yAGud_Rp1Ra*PW58SFKyx8;c7hktrgO-~uG0w1nbc27{0H4Yrh1}o=l zo6Cm(a%+bd#3cXzV<&ZTND234KZbHtW|q@kSv$!-*X-!sR8YKVICnoi zkqjSymq-@iw?=nRb~a4BE9G;sSO2{`4s} zSWY;JHA8LBjXt^<)Vf(&Xi73>KN%WCs^P^y<`Rj&!(6c-EXf-$+|B;wZbmpdm#cNt zBCEpl|2R7HK&Jo4k8dVNa%?I$GmCsAMdqHxa^$KM%9%4UH@QtI6Jkhm-<127J24_* za?Kf$xsN%v9KU^k|M<&)uf2}<>-Bs-9>(gewH5BUrNK+&hf}Mc@=Ajoe#MqnUCJGg zn-If|#VNUO1|fVzY#OwvP<6{IbFR`7WrOIT;2U$GZ85Pfxsv@dgF)#*VCPm{jym;t zw(i!rTAn#~ejU*lp6@w4yjQ(ODa!l15bQ{|-`d;Ni!a*}bVHxM+XXuO&~x~kzQgKy zx)pgucoQ)+=-r~eznN$@_}kfqzVPmeT6mtXZ@hIn@w>fql0KN6i7!6qZFrn`xVqhK zA8P^r#(p;FeTC$jA?U$?2;)BsLr#w~-ZnC`gx^bRiM`hx{tYdFxkVSm!|#^|?#(jk z#&Z#i&UKmB8fr15t(x}K)qe8UcmYk`OpI@2@`#dk0SGTMky9(jYo9LBrOK>`M|8qU z_{Xs=q5n#x_v=ha<{FU%e^$r?vnbr(PjdyheRqzPMUpCSWKedLQB~bvnGoPrL<-UD z*P;w^d_`vEk0zloq%Aj27s-;<&%=ThWQB%5&7Q7H0X*3ZpGJRSc_oWYtDkn!)U?1=pG+l zCvm)~epY9&Q*$k#{>xhg6_%YPW2n*DUiWEkS51Jb(tc=BDNfn=;t>-?Gxrmold=yOoK}sqRReKD(ZN$}6VwzvS`D2ufP~x`C6! z3q^N-Hg^lQ$l!esFa$Pj%P{BlS!h%0mQh1$4N5WoxpB2p!1h!x$zO~EQ|Jx`k0WdF zvxK71h}?RBw*4J*#8(8y;VpOCvvD2mG!wddFUqVLZNB=eJTSy>Xj#QqB7>LrRina2 zxs-|~;(4O}wB85nk6%8%jWUo2fLVdE%2!q*=YXCM(q=>;RFWtebB*Bp2|%~e1tZSs z;3j{X0pWf{ud3-FVCA$*a0oeTbHuN2J57g;Ava{u4c>J`hcCcAv(C6sQW^l3W~R3= zF!sS=R|veT?pC&60vC0Z+hrupYN-q8hHdn5&Ujm_$?%+5E5zzC^Zjl|9OF-kUgNR4 zT0^cC=1LdSCPcviVmfh`A+exYJmX=pi$1BuAb**s{iwSl%veL@q);Zu{G{@>!*s=x z<%nhw_w=f@wJnCv+nZoG;NJCW;9tqZP5j0BtU=tP{K0+Yaq0GSGATf>wuh5yXa9}f zfZ3rtsbR!G;fBkw%jIfpPk4x?pVH;?j25%4Pq$Ka8ZMU^xa9kOeX}fj=FDN?^pBYK zg4(CxK9IP!(3c|RO@HiqZ8Us*?q=5KfXtxe!NIC^Q8k6{93R-9#z*P;H5xYZvVzOy z@go6#{^>(4GtW0&gFDjLKQ){ZU2QS`_;`So1PnM0hss!A5PV+5Zr;XT$^Jmey*X*b zNua>Mm=A`zl=eRM{LsD%Sb)dVzzE~4JxLla^szIG(peM-T+e9_@&gN01d_N?{jSvxEAHa=a(OZhpf2KSJZ?dPW>hM zS=Z;8Kcak^s^k1gvOukT7Zvqi9PMQ0(q+7RUtDlwX6RxCn5xgrwg1Tw4&W6BT#ILn z{|fr=+Q`z`=abu_uEaj5o>o?| z`o(0{_d%xO6rV~^P1v4D)f(Sd?W2jL-Cl|=@;_ZiX^PGHFH%!|2` z)hYM(5d2uVy!*ysZm06j5Bw&QK_i|kVC*qH!ueOyvLNW)<5z0l)Lg3Lmg~5ny!E$C?hDH=S0V>auFkmI#srQ zeK>7}|2pzQC9rv_oMCCao^yptx;lWFI$y@^=f>9t3X6q0h6u%F2wNMXggnjF`@_}~ zzBH$_tDp44r2F5zj;Dmdf93RFvo$xE|-3hVZ3LwC*rh zONk{LVq;fFs&@21x8k`vtW=HeK%8BaGwA;dSksyN^6Ia|zab^Au7l-=Spzc7l7A_B zZ9C;%n##@RCUk5*1yRv~A@pucuHe5>rk!@4<1D6y3J6tZ;DpuE=Az=cE*P_Jhjk#D z;U2S<+kBZ~&q=&-E`lI?=Kxa377=M1B;@D~YT^7)M&{7X3rMtcn8kyn( zs-Ol7`G8dcctDGp5ab!N|0tdb-c&z1sgvXmy1Zs=-BCqbdT&IEuxR*5%5TB&n74Pe z%7&XPK@Q0m!McZpgi?6KRS~L9G&+r;vJ!%4Wz3(tH~Dn+Q4_8FeTB$A_B=gn7(W|o z7!Lt_bS|lssjA9Sf$|aF``3`=xDTG1pAK0#fQWUT3UdS*t%op6(oGR!BFRPydHMTC zhyQx~PA=t&gdY7iRi}P83O#A(PmeiLWzGTUsCR zjKgS#4P$txOjYLr=BIfP8-c^vD#E<)Woly z-xop?N$k)_3(C#PSHK&Gk^9Q*L}Oo9>OwU|C}O)m@LONQ$yAeD@m_E3i}d2-l_Wwx zEDnf!gyZNa_jzW(>woB0*IOIUtyW?pc%`QPIQ2Q|)sGeK2LBZ78!SAPcvVe%s!8u3 zs$VeFiU*^5&zw*?!FjXpEM2`XjT4Ylcg4-lS%K<-C%A}~-e_4c*j_u0SS$Lj^jF(I zBA^A8g@lktuj~R*^PE5yE(kz)#V-I zYIA{*pQ&zkZ%XOSvBdf1n--ns-!aMWFLFA$Dq%EpQ+!J z!e*R|9g5hOPr#3zW0r%y!vJwFmjTYDVY#Ctkh^&*0a|f-~w4B?ko{kOH~N-ZkYh z>=Vkai%CTm`?!JPAnN{N7Tv$BVdR-+x>Q%P#d0afluiO7rWDqGa#6|AJc;jkH6SNc z^rJfe<`vZITTR1}8+GSm2InH7SN45BL!qw0<$&$VGEY&(bxt&eryp>kOVZ0x5YK7% zXz&QqR3#^p;M9T+@pI>>&1plh3QfG-s!VHHuW0%5r-3*bei9EpyR})QenPH@(owg% ztRlpkqGgB;frAv;i~r+J;jouvo^DFMJdr3~p-dEqj`>N*Zoba|cpl_gVed8ZZnOD+ z5H~SR4ebINZ9FpyRMz*H3~?Sc?cuEzl_qANv1kUMn*#faOJ*oJbFS8zyM52|PQ?U9 zM~wnVNhWC}SJOf_M{l;dq9&B5#G<>2u-r{*f$v-m)_*qs*o<^duHyY-Ugm8$WP!T) z*pYoezW-2-yQ@r|jE~dRu#n1Yr`)s3%5Z( z9956|j14W64s9{DlLv3qca$^*JbZNo{O!&wG6E7BbZ|&r<+5BE8=IGIW(j6d~C{@2m>Y2opUcQ<;znJmu)i@iEQ79l5LowhNnm7+o7giocOOGela zK>$60Tq2j*IELH1pL z#d@RW;sLpIR>pr!_qwsAs_0HN8^M%wE%{Q5PXg(&LOF-1pru-Ak$6xxu!Z%A;a6V? z&yg4)SJmNHbWE>Qa-rJ^S+jZ7L>zBAXDCd(-Hs|n(7V>YTyHctoQrneiZS<%8`;B% zw~3lh>Wed5XjdyzI0&mxCQ&aozWn5vRIh%TX~7NuH62ZTSxY{ndJpOn<#3Ie0R=nM z2x~D>L*Nqyx|d;)S{9nGttt+@Pf#9e3r)J@G9?$6xl1+qQ$e*C>qHFLW94y)kJq8lsHciHTeyGh+18ZbX!1J_nf0K!@z=YaHZe`%H< z4eMHxSoJZe2;j6yAS7(oSa~wuEseuPdfq|vN1J7)KyQ!=qu4!|Cx&9fhRuW4^F!?a#GS6hS%u0h z$d%FmL@;in5z0cW#esU)WvYSGc$UZswFi)Gklzf*sZYmSh{Z%(gv2zu8hNLB3j zrcWMN9f*6s!yW9uAFLATbhlu^87X9>(&4ialy4M*{SQLjx211aZfH#`J>XsD>m1O* zRZ9Hb`6mB&Yx)FGi{ibfm;RQEj7=Zte{&h?CdXdOtXd`_ASsK*0)i3TfFY*bcV2yH zE`XM2T8u2oyD4X*<4X(ru`{|YXy0P07VERLBF%A&XV6n03LTTk;UU5|XB`d0##hM- zt-6QCE8N*BjCsmkYLeC$Jc@e^DcKcktjHgH5D3Z?IZSBb{Gl^GuKjZ7mSMevHX<)g zX~1e&a=|!{_$r@kT5^`Cv~DI}v(~RQNMddI zPsR74RnuH{qc|z{#xL-K%@@G=WG@{w&YvNr|cC9=GoNFY(Ex0bTOLh+z?dC!B`7WipE>)nmU4;E(G1 z4O)1vMO!vI((m2hsl3anDP(Zx0J4XaxHIwF#QVk1P|P!Wc}<$kEuEHTP|YrfXIclo zLw>t041*%TSkCRWvlkOSfB**uJVJZzr#y7UD)S(JN!XHYVuOz- zR2|QxIHG=!OA?%Ds2&)7)evBsYZ1alqob;CuUtaeI6=RfC4Bl2L}NzcZUr)|QsN!U zu?ffl4Z;1Kll=O+rO=oB0bA^`F6XC)rJEbw1i>#+_W}L96Wx2svxIE@wtOLn8nvtk zJt^;j8?t#iw?$h&@Hn7~dS|YRY!>gAeut!>t2v3HLu_&G0^kKDMq5S5fbwJ>|_o^V|2YahFPAE|#N z(_Wu>q%86%Oa0ISuWcbUN2>j4Q6i?M-oM3fxA>EzyvEaWA@gd@SmI`r^6td7f8-At zrD85?+Um67evxt%nu~+3dlb)4jL+mGRMDrkbkz@OT3e9^kGlTZYT~xeZ>!4#NDF`YE_A;@|@9^*_SB2p?LjV_ljMp}8`lAKl-I!4hMh znTPC+S`%Rz?-coVK3zt=j(}bP-apK+1q6pb0Q^t`G8KGb8e{loOI~I8g6CYq9@|{oXWhUZ5JB*o2(M!&nN;ZjZn+0N*`j~CVAp0>V+PMd#pJqON2wtkq zkghE=QdU5Y>qPq{85=!Ln6+J6HCCbZ)~~*>P2i}RA&84l-UxdBjW?>+N9V=f*mu)$ zL*4ZBy80;jP6;Y+mXWHls$M!kTO*KT+u5bSH>WKqRG9887^)jM>>ew;Max(JSTD!4 zLwP;QL5yA!Q2%6+P=@o1Qu>qTx_E2H=!{|%c4Bls?*L`#HWf&syT56+VVqK1xkC=YJpx89_JTVHg z-7C(YVw!Nws->=4TlHK|4e}VJ?25oB8uHOB2ydRuPWL*Ma^T$sZRz5TE+S4j!=JH~ z%y!HYp8UtA=Scswe0C;=X#h~mc#_NDsls42ty?h|@=1`>hlOdDfo-Gl>=Tx)Cx`M1{(GTxmD@K-34KrbH4!Q4oPL3jGIJ;P?Y7oTBWH- zcz|#IxvK?Wl)%09Tbe5SVr9D>U%VD3i&S&d4@R$ShSPA^gD%ogQN4?tCBrB3%_-CJ z&@M2`e!jCx^OuS&dLH+BU*(Rgap{GVnUbP)*E}S-%$iF3PFQ_zu0j?w$W%f!7!rbW zuV~%Vb;&R~xKM?BGB?H+wjKc8RQj4#R&}ffku8udyMrvX4y@UtNCg%J`AN?B9>6Bi zsy%9Zj*qF-H%JvepO-5}c4E+sV5rqWr8CCX=0z0cHk* zKhi_g1PlGblbUh3{$$qGyz;-FPE}6k#g;`TZXBYOMQqg_Vn59BvCVHiQE}Dd%tmLX zAlDzaI`{aV2`OJ1{6_<-FwlLo%z$&) z8PHRrj?F!*`62mSFpxaLhmyf=3Ii@&Wy%Ca0J7FlPn}1>dd3nRWeV&;OFfwzRKT=!}gaxXt$HZXz}9h2bPJHk#|1h zeg8W^Gv@nEyv(pDStLypjZ+c%cMtfmd5LGTL zNnyNB73qT6Ge`1*e@3nhXvK#A+^mUmS;U0$n~o3YI_R0U`$@@RZu1o3PVt{wJDTJi z2VV>_I%h=qUpMXb?0>D@fr!I?MRNbVtMT(`r4!;HFJkcLZ|P2LAEs40yEIY_ z>s(XAs)Yv3cPRs*;o51hW4|#${JmS=1y8u*Zq1K;XQ`q-6UnXzPTh#|!{mpX3;5Vv zDz5v=+S7)iypp7 z;S7X0v=0A~Kwb8rU+lj9D~)&3rxnB<#C%tr=y4K=u$+7-LXa3#T;b@_Q9#fmIVnrr zlL(0Hcb4yARHsg+^&<9=p}}-fozsM|toD&mC|4V2FT=Pl^O z@sRl{GfRi?HdFu_p)LZXVUuQHmf zxgV6Y{3BHuQD^!q=4dw^$I(jr`)j{6sD$E7)!fW#LY_XxxuKfaUlL0jeRFFmfnXfC z7=L}hcdxH}dGZtE-1cKgm}e@1e%}T3LMo28yM#{3b)@!m+C*xS$7P6@+c(uTyvP;RSFhT&&j2DjZzh)=#Kgia1(>*Wu&!A{faKZf zeFK@?r*gMdgV&_o?5cJqY(RmCM`;!HSe--syAJ7ji9yfSI^Bwn%9cm2Cbk{F2tv+P z&f3T>^cO;LaEB5^qd}+VzugrO?|9_FulIu{K8Ef~y7RLs6T?jX^{i8ee%y^I*`zw; zFXm~1JmuZgX40qfD*g|rqfX`6>1p!L1*Lf$zOXHflvE={NixM z6|UYDVctbDp*9wiUG53NO!TUZOWbDgWu4*VovO&Sb**Z<6JI0KgN5cjZjB}bS;$jy z+9;>MlJWX9iA?``lhbISo>L4dyabF&hw^UXxv3qw#$5C49%4YGjbU3L@NQL$4seL~ zst@M{hW6FB@7c{hSERS}t(vDI3&0NjJpCUo-;ikyn&+P2SZN-QTq7BN_-Huo68CQR zy|hsV?Xy8{%!EI`2uy=#zglEi3uTdcu<8y0`&zh22-TDYjoV@noU1;zvOVih+Lu!; zal5!)xM(n8D>fc8pB84$d^{%K?mMIWr=7U_R|ls&hOf&Oyjelksqm50+DW&gy`52* zBX+^fpXX7OtbC)|SpMlRIJj3PmnsYzu6>sq-s?m@J*(XOqpcA$m^wv|*WjxR&7=eV zY(Ir~IfGQ2o{C6XcnQ0M4TU(N?*R{mPZ3QWpIq`m@$inieWLqqF0Kg8m|%*Xrog+{ zo+%lu;bUlp!U9U-28Rtv5mUW6<+C(Z>}p2KXWNztdHJ=xnA@Iv$1c}S1d4=8t7 z2!#OC2x_{T<1;Q5NQNHTcp)NRdu(OEukYL@&>a?Q*a3oqqoA80zNiCok+9`2c5I3q zH5stc+I8CY$MD{!xwKE znIQ-LF8?F@B2iL-H@UC4f0OhmjC4(ao_eUNUgge~h>D@x002=dk-R+S&$Xv0D?VLe zPnoZU9n@sC27|VYrC+*2#TkL*C(7B&i9*@zX6Gy<{4eOg1*+NHn`Mjyh_afQ6z(oX z0nrWsCzzUtZtWTp^(2jGX{tTd=aMx`i5`O2-Jc>os_=7>v77;Iz4tBKpm|#g5Ggt3 zyDWFQTp>|DIz_JEIA~)g=sPMQq$Q-eq-MTTP!m_k=e+b_SlDWX(D*X%)xX@Q4=!5& zmJ1$!Qtc+e`n%@%nyqMt_1~$oOQFxyz-`|ncLf6Txt*^~R(M9$L{f-d)FIcBe|?GT zpRK!;!Www|PlLn}m)ClcPccy&Y?&f`{+WDd^c{Z?7a;7ZPmffN3$Enx@89pNnK~@1 znmiTU( zB4Kg?!rA213H@+0lvPu3nrYfb%R7DeDs%GRIs?J&N8%8oB5)f{6g6bnMVxh1+yZ>$ zAl+A(7YetPlh8h4Q9+fJhLTYY?_&TwM2dE8T*Nc;xn-RI0lz=pbxIFE#MYI#7IDz- zn&y_R3mkp7n$-W{7|wjyx02O}(8?7QAZxa-Cl9!c$U7sS_wa(u2nn~um5HWdc$URq z9I!iQuKTGgHMA(|?b1D?)APKdqJWF)n_Yt`yNQI)?tw5dH&;-7ItGa2FWrKR<{0Aovx zq>OdQ{`89kF6Rd_sL$8#oBk^w(Vkk>x{mWAGSrZA6BD7%eT8E9<*)FU9jZ=?W+#hube7rg5>irn%)!)h90UO&Svyfd|5M?L} z!cxBjbQ;si`ZaNni!EZYd8;i*RM0l9r(rJiUx|Agb@_^xMiTj|l_kcx=Z&4_IpH!j z>`(Cv9Sy*S``;UsM5TZe2n%W?S|HqN9N|pVs)#{$UN~A)W75 z3$he*lPtSj9fNIs_w`~%TUGy;sLm4(`7;>seRIIvp;p2qPDCGKtG}088SW_tTkpP3 zc((3ZAWi$M`Ac1#mS^mjY8y(^my&(y@3Zhh9b`C=Hqj!GSWjN1FoAFD&_8yzwBjM? z2!AP#c=}gjMg(I=RM0#JpQkj3j?}n3ly9D0|1KxIDXXK3@)(Jgo{3_x`J7%4Gzz@R z?2))z@JK6&XhFC1`~$QiYGqWd|jHGksp>7-054Cdu|amoo3o zE2&yFQX41vmT}xiw00Lr6$LBjyJJ4)E#GTj@IeU<$Z7P6q(}I3?3u6qS0&D3y<|Sd zan{$~9UObsUo%^(=CJ=QZbegF*&!|eA3>$(YNq$63^elNc%MA7Ey_Y5Yu~m4g($s5 zw`3cRzdY&i?xNNIbb5A1`|sa=U8iZ)U$LXX68N9Yq;@AUPA&F|w>DXAF^-t$ zs7$lato!)c3sV-$QIUh?uCjfw3pky#_|GF;9RrSbt&(CBF#vn45Uw`-Ni;VA6fipm z>Mxh*J-6`J*S^!SjGbYHblg<`RZ3kKx26N4gZPhiQ7kh_-ep$Grq*qUKjXr{gI0_} zXh*WNB{$}oUKmBeO_@n?d73vUq&P1o*n1^4Mdc8CH@{PHlzi*9{zMY=?qpO7&mxQl z2Zn?^6L>B1B9fo)_sH>!)32|4S-dc_sX=}}4JjxsF8tZQu(K_;35u9s)^jD++ZxJzx6$G^ z$raAPd8|-8PY1|WH=x7%416<#5yU$Io=r*RF*JHh?mS>E&yNL?FPOkx6<;3n@3DzFWys2*Z=^nWBf5zFPtnxp znrcfIyDRee9?9Ntsuye_Q4L<#&cp+x%iU6+Sw@)$MT7-hzbZAjhdq02ysyWpA<-mZ zd}vE9?~a|CHh{pSKUpnNc)l(SmVpOVTo5N@msmkIg73B3u&`0JV~gKXcG*FctU0LY z;pbwHIOUn3#=q1SKeG)RxyqXpKUgXi6cleR0A0)6Bfy;V7qZ{QD*}PD0E=-$9T;qN zD&BF3XC89`+@vwDgb&OD=+M5KU3UWig!f8~8CKmiSQxIGXjSfu!pxTM17ln?pLB`c zPUcDn6r~JBX0Be<>_MHjj3GJ(ks0DutSTVE<(I;EJfNuxFpp=WCnS~Z9*B6Dh;Nsq z2idWA@q*O2l#6cYFsAW0+ypVNO6gHD>{XhI?Ji8dU&#w~JRw>RwxDkq(oar1tW5&i z=!idYgbw7U7_6MERfHnBkiH#5{hDG0l*X#o7;QIp` zrF-QuO`G9?SaYTMYQ_6jlai|+DnvGhdg^E-IG{ZAy|K6@`4Wra2g;BkdG)yrG$V6g zGau}1d{?gm-R$$!-7e3ZQJghJdmGn8`Tj1pU3I}KjAZb`QsUfln#|E6)A5bnn~P)b ze7mxCe`gK{Tk#EwKv?)`V zks8VaVFge51AMZD!1tHUhOCQ3f%nH3D4>>b|9QU3hEG>^u}Bojx5`gqXC-w-0;1tM z+o9Mxs)p9UHR0Kp)D&QF(nv#46Wx8fX6TLeUtD2V5%41c?RjhbYCpWAo%``VulW?l z+40r~(!r749LMr38kzZG`KKUJzL~DYX-v+P;lg|>YV+~^EG5301v__^hi;yH&s%YG zyHyw6gm61BmGE$1U)MA`7+N;ZEe*x0{{etKLvS&?FN)0YJ2;jO2TO{C&U-sk<=ra> z`BG_ouMRTa9T~0DE#|o=DXrXKo9ns2mbbu(P${Cbu7ns$^hSCk9dKI^9x!ip!m1i> zP({HyQ9G`pq@?3pXQfou8q3w4!vpAbWK-*=#0%*BCUpC5KG`Tk^1XN2h1-yrioq_T zk#f{JfK)S6J{ikiYaWu@;?>=E)m&)ly`G3C-N&_StbFsvTqsY%*-~Oe+-}-fj0^cV zZTp3c_vo_&LP0OlheW#M!g!F&Wqvv* zBy?-P=ryKj?!ri<+taKUXE#oSJN@z(f1A9cJQGy`#v$Hz1gB-Pe{(nyyne?h#Y^-nTaVSqesDtQpQ$2Mz_lGMp(AfEn9vbgF-Z(-2d!#Y z4A;%Q5YO7!{6eVFN63?<6jT(x*`+r8V#CDoDh{RlO%D3lW038hLXvd4N^uzYm7H17+>; z-R(!VjAG7ewc;?zU3y~F%ua3aM;&s7$g8^t9Sk}6kv#B6?u z+Xy`xR%9mhr{k#ZQbbg&2%jh+yVQpU!H83~2AX2|bL>>I8L|-~z~_Ft z3c2delp<@JX>m??iFGSL*;1fFIfO$iGPLNMmaZR>sWOkAJ|sr1kuKHP9Rgv8x=&AJ zHqJFEf4vQ(tffldjkZ8*OnhkT2(~j#7K*i;97l_Ui}_0M?VRZb!$zE**ixgE>>H3H zvSE1q7<%nC-=FU3y>o5d2%v7Rx`bG$$UK_yf0y#~eNd>2k=2u*4(Y{%Z7#D)whuM} zx@X_&fkG`o699)lz=;bMOlF`N(onLGGvGNi>8hBK`Dlq+K%LwaH?v2bgp3!|Km`v7 zsFR=aEfai+;`%_h_=wW3nKT%K$MX@mCgA3z8=@pua&kicq*@C5(+?MZO!?rJ`J-fT z@2F(|(pR0ML%3+!*Wey+jgMcJYb~vPGH7=PFK>3|2e?eTq!*X4+i~ql6nO^6hiP?C zTmC{VV`JOKCgnB#ZR}p2u})py;vC=3i@YM*>G#X22FgR zlRASKW+*VeJKP0;Eq0Hg9Ja{0PeOL=#TL0-%q{l_KPO}KA-UHw3Wd@nLI!F(MR)Jt zaJ091H)967L<^%xGM$cpgEPi;ieg>XS1S;(a5Zug#j#92+rKA7)gL_U2t zeKR~`L7bZgIFk+^ze@z$cL{hEiJg8nX&1e%LmO#B2JI|Aj)|b?#@q^MgDO)r!t0Lr{bLq_(wx2PSh)pcbTvPHnSn4wPx1<|9<7ic_2 zFgaFD`u-slGJHF8H*x-IQEU1B;uG`DsGtXDlg625|Kzfs^(fYsxu1Mtp2q7J*#u9J zQsEKSTBy>2v235Vw86fb<&k_4I#DU*?eB6Kd zK+$o0oK8>GNSr*t4#k!sCTyvVgxJ}c2j1bpR^xET#_*}tNVFD9HTXA*D;{E>!<|4| zQdovKJL#=4-d89BL%e@1yH;FNw+XVdF=`vA_ZjE(Se5?54LN&cKFv89Zt6aKat21j zA-}mr;1T-sY&vhnF5#JBLLEusGL>X@B4jZK zzH#qqD(RRVr`A#Pvu27^jVPT7Vtx9i0w;hlQFd1>l2KD-1-B)<%5YhDag+sUocsmI z$386LJ$ZLq(Epteqe+yHi{t{(=3FOe?|Y7oA;v2FMfQd4(RaKn=f=1$064a}D=^$A zg9FpznT*945*WNO!u?y8BjlIKpQx6D^dXV#Y)c2SK^*-NR)=M(N?w-7Z2uqs{x1cq zgCVzhI|e6b+WB67W`N5gXZDapN4YfS`4lgZ`M}0$uP`L=(RFj@SB=->pvVXgUHgdZ zuZ>x8sPWz&IFxY3?OIn|Rhrni4p3c7_#Hmp`J1Hcow3kvlHG{me>xIkw2RtWINxFZ z)FO*DGE45u7&G(4(wed_qcXA!+Uty9>hDMqD?=TuX_x`sTfBzxX}=9{(*s=w^>ws2 zY+=8+WJ9tq)FvPW&igde`P`p%{XZEDFtTt|pJngxiV~zMW;8ppZb9sOr!YggF+dXPpmj_3L(hWj>9# z3}E$ON?>T&EECAKT;FJ_-34uzPzXH!b82!ptD@YV!x?7T^eQm@z)j zC5?Jl16S(0X z1n#r+T#@Cz058)I;KhCHE((gpv;SX}*F|UEbk3 zbQF$f(g-(<&{Csz6#Bn3UkV?`wkiWX0SY!!Wli=F;D*rncI zIUyxjMT3V)i=ZxFYH)(OmWHZWnae_x(p~jM7+EV-Y=P7m6Ml=ZE;&$luzP6{^)HzC>4 zKI*J519Eu0z}a>@OHvB24VF(BLt4Al==Jh>ncS+(mx7SJsO^C|`S0`zYp5^IceBXV zpok^mCjXr3mD^hB@pMfw&d477E%e81+6y#e4gdDh$);xn z!z=;^??|^Qc}}nto$s;g++)7@&BA!yq^171rIYx_vMfgzH-9<4ZE|e32?pW2lry3ucRX<8)m{mI1|( zpabyW(|I8yQyJq*$7??DonbC6V6Kk}0<Sp5qQ)<*$3LD^zs5 z_7$iL%PUn-GU+$6^JZ4yT?kAycTXraTd15H`=5YdHX{pl02`*tA~^ZX1j5C8?(GuL zfIfrRYMHmEpv_FXg%gTX9y4r+ry+o~u|k)Sc$!R>8`j4L*$HTI?$HW~i5OCUU@r)0 zuMgywHVC458X+N+3QkNF_^FI?vzsbKD}prL4fv$Ao&H>(^t2zKe6J7T8pjKe?O?wF za9x{f1kJi)kV*35$}1Jf+AIt$TA>eZ#WICsD~gYkZ_%RLXo0r^6~_1^DD<}pK>pH5 z$NfKc3~HD(f%+SWkfvm-kGLMu98K(vZTSi@Xi18xOX*xRR1BQZ%M#ziLj|>G7oABl zv^>{rClt!GOT~|8Q6Di4-MLFU6GIMrDZ@5Lq_Z1GzyNO6+gg9VY(50=Ug=A^Jalee zOuiiSS9d?$%9o)NXfJV*`=Y6p@Vttz$8L@V?h~c=jn@jsY_-lVP}gnlP79po%b#$@U-mE*+~8u^6xK1-;w_<~(_e@!uC? z=VDqWvt1iBK1T)`V9L<&8#4kSm^%P~8|E1sP;`?u`)s&_iAH2nNz~nr(Y2;YP{`gw z`9p%m?#Dh(DrxGdw>K)A>nV2EK_%v>k}bZU zJ?|?1dJ_O@`SBETFWMgp1OpK_FCT`yV=DgQB!;=uS({N&6}}@-gP6FVDT|&VDTVGg0+;aA2iBO=`Q*xhr(&FnP=Xaz-~u~S%G-zRJ-@5&=4fA$GbQwYPQlq=Zs-9B)UKsaspmnVCz zm}1`-PSrKzCxNOea|X9i;TN;pHPWp_@I;i za>v;#&$pw;1`x=XmC4@2r6rf+=(B!f$AoxSA}{gViJ-*CfYl$n1$S$qaiD2%u>Vw(>qg*wH8+RMrSg~5x_Kd~j3RPdGIym?5 zV2$Y40Sr5s@^YZp2^xu`x8!5=($>kbw&)1ntWbvB{DwtzzTYq2m7)-5 z)N^ci`bRe3$=7PBJXQ7lE;iGG{X8{M_4ve2r|&)dCbA4Z!)leBxH}ryj4rh~`7DCd z4+6(U`P0>!4?AgLi*DCh{_(v)KuQ!en*i$$GxH8&U5htZ=c6HGm6Hm z1Har_VmMqn=L+=72X*+)kl%O_yTktg>bzEYr1GTcEvCfl#L*H9%oh_w<@>_V=&NXd zg%Fh>1Rj2eT#`)u5B7Hr-u%g>83FSEJP6k9ld< zWJ8s&LA53VudsisJfK3&PWEr8OP2`Oq9M6dD75FSjRE*kblq#~=y~KnP9r0Yh#)V5 zwpoj{d@UYu$B@xg5zm#)!cuKT=g!s}$Ud-@V|)Nq!g3X#OAc2Fi0sAEN+x^~ac>Y^ z05f~IMs6H+yb$0E&!xLIYpgYT&?>9E3J9{(?5Da1`OdgG10x9l_!Dbt^g{1_($c;xDUjNDG z`0vEygS+w!7xSjd#tp+o1vfi10+83Y?TkoxH(kx1HJ{ik-OTTeOy_(%s&ujTg+A;K zkU$ABSkXPwj9}!eVxoS{F{)cJ2%Enln>$E(QD$(kXT+s)Y3K5+yHuYUWlZzEGG=QBJ(aQhIY-Xn^h=10xjN1{apEDg zlLBX?ZjT9jY(_9T1AKI|%~Kl{ws!&J$SH>BQWAq9Hr7qN_cGz(fD`oNLvH=?7d9WS z3S^r&o}Ow3+Q0Eh$aBx-JaLK4+@#mD+oZTFjU;k0Ck2{zy6Tu}W`Sy{G?kCC63YZy zDja_1dP;k!_js=ux(dq(A^m5EoQ%>v|r{xf5IF0|UeNw++EcTT0y=Ki!1RwPD8t@S~DU zZD3N3w_b7X00n{94Mm0=BPr$T6U)L#dl&yJ9io8#a-b<6=q#S+>EiESuo6f0irfym z#8xGu6@Fvv*1&&W!j5pN?mJkoX-4n13_6sj1s-3>V60;>jR!_#gojT&{gDhM3C=Tf z!Ek>x!n}CitGbB~-OYA&E&v-=`NwGa=zlMI5XFgnTcZKO(3owR(-h$d)L1fXkYJO* z>jB$iFv6^$bhZaJA3juTqtxlV>^}l@mVQa;E41kQjmTmR3DDket=C_6ETFs+xZMtq zVB~=HteEPd_jQ}zg|YkC^?9(`tpj)WrqtEh!Pg`un!CFKR6l1edp2I;b7wpjy`bio zS(n@~W6JltwpybAgcwL<_~_5wc8y(i+26<(5+>wXWkt=4jZS@9nJZ>wu+{@^(T?k;C}?OodPI%iOKVdoLw z2A6fP@{iL^ji-H<_e%DMR8IRV8NONJ7;1Tsb7DOdO|WRD`M%*|4q8q}_lYSvaBsJ~ z*qf8ugRHl^#Qf0yw*t`;tSeUQ-(z|6yHEvMq;M1;Q4=0lkWPN<={P|*o+#N?*ICWbayPoX@++RHT9Ui^w) zg;S?frM4^mC$O6VRrVp9ivIgTJE9-leMC7RFJgWS#9D}p2(z_FeR{IS=XhvB3;D<= z1euL_yJy^w!zlfbb>ucv+&Q3D&YCyV$|l-XgLmQVlU=#n13e*qb+-r)OhO9&W4`N` z;UF$x=iW7zoh_AWsNgHe@fI%CUdZ^HO_fee~vd z=)$+5Ue>EuzBHEA-jf}D{&xqr4ssc6Z%-vxE!rLqNi|zaU8ALs&nKH7o!*-f2`O^P z(zv&hPr!PH7W|ZQ(6e^=PK&Huy8WVKu>@TDvRiawr~8#J)TJq`zZDx3s5g39PZkN* zxwD&qBdPD`S5DUtO;$lJm%kr83G>1mqomd$MQmLVJ&`K_#PraSf3s*LllHQruB9lcx1JIsW`;nbT|iurk-CQ;eKBr2*)V% z@jYVYD-!~N!du_V3y{d2ruSxBu@c^jcTi2q&wVc1hj;K7X3g^mVE-q-G^BcGNpHl;e_{Vdlav9W z|Dh68eaD=aL#bQJaO~C29?zS{c0dVH4&b4GA&?B|$u!QQbDcE@9B*dav#Tg2o6Nd@ z`zD)mH*$NpsPzj^*N4!pu8w!2pU3Xb-wa;2mikjxShM)E%o}^Fi9FEs*YiNU(Z!@s zaM-Hu;H%DY+c5^+Eyba@v$!RSon;V^Cp0gp&#Gp*1ogZu@Xaj@RLKLkeH)Ryw?Tbh z_hBa+c;2xqr-?+atlpaZkwC9^N!uO)E1rfU$0}g~c&$_kI-j%=asT8Ank4x@(~Em} z^Hf|Hm&Z<%P5Q$KJ9qh_k9CV>pAE&Q-%mAWTOc0Ns6am6JVVXx2dj|^&Byvh$ zpArnjkq9@6cGA1%Ts>OF|6m>VU35{5qW6l%8y*fDWJdA(2G&ieN^IiFz3eq#;kR)F zSQQg?+3{d-Xh>Cw>tvzXG)G#L9{AqQ*8h*-2 zL{ax%n}Z)j!(Takx%2L9Vt!0~cu~t+{cWpnx1h)0sYg-XB*7a>e8>e~YIx<{OMA1i z@hKL^BbSf+V5zF#H-Dc0w|`AmzrLfHOltglfzAkP=Behx!6yu_T4QC1_oYxw@CW?D z%f^KO%MKIjm&I58zJsi56=Z`#9?EmX+ zUGaM(Ykq$_wQxbEwjt5d2gjH2=+0Rm8g)~2DaEj`>80uXsmbJiW2dN<1=q1QXDL)j zi)Jx?zG?0?b@{>A10K;b?*YfB^5Dq6qv^$YSL@K{DM*WY4M^gN6wx9UC(5pw3gA*) zg(p1*5X3&=k`_b5oSncI`2YRAvu8}02UHA2p^FRz6aky`&Bk{9XHu#c?Oqa_+8gIz zW_k%6j}nrd{*Jz?9TfPP$i|GJ-V2!Z1ou*xt>?E5csESm#*I}`YEfpJF)BgUxBc- zXxr-Q8dU;_iHAILWAa1mZvbhqjdgXOY3Yds@2PzgHW z|M2Ro5IE^h9)@wcAF>!I<_4t0y4ES~d|y#RH*N?yN35EW&Ssl=vW#G{X&-wt%8_x4 zy*nT0?tI=?#XBn9&53Ov=n`H38Io-NY!oYQ@v*{KKPhqSm21ah@ZwZ0m=tbY5JE2} zD((jrtcvY6TV{O-+Y=J=uQb`^Dj#~Ztk@ulJ{B|co`^pmCnhcr-tyP_k;o;MN0706 z5$9>x!#}XiKM;phY!`bom|POEOm(GHSB*JEzhxP4IL1A}^G4uugH3y2~L|GW5E ztd+IMkcGs=me9*8N@{E}d=cvJ#iA*q>)p;1+pqKGxmRMwLWF$~EA#gFSceFk&0u^u^z-pv#_`^I%ZoM0dQ`h{)Fnb7{zS~~J+;-moXrKHdFBq4zGuOC=1}57n7r)pT!;Zv zS}9R{>w?6JtgIxUK)j$?R>auMAdNUYr^T=>g;tsd_D zS3|xjaD`qIai#GMe>^++Sm0YIW?cQ-qTo$GEVd7#K_Y`JEw9m4)s5zzQb@>b$sXI` zLHgGPj$zm@Gs7y$uwL=Z3rZM?MmOU|*yIDTD^WC{5lLxgnGh|K8vVfE3`*VkCdfF_Nq~9H1`>p$8hU0^Lp42X0Hyk^A#wu4CK4^{3qctK~DlgGs|Ghh)^0>&j znJ-tlZgx{k+cw$9v!@us5(BvoO#*xiA}VN)-BZyJOXyFMkQ*@;ZzIe5amWN>o%-I_ z^L9KXKdkZ3(vvQZ%HHydDbj7ed1w*f3wC7W!BxKf!j2`u>Ogn(oh_ThtxYsa9i|ie z+;jd?%;&X*PQe8UMSJdDk3p$X!V@2szw_bMV0@gt7Nu;Xo7+LPcNZo(>R(EE_4& zDh^tk4G=*~^5)hei~Y3^*=Yo8w(jRq+R}OFf1_WFXKeUML_~%3#=9S?7-nc_$m#bD zw25|pKE2UmO!!!6L8i^oyzeG%CM%{{%l4=*M6$ntg9zqOZJA4Nb1t(iRAca*u-N!|*gh-!P-wf6NZNH=5{e%9Rt5&78Xf z5<+0=i>?+`VL^$pF=T`LrSD^WJ!R*HELrbBEHY0((7ru4y-AJ9^I+3-gjF6-PAA3M z$gngLfG@L$3P&d2XNF4YG~M%vu*N3`=B&B6I6~Ryvvq?|5@}CeVXGbI7vB}yZk*oT z3|FSy^na7F22)z#8JV{VtxEBtz;;m)IJbx^{cnYgHr(%*V$DYCPGiI