1 module raygui; 2 3 /******************************************************************************************* 4 * 5 * raygui v2.8 - A simple and easy-to-use immediate-mode gui library 6 * 7 * DESCRIPTION: 8 * 9 * raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also 10 * available as a standalone library, as long as input and drawing functions are provided. 11 * 12 * Controls provided: 13 * 14 * # Container/separators Controls 15 * - WindowBox 16 * - GroupBox 17 * - Line 18 * - Panel 19 * 20 * # Basic Controls 21 * - Label 22 * - Button 23 * - LabelButton --> Label 24 * - ImageButton --> Button 25 * - ImageButtonEx --> Button 26 * - Toggle 27 * - ToggleGroup --> Toggle 28 * - CheckBox 29 * - ComboBox 30 * - DropdownBox 31 * - TextBox 32 * - TextBoxMulti 33 * - ValueBox --> TextBox 34 * - Spinner --> Button, ValueBox 35 * - Slider 36 * - SliderBar --> Slider 37 * - ProgressBar 38 * - StatusBar 39 * - ScrollBar 40 * - ScrollPanel 41 * - DummyRec 42 * - Grid 43 * 44 * # Advance Controls 45 * - ListView 46 * - ColorPicker --> ColorPanel, ColorBarHue 47 * - MessageBox --> Window, Label, Button 48 * - TextInputBox --> Window, Label, TextBox, Button 49 * 50 * It also provides a set of functions for styling the controls based on its properties (size, color). 51 * 52 * CONFIGURATION: 53 * 54 * #define RAYGUI_IMPLEMENTATION 55 * Generates the implementation of the library into the included file. 56 * If not defined, the library is in header only mode and can be included in other headers 57 * or source files without problems. But only ONE file should hold the implementation. 58 * 59 * #define RAYGUI_STATIC (defined by default) 60 * The generated implementation will stay private inside implementation file and all 61 * internal symbols and functions will only be visible inside that file. 62 * 63 * #define RAYGUI_STANDALONE 64 * Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined 65 * internally in the library and input management and drawing functions must be provided by 66 * the user (check library implementation for further details). 67 * 68 * #define RAYGUI_SUPPORT_ICONS 69 * Includes riconsdata.h header defining a set of 128 icons (binary format) to be used on 70 * multiple controls and following raygui styles 71 * 72 * 73 * VERSIONS HISTORY: 74 * 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle() 75 * 2.7 (20-Feb-2020) Added possible tooltips API 76 * 2.6 (09-Sep-2019) ADDED: GuiTextInputBox() 77 * REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox() 78 * REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() 79 * Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties 80 * Added 8 new custom styles ready to use 81 * Multiple minor tweaks and bugs corrected 82 * 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() 83 * 2.3 (29-Apr-2019) Added rIcons auxiliar library and support for it, multiple controls reviewed 84 * Refactor all controls drawing mechanism to use control state 85 * 2.2 (05-Feb-2019) Added GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls 86 * 2.1 (26-Dec-2018) Redesign of GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string 87 * Complete redesign of style system (breaking change) 88 * 2.0 (08-Nov-2018) Support controls guiLock and custom fonts, reviewed GuiComboBox(), GuiListView()... 89 * 1.9 (09-Oct-2018) Controls review: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()... 90 * 1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout 91 * 1.5 (21-Jun-2017) Working in an improved styles system 92 * 1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones) 93 * 1.3 (12-Jun-2017) Redesigned styles system 94 * 1.1 (01-Jun-2017) Complete review of the library 95 * 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. 96 * 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. 97 * 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. 98 * 99 * CONTRIBUTORS: 100 * Ramon Santamaria: Supervision, review, redesign, update and maintenance... 101 * Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019) 102 * Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018) 103 * Adria Arranz: Testing and Implementation of additional controls (2018) 104 * Jordi Jorba: Testing and Implementation of additional controls (2018) 105 * Albert Martos: Review and testing of the library (2015) 106 * Ian Eito: Review and testing of the library (2015) 107 * Kevin Gato: Initial implementation of basic components (2014) 108 * Daniel Nicolas: Initial implementation of basic components (2014) 109 * 110 * 111 * LICENSE: zlib/libpng 112 * 113 * Copyright (c) 2014-2020 Ramon Santamaria (@raysan5) 114 * 115 * This software is provided "as-is", without any express or implied warranty. In no event 116 * will the authors be held liable for any damages arising from the use of this software. 117 * 118 * Permission is granted to anyone to use this software for any purpose, including commercial 119 * applications, and to alter it and redistribute it freely, subject to the following restrictions: 120 * 121 * 1. The origin of this software must not be misrepresented; you must not claim that you 122 * wrote the original software. If you use this software in a product, an acknowledgment 123 * in the product documentation would be appreciated but is not required. 124 * 125 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 126 * as being the original software. 127 * 128 * 3. This notice may not be removed or altered from any source distribution. 129 * 130 **********************************************************************************************/ 131 132 import raylib; 133 134 extern (C) @nogc nothrow: 135 136 enum RAYGUI_VERSION = "2.6-dev"; 137 138 //---------------------------------------------------------------------------------- 139 // Defines and Macros 140 //---------------------------------------------------------------------------------- 141 enum NUM_CONTROLS = 16; // Number of standard controls 142 enum NUM_PROPS_DEFAULT = 16; // Number of standard properties 143 enum NUM_PROPS_EXTENDED = 8; // Number of extended properties 144 145 enum TEXTEDIT_CURSOR_BLINK_FRAMES = 20; // Text edit controls cursor blink timming 146 147 // Prevents name mangling of functions 148 149 //---------------------------------------------------------------------------------- 150 // Types and Structures Definition 151 // NOTE: Some types are required for RAYGUI_STANDALONE usage 152 //---------------------------------------------------------------------------------- 153 154 // Boolean type 155 156 // Vector2 type 157 158 // Vector3 type 159 160 // Color type, RGBA (32bit) 161 162 // Rectangle type 163 164 // TODO: Texture2D type is very coupled to raylib, mostly required by GuiImageButton() 165 // It should be redesigned to be provided by user 166 167 // OpenGL texture id 168 // Texture base width 169 // Texture base height 170 // Mipmap levels, 1 by default 171 // Data format (PixelFormat type) 172 173 // Font character info 174 175 // TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle() 176 // It should be redesigned to be provided by user 177 178 // Base size (default chars height) 179 // Number of characters 180 // Characters texture atlas 181 // Characters rectangles in texture 182 // Characters info data 183 184 // Style property 185 struct GuiStyleProp 186 { 187 ushort controlId; 188 ushort propertyId; 189 int propertyValue; 190 } 191 192 // Gui control state 193 enum GuiControlState 194 { 195 GUI_STATE_NORMAL = 0, 196 GUI_STATE_FOCUSED = 1, 197 GUI_STATE_PRESSED = 2, 198 GUI_STATE_DISABLED = 3 199 } 200 201 // Gui control text alignment 202 enum GuiTextAlignment 203 { 204 GUI_TEXT_ALIGN_LEFT = 0, 205 GUI_TEXT_ALIGN_CENTER = 1, 206 GUI_TEXT_ALIGN_RIGHT = 2 207 } 208 209 // Gui controls 210 enum GuiControl 211 { 212 DEFAULT = 0, 213 LABEL = 1, // LABELBUTTON 214 BUTTON = 2, // IMAGEBUTTON 215 TOGGLE = 3, // TOGGLEGROUP 216 SLIDER = 4, // SLIDERBAR 217 PROGRESSBAR = 5, 218 CHECKBOX = 6, 219 COMBOBOX = 7, 220 DROPDOWNBOX = 8, 221 TEXTBOX = 9, // TEXTBOXMULTI 222 VALUEBOX = 10, 223 SPINNER = 11, 224 LISTVIEW = 12, 225 COLORPICKER = 13, 226 SCROLLBAR = 14, 227 STATUSBAR = 15 228 } 229 230 // Gui base properties for every control 231 enum GuiControlProperty 232 { 233 BORDER_COLOR_NORMAL = 0, 234 BASE_COLOR_NORMAL = 1, 235 TEXT_COLOR_NORMAL = 2, 236 BORDER_COLOR_FOCUSED = 3, 237 BASE_COLOR_FOCUSED = 4, 238 TEXT_COLOR_FOCUSED = 5, 239 BORDER_COLOR_PRESSED = 6, 240 BASE_COLOR_PRESSED = 7, 241 TEXT_COLOR_PRESSED = 8, 242 BORDER_COLOR_DISABLED = 9, 243 BASE_COLOR_DISABLED = 10, 244 TEXT_COLOR_DISABLED = 11, 245 BORDER_WIDTH = 12, 246 TEXT_PADDING = 13, 247 TEXT_ALIGNMENT = 14, 248 RESERVED = 15 249 } 250 251 // Gui extended properties depend on control 252 // NOTE: We reserve a fixed size of additional properties per control 253 254 // DEFAULT properties 255 enum GuiDefaultProperty 256 { 257 TEXT_SIZE = 16, 258 TEXT_SPACING = 17, 259 LINE_COLOR = 18, 260 BACKGROUND_COLOR = 19 261 } 262 263 // Label 264 //typedef enum { } GuiLabelProperty; 265 266 // Button 267 //typedef enum { } GuiButtonProperty; 268 269 // Toggle / ToggleGroup 270 enum GuiToggleProperty 271 { 272 GROUP_PADDING = 16 273 } 274 275 // Slider / SliderBar 276 enum GuiSliderProperty 277 { 278 SLIDER_WIDTH = 16, 279 SLIDER_PADDING = 17 280 } 281 282 // ProgressBar 283 enum GuiProgressBarProperty 284 { 285 PROGRESS_PADDING = 16 286 } 287 288 // CheckBox 289 enum GuiCheckBoxProperty 290 { 291 CHECK_PADDING = 16 292 } 293 294 // ComboBox 295 enum GuiComboBoxProperty 296 { 297 COMBO_BUTTON_WIDTH = 16, 298 COMBO_BUTTON_PADDING = 17 299 } 300 301 // DropdownBox 302 enum GuiDropdownBoxProperty 303 { 304 ARROW_PADDING = 16, 305 DROPDOWN_ITEMS_PADDING = 17 306 } 307 308 // TextBox / TextBoxMulti / ValueBox / Spinner 309 enum GuiTextBoxProperty 310 { 311 TEXT_INNER_PADDING = 16, 312 TEXT_LINES_PADDING = 17, 313 COLOR_SELECTED_FG = 18, 314 COLOR_SELECTED_BG = 19 315 } 316 317 // Spinner 318 enum GuiSpinnerProperty 319 { 320 SPIN_BUTTON_WIDTH = 16, 321 SPIN_BUTTON_PADDING = 17 322 } 323 324 // ScrollBar 325 enum GuiScrollBarProperty 326 { 327 ARROWS_SIZE = 16, 328 ARROWS_VISIBLE = 17, 329 SCROLL_SLIDER_PADDING = 18, 330 SCROLL_SLIDER_SIZE = 19, 331 SCROLL_PADDING = 20, 332 SCROLL_SPEED = 21 333 } 334 335 // ScrollBar side 336 enum GuiScrollBarSide 337 { 338 SCROLLBAR_LEFT_SIDE = 0, 339 SCROLLBAR_RIGHT_SIDE = 1 340 } 341 342 // ListView 343 enum GuiListViewProperty 344 { 345 LIST_ITEMS_HEIGHT = 16, 346 LIST_ITEMS_PADDING = 17, 347 SCROLLBAR_WIDTH = 18, 348 SCROLLBAR_SIDE = 19 349 } 350 351 // ColorPicker 352 enum GuiColorPickerProperty 353 { 354 COLOR_SELECTOR_SIZE = 16, 355 HUEBAR_WIDTH = 17, // Right hue bar width 356 HUEBAR_PADDING = 18, // Right hue bar separation from panel 357 HUEBAR_SELECTOR_HEIGHT = 19, // Right hue bar selector height 358 HUEBAR_SELECTOR_OVERFLOW = 20 // Right hue bar selector overflow 359 } 360 361 //---------------------------------------------------------------------------------- 362 // Global Variables Definition 363 //---------------------------------------------------------------------------------- 364 // ... 365 366 //---------------------------------------------------------------------------------- 367 // Module Functions Declaration 368 //---------------------------------------------------------------------------------- 369 370 // State modification functions 371 void GuiEnable (); // Enable gui controls (global state) 372 void GuiDisable (); // Disable gui controls (global state) 373 void GuiLock (); // Lock gui controls (global state) 374 void GuiUnlock (); // Unlock gui controls (global state) 375 void GuiFade (float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f 376 void GuiSetState (int state); // Set gui state (global state) 377 int GuiGetState (); // Get gui state (global state) 378 379 // Font set/get functions 380 void GuiSetFont (Font font); // Set gui custom font (global state) 381 Font GuiGetFont (); // Get gui custom font (global state) 382 383 // Style set/get functions 384 void GuiSetStyle (int control, int property, int value); // Set one style property 385 int GuiGetStyle (int control, int property); // Get one style property 386 387 // Tooltips set functions 388 void GuiEnableTooltip (); // Enable gui tooltips 389 void GuiDisableTooltip (); // Disable gui tooltips 390 void GuiSetTooltip (const(char)* tooltip); // Set current tooltip for display 391 void GuiClearTooltip (); // Clear any tooltip registered 392 393 // Container/separator controls, useful for controls organization 394 bool GuiWindowBox (Rectangle bounds, const(char)* title); // Window Box control, shows a window that can be closed 395 void GuiGroupBox (Rectangle bounds, const(char)* text); // Group Box control with text name 396 void GuiLine (Rectangle bounds, const(char)* text); // Line separator control, could contain text 397 void GuiPanel (Rectangle bounds); // Panel control, useful to group controls 398 Rectangle GuiScrollPanel (Rectangle bounds, Rectangle content, Vector2* scroll); // Scroll Panel control 399 400 // Basic controls set 401 void GuiLabel (Rectangle bounds, const(char)* text); // Label control, shows text 402 bool GuiButton (Rectangle bounds, const(char)* text); // Button control, returns true when clicked 403 bool GuiLabelButton (Rectangle bounds, const(char)* text); // Label button control, show true when clicked 404 bool GuiImageButton (Rectangle bounds, const(char)* text, Texture2D texture); // Image button control, returns true when clicked 405 bool GuiImageButtonEx (Rectangle bounds, const(char)* text, Texture2D texture, Rectangle texSource); // Image button extended control, returns true when clicked 406 bool GuiToggle (Rectangle bounds, const(char)* text, bool active); // Toggle Button control, returns true when active 407 int GuiToggleGroup (Rectangle bounds, const(char)* text, int active); // Toggle Group control, returns active toggle index 408 bool GuiCheckBox (Rectangle bounds, const(char)* text, bool checked); // Check Box control, returns true when active 409 int GuiComboBox (Rectangle bounds, const(char)* text, int active); // Combo Box control, returns selected item index 410 bool GuiDropdownBox (Rectangle bounds, const(char)* text, int* active, bool editMode); // Dropdown Box control, returns selected item 411 bool GuiSpinner (Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value 412 bool GuiValueBox (Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers 413 bool GuiTextBox (Rectangle bounds, char* text, int textSize, bool editMode); // Text Box control, updates input text 414 bool GuiTextBoxMulti (Rectangle bounds, char* text, int textSize, bool editMode); // Text Box control with multiple lines 415 float GuiSlider (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Slider control, returns selected value 416 float GuiSliderBar (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value 417 float GuiProgressBar (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value 418 void GuiStatusBar (Rectangle bounds, const(char)* text); // Status Bar control, shows info text 419 void GuiDummyRec (Rectangle bounds, const(char)* text); // Dummy control for placeholders 420 int GuiScrollBar (Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control 421 Vector2 GuiGrid (Rectangle bounds, float spacing, int subdivs); // Grid control 422 423 // Advance controls set 424 int GuiListView (Rectangle bounds, const(char)* text, int* scrollIndex, int active); // List View control, returns selected list item index 425 int GuiListViewEx (Rectangle bounds, const(char*)* text, int count, int* focus, int* scrollIndex, int active); // List View with extended parameters 426 int GuiMessageBox (Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons); // Message Box control, displays a message 427 int GuiTextInputBox (Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons, char* text); // Text Input Box control, ask for text 428 Color GuiColorPicker (Rectangle bounds, Color color); // Color Picker control (multiple color controls) 429 Color GuiColorPanel (Rectangle bounds, Color color); // Color Panel control 430 float GuiColorBarAlpha (Rectangle bounds, float alpha); // Color Bar Alpha control 431 float GuiColorBarHue (Rectangle bounds, float value); // Color Bar Hue control 432 433 // Styles loading functions 434 void GuiLoadStyle (const(char)* fileName); // Load style file (.rgs) 435 void GuiLoadStyleDefault (); // Load style default over global style 436 437 /* 438 typedef GuiStyle (unsigned int *) 439 RAYGUIDEF GuiStyle LoadGuiStyle(const char *fileName); // Load style from file (.rgs) 440 RAYGUIDEF void UnloadGuiStyle(GuiStyle style); // Unload style 441 */ 442 443 const(char)* GuiIconText (int iconId, const(char)* text); // Get text with icon id prepended (if supported) 444 445 // Gui icons functionality 446 447 // Get full icons data pointer 448 // Get icon bit data 449 // Set icon bit data 450 451 // Set icon pixel value 452 // Clear icon pixel value 453 // Check icon pixel value 454 455 /*********************************************************************************** 456 * 457 * RAYGUI IMPLEMENTATION 458 * 459 ************************************************************************************/ 460 461 // Required for: raygui icons data 462 463 // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() 464 // Required for: strlen() on GuiTextBox() 465 // Required for: roundf() on GuiColorPicker() 466 467 // Required for: va_list, va_start(), vfprintf(), va_end() 468 469 //---------------------------------------------------------------------------------- 470 // Defines and Macros 471 //---------------------------------------------------------------------------------- 472 //... 473 474 //---------------------------------------------------------------------------------- 475 // Types and Structures Definition 476 //---------------------------------------------------------------------------------- 477 // Gui control property style color element 478 479 //---------------------------------------------------------------------------------- 480 // Global Variables Definition 481 //---------------------------------------------------------------------------------- 482 483 // Gui current font (WARNING: highly coupled to raylib) 484 // Gui lock state (no inputs processed) 485 // Gui element transpacency on drawing 486 487 // Global gui style array (allocated on data segment by default) 488 // NOTE: In raygui we manage a single int array with all the possible style properties. 489 // When a new style is loaded, it loads over the global style... but default gui style 490 // could always be recovered with GuiLoadStyleDefault() 491 492 // Style loaded flag for lazy style initialization 493 494 // Tooltips required variables 495 // Gui tooltip currently active (user provided) 496 // Gui tooltips enabled 497 498 //---------------------------------------------------------------------------------- 499 // Standalone Mode Functions Declaration 500 // 501 // NOTE: raygui depend on some raylib input and drawing functions 502 // To use raygui as standalone library, below functions must be defined by the user 503 //---------------------------------------------------------------------------------- 504 505 // Input required functions 506 //------------------------------------------------------------------------------- 507 508 // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox() 509 //------------------------------------------------------------------------------- 510 511 // Drawing required functions 512 //------------------------------------------------------------------------------- 513 // -- GuiDrawRectangle(), GuiDrawIcon() 514 515 // -- GuiColorPicker() 516 // -- GuiDropdownBox(), GuiScrollBar() 517 // -- GuiImageButtonEx() 518 519 // -- GuiTextBoxMulti() 520 //------------------------------------------------------------------------------- 521 522 // Text required functions 523 //------------------------------------------------------------------------------- 524 // -- GuiLoadStyleDefault() 525 // -- GetTextWidth(), GuiTextBoxMulti() 526 // -- GuiDrawText() 527 528 // -- GuiLoadStyle() 529 // -- GuiLoadStyle() 530 // -- GuiLoadStyle() 531 //------------------------------------------------------------------------------- 532 533 // raylib functions already implemented in raygui 534 //------------------------------------------------------------------------------- 535 // Returns a Color struct from hexadecimal value 536 // Returns hexadecimal value for a Color 537 // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f 538 // Check if point is inside rectangle 539 // Formatting of text with variables to 'embed' 540 // Split text into multiple strings 541 // Get integer value from text 542 543 // Draw rectangle vertical gradient 544 //------------------------------------------------------------------------------- 545 546 // RAYGUI_STANDALONE 547 548 //---------------------------------------------------------------------------------- 549 // Module specific Functions Declaration 550 //---------------------------------------------------------------------------------- 551 // Gui get text width using default font 552 // Get text bounds considering control bounds 553 // Get text icon if provided and move text cursor 554 555 // Gui draw text using default font 556 // Gui draw rectangle using default raygui style 557 // Draw tooltip relatively to bounds 558 559 // Split controls text into multiple strings 560 // Convert color data from HSV to RGB 561 // Convert color data from RGB to HSV 562 563 //---------------------------------------------------------------------------------- 564 // Gui Setup Functions Definition 565 //---------------------------------------------------------------------------------- 566 // Enable gui global state 567 568 // Disable gui global state 569 570 // Lock gui global state 571 572 // Unlock gui global state 573 574 // Set gui controls alpha global state 575 576 // Set gui state (global state) 577 578 // Get gui state (global state) 579 580 // Set custom gui font 581 // NOTE: Font loading/unloading is external to raygui 582 583 // NOTE: If we try to setup a font but default style has not been 584 // lazily loaded before, it will be overwritten, so we need to force 585 // default style loading first 586 587 // Get custom gui font 588 589 // Set control style property value 590 591 // Default properties are propagated to all controls 592 593 // Get control style property value 594 595 // Enable gui tooltips 596 597 // Disable gui tooltips 598 599 // Set current tooltip for display 600 601 // Clear any tooltip registered 602 603 //---------------------------------------------------------------------------------- 604 // Gui Controls Functions Definition 605 //---------------------------------------------------------------------------------- 606 607 // Window Box control 608 609 // NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox() 610 611 //GuiControlState state = guiState; 612 613 // Update control 614 //-------------------------------------------------------------------- 615 // NOTE: Logic is directly managed by button 616 //-------------------------------------------------------------------- 617 618 // Draw control 619 //-------------------------------------------------------------------- 620 // Draw window header as status bar 621 // Draw window base 622 623 // Draw window close button 624 625 //-------------------------------------------------------------------- 626 627 // Group Box control with text name 628 629 // Draw control 630 //-------------------------------------------------------------------- 631 632 //-------------------------------------------------------------------- 633 634 // Line control 635 636 // Draw control 637 //-------------------------------------------------------------------- 638 639 // TODO: Consider text icon 640 641 // Draw line with embedded text label: "--- text --------------" 642 643 //-------------------------------------------------------------------- 644 645 // Panel control 646 647 // Draw control 648 //-------------------------------------------------------------------- 649 650 //-------------------------------------------------------------------- 651 652 // Scroll Panel control 653 654 // Recheck to account for the other scrollbar being visible 655 656 // Calculate view area (area without the scrollbars) 657 658 // Clip view area to the actual content size 659 660 // TODO: Review! 661 662 // Update control 663 //-------------------------------------------------------------------- 664 665 // Check button state 666 667 // Horizontal scroll (Shift + Mouse wheel) 668 669 // Vertical scroll 670 671 // Normalize scroll values 672 673 //-------------------------------------------------------------------- 674 675 // Draw control 676 //-------------------------------------------------------------------- 677 // Draw background 678 679 // Save size of the scrollbar slider 680 681 // Draw horizontal scrollbar if visible 682 683 // Change scrollbar slider size to show the diff in size between the content width and the widget width 684 685 // Draw vertical scrollbar if visible 686 687 // Change scrollbar slider size to show the diff in size between the content height and the widget height 688 689 // Draw detail corner rectangle if both scroll bars are visible 690 691 // TODO: Consider scroll bars side 692 693 // Draw scrollbar lines depending on current state 694 695 // Set scrollbar slider size back to the way it was before 696 697 //-------------------------------------------------------------------- 698 699 // Label control 700 701 // Update control 702 //-------------------------------------------------------------------- 703 // ... 704 //-------------------------------------------------------------------- 705 706 // Draw control 707 //-------------------------------------------------------------------- 708 709 //-------------------------------------------------------------------- 710 711 // Button control, returns true when clicked 712 713 // Update control 714 //-------------------------------------------------------------------- 715 716 // Check button state 717 718 //-------------------------------------------------------------------- 719 720 // Draw control 721 //-------------------------------------------------------------------- 722 723 //------------------------------------------------------------------ 724 725 // Label button control 726 727 // NOTE: We force bounds.width to be all text 728 729 // Update control 730 //-------------------------------------------------------------------- 731 732 // Check checkbox state 733 734 //-------------------------------------------------------------------- 735 736 // Draw control 737 //-------------------------------------------------------------------- 738 739 //-------------------------------------------------------------------- 740 741 // Image button control, returns true when clicked 742 743 // Image button control, returns true when clicked 744 745 // Update control 746 //-------------------------------------------------------------------- 747 748 // Check button state 749 750 //-------------------------------------------------------------------- 751 752 // Draw control 753 //-------------------------------------------------------------------- 754 755 //------------------------------------------------------------------ 756 757 // Toggle Button control, returns true when active 758 759 // Update control 760 //-------------------------------------------------------------------- 761 762 // Check toggle button state 763 764 //-------------------------------------------------------------------- 765 766 // Draw control 767 //-------------------------------------------------------------------- 768 769 //-------------------------------------------------------------------- 770 771 // Toggle Group control, returns toggled button index 772 773 // Get substrings items from text (items pointers) 774 775 // Check Box control, returns true when active 776 777 // Update control 778 //-------------------------------------------------------------------- 779 780 // Check checkbox state 781 782 //-------------------------------------------------------------------- 783 784 // Draw control 785 //-------------------------------------------------------------------- 786 787 //-------------------------------------------------------------------- 788 789 // Combo Box control, returns selected item index 790 791 // Get substrings items from text (items pointers, lengths and count) 792 793 // Update control 794 //-------------------------------------------------------------------- 795 796 //-------------------------------------------------------------------- 797 798 // Draw control 799 //-------------------------------------------------------------------- 800 // Draw combo box main 801 802 // Draw selector using a custom button 803 // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values 804 805 //-------------------------------------------------------------------- 806 807 // Dropdown Box control 808 // NOTE: Returns mouse click 809 810 // Get substrings items from text (items pointers, lengths and count) 811 812 // Check mouse button pressed 813 814 // Update control 815 //-------------------------------------------------------------------- 816 817 // Check if mouse has been pressed or released outside limits 818 819 // Check if already selected item has been pressed again 820 821 // Check focused and selected item 822 823 // Update item rectangle y position for next item 824 825 // Item selected, change to editMode = false 826 827 //-------------------------------------------------------------------- 828 829 // Draw control 830 //-------------------------------------------------------------------- 831 832 // Draw visible items 833 834 // Update item rectangle y position for next item 835 836 // TODO: Avoid this function, use icon instead or 'v' 837 838 //GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 }, 839 // GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha)); 840 //-------------------------------------------------------------------- 841 842 // Text Box control, updates input text 843 // NOTE 1: Requires static variables: framesCounter 844 // NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) 845 846 // Required for blinking cursor 847 848 // Update control 849 //-------------------------------------------------------------------- 850 851 // Returns codepoint as Unicode 852 853 // Only allow keys in range [32..125] 854 855 // Delete text 856 857 // Check text alignment to position cursor properly 858 859 //-------------------------------------------------------------------- 860 861 // Draw control 862 //-------------------------------------------------------------------- 863 864 // Draw blinking cursor 865 866 //-------------------------------------------------------------------- 867 868 // Spinner control, returns selected value 869 870 // Update control 871 //-------------------------------------------------------------------- 872 873 // Check spinner state 874 875 //-------------------------------------------------------------------- 876 877 // Draw control 878 //-------------------------------------------------------------------- 879 // TODO: Set Spinner properties for ValueBox 880 881 // Draw value selector custom buttons 882 // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values 883 884 // Draw text label if provided 885 886 //-------------------------------------------------------------------- 887 888 // Value Box control, updates input text with numbers 889 // NOTE: Requires static variables: framesCounter 890 891 // Required for blinking cursor 892 893 // Update control 894 //-------------------------------------------------------------------- 895 896 // Only allow keys in range [48..57] 897 898 // Delete text 899 900 //-------------------------------------------------------------------- 901 902 // Draw control 903 //-------------------------------------------------------------------- 904 905 // WARNING: BLANK color does not work properly with Fade() 906 907 // Draw blinking cursor 908 909 // NOTE: ValueBox internal text is always centered 910 911 // Draw text label if provided 912 913 //-------------------------------------------------------------------- 914 915 // Text Box control with multiple lines 916 917 // Required for blinking cursor 918 919 // Cursor position, [x, y] values should be updated 920 921 // Update control 922 //-------------------------------------------------------------------- 923 924 // Introduce characters 925 926 // TODO: Support Unicode inputs 927 928 // Delete characters 929 930 // Calculate cursor position considering text 931 932 // Exit edit mode 933 934 // Reset blinking cursor 935 936 //-------------------------------------------------------------------- 937 938 // Draw control 939 //-------------------------------------------------------------------- 940 941 // Draw blinking cursor 942 943 //-------------------------------------------------------------------- 944 945 // Slider control with pro parameters 946 // NOTE: Other GuiSlider*() controls use this one 947 948 // Slider 949 950 // SliderBar 951 952 // Update control 953 //-------------------------------------------------------------------- 954 955 // Get equivalent value and slider position from mousePoint.x 956 957 // Slider 958 // SliderBar 959 960 // Bar limits check 961 // Slider 962 963 // SliderBar 964 965 //-------------------------------------------------------------------- 966 967 // Draw control 968 //-------------------------------------------------------------------- 969 970 // Draw slider internal bar (depends on state) 971 972 // Draw left/right text if provided 973 974 // TODO: Consider text icon 975 976 // TODO: Consider text icon 977 978 //-------------------------------------------------------------------- 979 980 // Slider control extended, returns selected value and has text 981 982 // Slider Bar control extended, returns selected value 983 984 // Progress Bar control extended, shows current progress value 985 986 // Update control 987 //-------------------------------------------------------------------- 988 989 //-------------------------------------------------------------------- 990 991 // Draw control 992 //-------------------------------------------------------------------- 993 994 // Draw slider internal progress bar (depends on state) 995 996 // Draw left/right text if provided 997 998 // TODO: Consider text icon 999 1000 // TODO: Consider text icon 1001 1002 //-------------------------------------------------------------------- 1003 1004 // Status Bar control 1005 1006 // Draw control 1007 //-------------------------------------------------------------------- 1008 1009 //-------------------------------------------------------------------- 1010 1011 // Dummy rectangle control, intended for placeholding 1012 1013 // Update control 1014 //-------------------------------------------------------------------- 1015 1016 // Check button state 1017 1018 //-------------------------------------------------------------------- 1019 1020 // Draw control 1021 //-------------------------------------------------------------------- 1022 1023 //------------------------------------------------------------------ 1024 1025 // Scroll Bar control 1026 // TODO: I feel GuiScrollBar could be simplified... 1027 1028 // Is the scrollbar horizontal or vertical? 1029 1030 // The size (width or height depending on scrollbar type) of the spinner buttons 1031 1032 // Arrow buttons [<] [>] [∧] [∨] 1033 1034 // Actual area of the scrollbar excluding the arrow buttons 1035 1036 // Slider bar that moves --[///]----- 1037 1038 // Normalize value 1039 1040 // Calculate rectangles for all of the components 1041 1042 // Make sure the slider won't get outside of the scrollbar 1043 1044 // Make sure the slider won't get outside of the scrollbar 1045 1046 // Update control 1047 //-------------------------------------------------------------------- 1048 1049 // Handle mouse wheel 1050 1051 // Normalize value 1052 1053 //-------------------------------------------------------------------- 1054 1055 // Draw control 1056 //-------------------------------------------------------------------- 1057 // Draw the background 1058 1059 // Draw the scrollbar active area background 1060 // Draw the slider bar 1061 1062 // Draw arrows 1063 1064 // Coordinates for < 0,1,2 1065 1066 // Coordinates for > 3,4,5 1067 1068 // Coordinates for ∧ 6,7,8 1069 1070 // Coordinates for ∨ 9,10,11 1071 1072 //-------------------------------------------------------------------- 1073 1074 // List View control 1075 1076 // List View control with extended parameters 1077 1078 // Check if we need a scroll bar 1079 1080 // Define base item rectangle [0] 1081 1082 // Get items on the list 1083 1084 // Update control 1085 //-------------------------------------------------------------------- 1086 1087 // Check mouse inside list view 1088 1089 // Check focused and selected item 1090 1091 // Update item rectangle y position for next item 1092 1093 // Reset item rectangle y to [0] 1094 1095 //-------------------------------------------------------------------- 1096 1097 // Draw control 1098 //-------------------------------------------------------------------- 1099 // Draw background 1100 1101 // Draw visible items 1102 1103 // Draw item selected 1104 1105 // Draw item focused 1106 1107 // Draw item normal 1108 1109 // Update item rectangle y position for next item 1110 1111 // Calculate percentage of visible items and apply same percentage to scrollbar 1112 1113 // Save default slider size 1114 // Save default scroll speed 1115 // Change slider size 1116 // Change scroll speed 1117 1118 // Reset scroll speed to default 1119 // Reset slider size to default 1120 1121 //-------------------------------------------------------------------- 1122 1123 // Color Panel control 1124 1125 // HSV: Saturation 1126 // HSV: Value 1127 1128 // Update control 1129 //-------------------------------------------------------------------- 1130 1131 // Calculate color from picker 1132 1133 // Get normalized value on x 1134 // Get normalized value on y 1135 1136 // NOTE: Vector3ToColor() only available on raylib 1.8.1 1137 1138 //-------------------------------------------------------------------- 1139 1140 // Draw control 1141 //-------------------------------------------------------------------- 1142 1143 // Draw color picker: selector 1144 1145 //-------------------------------------------------------------------- 1146 1147 // Color Bar Alpha control 1148 // NOTE: Returns alpha value normalized [0..1] 1149 1150 // Update control 1151 //-------------------------------------------------------------------- 1152 1153 //selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2; 1154 1155 //-------------------------------------------------------------------- 1156 1157 // Draw control 1158 //-------------------------------------------------------------------- 1159 1160 // Draw alpha bar: checked background 1161 1162 // Draw alpha bar: selector 1163 1164 //-------------------------------------------------------------------- 1165 1166 // Color Bar Hue control 1167 // NOTE: Returns hue value normalized [0..1] 1168 1169 // Update control 1170 //-------------------------------------------------------------------- 1171 1172 /*if (IsKeyDown(KEY_UP)) 1173 { 1174 hue -= 2.0f; 1175 if (hue <= 0.0f) hue = 0.0f; 1176 } 1177 else if (IsKeyDown(KEY_DOWN)) 1178 { 1179 hue += 2.0f; 1180 if (hue >= 360.0f) hue = 360.0f; 1181 }*/ 1182 1183 //-------------------------------------------------------------------- 1184 1185 // Draw control 1186 //-------------------------------------------------------------------- 1187 1188 // Draw hue bar:color bars 1189 1190 // Draw hue bar: selector 1191 1192 //-------------------------------------------------------------------- 1193 1194 // TODO: Color GuiColorBarSat() [WHITE->color] 1195 // TODO: Color GuiColorBarValue() [BLACK->color], HSV / HSL 1196 // TODO: float GuiColorBarLuminance() [BLACK->WHITE] 1197 1198 // Color Picker control 1199 // NOTE: It's divided in multiple controls: 1200 // Color GuiColorPanel(Rectangle bounds, Color color) 1201 // float GuiColorBarAlpha(Rectangle bounds, float alpha) 1202 // float GuiColorBarHue(Rectangle bounds, float value) 1203 // NOTE: bounds define GuiColorPanel() size 1204 1205 //Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) }; 1206 1207 //color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f); 1208 1209 // Message Box control 1210 1211 // Returns clicked button from buttons list, 0 refers to closed window button 1212 1213 // Draw control 1214 //-------------------------------------------------------------------- 1215 1216 //-------------------------------------------------------------------- 1217 1218 // Text Input Box control, ask for text 1219 1220 // Used to enable text edit mode 1221 // WARNING: No more than one GuiTextInputBox() should be open at the same time 1222 1223 // Draw control 1224 //-------------------------------------------------------------------- 1225 1226 // Draw message if available 1227 1228 //-------------------------------------------------------------------- 1229 1230 // Grid control 1231 // NOTE: Returns grid mouse-hover selected cell 1232 // About drawing lines at subpixel spacing, simple put, not easy solution: 1233 // https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster 1234 1235 // Grid lines alpha amount 1236 1237 // Update control 1238 //-------------------------------------------------------------------- 1239 1240 //-------------------------------------------------------------------- 1241 1242 // Draw control 1243 //-------------------------------------------------------------------- 1244 1245 // Draw vertical grid lines 1246 1247 // Draw horizontal grid lines 1248 1249 //---------------------------------------------------------------------------------- 1250 // Styles loading functions 1251 //---------------------------------------------------------------------------------- 1252 1253 // Load raygui style file (.rgs) 1254 1255 // Try reading the files as text file first 1256 1257 // Style property: p <control_id> <property_id> <property_value> <property_name> 1258 1259 // Style font: f <gen_font_size> <charmap_file> <font_file> 1260 1261 // Load characters from charmap file, 1262 // expected '\n' separated list of integer values 1263 1264 // DEFAULT control 1265 1266 // If a DEFAULT property is loaded, it is propagated to all controls 1267 // NOTE: All DEFAULT properties should be defined first in the file 1268 1269 // Font loading is highly dependant on raylib API to load font data and image 1270 // TODO: Find some mechanism to support it in standalone mode 1271 1272 // Load custom font if available 1273 1274 // 0-Normal, 1-SDF 1275 1276 // Load font white rectangle 1277 1278 // Load font image parameters 1279 1280 // Load font recs data 1281 1282 // Load font chars info data 1283 1284 // Set font texture source rectangle to be used as white texture to draw shapes 1285 // NOTE: This way, all gui can be draw using a single draw call 1286 1287 // Load style default over global style 1288 1289 // We set this variable first to avoid cyclic function calls 1290 // when calling GuiSetStyle() and GuiGetStyle() 1291 1292 // Initialize default LIGHT style property values 1293 1294 // WARNING: Some controls use other values 1295 // WARNING: Some controls use other values 1296 // WARNING: Some controls use other values 1297 1298 // Initialize control-specific property values 1299 // NOTE: Those properties are in default list but require specific values by control type 1300 1301 // Initialize extended property values 1302 // NOTE: By default, extended property values are initialized to 0 1303 // DEFAULT, shared by all controls 1304 // DEFAULT, shared by all controls 1305 // DEFAULT specific property 1306 // DEFAULT specific property 1307 1308 // Initialize default font 1309 1310 // Get text with icon id prepended 1311 // NOTE: Useful to add icons by name id (enum) instead of 1312 // a number that can change between ricon versions 1313 1314 // Get full icons data pointer 1315 1316 // Load raygui icons file (.rgi) 1317 // NOTE: In case nameIds are required, they can be requested with loadIconsName, 1318 // they are returned as a guiIconsName[iconsCount][RICON_MAX_NAME_LENGTH], 1319 // guiIconsName[]][] memory should be manually freed! 1320 1321 // Style File Structure (.rgi) 1322 // ------------------------------------------------------ 1323 // Offset | Size | Type | Description 1324 // ------------------------------------------------------ 1325 // 0 | 4 | char | Signature: "rGI " 1326 // 4 | 2 | short | Version: 100 1327 // 6 | 2 | short | reserved 1328 1329 // 8 | 2 | short | Num icons (N) 1330 // 10 | 2 | short | Icons size (Options: 16, 32, 64) (S) 1331 1332 // Icons name id (32 bytes per name id) 1333 // foreach (icon) 1334 // { 1335 // 12+32*i | 32 | char | Icon NameId 1336 // } 1337 1338 // Icons data: One bit per pixel, stored as unsigned int array (depends on icon size) 1339 // S*S pixels/32bit per unsigned int = K unsigned int per icon 1340 // foreach (icon) 1341 // { 1342 // ... | K | unsigned int | Icon Data 1343 // } 1344 1345 // Read icons data directly over guiIcons data array 1346 1347 // Draw selected icon using rectangles pixel-by-pixel 1348 1349 // Get icon bit data 1350 // NOTE: Bit data array grouped as unsigned int (ICON_SIZE*ICON_SIZE/32 elements) 1351 1352 // Set icon bit data 1353 // NOTE: Data must be provided as unsigned int array (ICON_SIZE*ICON_SIZE/32 elements) 1354 1355 // Set icon pixel value 1356 1357 // This logic works for any RICON_SIZE pixels icons, 1358 // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element 1359 1360 // Clear icon pixel value 1361 1362 // This logic works for any RICON_SIZE pixels icons, 1363 // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element 1364 1365 // Check icon pixel value 1366 1367 // RAYGUI_SUPPORT_ICONS 1368 1369 //---------------------------------------------------------------------------------- 1370 // Module specific Functions Definition 1371 //---------------------------------------------------------------------------------- 1372 // Gui get text width using default font 1373 1374 // TODO: Consider text icon width here??? 1375 1376 // Get text bounds considering control bounds 1377 1378 // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT 1379 1380 // NOTE: ValueBox text value always centered, text padding applies to label 1381 1382 // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?) 1383 // More special cases (label side): CHECKBOX, SLIDER, VALUEBOX, SPINNER 1384 1385 // Get text icon if provided and move text cursor 1386 // NOTE: We support up to 999 values for iconId 1387 1388 // Maybe we have an icon! 1389 1390 // Maximum length for icon value: 3 digits + '\0' 1391 1392 // Move text pointer after icon 1393 // WARNING: If only icon provided, it could point to EOL character! 1394 1395 // Gui draw text using default font 1396 1397 // Vertical alignment for pixel perfect 1398 1399 // Check text for icon and move cursor 1400 1401 // Get text position depending on alignment and iconId 1402 //--------------------------------------------------------------------------------- 1403 1404 // NOTE: We get text size after icon been processed 1405 1406 // WARNING: If only icon provided, text could be pointing to eof character! 1407 1408 // Check guiTextAlign global variables 1409 1410 // NOTE: Make sure we get pixel-perfect coordinates, 1411 // In case of decimals we got weird text positioning 1412 1413 //--------------------------------------------------------------------------------- 1414 1415 // Draw text (with icon if available) 1416 //--------------------------------------------------------------------------------- 1417 1418 // NOTE: We consider icon height, probably different than text size 1419 1420 //--------------------------------------------------------------------------------- 1421 1422 // Gui draw rectangle using default raygui plain style with borders 1423 1424 // Draw rectangle filled with color 1425 1426 // Draw rectangle border lines with color 1427 1428 // TODO: For n-patch-based style we would need: [state] and maybe [control] 1429 // In this case all controls drawing logic should be moved to this function... I don't like it... 1430 1431 // Draw tooltip relatively to bounds 1432 1433 //static int tooltipFramesCounter = 0; // Not possible gets reseted at second function call! 1434 1435 // Split controls text into multiple strings 1436 // Also check for multiple columns (required by GuiToggleGroup()) 1437 1438 // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) 1439 // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, 1440 // all used memory is static... it has some limitations: 1441 // 1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_TEXT_ELEMENTS 1442 // 2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_LENGTH 1443 // NOTE: Those definitions could be externally provided if required 1444 1445 // Count how many substrings we have on text and point to every one 1446 1447 // Set an end of string at this point 1448 1449 // Convert color data from RGB to HSV 1450 // NOTE: Color data should be passed normalized 1451 1452 // Value 1453 1454 // Undefined, maybe NAN? 1455 1456 // NOTE: If max is 0, this divide would cause a crash 1457 // Saturation 1458 1459 // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined 1460 1461 // Undefined, maybe NAN? 1462 1463 // NOTE: Comparing float values could not work properly 1464 // Between yellow & magenta 1465 1466 // Between cyan & yellow 1467 // Between magenta & cyan 1468 1469 // Convert to degrees 1470 1471 // Convert color data from HSV to RGB 1472 // NOTE: Color data should be passed normalized 1473 1474 // NOTE: Comparing float values could not work properly 1475 1476 // Returns a Color struct from hexadecimal value 1477 1478 // Returns hexadecimal value for a Color 1479 1480 // Check if point is inside rectangle 1481 1482 // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f 1483 1484 // Formatting of text with variables to 'embed' 1485 1486 // Draw rectangle with vertical gradient fill color 1487 // NOTE: This function is only used by GuiColorPicker() 1488 1489 // Size of static buffer: TextSplit() 1490 // Size of static pointers array: TextSplit() 1491 1492 // Split string into multiple strings 1493 1494 // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) 1495 // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, 1496 // all used memory is static... it has some limitations: 1497 // 1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_SUBSTRINGS_COUNT 1498 // 2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH 1499 1500 // Count how many substrings we have on text and point to every one 1501 1502 // Set an end of string at this point 1503 1504 // Get integer value from text 1505 // NOTE: This function replaces atoi() [stdlib.h] 1506 1507 // Encode codepoint into utf8 text (char array length returned as parameter) 1508 1509 // RAYGUI_STANDALONE 1510 1511 // RAYGUI_IMPLEMENTATION 1512 1513 // Prevents name mangling of functions 1514 1515 // RAYGUI_H