diff --git a/docs/API.md b/docs/API.md index f662fa2..34e75af 100644 --- a/docs/API.md +++ b/docs/API.md @@ -35,7 +35,7 @@

Check if one specific window flag is enabled

SetWindowState(flags)undefined
-

Set window configuration state using flags (only PLATFORM_DESKTOP)

+

Set window configuration state using flags

ClearWindowState(flags)undefined

Clear window configuration state flags

@@ -821,7 +821,7 @@

Load font from file into GPU memory (VRAM)

LoadFontEx(fileName, fontSize, fontChars, glyphCount)Font
-

Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set

+

Load font from file with extended parameters

LoadFontFromImage(image, key, firstChar)Font

Load font from Image (XNA style)

@@ -839,7 +839,7 @@

Unload font chars info data (RAM)

UnloadFont(font)undefined
-

Unload font from GPU memory (VRAM)

+

Unload Font from GPU memory (VRAM)

DrawFPS(posX, posY)undefined

Draw current FPS

@@ -1276,89 +1276,164 @@
SetAudioStreamBufferSizeDefault(size)undefined

Default size for new audio streams

-
EaseLinearNone(t, b, c, d)number
-

Easing: EaseLinearNone.

+
GuiEnable()undefined
+

Enable gui controls (global state)

-
EaseLinearIn(t, b, c, d)number
-

Easing: EaseLinearIn.

+
GuiDisable()undefined
+

Disable gui controls (global state)

-
EaseLinearOut(t, b, c, d)number
-

Easing: EaseLinearOut.

+
GuiLock()undefined
+

Lock gui controls (global state)

-
EaseLinearInOut(t, b, c, d)number
-

Easing: EaseLinearInOut.

+
GuiUnlock()undefined
+

Unlock gui controls (global state)

-
EaseSineIn(t, b, c, d)number
-

Easing: EaseSineIn.

+
GuiIsLocked()boolean
+

Check if gui is locked (global state)

-
EaseSineOut(t, b, c, d)number
-

Easing: EaseSineOut.

+
GuiFade(alpha)undefined
+

Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f

-
EaseSineInOut(t, b, c, d)number
-

Easing: EaseSineInOut.

+
GuiSetState(state)undefined
+

Set gui state (global state)

-
EaseCircIn(t, b, c, d)number
-

Easing: EaseCircIn.

+
GuiGetState()number
+

Get gui state (global state)

-
EaseCircOut(t, b, c, d)number
-

Easing: EaseCircOut.

+
GuiSetFont(font)undefined
+

Set gui custom font (global state)

-
EaseCircInOut(t, b, c, d)number
-

Easing: EaseCircInOut.

+
GuiGetFont()Font
+

Get gui custom font (global state)

-
EaseCubicIn(t, b, c, d)number
-

Easing: EaseCubicIn.

+
GuiSetStyle(control, property, value)undefined
+

Set one style property

-
EaseCubicOut(t, b, c, d)number
-

Easing: EaseCubicOut.

+
GuiGetStyle(control, property)number
+

Get one style property

-
EaseCubicInOut(t, b, c, d)number
-

Easing: EaseCubicInOut.

+
GuiWindowBox(bounds, title)boolean
+

Window Box control, shows a window that can be closed

-
EaseQuadIn(t, b, c, d)number
-

Easing: EaseQuadIn.

+
GuiGroupBox(bounds, text)undefined
+

Group Box control with text name

-
EaseQuadOut(t, b, c, d)number
-

Easing: EaseQuadOut.

+
GuiLine(bounds, text)undefined
+

Line separator control, could contain text

-
EaseQuadInOut(t, b, c, d)number
-

Easing: EaseQuadInOut.

+
GuiPanel(bounds)undefined
+

Panel control, useful to group controls

-
EaseExpoIn(t, b, c, d)number
-

Easing: EaseExpoIn.

+
GuiScrollPanel(bounds, content, scroll)Rectangle
+

Scroll Panel control

-
EaseExpoOut(t, b, c, d)number
-

Easing: EaseExpoOut.

+
GuiLabel(bounds, text)undefined
+

Label control, shows text

-
EaseExpoInOut(t, b, c, d)number
-

Easing: EaseExpoInOut.

+
GuiButton(bounds, text)boolean
+

Button control, returns true when clicked

-
EaseBackIn(t, b, c, d)number
-

Easing: EaseBackIn.

+
GuiLabelButton(bounds, text)boolean
+

Label button control, show true when clicked

-
EaseBackOut(t, b, c, d)number
-

Easing: EaseBackOut.

+
GuiToggle(bounds, text, active)boolean
+

Toggle Button control, returns true when active

-
EaseBackInOut(t, b, c, d)number
-

Easing: EaseBackInOut.

+
GuiToggleGroup(bounds, text, active)number
+

Toggle Group control, returns active toggle index

-
EaseBounceOut(t, b, c, d)number
-

Easing: EaseBounceOut.

+
GuiCheckBox(bounds, text, checked)boolean
+

Check Box control, returns true when active

-
EaseBounceIn(t, b, c, d)number
-

Easing: EaseBounceIn.

+
GuiComboBox(bounds, text, active)number
+

Combo Box control, returns selected item index

-
EaseBounceInOut(t, b, c, d)number
-

Easing: EaseBounceInOut.

+
GuiDropdownBox(bounds, text, active, editMode)boolean
+

Dropdown Box control, returns selected item

-
EaseElasticIn(t, b, c, d)number
-

Easing: EaseElasticIn.

+
GuiSpinner(bounds, text, value, minValue, maxValue, editMode)boolean
+

Spinner control, returns selected value

-
EaseElasticOut(t, b, c, d)number
-

Easing: EaseElasticOut.

+
GuiValueBox(bounds, text, value, minValue, maxValue, editMode)boolean
+

Value Box control, updates input text with numbers

-
EaseElasticInOut(t, b, c, d)number
-

Easing: EaseElasticInOut.

+
GuiTextBox(bounds, text, textSize, editMode)boolean
+

Text Box control, updates input text

+
+
GuiTextBoxMulti(bounds, text, textSize, editMode)boolean
+

Text Box control with multiple lines

+
+
GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Slider control, returns selected value

+
+
GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Slider Bar control, returns selected value

+
+
GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue)number
+

Progress Bar control, shows current progress value

+
+
GuiStatusBar(bounds, text)undefined
+

Status Bar control, shows info text

+
+
GuiDummyRec(bounds, text)undefined
+

Dummy control for placeholders

+
+
GuiScrollBar(bounds, value, minValue, maxValue)number
+

Scroll Bar control

+
+
GuiGrid(bounds, spacing, subdivs)Vector2
+

Grid control

+
+
GuiListView(bounds, text, scrollIndex, active)number
+

List View control, returns selected list item index

+
+
GuiListViewEx(bounds, text, count, focus, scrollIndex, active)number
+

List View with extended parameters

+
+
GuiMessageBox(bounds, title, message, buttons)number
+

Message Box control, displays a message

+
+
GuiTextInputBox(bounds, title, message, buttons, text)number
+

Text Input Box control, ask for text

+
+
GuiColorPicker(bounds, color)Color
+

Color Picker control (multiple color controls)

+
+
GuiColorPanel(bounds, color)Color
+

Color Panel control

+
+
GuiColorBarAlpha(bounds, alpha)number
+

Color Bar Alpha control

+
+
GuiColorBarHue(bounds, value)number
+

Color Bar Hue control

+
+
GuiLoadStyle(fileName)undefined
+

Load style file over global style variable (.rgs)

+
+
GuiLoadStyleDefault()undefined
+

Load style default over global style

+
+
GuiIconText(iconId, text)string
+

Get text with icon id prepended (if supported)

+
+
GuiGetIcons()number
+

Get full icons data pointer

+
+
GuiGetIconData(iconId)number
+

Get icon bit data

+
+
GuiSetIconData(iconId, data)undefined
+

Set icon bit data

+
+
GuiSetIconPixel(iconId, x, y)undefined
+

Set icon pixel value

+
+
GuiClearIconPixel(iconId, x, y)undefined
+

Clear icon pixel value

+
+
GuiCheckIconPixel(iconId, x, y)boolean
+

Check icon pixel value

UpdateCamera(camera)undefined

Update camera position for selected mode

@@ -1620,7 +1695,7 @@ Check if one specific window flag is enabled ## SetWindowState(flags) ⇒ undefined -Set window configuration state using flags (only PLATFORM_DESKTOP) +Set window configuration state using flags **Kind**: global function @@ -4668,7 +4743,7 @@ Load font from file into GPU memory (VRAM) ## LoadFontEx(fileName, fontSize, fontChars, glyphCount) ⇒ Font -Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set +Load font from file with extended parameters **Kind**: global function **Returns**: Font - The resulting Font. @@ -4760,7 +4835,7 @@ Unload font chars info data (RAM) ## UnloadFont(font) ⇒ undefined -Unload font from GPU memory (VRAM) +Unload Font from GPU memory (VRAM) **Kind**: global function @@ -6627,425 +6702,664 @@ Default size for new audio streams | --- | --- | | size | number | - + -## EaseLinearNone(t, b, c, d) ⇒ number -Easing: EaseLinearNone. +## GuiEnable() ⇒ undefined +Enable gui controls (global state) + +**Kind**: global function + + +## GuiDisable() ⇒ undefined +Disable gui controls (global state) + +**Kind**: global function + + +## GuiLock() ⇒ undefined +Lock gui controls (global state) + +**Kind**: global function + + +## GuiUnlock() ⇒ undefined +Unlock gui controls (global state) + +**Kind**: global function + + +## GuiIsLocked() ⇒ boolean +Check if gui is locked (global state) + +**Kind**: global function +**Returns**: boolean - The resulting bool. + + +## GuiFade(alpha) ⇒ undefined +Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| alpha | number | - + -## EaseLinearIn(t, b, c, d) ⇒ number -Easing: EaseLinearIn. +## GuiSetState(state) ⇒ undefined +Set gui state (global state) **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| state | number | - + -## EaseLinearOut(t, b, c, d) ⇒ number -Easing: EaseLinearOut. +## GuiGetState() ⇒ number +Get gui state (global state) + +**Kind**: global function +**Returns**: number - The resulting int. + + +## GuiSetFont(font) ⇒ undefined +Set gui custom font (global state) **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| font | Font | - + -## EaseLinearInOut(t, b, c, d) ⇒ number -Easing: EaseLinearInOut. +## GuiGetFont() ⇒ Font +Get gui custom font (global state) + +**Kind**: global function +**Returns**: Font - The resulting Font. + + +## GuiSetStyle(control, property, value) ⇒ undefined +Set one style property **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| control | number | +| property | number | +| value | number | - + -## EaseSineIn(t, b, c, d) ⇒ number -Easing: EaseSineIn. +## GuiGetStyle(control, property) ⇒ number +Get one style property **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| control | number | +| property | number | - + -## EaseSineOut(t, b, c, d) ⇒ number -Easing: EaseSineOut. +## GuiWindowBox(bounds, title) ⇒ boolean +Window Box control, shows a window that can be closed **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| title | string | - + -## EaseSineInOut(t, b, c, d) ⇒ number -Easing: EaseSineInOut. +## GuiGroupBox(bounds, text) ⇒ undefined +Group Box control with text name **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCircIn(t, b, c, d) ⇒ number -Easing: EaseCircIn. +## GuiLine(bounds, text) ⇒ undefined +Line separator control, could contain text **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | + + + +## GuiPanel(bounds) ⇒ undefined +Panel control, useful to group controls + +**Kind**: global function + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | - + -## EaseCircOut(t, b, c, d) ⇒ number -Easing: EaseCircOut. +## GuiScrollPanel(bounds, content, scroll) ⇒ [Rectangle](#Rectangle) +Scroll Panel control **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: [Rectangle](#Rectangle) - The resulting Rectangle. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| content | [Rectangle](#Rectangle) | +| scroll | number | - + -## EaseCircInOut(t, b, c, d) ⇒ number -Easing: EaseCircInOut. +## GuiLabel(bounds, text) ⇒ undefined +Label control, shows text **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicIn(t, b, c, d) ⇒ number -Easing: EaseCubicIn. +## GuiButton(bounds, text) ⇒ boolean +Button control, returns true when clicked **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicOut(t, b, c, d) ⇒ number -Easing: EaseCubicOut. +## GuiLabelButton(bounds, text) ⇒ boolean +Label button control, show true when clicked **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseCubicInOut(t, b, c, d) ⇒ number -Easing: EaseCubicInOut. +## GuiToggle(bounds, text, active) ⇒ boolean +Toggle Button control, returns true when active **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | boolean | - + -## EaseQuadIn(t, b, c, d) ⇒ number -Easing: EaseQuadIn. +## GuiToggleGroup(bounds, text, active) ⇒ number +Toggle Group control, returns active toggle index **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | - + -## EaseQuadOut(t, b, c, d) ⇒ number -Easing: EaseQuadOut. +## GuiCheckBox(bounds, text, checked) ⇒ boolean +Check Box control, returns true when active **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| checked | boolean | - + -## EaseQuadInOut(t, b, c, d) ⇒ number -Easing: EaseQuadInOut. +## GuiComboBox(bounds, text, active) ⇒ number +Combo Box control, returns selected item index **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | - + -## EaseExpoIn(t, b, c, d) ⇒ number -Easing: EaseExpoIn. +## GuiDropdownBox(bounds, text, active, editMode) ⇒ boolean +Dropdown Box control, returns selected item **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| active | number | +| editMode | boolean | - + -## EaseExpoOut(t, b, c, d) ⇒ number -Easing: EaseExpoOut. +## GuiSpinner(bounds, text, value, minValue, maxValue, editMode) ⇒ boolean +Spinner control, returns selected value **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| value | number | +| minValue | number | +| maxValue | number | +| editMode | boolean | - + -## EaseExpoInOut(t, b, c, d) ⇒ number -Easing: EaseExpoInOut. +## GuiValueBox(bounds, text, value, minValue, maxValue, editMode) ⇒ boolean +Value Box control, updates input text with numbers **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| value | number | +| minValue | number | +| maxValue | number | +| editMode | boolean | - + -## EaseBackIn(t, b, c, d) ⇒ number -Easing: EaseBackIn. +## GuiTextBox(bounds, text, textSize, editMode) ⇒ boolean +Text Box control, updates input text **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| textSize | number | +| editMode | boolean | - + -## EaseBackOut(t, b, c, d) ⇒ number -Easing: EaseBackOut. +## GuiTextBoxMulti(bounds, text, textSize, editMode) ⇒ boolean +Text Box control with multiple lines **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: boolean - The resulting bool. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| textSize | number | +| editMode | boolean | - + -## EaseBackInOut(t, b, c, d) ⇒ number -Easing: EaseBackInOut. +## GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Slider control, returns selected value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseBounceOut(t, b, c, d) ⇒ number -Easing: EaseBounceOut. +## GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Slider Bar control, returns selected value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseBounceIn(t, b, c, d) ⇒ number -Easing: EaseBounceIn. +## GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue) ⇒ number +Progress Bar control, shows current progress value **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| textLeft | string | +| textRight | string | +| value | number | +| minValue | number | +| maxValue | number | + + + +## GuiStatusBar(bounds, text) ⇒ undefined +Status Bar control, shows info text + +**Kind**: global function + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseBounceInOut(t, b, c, d) ⇒ number -Easing: EaseBounceInOut. +## GuiDummyRec(bounds, text) ⇒ undefined +Dummy control for placeholders **Kind**: global function -**Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| text | string | - + -## EaseElasticIn(t, b, c, d) ⇒ number -Easing: EaseElasticIn. +## GuiScrollBar(bounds, value, minValue, maxValue) ⇒ number +Scroll Bar control **Kind**: global function -**Returns**: number - The resulting float. +**Returns**: number - The resulting int. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| value | number | +| minValue | number | +| maxValue | number | - + -## EaseElasticOut(t, b, c, d) ⇒ number -Easing: EaseElasticOut. +## GuiGrid(bounds, spacing, subdivs) ⇒ [Vector2](#Vector2) +Grid control + +**Kind**: global function +**Returns**: [Vector2](#Vector2) - The resulting Vector2. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| spacing | number | +| subdivs | number | + + + +## GuiListView(bounds, text, scrollIndex, active) ⇒ number +List View control, returns selected list item index + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | string | +| scrollIndex | number | +| active | number | + + + +## GuiListViewEx(bounds, text, count, focus, scrollIndex, active) ⇒ number +List View with extended parameters + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| text | number | +| count | number | +| focus | number | +| scrollIndex | number | +| active | number | + + + +## GuiMessageBox(bounds, title, message, buttons) ⇒ number +Message Box control, displays a message + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| title | string | +| message | string | +| buttons | string | + + + +## GuiTextInputBox(bounds, title, message, buttons, text) ⇒ number +Text Input Box control, ask for text + +**Kind**: global function +**Returns**: number - The resulting int. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| title | string | +| message | string | +| buttons | string | +| text | string | + + + +## GuiColorPicker(bounds, color) ⇒ [Color](#Color) +Color Picker control (multiple color controls) + +**Kind**: global function +**Returns**: [Color](#Color) - The resulting Color. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| color | [Color](#Color) | + + + +## GuiColorPanel(bounds, color) ⇒ [Color](#Color) +Color Panel control + +**Kind**: global function +**Returns**: [Color](#Color) - The resulting Color. + +| Param | Type | +| --- | --- | +| bounds | [Rectangle](#Rectangle) | +| color | [Color](#Color) | + + + +## GuiColorBarAlpha(bounds, alpha) ⇒ number +Color Bar Alpha control **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| alpha | number | - + -## EaseElasticInOut(t, b, c, d) ⇒ number -Easing: EaseElasticInOut. +## GuiColorBarHue(bounds, value) ⇒ number +Color Bar Hue control **Kind**: global function **Returns**: number - The resulting float. | Param | Type | | --- | --- | -| t | number | -| b | number | -| c | number | -| d | number | +| bounds | [Rectangle](#Rectangle) | +| value | number | + + + +## GuiLoadStyle(fileName) ⇒ undefined +Load style file over global style variable (.rgs) + +**Kind**: global function + +| Param | Type | +| --- | --- | +| fileName | string | + + + +## GuiLoadStyleDefault() ⇒ undefined +Load style default over global style + +**Kind**: global function + + +## GuiIconText(iconId, text) ⇒ string +Get text with icon id prepended (if supported) + +**Kind**: global function +**Returns**: string - The resulting const char *. + +| Param | Type | +| --- | --- | +| iconId | number | +| text | string | + + + +## GuiGetIcons() ⇒ number +Get full icons data pointer + +**Kind**: global function +**Returns**: number - The resulting unsigned int *. + + +## GuiGetIconData(iconId) ⇒ number +Get icon bit data + +**Kind**: global function +**Returns**: number - The resulting unsigned int *. + +| Param | Type | +| --- | --- | +| iconId | number | + + + +## GuiSetIconData(iconId, data) ⇒ undefined +Set icon bit data + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| data | number | + + + +## GuiSetIconPixel(iconId, x, y) ⇒ undefined +Set icon pixel value + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | + + + +## GuiClearIconPixel(iconId, x, y) ⇒ undefined +Clear icon pixel value + +**Kind**: global function + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | + + + +## GuiCheckIconPixel(iconId, x, y) ⇒ boolean +Check icon pixel value + +**Kind**: global function +**Returns**: boolean - The resulting bool. + +| Param | Type | +| --- | --- | +| iconId | number | +| x | number | +| y | number | diff --git a/examples/models/models_rlgl_solar_system.js b/examples/models/models_rlgl_solar_system.js index 72ae86c..b3b1be8 100644 --- a/examples/models/models_rlgl_solar_system.js +++ b/examples/models/models_rlgl_solar_system.js @@ -73,6 +73,7 @@ camera.target = r.Vector3(0, 0, 0) camera.up = r.Vector3(0, 1, 0) camera.fovy = 45 camera.type = r.CAMERA_PERSPECTIVE +camera.projection = r.CAMERA_PERSPECTIVE r.SetCameraMode(camera, r.CAMERA_FREE) diff --git a/examples/raygui/raygui_basic_window.js b/examples/raygui/raygui_basic_window.js new file mode 100644 index 0000000..0163d35 --- /dev/null +++ b/examples/raygui/raygui_basic_window.js @@ -0,0 +1,68 @@ +/******************************************************************************************* +* +* raylib [raygui] example - Basic window +* +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Copyright (c) 2022 Rob Loach (@RobLoach) +* +********************************************************************************************/ + +const r = require('raylib') + +// Initialization +// -------------------------------------------------------------------------------------- +const screenWidth = 800 +const screenHeight = 450 +let showMessageBox = false +let backgroundColor = r.RAYWHITE + +r.InitWindow(screenWidth, screenHeight, 'raylib [raygui] example - basic window') + +r.SetTargetFPS(60) + +// r.GuiLoadStyleDefault() +// -------------------------------------------------------------------------------------- + +// Main game loop +while (!r.WindowShouldClose()) { // Detect window close button or ESC key + // Update + // ---------------------------------------------------------------------------------- + // TODO: Update your variables here + // ---------------------------------------------------------------------------------- + + // Draw + // ---------------------------------------------------------------------------------- + r.BeginDrawing() + + r.ClearBackground(backgroundColor) + + if (r.GuiButton(r.Rectangle(30, 100, 200, 30), 'Change Background Color')) { + showMessageBox = true + } + + if (showMessageBox) { + switch (r.GuiMessageBox(r.Rectangle(r.GetScreenWidth() / 2 - 200, r.GetScreenHeight() / 2 - 50, 400, 100), 'Change Background Color', 'Do you really want to change the background?', 'Yes;No')) { + case 0: + case 2: + showMessageBox = false + break + case 1: // Yes + backgroundColor = r.Color( + r.GetRandomValue(0, 255), + r.GetRandomValue(0, 255), + r.GetRandomValue(0, 255), + 255 + ) + showMessageBox = false + } + } + + r.EndDrawing() + // ---------------------------------------------------------------------------------- +} + +// De-Initialization +// -------------------------------------------------------------------------------------- +r.CloseWindow() // Close window and OpenGL context +// -------------------------------------------------------------------------------------- diff --git a/package-lock.json b/package-lock.json index 97342ce..a0ad0fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "raylib": "bin/node-raylib" }, "devDependencies": { + "@raylib/api": "^4.0.0", "archiver": "^5.3.1", "jest": "^28.1.0", "jsdoc-to-markdown": "^7.1.1", @@ -1050,6 +1051,12 @@ "node": ">= 8" } }, + "node_modules/@raylib/api": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@raylib/api/-/api-4.0.0.tgz", + "integrity": "sha512-U/TsyYPQDxkU1bG5cMdnmi2lfzz5tJRQBSYmwPdXn/P3puyFYe1tWkk0OzueS3zr/8j4yZbc6ibg5JMU0I4L5w==", + "dev": true + }, "node_modules/@sinclair/typebox": { "version": "0.23.5", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz", @@ -8409,6 +8416,12 @@ "fastq": "^1.6.0" } }, + "@raylib/api": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@raylib/api/-/api-4.0.0.tgz", + "integrity": "sha512-U/TsyYPQDxkU1bG5cMdnmi2lfzz5tJRQBSYmwPdXn/P3puyFYe1tWkk0OzueS3zr/8j4yZbc6ibg5JMU0I4L5w==", + "dev": true + }, "@sinclair/typebox": { "version": "0.23.5", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz", diff --git a/package.json b/package.json index 9e0ee92..2805aba 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "module-alias": "^2.2.2" }, "devDependencies": { + "@raylib/api": "^4.0.0", "archiver": "^5.3.1", "jest": "^28.1.0", "jsdoc-to-markdown": "^7.1.1", diff --git a/src/generated/node-raylib.cc b/src/generated/node-raylib.cc index f864f66..5dfedd0 100644 --- a/src/generated/node-raylib.cc +++ b/src/generated/node-raylib.cc @@ -6,6 +6,11 @@ #include #include "raylib.h" #include "extras/easings.h" +#include "raymath.h" + +#define RAYGUI_IMPLEMENTATION +#include "extras/raygui.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { @@ -40,10 +45,13 @@ inline Napi::Value ToValue(Napi::Env env, void * value) { } inline float floatFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().FloatValue(); } inline int intFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Int32Value(); +} +inline double doubleFromValue(const Napi::CallbackInfo& info, int index) { + return info[index].As().DoubleValue(); } uintptr_t pointerFromValue(const Napi::CallbackInfo& info, int index) { return (uintptr_t) info[index].As().Int64Value(); @@ -52,7 +60,7 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i return info[index].As().Uint32Value(); } inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Uint32Value(); } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); @@ -247,14 +255,6 @@ inline MaterialMap MaterialMapFromValue(const Napi::CallbackInfo& info, int inde }; } -inline Material MaterialFromValue(const Napi::CallbackInfo& info, int index) { - return { - ShaderFromValue(info, index + 0), - (MaterialMap *) pointerFromValue(info, index + 2), - floatFromValue(info, index + 3) - }; -} - inline Transform TransformFromValue(const Napi::CallbackInfo& info, int index) { return { Vector3FromValue(info, index + 0), @@ -351,34 +351,6 @@ inline Music MusicFromValue(const Napi::CallbackInfo& info, int index) { (void *) pointerFromValue(info, index + 7) }; } - -inline VrDeviceInfo VrDeviceInfoFromValue(const Napi::CallbackInfo& info, int index) { - return { - intFromValue(info, index + 0), - intFromValue(info, index + 1), - floatFromValue(info, index + 2), - floatFromValue(info, index + 3), - floatFromValue(info, index + 4), - floatFromValue(info, index + 5), - floatFromValue(info, index + 6), - floatFromValue(info, index + 7), - floatFromValue(info, index + 8), - floatFromValue(info, index + 9) - }; -} - -inline VrStereoConfig VrStereoConfigFromValue(const Napi::CallbackInfo& info, int index) { - return { - MatrixFromValue(info, index + 0), - MatrixFromValue(info, index + 16), - floatFromValue(info, index + 32), - floatFromValue(info, index + 33), - floatFromValue(info, index + 34), - floatFromValue(info, index + 35), - floatFromValue(info, index + 36), - floatFromValue(info, index + 37) - }; -} // Convert structs to Napi::Objects for output to JS inline Napi::Value ToValue(Napi::Env env, Vector2 obj) { @@ -408,20 +380,20 @@ inline Napi::Value ToValue(Napi::Env env, Vector4 obj) { inline Napi::Value ToValue(Napi::Env env, Matrix obj) { Napi::Object out = Napi::Object::New(env); out.Set("m0", ToValue(env, obj.m0)); - out.Set("m1", ToValue(env, obj.m1)); - out.Set("m2", ToValue(env, obj.m2)); - out.Set("m3", ToValue(env, obj.m3)); out.Set("m4", ToValue(env, obj.m4)); - out.Set("m5", ToValue(env, obj.m5)); - out.Set("m6", ToValue(env, obj.m6)); - out.Set("m7", ToValue(env, obj.m7)); out.Set("m8", ToValue(env, obj.m8)); - out.Set("m9", ToValue(env, obj.m9)); - out.Set("m10", ToValue(env, obj.m10)); - out.Set("m11", ToValue(env, obj.m11)); out.Set("m12", ToValue(env, obj.m12)); + out.Set("m1", ToValue(env, obj.m1)); + out.Set("m5", ToValue(env, obj.m5)); + out.Set("m9", ToValue(env, obj.m9)); out.Set("m13", ToValue(env, obj.m13)); + out.Set("m2", ToValue(env, obj.m2)); + out.Set("m6", ToValue(env, obj.m6)); + out.Set("m10", ToValue(env, obj.m10)); out.Set("m14", ToValue(env, obj.m14)); + out.Set("m3", ToValue(env, obj.m3)); + out.Set("m7", ToValue(env, obj.m7)); + out.Set("m11", ToValue(env, obj.m11)); out.Set("m15", ToValue(env, obj.m15)); return out; } @@ -558,14 +530,6 @@ inline Napi::Value ToValue(Napi::Env env, MaterialMap obj) { return out; } -inline Napi::Value ToValue(Napi::Env env, Material obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("shader", ToValue(env, obj.shader)); - out.Set("maps", ToValue(env, obj.maps)); - out.Set("params", ToValue(env, obj.params)); - return out; -} - inline Napi::Value ToValue(Napi::Env env, Transform obj) { Napi::Object out = Napi::Object::New(env); out.Set("translation", ToValue(env, obj.translation)); @@ -663,34 +627,6 @@ inline Napi::Value ToValue(Napi::Env env, Music obj) { return out; } -inline Napi::Value ToValue(Napi::Env env, VrDeviceInfo obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("hResolution", ToValue(env, obj.hResolution)); - out.Set("vResolution", ToValue(env, obj.vResolution)); - out.Set("hScreenSize", ToValue(env, obj.hScreenSize)); - out.Set("vScreenSize", ToValue(env, obj.vScreenSize)); - out.Set("vScreenCenter", ToValue(env, obj.vScreenCenter)); - out.Set("eyeToScreenDistance", ToValue(env, obj.eyeToScreenDistance)); - out.Set("lensSeparationDistance", ToValue(env, obj.lensSeparationDistance)); - out.Set("interpupillaryDistance", ToValue(env, obj.interpupillaryDistance)); - out.Set("lensDistortionValues", ToValue(env, obj.lensDistortionValues)); - out.Set("chromaAbCorrection", ToValue(env, obj.chromaAbCorrection)); - return out; -} - -inline Napi::Value ToValue(Napi::Env env, VrStereoConfig obj) { - Napi::Object out = Napi::Object::New(env); - out.Set("projection", ToValue(env, obj.projection)); - out.Set("viewOffset", ToValue(env, obj.viewOffset)); - out.Set("leftLensCenter", ToValue(env, obj.leftLensCenter)); - out.Set("rightLensCenter", ToValue(env, obj.rightLensCenter)); - out.Set("leftScreenCenter", ToValue(env, obj.leftScreenCenter)); - out.Set("rightScreenCenter", ToValue(env, obj.rightScreenCenter)); - out.Set("scale", ToValue(env, obj.scale)); - out.Set("scaleIn", ToValue(env, obj.scaleIn)); - return out; -} - inline Texture2D Texture2DFromValue(const Napi::CallbackInfo& info, int index) { return (Texture2D) TextureFromValue(info, index); } @@ -3028,187 +2964,1360 @@ Napi::Value BindEaseElasticInOut(const Napi::CallbackInfo& info) { ); } -void BindInitWindow(const Napi::CallbackInfo& info) { - InitWindow( - intFromValue(info, 0), - intFromValue(info, 1), - (const char *) stringFromValue(info, 2) +Napi::Value BindClamp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Clamp( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindCloseWindow(const Napi::CallbackInfo& info) { - CloseWindow( - +Napi::Value BindLerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Lerp( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindSetWindowState(const Napi::CallbackInfo& info) { - SetWindowState( - unsignedintFromValue(info, 0) +Napi::Value BindNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Normalize( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) ); } -void BindClearWindowState(const Napi::CallbackInfo& info) { - ClearWindowState( - unsignedintFromValue(info, 0) +Napi::Value BindRemap(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Remap( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2), + floatFromValue(info, 3), + floatFromValue(info, 4) + ) ); } -void BindToggleFullscreen(const Napi::CallbackInfo& info) { - ToggleFullscreen( - +Napi::Value BindVector2Zero(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Zero( + + ) ); } -void BindMaximizeWindow(const Napi::CallbackInfo& info) { - MaximizeWindow( - +Napi::Value BindVector2One(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2One( + + ) ); } -void BindMinimizeWindow(const Napi::CallbackInfo& info) { - MinimizeWindow( - +Napi::Value BindVector2Add(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Add( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindRestoreWindow(const Napi::CallbackInfo& info) { - RestoreWindow( - +Napi::Value BindVector2AddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2AddValue( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindSetWindowIcon(const Napi::CallbackInfo& info) { - SetWindowIcon( - ImageFromValue(info, 0) +Napi::Value BindVector2Subtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Subtract( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetWindowTitle(const Napi::CallbackInfo& info) { - SetWindowTitle( - (const char *) stringFromValue(info, 0) +Napi::Value BindVector2SubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2SubtractValue( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindSetWindowPosition(const Napi::CallbackInfo& info) { - SetWindowPosition( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2Length(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Length( + Vector2FromValue(info, 0) + ) ); } -void BindSetWindowMonitor(const Napi::CallbackInfo& info) { - SetWindowMonitor( - intFromValue(info, 0) +Napi::Value BindVector2LengthSqr(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2LengthSqr( + Vector2FromValue(info, 0) + ) ); } -void BindSetWindowMinSize(const Napi::CallbackInfo& info) { - SetWindowMinSize( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2DotProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2DotProduct( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetWindowSize(const Napi::CallbackInfo& info) { - SetWindowSize( - intFromValue(info, 0), - intFromValue(info, 1) +Napi::Value BindVector2Distance(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Distance( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSetClipboardText(const Napi::CallbackInfo& info) { - SetClipboardText( - (const char *) stringFromValue(info, 0) +Napi::Value BindVector2Angle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Angle( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindSwapScreenBuffer(const Napi::CallbackInfo& info) { - SwapScreenBuffer( - +Napi::Value BindVector2Scale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Scale( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindPollInputEvents(const Napi::CallbackInfo& info) { - PollInputEvents( - +Napi::Value BindVector2Multiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Multiply( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindWaitTime(const Napi::CallbackInfo& info) { - WaitTime( - floatFromValue(info, 0) +Napi::Value BindVector2Negate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Negate( + Vector2FromValue(info, 0) + ) ); } -void BindShowCursor(const Napi::CallbackInfo& info) { - ShowCursor( - +Napi::Value BindVector2Divide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Divide( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindHideCursor(const Napi::CallbackInfo& info) { - HideCursor( - +Napi::Value BindVector2Normalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Normalize( + Vector2FromValue(info, 0) + ) ); } -void BindEnableCursor(const Napi::CallbackInfo& info) { - EnableCursor( - +Napi::Value BindVector2Lerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Lerp( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2), + floatFromValue(info, 4) + ) ); } -void BindDisableCursor(const Napi::CallbackInfo& info) { - DisableCursor( - +Napi::Value BindVector2Reflect(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Reflect( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2) + ) ); } -void BindClearBackground(const Napi::CallbackInfo& info) { - ClearBackground( - ColorFromValue(info, 0) +Napi::Value BindVector2Rotate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2Rotate( + Vector2FromValue(info, 0), + floatFromValue(info, 2) + ) ); } -void BindBeginDrawing(const Napi::CallbackInfo& info) { - BeginDrawing( - +Napi::Value BindVector2MoveTowards(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector2MoveTowards( + Vector2FromValue(info, 0), + Vector2FromValue(info, 2), + floatFromValue(info, 4) + ) ); } -void BindEndDrawing(const Napi::CallbackInfo& info) { - EndDrawing( - +Napi::Value BindVector3Zero(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Zero( + + ) ); } -void BindBeginMode2D(const Napi::CallbackInfo& info) { - BeginMode2D( - Camera2DFromValue(info, 0) +Napi::Value BindVector3One(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3One( + + ) ); } -void BindEndMode2D(const Napi::CallbackInfo& info) { - EndMode2D( - +Napi::Value BindVector3Add(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Add( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindBeginMode3D(const Napi::CallbackInfo& info) { - BeginMode3D( - Camera3DFromValue(info, 0) +Napi::Value BindVector3AddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3AddValue( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) ); } -void BindEndMode3D(const Napi::CallbackInfo& info) { - EndMode3D( - +Napi::Value BindVector3Subtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Subtract( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) ); } -void BindBeginTextureMode(const Napi::CallbackInfo& info) { - BeginTextureMode( +Napi::Value BindVector3SubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3SubtractValue( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Scale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Scale( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Multiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Multiply( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3CrossProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3CrossProduct( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Perpendicular(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Perpendicular( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3Length(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Length( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3LengthSqr(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3LengthSqr( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3DotProduct(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3DotProduct( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Distance(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Distance( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Angle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Angle( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Negate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Negate( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3Divide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Divide( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Normalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Normalize( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindVector3Transform(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Transform( + Vector3FromValue(info, 0), + MatrixFromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3RotateByQuaternion(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3RotateByQuaternion( + Vector3FromValue(info, 0), + Vector4FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Lerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Lerp( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + floatFromValue(info, 6) + ) + ); +} + +Napi::Value BindVector3Reflect(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Reflect( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Min(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Min( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Max(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Max( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindVector3Barycenter(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Barycenter( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + Vector3FromValue(info, 6), + Vector3FromValue(info, 9) + ) + ); +} + +Napi::Value BindVector3Unproject(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + Vector3Unproject( + Vector3FromValue(info, 0), + MatrixFromValue(info, 3), + MatrixFromValue(info, 19) + ) + ); +} + +Napi::Value BindMatrixDeterminant(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixDeterminant( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixTrace(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTrace( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixTranspose(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTranspose( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixInvert(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixInvert( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixNormalize( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixIdentity(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixIdentity( + + ) + ); +} + +Napi::Value BindMatrixAdd(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixAdd( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixSubtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixSubtract( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixMultiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixMultiply( + MatrixFromValue(info, 0), + MatrixFromValue(info, 16) + ) + ); +} + +Napi::Value BindMatrixTranslate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixTranslate( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindMatrixRotate(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotate( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindMatrixRotateX(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateX( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateY(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateY( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateZ(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateZ( + floatFromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateXYZ(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateXYZ( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixRotateZYX(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixRotateZYX( + Vector3FromValue(info, 0) + ) + ); +} + +Napi::Value BindMatrixScale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixScale( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindMatrixFrustum(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixFrustum( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3), + doubleFromValue(info, 4), + doubleFromValue(info, 5) + ) + ); +} + +Napi::Value BindMatrixPerspective(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixPerspective( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3) + ) + ); +} + +Napi::Value BindMatrixOrtho(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixOrtho( + doubleFromValue(info, 0), + doubleFromValue(info, 1), + doubleFromValue(info, 2), + doubleFromValue(info, 3), + doubleFromValue(info, 4), + doubleFromValue(info, 5) + ) + ); +} + +Napi::Value BindMatrixLookAt(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + MatrixLookAt( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3), + Vector3FromValue(info, 6) + ) + ); +} + +Napi::Value BindQuaternionAdd(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionAdd( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionAddValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionAddValue( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionSubtract(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSubtract( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionSubtractValue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSubtractValue( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionIdentity(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionIdentity( + + ) + ); +} + +Napi::Value BindQuaternionLength(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionLength( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionNormalize(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionNormalize( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionInvert(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionInvert( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionMultiply(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionMultiply( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionScale(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionScale( + Vector4FromValue(info, 0), + floatFromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionDivide(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionDivide( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1) + ) + ); +} + +Napi::Value BindQuaternionLerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionLerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionNlerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionNlerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionSlerp(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionSlerp( + Vector4FromValue(info, 0), + Vector4FromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionFromVector3ToVector3(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromVector3ToVector3( + Vector3FromValue(info, 0), + Vector3FromValue(info, 3) + ) + ); +} + +Napi::Value BindQuaternionFromMatrix(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromMatrix( + MatrixFromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionToMatrix(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionToMatrix( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionFromAxisAngle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromAxisAngle( + Vector3FromValue(info, 0), + floatFromValue(info, 3) + ) + ); +} + +Napi::Value BindQuaternionFromEuler(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionFromEuler( + floatFromValue(info, 0), + floatFromValue(info, 1), + floatFromValue(info, 2) + ) + ); +} + +Napi::Value BindQuaternionToEuler(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionToEuler( + Vector4FromValue(info, 0) + ) + ); +} + +Napi::Value BindQuaternionTransform(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + QuaternionTransform( + Vector4FromValue(info, 0), + MatrixFromValue(info, 1) + ) + ); +} + +Napi::Value BindGuiIsLocked(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiIsLocked( + + ) + ); +} + +Napi::Value BindGuiGetState(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetState( + + ) + ); +} + +Napi::Value BindGuiGetFont(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetFont( + + ) + ); +} + +Napi::Value BindGuiGetStyle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetStyle( + intFromValue(info, 0), + intFromValue(info, 1) + ) + ); +} + +Napi::Value BindGuiWindowBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiWindowBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiScrollPanel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiScrollPanel( + RectangleFromValue(info, 0), + RectangleFromValue(info, 4), + (Vector2 *) pointerFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiButton(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiButton( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiLabelButton(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiLabelButton( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiToggle(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiToggle( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + boolFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiToggleGroup(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiToggleGroup( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiCheckBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiCheckBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + boolFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiComboBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiComboBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiDropdownBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiDropdownBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiSpinner(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSpinner( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6), + intFromValue(info, 7), + boolFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiValueBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiValueBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6), + intFromValue(info, 7), + boolFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiTextBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextBox( + RectangleFromValue(info, 0), + (char *) pointerFromValue(info, 4), + intFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiTextBoxMulti(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextBoxMulti( + RectangleFromValue(info, 0), + (char *) pointerFromValue(info, 4), + intFromValue(info, 5), + boolFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiSlider(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSlider( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiSliderBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiSliderBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiProgressBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiProgressBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + floatFromValue(info, 6), + floatFromValue(info, 7), + floatFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiScrollBar(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiScrollBar( + RectangleFromValue(info, 0), + intFromValue(info, 4), + intFromValue(info, 5), + intFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiGrid(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGrid( + RectangleFromValue(info, 0), + floatFromValue(info, 4), + intFromValue(info, 5) + ) + ); +} + +Napi::Value BindGuiListView(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiListView( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (int *) pointerFromValue(info, 5), + intFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiListViewEx(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiListViewEx( + RectangleFromValue(info, 0), + (const char **) pointerFromValue(info, 4), + intFromValue(info, 5), + (int *) pointerFromValue(info, 6), + (int *) pointerFromValue(info, 7), + intFromValue(info, 8) + ) + ); +} + +Napi::Value BindGuiMessageBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiMessageBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + (const char *) stringFromValue(info, 6) + ) + ); +} + +Napi::Value BindGuiTextInputBox(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiTextInputBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4), + (const char *) stringFromValue(info, 5), + (const char *) stringFromValue(info, 6), + (char *) pointerFromValue(info, 7) + ) + ); +} + +Napi::Value BindGuiColorPicker(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorPicker( + RectangleFromValue(info, 0), + ColorFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorPanel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorPanel( + RectangleFromValue(info, 0), + ColorFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorBarAlpha(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorBarAlpha( + RectangleFromValue(info, 0), + floatFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiColorBarHue(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiColorBarHue( + RectangleFromValue(info, 0), + floatFromValue(info, 4) + ) + ); +} + +Napi::Value BindGuiIconText(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiIconText( + intFromValue(info, 0), + (const char *) stringFromValue(info, 1) + ) + ); +} + +Napi::Value BindGuiGetIcons(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetIcons( + + ) + ); +} + +Napi::Value BindGuiGetIconData(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiGetIconData( + intFromValue(info, 0) + ) + ); +} + +Napi::Value BindGuiCheckIconPixel(const Napi::CallbackInfo& info) { + return ToValue(info.Env(), + GuiCheckIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ) + ); +} + +void BindInitWindow(const Napi::CallbackInfo& info) { + InitWindow( + intFromValue(info, 0), + intFromValue(info, 1), + (const char *) stringFromValue(info, 2) + ); +} + +void BindCloseWindow(const Napi::CallbackInfo& info) { + CloseWindow( + + ); +} + +void BindSetWindowState(const Napi::CallbackInfo& info) { + SetWindowState( + unsignedintFromValue(info, 0) + ); +} + +void BindClearWindowState(const Napi::CallbackInfo& info) { + ClearWindowState( + unsignedintFromValue(info, 0) + ); +} + +void BindToggleFullscreen(const Napi::CallbackInfo& info) { + ToggleFullscreen( + + ); +} + +void BindMaximizeWindow(const Napi::CallbackInfo& info) { + MaximizeWindow( + + ); +} + +void BindMinimizeWindow(const Napi::CallbackInfo& info) { + MinimizeWindow( + + ); +} + +void BindRestoreWindow(const Napi::CallbackInfo& info) { + RestoreWindow( + + ); +} + +void BindSetWindowIcon(const Napi::CallbackInfo& info) { + SetWindowIcon( + ImageFromValue(info, 0) + ); +} + +void BindSetWindowTitle(const Napi::CallbackInfo& info) { + SetWindowTitle( + (const char *) stringFromValue(info, 0) + ); +} + +void BindSetWindowPosition(const Napi::CallbackInfo& info) { + SetWindowPosition( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetWindowMonitor(const Napi::CallbackInfo& info) { + SetWindowMonitor( + intFromValue(info, 0) + ); +} + +void BindSetWindowMinSize(const Napi::CallbackInfo& info) { + SetWindowMinSize( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetWindowSize(const Napi::CallbackInfo& info) { + SetWindowSize( + intFromValue(info, 0), + intFromValue(info, 1) + ); +} + +void BindSetClipboardText(const Napi::CallbackInfo& info) { + SetClipboardText( + (const char *) stringFromValue(info, 0) + ); +} + +void BindSwapScreenBuffer(const Napi::CallbackInfo& info) { + SwapScreenBuffer( + + ); +} + +void BindPollInputEvents(const Napi::CallbackInfo& info) { + PollInputEvents( + + ); +} + +void BindWaitTime(const Napi::CallbackInfo& info) { + WaitTime( + floatFromValue(info, 0) + ); +} + +void BindShowCursor(const Napi::CallbackInfo& info) { + ShowCursor( + + ); +} + +void BindHideCursor(const Napi::CallbackInfo& info) { + HideCursor( + + ); +} + +void BindEnableCursor(const Napi::CallbackInfo& info) { + EnableCursor( + + ); +} + +void BindDisableCursor(const Napi::CallbackInfo& info) { + DisableCursor( + + ); +} + +void BindClearBackground(const Napi::CallbackInfo& info) { + ClearBackground( + ColorFromValue(info, 0) + ); +} + +void BindBeginDrawing(const Napi::CallbackInfo& info) { + BeginDrawing( + + ); +} + +void BindEndDrawing(const Napi::CallbackInfo& info) { + EndDrawing( + + ); +} + +void BindBeginMode2D(const Napi::CallbackInfo& info) { + BeginMode2D( + Camera2DFromValue(info, 0) + ); +} + +void BindEndMode2D(const Napi::CallbackInfo& info) { + EndMode2D( + + ); +} + +void BindBeginMode3D(const Napi::CallbackInfo& info) { + BeginMode3D( + Camera3DFromValue(info, 0) + ); +} + +void BindEndMode3D(const Napi::CallbackInfo& info) { + EndMode3D( + + ); +} + +void BindBeginTextureMode(const Napi::CallbackInfo& info) { + BeginTextureMode( RenderTexture2DFromValue(info, 0) ); } @@ -4554,6 +5663,157 @@ void BindSetAudioStreamBufferSizeDefault(const Napi::CallbackInfo& info) { intFromValue(info, 0) ); } + +void BindVector3OrthoNormalize(const Napi::CallbackInfo& info) { + Vector3OrthoNormalize( + (Vector3 *) pointerFromValue(info, 0), + (Vector3 *) pointerFromValue(info, 1) + ); +} + +void BindQuaternionToAxisAngle(const Napi::CallbackInfo& info) { + QuaternionToAxisAngle( + Vector4FromValue(info, 0), + (Vector3 *) pointerFromValue(info, 1), + (float *) pointerFromValue(info, 2) + ); +} + +void BindGuiEnable(const Napi::CallbackInfo& info) { + GuiEnable( + + ); +} + +void BindGuiDisable(const Napi::CallbackInfo& info) { + GuiDisable( + + ); +} + +void BindGuiLock(const Napi::CallbackInfo& info) { + GuiLock( + + ); +} + +void BindGuiUnlock(const Napi::CallbackInfo& info) { + GuiUnlock( + + ); +} + +void BindGuiFade(const Napi::CallbackInfo& info) { + GuiFade( + floatFromValue(info, 0) + ); +} + +void BindGuiSetState(const Napi::CallbackInfo& info) { + GuiSetState( + intFromValue(info, 0) + ); +} + +void BindGuiSetFont(const Napi::CallbackInfo& info) { + GuiSetFont( + FontFromValue(info, 0) + ); +} + +void BindGuiSetStyle(const Napi::CallbackInfo& info) { + GuiSetStyle( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} + +void BindGuiGroupBox(const Napi::CallbackInfo& info) { + GuiGroupBox( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiLine(const Napi::CallbackInfo& info) { + GuiLine( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiPanel(const Napi::CallbackInfo& info) { + GuiPanel( + RectangleFromValue(info, 0) + ); +} + +void BindGuiLabel(const Napi::CallbackInfo& info) { + GuiLabel( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiStatusBar(const Napi::CallbackInfo& info) { + GuiStatusBar( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiDummyRec(const Napi::CallbackInfo& info) { + GuiDummyRec( + RectangleFromValue(info, 0), + (const char *) stringFromValue(info, 4) + ); +} + +void BindGuiLoadStyle(const Napi::CallbackInfo& info) { + GuiLoadStyle( + (const char *) stringFromValue(info, 0) + ); +} + +void BindGuiLoadStyleDefault(const Napi::CallbackInfo& info) { + GuiLoadStyleDefault( + + ); +} + +void BindGuiDrawIcon(const Napi::CallbackInfo& info) { + GuiDrawIcon( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2), + intFromValue(info, 3), + ColorFromValue(info, 4) + ); +} + +void BindGuiSetIconData(const Napi::CallbackInfo& info) { + GuiSetIconData( + intFromValue(info, 0), + (unsigned int *) pointerFromValue(info, 1) + ); +} + +void BindGuiSetIconPixel(const Napi::CallbackInfo& info) { + GuiSetIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} + +void BindGuiClearIconPixel(const Napi::CallbackInfo& info) { + GuiClearIconPixel( + intFromValue(info, 0), + intFromValue(info, 1), + intFromValue(info, 2) + ); +} // By-Reference function bindings Napi::Value BindUpdateCamera(const Napi::CallbackInfo& info) { @@ -5526,6 +6786,154 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set("BindEaseElasticIn", Napi::Function::New(env, BindEaseElasticIn)); exports.Set("BindEaseElasticOut", Napi::Function::New(env, BindEaseElasticOut)); exports.Set("BindEaseElasticInOut", Napi::Function::New(env, BindEaseElasticInOut)); + exports.Set("BindClamp", Napi::Function::New(env, BindClamp)); + exports.Set("BindLerp", Napi::Function::New(env, BindLerp)); + exports.Set("BindNormalize", Napi::Function::New(env, BindNormalize)); + exports.Set("BindRemap", Napi::Function::New(env, BindRemap)); + exports.Set("BindVector2Zero", Napi::Function::New(env, BindVector2Zero)); + exports.Set("BindVector2One", Napi::Function::New(env, BindVector2One)); + exports.Set("BindVector2Add", Napi::Function::New(env, BindVector2Add)); + exports.Set("BindVector2AddValue", Napi::Function::New(env, BindVector2AddValue)); + exports.Set("BindVector2Subtract", Napi::Function::New(env, BindVector2Subtract)); + exports.Set("BindVector2SubtractValue", Napi::Function::New(env, BindVector2SubtractValue)); + exports.Set("BindVector2Length", Napi::Function::New(env, BindVector2Length)); + exports.Set("BindVector2LengthSqr", Napi::Function::New(env, BindVector2LengthSqr)); + exports.Set("BindVector2DotProduct", Napi::Function::New(env, BindVector2DotProduct)); + exports.Set("BindVector2Distance", Napi::Function::New(env, BindVector2Distance)); + exports.Set("BindVector2Angle", Napi::Function::New(env, BindVector2Angle)); + exports.Set("BindVector2Scale", Napi::Function::New(env, BindVector2Scale)); + exports.Set("BindVector2Multiply", Napi::Function::New(env, BindVector2Multiply)); + exports.Set("BindVector2Negate", Napi::Function::New(env, BindVector2Negate)); + exports.Set("BindVector2Divide", Napi::Function::New(env, BindVector2Divide)); + exports.Set("BindVector2Normalize", Napi::Function::New(env, BindVector2Normalize)); + exports.Set("BindVector2Lerp", Napi::Function::New(env, BindVector2Lerp)); + exports.Set("BindVector2Reflect", Napi::Function::New(env, BindVector2Reflect)); + exports.Set("BindVector2Rotate", Napi::Function::New(env, BindVector2Rotate)); + exports.Set("BindVector2MoveTowards", Napi::Function::New(env, BindVector2MoveTowards)); + exports.Set("BindVector3Zero", Napi::Function::New(env, BindVector3Zero)); + exports.Set("BindVector3One", Napi::Function::New(env, BindVector3One)); + exports.Set("BindVector3Add", Napi::Function::New(env, BindVector3Add)); + exports.Set("BindVector3AddValue", Napi::Function::New(env, BindVector3AddValue)); + exports.Set("BindVector3Subtract", Napi::Function::New(env, BindVector3Subtract)); + exports.Set("BindVector3SubtractValue", Napi::Function::New(env, BindVector3SubtractValue)); + exports.Set("BindVector3Scale", Napi::Function::New(env, BindVector3Scale)); + exports.Set("BindVector3Multiply", Napi::Function::New(env, BindVector3Multiply)); + exports.Set("BindVector3CrossProduct", Napi::Function::New(env, BindVector3CrossProduct)); + exports.Set("BindVector3Perpendicular", Napi::Function::New(env, BindVector3Perpendicular)); + exports.Set("BindVector3Length", Napi::Function::New(env, BindVector3Length)); + exports.Set("BindVector3LengthSqr", Napi::Function::New(env, BindVector3LengthSqr)); + exports.Set("BindVector3DotProduct", Napi::Function::New(env, BindVector3DotProduct)); + exports.Set("BindVector3Distance", Napi::Function::New(env, BindVector3Distance)); + exports.Set("BindVector3Angle", Napi::Function::New(env, BindVector3Angle)); + exports.Set("BindVector3Negate", Napi::Function::New(env, BindVector3Negate)); + exports.Set("BindVector3Divide", Napi::Function::New(env, BindVector3Divide)); + exports.Set("BindVector3Normalize", Napi::Function::New(env, BindVector3Normalize)); + exports.Set("BindVector3OrthoNormalize", Napi::Function::New(env, BindVector3OrthoNormalize)); + exports.Set("BindVector3Transform", Napi::Function::New(env, BindVector3Transform)); + exports.Set("BindVector3RotateByQuaternion", Napi::Function::New(env, BindVector3RotateByQuaternion)); + exports.Set("BindVector3Lerp", Napi::Function::New(env, BindVector3Lerp)); + exports.Set("BindVector3Reflect", Napi::Function::New(env, BindVector3Reflect)); + exports.Set("BindVector3Min", Napi::Function::New(env, BindVector3Min)); + exports.Set("BindVector3Max", Napi::Function::New(env, BindVector3Max)); + exports.Set("BindVector3Barycenter", Napi::Function::New(env, BindVector3Barycenter)); + exports.Set("BindVector3Unproject", Napi::Function::New(env, BindVector3Unproject)); + exports.Set("BindMatrixDeterminant", Napi::Function::New(env, BindMatrixDeterminant)); + exports.Set("BindMatrixTrace", Napi::Function::New(env, BindMatrixTrace)); + exports.Set("BindMatrixTranspose", Napi::Function::New(env, BindMatrixTranspose)); + exports.Set("BindMatrixInvert", Napi::Function::New(env, BindMatrixInvert)); + exports.Set("BindMatrixNormalize", Napi::Function::New(env, BindMatrixNormalize)); + exports.Set("BindMatrixIdentity", Napi::Function::New(env, BindMatrixIdentity)); + exports.Set("BindMatrixAdd", Napi::Function::New(env, BindMatrixAdd)); + exports.Set("BindMatrixSubtract", Napi::Function::New(env, BindMatrixSubtract)); + exports.Set("BindMatrixMultiply", Napi::Function::New(env, BindMatrixMultiply)); + exports.Set("BindMatrixTranslate", Napi::Function::New(env, BindMatrixTranslate)); + exports.Set("BindMatrixRotate", Napi::Function::New(env, BindMatrixRotate)); + exports.Set("BindMatrixRotateX", Napi::Function::New(env, BindMatrixRotateX)); + exports.Set("BindMatrixRotateY", Napi::Function::New(env, BindMatrixRotateY)); + exports.Set("BindMatrixRotateZ", Napi::Function::New(env, BindMatrixRotateZ)); + exports.Set("BindMatrixRotateXYZ", Napi::Function::New(env, BindMatrixRotateXYZ)); + exports.Set("BindMatrixRotateZYX", Napi::Function::New(env, BindMatrixRotateZYX)); + exports.Set("BindMatrixScale", Napi::Function::New(env, BindMatrixScale)); + exports.Set("BindMatrixFrustum", Napi::Function::New(env, BindMatrixFrustum)); + exports.Set("BindMatrixPerspective", Napi::Function::New(env, BindMatrixPerspective)); + exports.Set("BindMatrixOrtho", Napi::Function::New(env, BindMatrixOrtho)); + exports.Set("BindMatrixLookAt", Napi::Function::New(env, BindMatrixLookAt)); + exports.Set("BindQuaternionAdd", Napi::Function::New(env, BindQuaternionAdd)); + exports.Set("BindQuaternionAddValue", Napi::Function::New(env, BindQuaternionAddValue)); + exports.Set("BindQuaternionSubtract", Napi::Function::New(env, BindQuaternionSubtract)); + exports.Set("BindQuaternionSubtractValue", Napi::Function::New(env, BindQuaternionSubtractValue)); + exports.Set("BindQuaternionIdentity", Napi::Function::New(env, BindQuaternionIdentity)); + exports.Set("BindQuaternionLength", Napi::Function::New(env, BindQuaternionLength)); + exports.Set("BindQuaternionNormalize", Napi::Function::New(env, BindQuaternionNormalize)); + exports.Set("BindQuaternionInvert", Napi::Function::New(env, BindQuaternionInvert)); + exports.Set("BindQuaternionMultiply", Napi::Function::New(env, BindQuaternionMultiply)); + exports.Set("BindQuaternionScale", Napi::Function::New(env, BindQuaternionScale)); + exports.Set("BindQuaternionDivide", Napi::Function::New(env, BindQuaternionDivide)); + exports.Set("BindQuaternionLerp", Napi::Function::New(env, BindQuaternionLerp)); + exports.Set("BindQuaternionNlerp", Napi::Function::New(env, BindQuaternionNlerp)); + exports.Set("BindQuaternionSlerp", Napi::Function::New(env, BindQuaternionSlerp)); + exports.Set("BindQuaternionFromVector3ToVector3", Napi::Function::New(env, BindQuaternionFromVector3ToVector3)); + exports.Set("BindQuaternionFromMatrix", Napi::Function::New(env, BindQuaternionFromMatrix)); + exports.Set("BindQuaternionToMatrix", Napi::Function::New(env, BindQuaternionToMatrix)); + exports.Set("BindQuaternionFromAxisAngle", Napi::Function::New(env, BindQuaternionFromAxisAngle)); + exports.Set("BindQuaternionToAxisAngle", Napi::Function::New(env, BindQuaternionToAxisAngle)); + exports.Set("BindQuaternionFromEuler", Napi::Function::New(env, BindQuaternionFromEuler)); + exports.Set("BindQuaternionToEuler", Napi::Function::New(env, BindQuaternionToEuler)); + exports.Set("BindQuaternionTransform", Napi::Function::New(env, BindQuaternionTransform)); + exports.Set("BindGuiEnable", Napi::Function::New(env, BindGuiEnable)); + exports.Set("BindGuiDisable", Napi::Function::New(env, BindGuiDisable)); + exports.Set("BindGuiLock", Napi::Function::New(env, BindGuiLock)); + exports.Set("BindGuiUnlock", Napi::Function::New(env, BindGuiUnlock)); + exports.Set("BindGuiIsLocked", Napi::Function::New(env, BindGuiIsLocked)); + exports.Set("BindGuiFade", Napi::Function::New(env, BindGuiFade)); + exports.Set("BindGuiSetState", Napi::Function::New(env, BindGuiSetState)); + exports.Set("BindGuiGetState", Napi::Function::New(env, BindGuiGetState)); + exports.Set("BindGuiSetFont", Napi::Function::New(env, BindGuiSetFont)); + exports.Set("BindGuiGetFont", Napi::Function::New(env, BindGuiGetFont)); + exports.Set("BindGuiSetStyle", Napi::Function::New(env, BindGuiSetStyle)); + exports.Set("BindGuiGetStyle", Napi::Function::New(env, BindGuiGetStyle)); + exports.Set("BindGuiWindowBox", Napi::Function::New(env, BindGuiWindowBox)); + exports.Set("BindGuiGroupBox", Napi::Function::New(env, BindGuiGroupBox)); + exports.Set("BindGuiLine", Napi::Function::New(env, BindGuiLine)); + exports.Set("BindGuiPanel", Napi::Function::New(env, BindGuiPanel)); + exports.Set("BindGuiScrollPanel", Napi::Function::New(env, BindGuiScrollPanel)); + exports.Set("BindGuiLabel", Napi::Function::New(env, BindGuiLabel)); + exports.Set("BindGuiButton", Napi::Function::New(env, BindGuiButton)); + exports.Set("BindGuiLabelButton", Napi::Function::New(env, BindGuiLabelButton)); + exports.Set("BindGuiToggle", Napi::Function::New(env, BindGuiToggle)); + exports.Set("BindGuiToggleGroup", Napi::Function::New(env, BindGuiToggleGroup)); + exports.Set("BindGuiCheckBox", Napi::Function::New(env, BindGuiCheckBox)); + exports.Set("BindGuiComboBox", Napi::Function::New(env, BindGuiComboBox)); + exports.Set("BindGuiDropdownBox", Napi::Function::New(env, BindGuiDropdownBox)); + exports.Set("BindGuiSpinner", Napi::Function::New(env, BindGuiSpinner)); + exports.Set("BindGuiValueBox", Napi::Function::New(env, BindGuiValueBox)); + exports.Set("BindGuiTextBox", Napi::Function::New(env, BindGuiTextBox)); + exports.Set("BindGuiTextBoxMulti", Napi::Function::New(env, BindGuiTextBoxMulti)); + exports.Set("BindGuiSlider", Napi::Function::New(env, BindGuiSlider)); + exports.Set("BindGuiSliderBar", Napi::Function::New(env, BindGuiSliderBar)); + exports.Set("BindGuiProgressBar", Napi::Function::New(env, BindGuiProgressBar)); + exports.Set("BindGuiStatusBar", Napi::Function::New(env, BindGuiStatusBar)); + exports.Set("BindGuiDummyRec", Napi::Function::New(env, BindGuiDummyRec)); + exports.Set("BindGuiScrollBar", Napi::Function::New(env, BindGuiScrollBar)); + exports.Set("BindGuiGrid", Napi::Function::New(env, BindGuiGrid)); + exports.Set("BindGuiListView", Napi::Function::New(env, BindGuiListView)); + exports.Set("BindGuiListViewEx", Napi::Function::New(env, BindGuiListViewEx)); + exports.Set("BindGuiMessageBox", Napi::Function::New(env, BindGuiMessageBox)); + exports.Set("BindGuiTextInputBox", Napi::Function::New(env, BindGuiTextInputBox)); + exports.Set("BindGuiColorPicker", Napi::Function::New(env, BindGuiColorPicker)); + exports.Set("BindGuiColorPanel", Napi::Function::New(env, BindGuiColorPanel)); + exports.Set("BindGuiColorBarAlpha", Napi::Function::New(env, BindGuiColorBarAlpha)); + exports.Set("BindGuiColorBarHue", Napi::Function::New(env, BindGuiColorBarHue)); + exports.Set("BindGuiLoadStyle", Napi::Function::New(env, BindGuiLoadStyle)); + exports.Set("BindGuiLoadStyleDefault", Napi::Function::New(env, BindGuiLoadStyleDefault)); + exports.Set("BindGuiIconText", Napi::Function::New(env, BindGuiIconText)); + exports.Set("BindGuiDrawIcon", Napi::Function::New(env, BindGuiDrawIcon)); + exports.Set("BindGuiGetIcons", Napi::Function::New(env, BindGuiGetIcons)); + exports.Set("BindGuiGetIconData", Napi::Function::New(env, BindGuiGetIconData)); + exports.Set("BindGuiSetIconData", Napi::Function::New(env, BindGuiSetIconData)); + exports.Set("BindGuiSetIconPixel", Napi::Function::New(env, BindGuiSetIconPixel)); + exports.Set("BindGuiClearIconPixel", Napi::Function::New(env, BindGuiClearIconPixel)); + exports.Set("BindGuiCheckIconPixel", Napi::Function::New(env, BindGuiCheckIconPixel)); exports.Set("BindSetShaderFloat", Napi::Function::New(env, BindSetShaderFloat)); exports.Set("BindSetShaderInt", Napi::Function::New(env, BindSetShaderInt)); diff --git a/src/generated/node-raylib.d.ts b/src/generated/node-raylib.d.ts index acb012f..675df3c 100644 --- a/src/generated/node-raylib.d.ts +++ b/src/generated/node-raylib.d.ts @@ -31,35 +31,35 @@ declare module "raylib" { export interface Matrix { /** Matrix first row (4 components) */ m0: number - /** Matrix second row (4 components) */ - m1: number - /** Matrix third row (4 components) */ - m2: number - /** Matrix fourth row (4 components) */ - m3: number /** Matrix first row (4 components) */ m4: number - /** Matrix second row (4 components) */ - m5: number - /** Matrix third row (4 components) */ - m6: number - /** Matrix fourth row (4 components) */ - m7: number /** Matrix first row (4 components) */ m8: number - /** Matrix second row (4 components) */ - m9: number - /** Matrix third row (4 components) */ - m10: number - /** Matrix fourth row (4 components) */ - m11: number /** Matrix first row (4 components) */ m12: number /** Matrix second row (4 components) */ + m1: number + /** Matrix second row (4 components) */ + m5: number + /** Matrix second row (4 components) */ + m9: number + /** Matrix second row (4 components) */ m13: number /** Matrix third row (4 components) */ + m2: number + /** Matrix third row (4 components) */ + m6: number + /** Matrix third row (4 components) */ + m10: number + /** Matrix third row (4 components) */ m14: number /** Matrix fourth row (4 components) */ + m3: number + /** Matrix fourth row (4 components) */ + m7: number + /** Matrix fourth row (4 components) */ + m11: number + /** Matrix fourth row (4 components) */ m15: number } /** Color, 4 components, R8G8B8A8 (32bit) */ @@ -242,7 +242,7 @@ declare module "raylib" { /** Material maps array (MAX_MATERIAL_MAPS) */ maps: number /** Material generic parameters (if required) */ - params: number + params: float[4] } /** Transform, vectex transformation data */ export interface Transform { @@ -380,28 +380,28 @@ declare module "raylib" { /** IPD (distance between pupils) in meters */ interpupillaryDistance: number /** Lens distortion constant parameters */ - lensDistortionValues: number + lensDistortionValues: float[4] /** Chromatic aberration correction parameters */ - chromaAbCorrection: number + chromaAbCorrection: float[4] } /** VrStereoConfig, VR stereo rendering configuration for simulator */ export interface VrStereoConfig { /** VR projection matrices (per eye) */ - projection: Matrix + projection: Matrix[2] /** VR view offset matrices (per eye) */ - viewOffset: Matrix + viewOffset: Matrix[2] /** VR left lens center */ - leftLensCenter: number + leftLensCenter: float[2] /** VR right lens center */ - rightLensCenter: number + rightLensCenter: float[2] /** VR left screen center */ - leftScreenCenter: number + leftScreenCenter: float[2] /** VR right screen center */ - rightScreenCenter: number + rightScreenCenter: float[2] /** VR distortion scale */ - scale: number + scale: float[2] /** VR distortion scale in */ - scaleIn: number + scaleIn: float[2] } /** RenderTexture, fbo for texture rendering */ @@ -449,7 +449,7 @@ declare module "raylib" { /** Check if one specific window flag is enabled */ export function IsWindowState(flag: number): boolean - /** Set window configuration state using flags (only PLATFORM_DESKTOP) */ + /** Set window configuration state using flags */ export function SetWindowState(flags: number): void /** Clear window configuration state flags */ @@ -1349,7 +1349,7 @@ declare module "raylib" { /** Load font from file into GPU memory (VRAM) */ export function LoadFont(fileName: string): Font - /** Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set */ + /** Load font from file with extended parameters */ export function LoadFontEx(fileName: string, fontSize: number, fontChars: number, glyphCount: number): Font /** Load font from Image (XNA style) */ @@ -1367,7 +1367,7 @@ declare module "raylib" { /** Unload font chars info data (RAM) */ export function UnloadFontData(chars: number, glyphCount: number): void - /** Unload font from GPU memory (VRAM) */ + /** Unload Font from GPU memory (VRAM) */ export function UnloadFont(font: Font): void /** Draw current FPS */ @@ -1823,90 +1823,534 @@ declare module "raylib" { /** Default size for new audio streams */ export function SetAudioStreamBufferSizeDefault(size: number): void - /** Easing: EaseLinearNone. */ + /** */ export function EaseLinearNone(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearIn. */ + /** */ export function EaseLinearIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearOut. */ + /** */ export function EaseLinearOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseLinearInOut. */ + /** */ export function EaseLinearInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineIn. */ + /** */ export function EaseSineIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineOut. */ + /** */ export function EaseSineOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseSineInOut. */ + /** */ export function EaseSineInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircIn. */ + /** */ export function EaseCircIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircOut. */ + /** */ export function EaseCircOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCircInOut. */ + /** */ export function EaseCircInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicIn. */ + /** */ export function EaseCubicIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicOut. */ + /** */ export function EaseCubicOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseCubicInOut. */ + /** */ export function EaseCubicInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadIn. */ + /** */ export function EaseQuadIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadOut. */ + /** */ export function EaseQuadOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseQuadInOut. */ + /** */ export function EaseQuadInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoIn. */ + /** */ export function EaseExpoIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoOut. */ + /** */ export function EaseExpoOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseExpoInOut. */ + /** */ export function EaseExpoInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackIn. */ + /** */ export function EaseBackIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackOut. */ + /** */ export function EaseBackOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBackInOut. */ + /** */ export function EaseBackInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceOut. */ + /** */ export function EaseBounceOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceIn. */ + /** */ export function EaseBounceIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseBounceInOut. */ + /** */ export function EaseBounceInOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticIn. */ + /** */ export function EaseElasticIn(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticOut. */ + /** */ export function EaseElasticOut(t: number, b: number, c: number, d: number): number - /** Easing: EaseElasticInOut. */ + /** */ export function EaseElasticInOut(t: number, b: number, c: number, d: number): number + /** */ + export function Clamp(value: number, min: number, max: number): number + + /** */ + export function Lerp(start: number, end: number, amount: number): number + + /** */ + export function Normalize(value: number, start: number, end: number): number + + /** */ + export function Remap(value: number, inputStart: number, inputEnd: number, outputStart: number, outputEnd: number): number + + /** */ + export function Vector2Zero(): Vector2 + + /** */ + export function Vector2One(): Vector2 + + /** */ + export function Vector2Add(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2AddValue(v: Vector2, add: number): Vector2 + + /** */ + export function Vector2Subtract(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2SubtractValue(v: Vector2, sub: number): Vector2 + + /** */ + export function Vector2Length(v: Vector2): number + + /** */ + export function Vector2LengthSqr(v: Vector2): number + + /** */ + export function Vector2DotProduct(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Distance(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Angle(v1: Vector2, v2: Vector2): number + + /** */ + export function Vector2Scale(v: Vector2, scale: number): Vector2 + + /** */ + export function Vector2Multiply(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2Negate(v: Vector2): Vector2 + + /** */ + export function Vector2Divide(v1: Vector2, v2: Vector2): Vector2 + + /** */ + export function Vector2Normalize(v: Vector2): Vector2 + + /** */ + export function Vector2Lerp(v1: Vector2, v2: Vector2, amount: number): Vector2 + + /** */ + export function Vector2Reflect(v: Vector2, normal: Vector2): Vector2 + + /** */ + export function Vector2Rotate(v: Vector2, angle: number): Vector2 + + /** */ + export function Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: number): Vector2 + + /** */ + export function Vector3Zero(): Vector3 + + /** */ + export function Vector3One(): Vector3 + + /** */ + export function Vector3Add(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3AddValue(v: Vector3, add: number): Vector3 + + /** */ + export function Vector3Subtract(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3SubtractValue(v: Vector3, sub: number): Vector3 + + /** */ + export function Vector3Scale(v: Vector3, scalar: number): Vector3 + + /** */ + export function Vector3Multiply(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3CrossProduct(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Perpendicular(v: Vector3): Vector3 + + /** */ + export function Vector3Length(v: Vector3): number + + /** */ + export function Vector3LengthSqr(v: Vector3): number + + /** */ + export function Vector3DotProduct(v1: Vector3, v2: Vector3): number + + /** */ + export function Vector3Distance(v1: Vector3, v2: Vector3): number + + /** */ + export function Vector3Angle(v1: Vector3, v2: Vector3): Vector2 + + /** */ + export function Vector3Negate(v: Vector3): Vector3 + + /** */ + export function Vector3Divide(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Normalize(v: Vector3): Vector3 + + /** */ + export function Vector3OrthoNormalize(v1: number, v2: number): void + + /** */ + export function Vector3Transform(v: Vector3, mat: Matrix): Vector3 + + /** */ + export function Vector3RotateByQuaternion(v: Vector3, q: Quaternion): Vector3 + + /** */ + export function Vector3Lerp(v1: Vector3, v2: Vector3, amount: number): Vector3 + + /** */ + export function Vector3Reflect(v: Vector3, normal: Vector3): Vector3 + + /** */ + export function Vector3Min(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Max(v1: Vector3, v2: Vector3): Vector3 + + /** */ + export function Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3): Vector3 + + /** */ + export function Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix): Vector3 + + /** */ + export function MatrixDeterminant(mat: Matrix): number + + /** */ + export function MatrixTrace(mat: Matrix): number + + /** */ + export function MatrixTranspose(mat: Matrix): Matrix + + /** */ + export function MatrixInvert(mat: Matrix): Matrix + + /** */ + export function MatrixNormalize(mat: Matrix): Matrix + + /** */ + export function MatrixIdentity(): Matrix + + /** */ + export function MatrixAdd(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixSubtract(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixMultiply(left: Matrix, right: Matrix): Matrix + + /** */ + export function MatrixTranslate(x: number, y: number, z: number): Matrix + + /** */ + export function MatrixRotate(axis: Vector3, angle: number): Matrix + + /** */ + export function MatrixRotateX(angle: number): Matrix + + /** */ + export function MatrixRotateY(angle: number): Matrix + + /** */ + export function MatrixRotateZ(angle: number): Matrix + + /** */ + export function MatrixRotateXYZ(ang: Vector3): Matrix + + /** */ + export function MatrixRotateZYX(ang: Vector3): Matrix + + /** */ + export function MatrixScale(x: number, y: number, z: number): Matrix + + /** */ + export function MatrixFrustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix + + /** */ + export function MatrixPerspective(fovy: number, aspect: number, near: number, far: number): Matrix + + /** */ + export function MatrixOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix + + /** */ + export function MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix + + /** */ + export function QuaternionAdd(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionAddValue(q: Quaternion, add: number): Quaternion + + /** */ + export function QuaternionSubtract(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionSubtractValue(q: Quaternion, sub: number): Quaternion + + /** */ + export function QuaternionIdentity(): Quaternion + + /** */ + export function QuaternionLength(q: Quaternion): number + + /** */ + export function QuaternionNormalize(q: Quaternion): Quaternion + + /** */ + export function QuaternionInvert(q: Quaternion): Quaternion + + /** */ + export function QuaternionMultiply(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionScale(q: Quaternion, mul: number): Quaternion + + /** */ + export function QuaternionDivide(q1: Quaternion, q2: Quaternion): Quaternion + + /** */ + export function QuaternionLerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionNlerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionSlerp(q1: Quaternion, q2: Quaternion, amount: number): Quaternion + + /** */ + export function QuaternionFromVector3ToVector3(from: Vector3, to: Vector3): Quaternion + + /** */ + export function QuaternionFromMatrix(mat: Matrix): Quaternion + + /** */ + export function QuaternionToMatrix(q: Quaternion): Matrix + + /** */ + export function QuaternionFromAxisAngle(axis: Vector3, angle: number): Quaternion + + /** */ + export function QuaternionToAxisAngle(q: Quaternion, outAxis: number, outAngle: number): void + + /** */ + export function QuaternionFromEuler(pitch: number, yaw: number, roll: number): Quaternion + + /** */ + export function QuaternionToEuler(q: Quaternion): Vector3 + + /** */ + export function QuaternionTransform(q: Quaternion, mat: Matrix): Quaternion + + /** Enable gui controls (global state) */ + export function GuiEnable(): void + + /** Disable gui controls (global state) */ + export function GuiDisable(): void + + /** Lock gui controls (global state) */ + export function GuiLock(): void + + /** Unlock gui controls (global state) */ + export function GuiUnlock(): void + + /** Check if gui is locked (global state) */ + export function GuiIsLocked(): boolean + + /** Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f */ + export function GuiFade(alpha: number): void + + /** Set gui state (global state) */ + export function GuiSetState(state: number): void + + /** Get gui state (global state) */ + export function GuiGetState(): number + + /** Set gui custom font (global state) */ + export function GuiSetFont(font: Font): void + + /** Get gui custom font (global state) */ + export function GuiGetFont(): Font + + /** Set one style property */ + export function GuiSetStyle(control: number, property: number, value: number): void + + /** Get one style property */ + export function GuiGetStyle(control: number, property: number): number + + /** Window Box control, shows a window that can be closed */ + export function GuiWindowBox(bounds: Rectangle, title: string): boolean + + /** Group Box control with text name */ + export function GuiGroupBox(bounds: Rectangle, text: string): void + + /** Line separator control, could contain text */ + export function GuiLine(bounds: Rectangle, text: string): void + + /** Panel control, useful to group controls */ + export function GuiPanel(bounds: Rectangle): void + + /** Scroll Panel control */ + export function GuiScrollPanel(bounds: Rectangle, content: Rectangle, scroll: number): Rectangle + + /** Label control, shows text */ + export function GuiLabel(bounds: Rectangle, text: string): void + + /** Button control, returns true when clicked */ + export function GuiButton(bounds: Rectangle, text: string): boolean + + /** Label button control, show true when clicked */ + export function GuiLabelButton(bounds: Rectangle, text: string): boolean + + /** Toggle Button control, returns true when active */ + export function GuiToggle(bounds: Rectangle, text: string, active: boolean): boolean + + /** Toggle Group control, returns active toggle index */ + export function GuiToggleGroup(bounds: Rectangle, text: string, active: number): number + + /** Check Box control, returns true when active */ + export function GuiCheckBox(bounds: Rectangle, text: string, checked: boolean): boolean + + /** Combo Box control, returns selected item index */ + export function GuiComboBox(bounds: Rectangle, text: string, active: number): number + + /** Dropdown Box control, returns selected item */ + export function GuiDropdownBox(bounds: Rectangle, text: string, active: number, editMode: boolean): boolean + + /** Spinner control, returns selected value */ + export function GuiSpinner(bounds: Rectangle, text: string, value: number, minValue: number, maxValue: number, editMode: boolean): boolean + + /** Value Box control, updates input text with numbers */ + export function GuiValueBox(bounds: Rectangle, text: string, value: number, minValue: number, maxValue: number, editMode: boolean): boolean + + /** Text Box control, updates input text */ + export function GuiTextBox(bounds: Rectangle, text: string, textSize: number, editMode: boolean): boolean + + /** Text Box control with multiple lines */ + export function GuiTextBoxMulti(bounds: Rectangle, text: string, textSize: number, editMode: boolean): boolean + + /** Slider control, returns selected value */ + export function GuiSlider(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Slider Bar control, returns selected value */ + export function GuiSliderBar(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Progress Bar control, shows current progress value */ + export function GuiProgressBar(bounds: Rectangle, textLeft: string, textRight: string, value: number, minValue: number, maxValue: number): number + + /** Status Bar control, shows info text */ + export function GuiStatusBar(bounds: Rectangle, text: string): void + + /** Dummy control for placeholders */ + export function GuiDummyRec(bounds: Rectangle, text: string): void + + /** Scroll Bar control */ + export function GuiScrollBar(bounds: Rectangle, value: number, minValue: number, maxValue: number): number + + /** Grid control */ + export function GuiGrid(bounds: Rectangle, spacing: number, subdivs: number): Vector2 + + /** List View control, returns selected list item index */ + export function GuiListView(bounds: Rectangle, text: string, scrollIndex: number, active: number): number + + /** List View with extended parameters */ + export function GuiListViewEx(bounds: Rectangle, text: number, count: number, focus: number, scrollIndex: number, active: number): number + + /** Message Box control, displays a message */ + export function GuiMessageBox(bounds: Rectangle, title: string, message: string, buttons: string): number + + /** Text Input Box control, ask for text */ + export function GuiTextInputBox(bounds: Rectangle, title: string, message: string, buttons: string, text: string): number + + /** Color Picker control (multiple color controls) */ + export function GuiColorPicker(bounds: Rectangle, color: Color): Color + + /** Color Panel control */ + export function GuiColorPanel(bounds: Rectangle, color: Color): Color + + /** Color Bar Alpha control */ + export function GuiColorBarAlpha(bounds: Rectangle, alpha: number): number + + /** Color Bar Hue control */ + export function GuiColorBarHue(bounds: Rectangle, value: number): number + + /** Load style file over global style variable (.rgs) */ + export function GuiLoadStyle(fileName: string): void + + /** Load style default over global style */ + export function GuiLoadStyleDefault(): void + + /** Get text with icon id prepended (if supported) */ + export function GuiIconText(iconId: number, text: string): string + + /** */ + export function GuiDrawIcon(iconId: number, posX: number, posY: number, pixelSize: number, color: Color): void + + /** Get full icons data pointer */ + export function GuiGetIcons(): number + + /** Get icon bit data */ + export function GuiGetIconData(iconId: number): number + + /** Set icon bit data */ + export function GuiSetIconData(iconId: number, data: number): void + + /** Set icon pixel value */ + export function GuiSetIconPixel(iconId: number, x: number, y: number): void + + /** Clear icon pixel value */ + export function GuiClearIconPixel(iconId: number, x: number, y: number): void + + /** Check icon pixel value */ + export function GuiCheckIconPixel(iconId: number, x: number, y: number): boolean + /** Set shader uniform float */ export function SetShaderFloat(shader: Shader, locIndex: number, value: number): void @@ -2409,7 +2853,7 @@ declare module "raylib" { export const PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 /** 2 bpp */ export const PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 - /** No filter, just pixel approximation */ + /** No filter, just pixel aproximation */ export const TEXTURE_FILTER_POINT = 0 /** Linear filtering */ export const TEXTURE_FILTER_BILINEAR = 1 @@ -2501,6 +2945,156 @@ declare module "raylib" { export const NPATCH_THREE_PATCH_VERTICAL = 1 /** Npatch layout: 3x1 tiles */ export const NPATCH_THREE_PATCH_HORIZONTAL = 2 + /** */ + export const GUI_STATE_NORMAL = 0 + /** */ + export const GUI_STATE_FOCUSED = 1 + /** */ + export const GUI_STATE_PRESSED = 2 + /** */ + export const GUI_STATE_DISABLED = 3 + /** */ + export const GUI_TEXT_ALIGN_LEFT = 0 + /** */ + export const GUI_TEXT_ALIGN_CENTER = 1 + /** */ + export const GUI_TEXT_ALIGN_RIGHT = 2 + /** Generic control -> populates to all controls when set */ + export const DEFAULT = 0 + /** Used also for: LABELBUTTON */ + export const LABEL = 1 + /** */ + export const BUTTON = 2 + /** Used also for: TOGGLEGROUP */ + export const TOGGLE = 3 + /** Used also for: SLIDERBAR */ + export const SLIDER = 4 + /** */ + export const PROGRESSBAR = 5 + /** */ + export const CHECKBOX = 6 + /** */ + export const COMBOBOX = 7 + /** */ + export const DROPDOWNBOX = 8 + /** Used also for: TEXTBOXMULTI */ + export const TEXTBOX = 9 + /** */ + export const VALUEBOX = 10 + /** */ + export const SPINNER = 11 + /** */ + export const LISTVIEW = 12 + /** */ + export const COLORPICKER = 13 + /** */ + export const SCROLLBAR = 14 + /** */ + export const STATUSBAR = 15 + /** */ + export const BORDER_COLOR_NORMAL = 0 + /** */ + export const BASE_COLOR_NORMAL = 1 + /** */ + export const TEXT_COLOR_NORMAL = 2 + /** */ + export const BORDER_COLOR_FOCUSED = 3 + /** */ + export const BASE_COLOR_FOCUSED = 4 + /** */ + export const TEXT_COLOR_FOCUSED = 5 + /** */ + export const BORDER_COLOR_PRESSED = 6 + /** */ + export const BASE_COLOR_PRESSED = 7 + /** */ + export const TEXT_COLOR_PRESSED = 8 + /** */ + export const BORDER_COLOR_DISABLED = 9 + /** */ + export const BASE_COLOR_DISABLED = 10 + /** */ + export const TEXT_COLOR_DISABLED = 11 + /** */ + export const BORDER_WIDTH = 12 + /** */ + export const TEXT_PADDING = 13 + /** */ + export const TEXT_ALIGNMENT = 14 + /** */ + export const RESERVED = 15 + /** */ + export const TEXT_SIZE = 16 + /** */ + export const TEXT_SPACING = 17 + /** */ + export const LINE_COLOR = 18 + /** */ + export const BACKGROUND_COLOR = 19 + /** */ + export const GROUP_PADDING = 16 + /** */ + export const SLIDER_WIDTH = 16 + /** */ + export const SLIDER_PADDING = 17 + /** */ + export const PROGRESS_PADDING = 16 + /** */ + export const CHECK_PADDING = 16 + /** */ + export const COMBO_BUTTON_WIDTH = 16 + /** */ + export const COMBO_BUTTON_PADDING = 17 + /** */ + export const ARROW_PADDING = 16 + /** */ + export const DROPDOWN_ITEMS_PADDING = 17 + /** */ + export const TEXT_INNER_PADDING = 16 + /** */ + export const TEXT_LINES_PADDING = 17 + /** */ + export const COLOR_SELECTED_FG = 18 + /** */ + export const COLOR_SELECTED_BG = 19 + /** */ + export const SPIN_BUTTON_WIDTH = 16 + /** */ + export const SPIN_BUTTON_PADDING = 17 + /** */ + export const ARROWS_SIZE = 16 + /** */ + export const ARROWS_VISIBLE = 17 + /** */ + export const SCROLL_SLIDER_PADDING = 18 + /** */ + export const SCROLL_SLIDER_SIZE = 19 + /** */ + export const SCROLL_PADDING = 20 + /** */ + export const SCROLL_SPEED = 21 + /** */ + export const SCROLLBAR_LEFT_SIDE = 0 + /** */ + export const SCROLLBAR_RIGHT_SIDE = 1 + /** */ + export const LIST_ITEMS_HEIGHT = 16 + /** */ + export const LIST_ITEMS_PADDING = 17 + /** */ + export const SCROLLBAR_WIDTH = 18 + /** */ + export const SCROLLBAR_SIDE = 19 + /** */ + export const COLOR_SELECTOR_SIZE = 16 + /** Right hue bar width */ + export const HUEBAR_WIDTH = 17 + /** Right hue bar separation from panel */ + export const HUEBAR_PADDING = 18 + /** Right hue bar selector height */ + export const HUEBAR_SELECTOR_HEIGHT = 19 + /** Right hue bar selector overflow */ + export const HUEBAR_SELECTOR_OVERFLOW = 20 export const LIGHTGRAY: { r: 200, g: 200, b: 200, a: 255 } export const GRAY: { r: 130, g: 130, b: 130, a: 255 } diff --git a/src/generated/node-raylib.js b/src/generated/node-raylib.js index a4adf36..5b2d816 100644 --- a/src/generated/node-raylib.js +++ b/src/generated/node-raylib.js @@ -134,7 +134,7 @@ function IsWindowState(flag) { raylib.IsWindowState = IsWindowState /** - * Set window configuration state using flags (only PLATFORM_DESKTOP) + * Set window configuration state using flags * * @param {number} flags * @@ -885,20 +885,20 @@ function SetShaderValueMatrix(shader, locIndex, mat) { shader.locs, locIndex, mat.m0, - mat.m1, - mat.m2, - mat.m3, mat.m4, - mat.m5, - mat.m6, - mat.m7, mat.m8, - mat.m9, - mat.m10, - mat.m11, mat.m12, + mat.m1, + mat.m5, + mat.m9, mat.m13, + mat.m2, + mat.m6, + mat.m10, mat.m14, + mat.m3, + mat.m7, + mat.m11, mat.m15 ) } @@ -4782,7 +4782,7 @@ function LoadFont(fileName) { raylib.LoadFont = LoadFont /** - * Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set + * Load font from file with extended parameters * * @param {string} fileName * @param {number} fontSize @@ -4915,7 +4915,7 @@ function UnloadFontData(chars, glyphCount) { raylib.UnloadFontData = UnloadFontData /** - * Unload font from GPU memory (VRAM) + * Unload Font from GPU memory (VRAM) * * @param {Font} font * @@ -6143,20 +6143,20 @@ raylib.LoadModelFromMesh = LoadModelFromMesh function UnloadModel(model) { return r.BindUnloadModel( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6180,20 +6180,20 @@ raylib.UnloadModel = UnloadModel function UnloadModelKeepMeshes(model) { return r.BindUnloadModelKeepMeshes( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6217,20 +6217,20 @@ raylib.UnloadModelKeepMeshes = UnloadModelKeepMeshes function GetModelBoundingBox(model) { return r.BindGetModelBoundingBox( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6257,20 +6257,20 @@ raylib.GetModelBoundingBox = GetModelBoundingBox function DrawModel(model, position, scale, tint) { return r.BindDrawModel( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6307,20 +6307,20 @@ raylib.DrawModel = DrawModel function DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint) { return r.BindDrawModelEx( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6361,20 +6361,20 @@ raylib.DrawModelEx = DrawModelEx function DrawModelWires(model, position, scale, tint) { return r.BindDrawModelWires( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6411,20 +6411,20 @@ raylib.DrawModelWires = DrawModelWires function DrawModelWiresEx(model, position, rotationAxis, rotationAngle, scale, tint) { return r.BindDrawModelWiresEx( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -6980,20 +6980,20 @@ raylib.LoadModelAnimations = LoadModelAnimations function UpdateModelAnimation(model, anim, frame) { return r.BindUpdateModelAnimation( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -7056,20 +7056,20 @@ raylib.UnloadModelAnimations = UnloadModelAnimations function IsModelAnimationValid(model, anim) { return r.BindIsModelAnimationValid( model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -7230,20 +7230,20 @@ function GetRayCollisionModel(ray, model) { ray.direction.y, ray.direction.z, model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, model.transform.m15, model.meshCount, model.materialCount, @@ -7290,20 +7290,20 @@ function GetRayCollisionMesh(ray, mesh, transform) { mesh.vaoId, mesh.vboId, transform.m0, - transform.m1, - transform.m2, - transform.m3, transform.m4, - transform.m5, - transform.m6, - transform.m7, transform.m8, - transform.m9, - transform.m10, - transform.m11, transform.m12, + transform.m1, + transform.m5, + transform.m9, transform.m13, + transform.m2, + transform.m6, + transform.m10, transform.m14, + transform.m3, + transform.m7, + transform.m11, transform.m15 ) } @@ -8299,16 +8299,6 @@ function SetAudioStreamBufferSizeDefault(size) { } raylib.SetAudioStreamBufferSizeDefault = SetAudioStreamBufferSizeDefault -/** - * Easing: EaseLinearNone. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseLinearNone(t, b, c, d) { return r.BindEaseLinearNone( t, @@ -8319,16 +8309,6 @@ function EaseLinearNone(t, b, c, d) { } raylib.EaseLinearNone = EaseLinearNone -/** - * Easing: EaseLinearIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseLinearIn(t, b, c, d) { return r.BindEaseLinearIn( t, @@ -8339,16 +8319,6 @@ function EaseLinearIn(t, b, c, d) { } raylib.EaseLinearIn = EaseLinearIn -/** - * Easing: EaseLinearOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseLinearOut(t, b, c, d) { return r.BindEaseLinearOut( t, @@ -8359,16 +8329,6 @@ function EaseLinearOut(t, b, c, d) { } raylib.EaseLinearOut = EaseLinearOut -/** - * Easing: EaseLinearInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseLinearInOut(t, b, c, d) { return r.BindEaseLinearInOut( t, @@ -8379,16 +8339,6 @@ function EaseLinearInOut(t, b, c, d) { } raylib.EaseLinearInOut = EaseLinearInOut -/** - * Easing: EaseSineIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseSineIn(t, b, c, d) { return r.BindEaseSineIn( t, @@ -8399,16 +8349,6 @@ function EaseSineIn(t, b, c, d) { } raylib.EaseSineIn = EaseSineIn -/** - * Easing: EaseSineOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseSineOut(t, b, c, d) { return r.BindEaseSineOut( t, @@ -8419,16 +8359,6 @@ function EaseSineOut(t, b, c, d) { } raylib.EaseSineOut = EaseSineOut -/** - * Easing: EaseSineInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseSineInOut(t, b, c, d) { return r.BindEaseSineInOut( t, @@ -8439,16 +8369,6 @@ function EaseSineInOut(t, b, c, d) { } raylib.EaseSineInOut = EaseSineInOut -/** - * Easing: EaseCircIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCircIn(t, b, c, d) { return r.BindEaseCircIn( t, @@ -8459,16 +8379,6 @@ function EaseCircIn(t, b, c, d) { } raylib.EaseCircIn = EaseCircIn -/** - * Easing: EaseCircOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCircOut(t, b, c, d) { return r.BindEaseCircOut( t, @@ -8479,16 +8389,6 @@ function EaseCircOut(t, b, c, d) { } raylib.EaseCircOut = EaseCircOut -/** - * Easing: EaseCircInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCircInOut(t, b, c, d) { return r.BindEaseCircInOut( t, @@ -8499,16 +8399,6 @@ function EaseCircInOut(t, b, c, d) { } raylib.EaseCircInOut = EaseCircInOut -/** - * Easing: EaseCubicIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCubicIn(t, b, c, d) { return r.BindEaseCubicIn( t, @@ -8519,16 +8409,6 @@ function EaseCubicIn(t, b, c, d) { } raylib.EaseCubicIn = EaseCubicIn -/** - * Easing: EaseCubicOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCubicOut(t, b, c, d) { return r.BindEaseCubicOut( t, @@ -8539,16 +8419,6 @@ function EaseCubicOut(t, b, c, d) { } raylib.EaseCubicOut = EaseCubicOut -/** - * Easing: EaseCubicInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseCubicInOut(t, b, c, d) { return r.BindEaseCubicInOut( t, @@ -8559,16 +8429,6 @@ function EaseCubicInOut(t, b, c, d) { } raylib.EaseCubicInOut = EaseCubicInOut -/** - * Easing: EaseQuadIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseQuadIn(t, b, c, d) { return r.BindEaseQuadIn( t, @@ -8579,16 +8439,6 @@ function EaseQuadIn(t, b, c, d) { } raylib.EaseQuadIn = EaseQuadIn -/** - * Easing: EaseQuadOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseQuadOut(t, b, c, d) { return r.BindEaseQuadOut( t, @@ -8599,16 +8449,6 @@ function EaseQuadOut(t, b, c, d) { } raylib.EaseQuadOut = EaseQuadOut -/** - * Easing: EaseQuadInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseQuadInOut(t, b, c, d) { return r.BindEaseQuadInOut( t, @@ -8619,16 +8459,6 @@ function EaseQuadInOut(t, b, c, d) { } raylib.EaseQuadInOut = EaseQuadInOut -/** - * Easing: EaseExpoIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseExpoIn(t, b, c, d) { return r.BindEaseExpoIn( t, @@ -8639,16 +8469,6 @@ function EaseExpoIn(t, b, c, d) { } raylib.EaseExpoIn = EaseExpoIn -/** - * Easing: EaseExpoOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseExpoOut(t, b, c, d) { return r.BindEaseExpoOut( t, @@ -8659,16 +8479,6 @@ function EaseExpoOut(t, b, c, d) { } raylib.EaseExpoOut = EaseExpoOut -/** - * Easing: EaseExpoInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseExpoInOut(t, b, c, d) { return r.BindEaseExpoInOut( t, @@ -8679,16 +8489,6 @@ function EaseExpoInOut(t, b, c, d) { } raylib.EaseExpoInOut = EaseExpoInOut -/** - * Easing: EaseBackIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBackIn(t, b, c, d) { return r.BindEaseBackIn( t, @@ -8699,16 +8499,6 @@ function EaseBackIn(t, b, c, d) { } raylib.EaseBackIn = EaseBackIn -/** - * Easing: EaseBackOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBackOut(t, b, c, d) { return r.BindEaseBackOut( t, @@ -8719,16 +8509,6 @@ function EaseBackOut(t, b, c, d) { } raylib.EaseBackOut = EaseBackOut -/** - * Easing: EaseBackInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBackInOut(t, b, c, d) { return r.BindEaseBackInOut( t, @@ -8739,16 +8519,6 @@ function EaseBackInOut(t, b, c, d) { } raylib.EaseBackInOut = EaseBackInOut -/** - * Easing: EaseBounceOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBounceOut(t, b, c, d) { return r.BindEaseBounceOut( t, @@ -8759,16 +8529,6 @@ function EaseBounceOut(t, b, c, d) { } raylib.EaseBounceOut = EaseBounceOut -/** - * Easing: EaseBounceIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBounceIn(t, b, c, d) { return r.BindEaseBounceIn( t, @@ -8779,16 +8539,6 @@ function EaseBounceIn(t, b, c, d) { } raylib.EaseBounceIn = EaseBounceIn -/** - * Easing: EaseBounceInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseBounceInOut(t, b, c, d) { return r.BindEaseBounceInOut( t, @@ -8799,16 +8549,6 @@ function EaseBounceInOut(t, b, c, d) { } raylib.EaseBounceInOut = EaseBounceInOut -/** - * Easing: EaseElasticIn. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseElasticIn(t, b, c, d) { return r.BindEaseElasticIn( t, @@ -8819,16 +8559,6 @@ function EaseElasticIn(t, b, c, d) { } raylib.EaseElasticIn = EaseElasticIn -/** - * Easing: EaseElasticOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseElasticOut(t, b, c, d) { return r.BindEaseElasticOut( t, @@ -8839,16 +8569,6 @@ function EaseElasticOut(t, b, c, d) { } raylib.EaseElasticOut = EaseElasticOut -/** - * Easing: EaseElasticInOut. - * - * @param {number} t - * @param {number} b - * @param {number} c - * @param {number} d - * - * @return {number} The resulting float. - */ function EaseElasticInOut(t, b, c, d) { return r.BindEaseElasticInOut( t, @@ -8859,3870 +8579,6577 @@ function EaseElasticInOut(t, b, c, d) { } raylib.EaseElasticInOut = EaseElasticInOut -/** - * Update camera position for selected mode - * - * @param {Camera} camera - * - * @return {undefined} - */ -function UpdateCamera(camera) { - const obj = r.BindUpdateCamera( - camera.position.x, - camera.position.y, - camera.position.z, - camera.target.x, - camera.target.y, - camera.target.z, - camera.up.x, - camera.up.y, - camera.up.z, - camera.fovy, - camera.projection +function Clamp(value, min, max) { + return r.BindClamp( + value, + min, + max ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - camera[key] = obj[key] - } - } } -raylib.UpdateCamera = UpdateCamera +raylib.Clamp = Clamp -/** - * Convert image data to desired format - * - * @param {Image} image - * @param {number} newFormat - * - * @return {undefined} - */ -function ImageFormat(image, newFormat) { - const obj = r.BindImageFormat( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newFormat +function Lerp(start, end, amount) { + return r.BindLerp( + start, + end, + amount ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageFormat = ImageFormat +raylib.Lerp = Lerp -/** - * Convert image to POT (power-of-two) - * - * @param {Image} image - * @param {Color} fill - * - * @return {undefined} - */ -function ImageToPOT(image, fill) { - const obj = r.BindImageToPOT( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - fill.r, - fill.g, - fill.b, - fill.a +function Normalize(value, start, end) { + return r.BindNormalize( + value, + start, + end ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageToPOT = ImageToPOT +raylib.Normalize = Normalize -/** - * Crop an image to a defined rectangle - * - * @param {Image} image - * @param {Rectangle} crop - * - * @return {undefined} - */ -function ImageCrop(image, crop) { - const obj = r.BindImageCrop( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - crop.x, - crop.y, - crop.width, - crop.height +function Remap(value, inputStart, inputEnd, outputStart, outputEnd) { + return r.BindRemap( + value, + inputStart, + inputEnd, + outputStart, + outputEnd ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageCrop = ImageCrop +raylib.Remap = Remap -/** - * Crop image depending on alpha value - * - * @param {Image} image - * @param {number} threshold - * - * @return {undefined} - */ -function ImageAlphaCrop(image, threshold) { - const obj = r.BindImageAlphaCrop( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - threshold +function Vector2Zero() { + return r.BindVector2Zero() +} +raylib.Vector2Zero = Vector2Zero + +function Vector2One() { + return r.BindVector2One() +} +raylib.Vector2One = Vector2One + +function Vector2Add(v1, v2) { + return r.BindVector2Add( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaCrop = ImageAlphaCrop +raylib.Vector2Add = Vector2Add -/** - * Clear alpha channel to desired color - * - * @param {Image} image - * @param {Color} color - * @param {number} threshold - * - * @return {undefined} - */ -function ImageAlphaClear(image, color, threshold) { - const obj = r.BindImageAlphaClear( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a, - threshold +function Vector2AddValue(v, add) { + return r.BindVector2AddValue( + v.x, + v.y, + add ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaClear = ImageAlphaClear +raylib.Vector2AddValue = Vector2AddValue -/** - * Apply alpha mask to image - * - * @param {Image} image - * @param {Image} alphaMask - * - * @return {undefined} - */ -function ImageAlphaMask(image, alphaMask) { - const obj = r.BindImageAlphaMask( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - alphaMask.data, - alphaMask.width, - alphaMask.height, - alphaMask.mipmaps, - alphaMask.format +function Vector2Subtract(v1, v2) { + return r.BindVector2Subtract( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaMask = ImageAlphaMask +raylib.Vector2Subtract = Vector2Subtract -/** - * Premultiply alpha channel - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageAlphaPremultiply(image) { - const obj = r.BindImageAlphaPremultiply( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2SubtractValue(v, sub) { + return r.BindVector2SubtractValue( + v.x, + v.y, + sub ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageAlphaPremultiply = ImageAlphaPremultiply +raylib.Vector2SubtractValue = Vector2SubtractValue -/** - * Resize image (Bicubic scaling algorithm) - * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight - * - * @return {undefined} - */ -function ImageResize(image, newWidth, newHeight) { - const obj = r.BindImageResize( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight +function Vector2Length(v) { + return r.BindVector2Length( + v.x, + v.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResize = ImageResize +raylib.Vector2Length = Vector2Length -/** - * Resize image (Nearest-Neighbor scaling algorithm) - * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight - * - * @return {undefined} - */ -function ImageResizeNN(image, newWidth, newHeight) { - const obj = r.BindImageResizeNN( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight +function Vector2LengthSqr(v) { + return r.BindVector2LengthSqr( + v.x, + v.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResizeNN = ImageResizeNN +raylib.Vector2LengthSqr = Vector2LengthSqr -/** - * Resize canvas and fill with color - * - * @param {Image} image - * @param {number} newWidth - * @param {number} newHeight - * @param {number} offsetX - * @param {number} offsetY - * @param {Color} fill - * - * @return {undefined} - */ -function ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, fill) { - const obj = r.BindImageResizeCanvas( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - newWidth, - newHeight, - offsetX, - offsetY, - fill.r, - fill.g, - fill.b, - fill.a +function Vector2DotProduct(v1, v2) { + return r.BindVector2DotProduct( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageResizeCanvas = ImageResizeCanvas +raylib.Vector2DotProduct = Vector2DotProduct -/** - * Compute all mipmap levels for a provided image - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageMipmaps(image) { - const obj = r.BindImageMipmaps( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Distance(v1, v2) { + return r.BindVector2Distance( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageMipmaps = ImageMipmaps +raylib.Vector2Distance = Vector2Distance -/** - * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) - * - * @param {Image} image - * @param {number} rBpp - * @param {number} gBpp - * @param {number} bBpp - * @param {number} aBpp - * - * @return {undefined} - */ -function ImageDither(image, rBpp, gBpp, bBpp, aBpp) { - const obj = r.BindImageDither( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - rBpp, - gBpp, - bBpp, - aBpp +function Vector2Angle(v1, v2) { + return r.BindVector2Angle( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageDither = ImageDither +raylib.Vector2Angle = Vector2Angle -/** - * Flip image vertically - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageFlipVertical(image) { - const obj = r.BindImageFlipVertical( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Scale(v, scale) { + return r.BindVector2Scale( + v.x, + v.y, + scale ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageFlipVertical = ImageFlipVertical +raylib.Vector2Scale = Vector2Scale -/** - * Flip image horizontally - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageFlipHorizontal(image) { - const obj = r.BindImageFlipHorizontal( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Multiply(v1, v2) { + return r.BindVector2Multiply( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageFlipHorizontal = ImageFlipHorizontal +raylib.Vector2Multiply = Vector2Multiply -/** - * Rotate image clockwise 90deg - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageRotateCW(image) { - const obj = r.BindImageRotateCW( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Negate(v) { + return r.BindVector2Negate( + v.x, + v.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageRotateCW = ImageRotateCW +raylib.Vector2Negate = Vector2Negate -/** - * Rotate image counter-clockwise 90deg - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageRotateCCW(image) { - const obj = r.BindImageRotateCCW( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Divide(v1, v2) { + return r.BindVector2Divide( + v1.x, + v1.y, + v2.x, + v2.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageRotateCCW = ImageRotateCCW +raylib.Vector2Divide = Vector2Divide -/** - * Modify image color: tint - * - * @param {Image} image - * @param {Color} color - * - * @return {undefined} - */ -function ImageColorTint(image, color) { - const obj = r.BindImageColorTint( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a +function Vector2Normalize(v) { + return r.BindVector2Normalize( + v.x, + v.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorTint = ImageColorTint +raylib.Vector2Normalize = Vector2Normalize -/** - * Modify image color: invert - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageColorInvert(image) { - const obj = r.BindImageColorInvert( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Lerp(v1, v2, amount) { + return r.BindVector2Lerp( + v1.x, + v1.y, + v2.x, + v2.y, + amount ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorInvert = ImageColorInvert +raylib.Vector2Lerp = Vector2Lerp -/** - * Modify image color: grayscale - * - * @param {Image} image - * - * @return {undefined} - */ -function ImageColorGrayscale(image) { - const obj = r.BindImageColorGrayscale( - image.data, - image.width, - image.height, - image.mipmaps, - image.format +function Vector2Reflect(v, normal) { + return r.BindVector2Reflect( + v.x, + v.y, + normal.x, + normal.y ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorGrayscale = ImageColorGrayscale +raylib.Vector2Reflect = Vector2Reflect -/** - * Modify image color: contrast (-100 to 100) - * - * @param {Image} image - * @param {number} contrast - * - * @return {undefined} - */ -function ImageColorContrast(image, contrast) { - const obj = r.BindImageColorContrast( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - contrast +function Vector2Rotate(v, angle) { + return r.BindVector2Rotate( + v.x, + v.y, + angle ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorContrast = ImageColorContrast +raylib.Vector2Rotate = Vector2Rotate -/** - * Modify image color: brightness (-255 to 255) - * - * @param {Image} image - * @param {number} brightness - * - * @return {undefined} - */ -function ImageColorBrightness(image, brightness) { - const obj = r.BindImageColorBrightness( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - brightness +function Vector2MoveTowards(v, target, maxDistance) { + return r.BindVector2MoveTowards( + v.x, + v.y, + target.x, + target.y, + maxDistance ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorBrightness = ImageColorBrightness +raylib.Vector2MoveTowards = Vector2MoveTowards -/** - * Modify image color: replace color - * - * @param {Image} image - * @param {Color} color - * @param {Color} replace - * - * @return {undefined} - */ -function ImageColorReplace(image, color, replace) { - const obj = r.BindImageColorReplace( - image.data, - image.width, - image.height, - image.mipmaps, - image.format, - color.r, - color.g, - color.b, - color.a, - replace.r, - replace.g, - replace.b, - replace.a +function Vector3Zero() { + return r.BindVector3Zero() +} +raylib.Vector3Zero = Vector3Zero + +function Vector3One() { + return r.BindVector3One() +} +raylib.Vector3One = Vector3One + +function Vector3Add(v1, v2) { + return r.BindVector3Add( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - image[key] = obj[key] - } - } } -raylib.ImageColorReplace = ImageColorReplace +raylib.Vector3Add = Vector3Add -/** - * Clear image background with given color - * - * @param {Image} dst - * @param {Color} color - * - * @return {undefined} - */ -function ImageClearBackground(dst, color) { - const obj = r.BindImageClearBackground( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - color.r, - color.g, - color.b, - color.a +function Vector3AddValue(v, add) { + return r.BindVector3AddValue( + v.x, + v.y, + v.z, + add ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageClearBackground = ImageClearBackground +raylib.Vector3AddValue = Vector3AddValue -/** - * Draw pixel within an image - * - * @param {Image} dst - * @param {number} posX - * @param {number} posY - * @param {Color} color - * - * @return {undefined} - */ -function ImageDrawPixel(dst, posX, posY, color) { - const obj = r.BindImageDrawPixel( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - posX, - posY, - color.r, - color.g, - color.b, - color.a +function Vector3Subtract(v1, v2) { + return r.BindVector3Subtract( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawPixel = ImageDrawPixel +raylib.Vector3Subtract = Vector3Subtract -/** - * Draw pixel within an image (Vector version) - * - * @param {Image} dst - * @param {Vector2} position - * @param {Color} color - * - * @return {undefined} - */ -function ImageDrawPixelV(dst, position, color) { - const obj = r.BindImageDrawPixelV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - position.x, - position.y, - color.r, - color.g, - color.b, - color.a +function Vector3SubtractValue(v, sub) { + return r.BindVector3SubtractValue( + v.x, + v.y, + v.z, + sub ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } } -raylib.ImageDrawPixelV = ImageDrawPixelV +raylib.Vector3SubtractValue = Vector3SubtractValue + +function Vector3Scale(v, scalar) { + return r.BindVector3Scale( + v.x, + v.y, + v.z, + scalar + ) +} +raylib.Vector3Scale = Vector3Scale + +function Vector3Multiply(v1, v2) { + return r.BindVector3Multiply( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Multiply = Vector3Multiply + +function Vector3CrossProduct(v1, v2) { + return r.BindVector3CrossProduct( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3CrossProduct = Vector3CrossProduct + +function Vector3Perpendicular(v) { + return r.BindVector3Perpendicular( + v.x, + v.y, + v.z + ) +} +raylib.Vector3Perpendicular = Vector3Perpendicular + +function Vector3Length(v) { + return r.BindVector3Length( + v + ) +} +raylib.Vector3Length = Vector3Length + +function Vector3LengthSqr(v) { + return r.BindVector3LengthSqr( + v + ) +} +raylib.Vector3LengthSqr = Vector3LengthSqr + +function Vector3DotProduct(v1, v2) { + return r.BindVector3DotProduct( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3DotProduct = Vector3DotProduct + +function Vector3Distance(v1, v2) { + return r.BindVector3Distance( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Distance = Vector3Distance + +function Vector3Angle(v1, v2) { + return r.BindVector3Angle( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Angle = Vector3Angle + +function Vector3Negate(v) { + return r.BindVector3Negate( + v.x, + v.y, + v.z + ) +} +raylib.Vector3Negate = Vector3Negate + +function Vector3Divide(v1, v2) { + return r.BindVector3Divide( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Divide = Vector3Divide + +function Vector3Normalize(v) { + return r.BindVector3Normalize( + v.x, + v.y, + v.z + ) +} +raylib.Vector3Normalize = Vector3Normalize + +function Vector3OrthoNormalize(v1, v2) { + return r.BindVector3OrthoNormalize( + v1, + v2 + ) +} +raylib.Vector3OrthoNormalize = Vector3OrthoNormalize + +function Vector3Transform(v, mat) { + return r.BindVector3Transform( + v.x, + v.y, + v.z, + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.Vector3Transform = Vector3Transform + +function Vector3RotateByQuaternion(v, q) { + return r.BindVector3RotateByQuaternion( + v.x, + v.y, + v.z, + q + ) +} +raylib.Vector3RotateByQuaternion = Vector3RotateByQuaternion + +function Vector3Lerp(v1, v2, amount) { + return r.BindVector3Lerp( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z, + amount + ) +} +raylib.Vector3Lerp = Vector3Lerp + +function Vector3Reflect(v, normal) { + return r.BindVector3Reflect( + v.x, + v.y, + v.z, + normal.x, + normal.y, + normal.z + ) +} +raylib.Vector3Reflect = Vector3Reflect + +function Vector3Min(v1, v2) { + return r.BindVector3Min( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Min = Vector3Min + +function Vector3Max(v1, v2) { + return r.BindVector3Max( + v1.x, + v1.y, + v1.z, + v2.x, + v2.y, + v2.z + ) +} +raylib.Vector3Max = Vector3Max + +function Vector3Barycenter(p, a, b, c) { + return r.BindVector3Barycenter( + p.x, + p.y, + p.z, + a.x, + a.y, + a.z, + b.x, + b.y, + b.z, + c.x, + c.y, + c.z + ) +} +raylib.Vector3Barycenter = Vector3Barycenter + +function Vector3Unproject(source, projection, view) { + return r.BindVector3Unproject( + source.x, + source.y, + source.z, + projection.m0, + projection.m4, + projection.m8, + projection.m12, + projection.m1, + projection.m5, + projection.m9, + projection.m13, + projection.m2, + projection.m6, + projection.m10, + projection.m14, + projection.m3, + projection.m7, + projection.m11, + projection.m15, + view.m0, + view.m4, + view.m8, + view.m12, + view.m1, + view.m5, + view.m9, + view.m13, + view.m2, + view.m6, + view.m10, + view.m14, + view.m3, + view.m7, + view.m11, + view.m15 + ) +} +raylib.Vector3Unproject = Vector3Unproject + +function MatrixDeterminant(mat) { + return r.BindMatrixDeterminant( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.MatrixDeterminant = MatrixDeterminant + +function MatrixTrace(mat) { + return r.BindMatrixTrace( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.MatrixTrace = MatrixTrace + +function MatrixTranspose(mat) { + return r.BindMatrixTranspose( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.MatrixTranspose = MatrixTranspose + +function MatrixInvert(mat) { + return r.BindMatrixInvert( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.MatrixInvert = MatrixInvert + +function MatrixNormalize(mat) { + return r.BindMatrixNormalize( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.MatrixNormalize = MatrixNormalize + +function MatrixIdentity() { + return r.BindMatrixIdentity() +} +raylib.MatrixIdentity = MatrixIdentity + +function MatrixAdd(left, right) { + return r.BindMatrixAdd( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} +raylib.MatrixAdd = MatrixAdd + +function MatrixSubtract(left, right) { + return r.BindMatrixSubtract( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} +raylib.MatrixSubtract = MatrixSubtract + +function MatrixMultiply(left, right) { + return r.BindMatrixMultiply( + left.m0, + left.m4, + left.m8, + left.m12, + left.m1, + left.m5, + left.m9, + left.m13, + left.m2, + left.m6, + left.m10, + left.m14, + left.m3, + left.m7, + left.m11, + left.m15, + right.m0, + right.m4, + right.m8, + right.m12, + right.m1, + right.m5, + right.m9, + right.m13, + right.m2, + right.m6, + right.m10, + right.m14, + right.m3, + right.m7, + right.m11, + right.m15 + ) +} +raylib.MatrixMultiply = MatrixMultiply + +function MatrixTranslate(x, y, z) { + return r.BindMatrixTranslate( + x, + y, + z + ) +} +raylib.MatrixTranslate = MatrixTranslate + +function MatrixRotate(axis, angle) { + return r.BindMatrixRotate( + axis.x, + axis.y, + axis.z, + angle + ) +} +raylib.MatrixRotate = MatrixRotate + +function MatrixRotateX(angle) { + return r.BindMatrixRotateX( + angle + ) +} +raylib.MatrixRotateX = MatrixRotateX + +function MatrixRotateY(angle) { + return r.BindMatrixRotateY( + angle + ) +} +raylib.MatrixRotateY = MatrixRotateY + +function MatrixRotateZ(angle) { + return r.BindMatrixRotateZ( + angle + ) +} +raylib.MatrixRotateZ = MatrixRotateZ + +function MatrixRotateXYZ(ang) { + return r.BindMatrixRotateXYZ( + ang.x, + ang.y, + ang.z + ) +} +raylib.MatrixRotateXYZ = MatrixRotateXYZ + +function MatrixRotateZYX(ang) { + return r.BindMatrixRotateZYX( + ang.x, + ang.y, + ang.z + ) +} +raylib.MatrixRotateZYX = MatrixRotateZYX + +function MatrixScale(x, y, z) { + return r.BindMatrixScale( + x, + y, + z + ) +} +raylib.MatrixScale = MatrixScale + +function MatrixFrustum(left, right, bottom, top, near, far) { + return r.BindMatrixFrustum( + left, + right, + bottom, + top, + near, + far + ) +} +raylib.MatrixFrustum = MatrixFrustum + +function MatrixPerspective(fovy, aspect, near, far) { + return r.BindMatrixPerspective( + fovy, + aspect, + near, + far + ) +} +raylib.MatrixPerspective = MatrixPerspective + +function MatrixOrtho(left, right, bottom, top, near, far) { + return r.BindMatrixOrtho( + left, + right, + bottom, + top, + near, + far + ) +} +raylib.MatrixOrtho = MatrixOrtho + +function MatrixLookAt(eye, target, up) { + return r.BindMatrixLookAt( + eye.x, + eye.y, + eye.z, + target.x, + target.y, + target.z, + up.x, + up.y, + up.z + ) +} +raylib.MatrixLookAt = MatrixLookAt + +function QuaternionAdd(q1, q2) { + return r.BindQuaternionAdd( + q1, + q2 + ) +} +raylib.QuaternionAdd = QuaternionAdd + +function QuaternionAddValue(q, add) { + return r.BindQuaternionAddValue( + q, + add + ) +} +raylib.QuaternionAddValue = QuaternionAddValue + +function QuaternionSubtract(q1, q2) { + return r.BindQuaternionSubtract( + q1, + q2 + ) +} +raylib.QuaternionSubtract = QuaternionSubtract + +function QuaternionSubtractValue(q, sub) { + return r.BindQuaternionSubtractValue( + q, + sub + ) +} +raylib.QuaternionSubtractValue = QuaternionSubtractValue + +function QuaternionIdentity() { + return r.BindQuaternionIdentity() +} +raylib.QuaternionIdentity = QuaternionIdentity + +function QuaternionLength(q) { + return r.BindQuaternionLength( + q + ) +} +raylib.QuaternionLength = QuaternionLength + +function QuaternionNormalize(q) { + return r.BindQuaternionNormalize( + q + ) +} +raylib.QuaternionNormalize = QuaternionNormalize + +function QuaternionInvert(q) { + return r.BindQuaternionInvert( + q + ) +} +raylib.QuaternionInvert = QuaternionInvert + +function QuaternionMultiply(q1, q2) { + return r.BindQuaternionMultiply( + q1, + q2 + ) +} +raylib.QuaternionMultiply = QuaternionMultiply + +function QuaternionScale(q, mul) { + return r.BindQuaternionScale( + q, + mul + ) +} +raylib.QuaternionScale = QuaternionScale + +function QuaternionDivide(q1, q2) { + return r.BindQuaternionDivide( + q1, + q2 + ) +} +raylib.QuaternionDivide = QuaternionDivide + +function QuaternionLerp(q1, q2, amount) { + return r.BindQuaternionLerp( + q1, + q2, + amount + ) +} +raylib.QuaternionLerp = QuaternionLerp + +function QuaternionNlerp(q1, q2, amount) { + return r.BindQuaternionNlerp( + q1, + q2, + amount + ) +} +raylib.QuaternionNlerp = QuaternionNlerp + +function QuaternionSlerp(q1, q2, amount) { + return r.BindQuaternionSlerp( + q1, + q2, + amount + ) +} +raylib.QuaternionSlerp = QuaternionSlerp + +function QuaternionFromVector3ToVector3(from, to) { + return r.BindQuaternionFromVector3ToVector3( + from.x, + from.y, + from.z, + to.x, + to.y, + to.z + ) +} +raylib.QuaternionFromVector3ToVector3 = QuaternionFromVector3ToVector3 + +function QuaternionFromMatrix(mat) { + return r.BindQuaternionFromMatrix( + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.QuaternionFromMatrix = QuaternionFromMatrix + +function QuaternionToMatrix(q) { + return r.BindQuaternionToMatrix( + q + ) +} +raylib.QuaternionToMatrix = QuaternionToMatrix + +function QuaternionFromAxisAngle(axis, angle) { + return r.BindQuaternionFromAxisAngle( + axis.x, + axis.y, + axis.z, + angle + ) +} +raylib.QuaternionFromAxisAngle = QuaternionFromAxisAngle + +function QuaternionToAxisAngle(q, outAxis, outAngle) { + return r.BindQuaternionToAxisAngle( + q, + outAxis, + outAngle + ) +} +raylib.QuaternionToAxisAngle = QuaternionToAxisAngle + +function QuaternionFromEuler(pitch, yaw, roll) { + return r.BindQuaternionFromEuler( + pitch, + yaw, + roll + ) +} +raylib.QuaternionFromEuler = QuaternionFromEuler + +function QuaternionToEuler(q) { + return r.BindQuaternionToEuler( + q + ) +} +raylib.QuaternionToEuler = QuaternionToEuler + +function QuaternionTransform(q, mat) { + return r.BindQuaternionTransform( + q, + mat.m0, + mat.m4, + mat.m8, + mat.m12, + mat.m1, + mat.m5, + mat.m9, + mat.m13, + mat.m2, + mat.m6, + mat.m10, + mat.m14, + mat.m3, + mat.m7, + mat.m11, + mat.m15 + ) +} +raylib.QuaternionTransform = QuaternionTransform + +/** + * Enable gui controls (global state) + * + * @return {undefined} + */ +function GuiEnable() { + return r.BindGuiEnable() +} +raylib.GuiEnable = GuiEnable + +/** + * Disable gui controls (global state) + * + * @return {undefined} + */ +function GuiDisable() { + return r.BindGuiDisable() +} +raylib.GuiDisable = GuiDisable + +/** + * Lock gui controls (global state) + * + * @return {undefined} + */ +function GuiLock() { + return r.BindGuiLock() +} +raylib.GuiLock = GuiLock + +/** + * Unlock gui controls (global state) + * + * @return {undefined} + */ +function GuiUnlock() { + return r.BindGuiUnlock() +} +raylib.GuiUnlock = GuiUnlock + +/** + * Check if gui is locked (global state) + * + * @return {boolean} The resulting bool. + */ +function GuiIsLocked() { + return r.BindGuiIsLocked() +} +raylib.GuiIsLocked = GuiIsLocked + +/** + * Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f + * + * @param {number} alpha + * + * @return {undefined} + */ +function GuiFade(alpha) { + return r.BindGuiFade( + alpha + ) +} +raylib.GuiFade = GuiFade + +/** + * Set gui state (global state) + * + * @param {number} state + * + * @return {undefined} + */ +function GuiSetState(state) { + return r.BindGuiSetState( + state + ) +} +raylib.GuiSetState = GuiSetState + +/** + * Get gui state (global state) + * + * @return {number} The resulting int. + */ +function GuiGetState() { + return r.BindGuiGetState() +} +raylib.GuiGetState = GuiGetState + +/** + * Set gui custom font (global state) + * + * @param {Font} font + * + * @return {undefined} + */ +function GuiSetFont(font) { + return r.BindGuiSetFont( + font.baseSize, + font.glyphCount, + font.glyphPadding, + font.texture.id, + font.texture.width, + font.texture.height, + font.texture.mipmaps, + font.texture.format, + font.recs, + font.glyphs + ) +} +raylib.GuiSetFont = GuiSetFont + +/** + * Get gui custom font (global state) + * + * @return {Font} The resulting Font. + */ +function GuiGetFont() { + return r.BindGuiGetFont() +} +raylib.GuiGetFont = GuiGetFont + +/** + * Set one style property + * + * @param {number} control + * @param {number} property + * @param {number} value + * + * @return {undefined} + */ +function GuiSetStyle(control, property, value) { + return r.BindGuiSetStyle( + control, + property, + value + ) +} +raylib.GuiSetStyle = GuiSetStyle + +/** + * Get one style property + * + * @param {number} control + * @param {number} property + * + * @return {number} The resulting int. + */ +function GuiGetStyle(control, property) { + return r.BindGuiGetStyle( + control, + property + ) +} +raylib.GuiGetStyle = GuiGetStyle + +/** + * Window Box control, shows a window that can be closed + * + * @param {Rectangle} bounds + * @param {string} title + * + * @return {boolean} The resulting bool. + */ +function GuiWindowBox(bounds, title) { + return r.BindGuiWindowBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title + ) +} +raylib.GuiWindowBox = GuiWindowBox + +/** + * Group Box control with text name + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {undefined} + */ +function GuiGroupBox(bounds, text) { + return r.BindGuiGroupBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiGroupBox = GuiGroupBox + +/** + * Line separator control, could contain text + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {undefined} + */ +function GuiLine(bounds, text) { + return r.BindGuiLine( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiLine = GuiLine + +/** + * Panel control, useful to group controls + * + * @param {Rectangle} bounds + * + * @return {undefined} + */ +function GuiPanel(bounds) { + return r.BindGuiPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height + ) +} +raylib.GuiPanel = GuiPanel + +/** + * Scroll Panel control + * + * @param {Rectangle} bounds + * @param {Rectangle} content + * @param {number} scroll + * + * @return {Rectangle} The resulting Rectangle. + */ +function GuiScrollPanel(bounds, content, scroll) { + return r.BindGuiScrollPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + content.x, + content.y, + content.width, + content.height, + scroll + ) +} +raylib.GuiScrollPanel = GuiScrollPanel + +/** + * Label control, shows text + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {undefined} + */ +function GuiLabel(bounds, text) { + return r.BindGuiLabel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiLabel = GuiLabel + +/** + * Button control, returns true when clicked + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {boolean} The resulting bool. + */ +function GuiButton(bounds, text) { + return r.BindGuiButton( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiButton = GuiButton + +/** + * Label button control, show true when clicked + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {boolean} The resulting bool. + */ +function GuiLabelButton(bounds, text) { + return r.BindGuiLabelButton( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiLabelButton = GuiLabelButton + +/** + * Toggle Button control, returns true when active + * + * @param {Rectangle} bounds + * @param {string} text + * @param {boolean} active + * + * @return {boolean} The resulting bool. + */ +function GuiToggle(bounds, text, active) { + return r.BindGuiToggle( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active + ) +} +raylib.GuiToggle = GuiToggle + +/** + * Toggle Group control, returns active toggle index + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active + * + * @return {number} The resulting int. + */ +function GuiToggleGroup(bounds, text, active) { + return r.BindGuiToggleGroup( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active + ) +} +raylib.GuiToggleGroup = GuiToggleGroup + +/** + * Check Box control, returns true when active + * + * @param {Rectangle} bounds + * @param {string} text + * @param {boolean} checked + * + * @return {boolean} The resulting bool. + */ +function GuiCheckBox(bounds, text, checked) { + return r.BindGuiCheckBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + checked + ) +} +raylib.GuiCheckBox = GuiCheckBox + +/** + * Combo Box control, returns selected item index + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active + * + * @return {number} The resulting int. + */ +function GuiComboBox(bounds, text, active) { + return r.BindGuiComboBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active + ) +} +raylib.GuiComboBox = GuiComboBox + +/** + * Dropdown Box control, returns selected item + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} active + * @param {boolean} editMode + * + * @return {boolean} The resulting bool. + */ +function GuiDropdownBox(bounds, text, active, editMode) { + return r.BindGuiDropdownBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + active, + editMode + ) +} +raylib.GuiDropdownBox = GuiDropdownBox + +/** + * Spinner control, returns selected value + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {boolean} editMode + * + * @return {boolean} The resulting bool. + */ +function GuiSpinner(bounds, text, value, minValue, maxValue, editMode) { + return r.BindGuiSpinner( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + value, + minValue, + maxValue, + editMode + ) +} +raylib.GuiSpinner = GuiSpinner + +/** + * Value Box control, updates input text with numbers + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {boolean} editMode + * + * @return {boolean} The resulting bool. + */ +function GuiValueBox(bounds, text, value, minValue, maxValue, editMode) { + return r.BindGuiValueBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + value, + minValue, + maxValue, + editMode + ) +} +raylib.GuiValueBox = GuiValueBox + +/** + * Text Box control, updates input text + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} textSize + * @param {boolean} editMode + * + * @return {boolean} The resulting bool. + */ +function GuiTextBox(bounds, text, textSize, editMode) { + return r.BindGuiTextBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + textSize, + editMode + ) +} +raylib.GuiTextBox = GuiTextBox + +/** + * Text Box control with multiple lines + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} textSize + * @param {boolean} editMode + * + * @return {boolean} The resulting bool. + */ +function GuiTextBoxMulti(bounds, text, textSize, editMode) { + return r.BindGuiTextBoxMulti( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + textSize, + editMode + ) +} +raylib.GuiTextBoxMulti = GuiTextBoxMulti + +/** + * Slider control, returns selected value + * + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * + * @return {number} The resulting float. + */ +function GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiSlider( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue + ) +} +raylib.GuiSlider = GuiSlider + +/** + * Slider Bar control, returns selected value + * + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * + * @return {number} The resulting float. + */ +function GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiSliderBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue + ) +} +raylib.GuiSliderBar = GuiSliderBar + +/** + * Progress Bar control, shows current progress value + * + * @param {Rectangle} bounds + * @param {string} textLeft + * @param {string} textRight + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * + * @return {number} The resulting float. + */ +function GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue) { + return r.BindGuiProgressBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + textLeft, + textRight, + value, + minValue, + maxValue + ) +} +raylib.GuiProgressBar = GuiProgressBar + +/** + * Status Bar control, shows info text + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {undefined} + */ +function GuiStatusBar(bounds, text) { + return r.BindGuiStatusBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiStatusBar = GuiStatusBar + +/** + * Dummy control for placeholders + * + * @param {Rectangle} bounds + * @param {string} text + * + * @return {undefined} + */ +function GuiDummyRec(bounds, text) { + return r.BindGuiDummyRec( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text + ) +} +raylib.GuiDummyRec = GuiDummyRec + +/** + * Scroll Bar control + * + * @param {Rectangle} bounds + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * + * @return {number} The resulting int. + */ +function GuiScrollBar(bounds, value, minValue, maxValue) { + return r.BindGuiScrollBar( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + value, + minValue, + maxValue + ) +} +raylib.GuiScrollBar = GuiScrollBar + +/** + * Grid control + * + * @param {Rectangle} bounds + * @param {number} spacing + * @param {number} subdivs + * + * @return {Vector2} The resulting Vector2. + */ +function GuiGrid(bounds, spacing, subdivs) { + return r.BindGuiGrid( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + spacing, + subdivs + ) +} +raylib.GuiGrid = GuiGrid + +/** + * List View control, returns selected list item index + * + * @param {Rectangle} bounds + * @param {string} text + * @param {number} scrollIndex + * @param {number} active + * + * @return {number} The resulting int. + */ +function GuiListView(bounds, text, scrollIndex, active) { + return r.BindGuiListView( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + scrollIndex, + active + ) +} +raylib.GuiListView = GuiListView + +/** + * List View with extended parameters + * + * @param {Rectangle} bounds + * @param {number} text + * @param {number} count + * @param {number} focus + * @param {number} scrollIndex + * @param {number} active + * + * @return {number} The resulting int. + */ +function GuiListViewEx(bounds, text, count, focus, scrollIndex, active) { + return r.BindGuiListViewEx( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + text, + count, + focus, + scrollIndex, + active + ) +} +raylib.GuiListViewEx = GuiListViewEx + +/** + * Message Box control, displays a message + * + * @param {Rectangle} bounds + * @param {string} title + * @param {string} message + * @param {string} buttons + * + * @return {number} The resulting int. + */ +function GuiMessageBox(bounds, title, message, buttons) { + return r.BindGuiMessageBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title, + message, + buttons + ) +} +raylib.GuiMessageBox = GuiMessageBox + +/** + * Text Input Box control, ask for text + * + * @param {Rectangle} bounds + * @param {string} title + * @param {string} message + * @param {string} buttons + * @param {string} text + * + * @return {number} The resulting int. + */ +function GuiTextInputBox(bounds, title, message, buttons, text) { + return r.BindGuiTextInputBox( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + title, + message, + buttons, + text + ) +} +raylib.GuiTextInputBox = GuiTextInputBox + +/** + * Color Picker control (multiple color controls) + * + * @param {Rectangle} bounds + * @param {Color} color + * + * @return {Color} The resulting Color. + */ +function GuiColorPicker(bounds, color) { + return r.BindGuiColorPicker( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + color.r, + color.g, + color.b, + color.a + ) +} +raylib.GuiColorPicker = GuiColorPicker + +/** + * Color Panel control + * + * @param {Rectangle} bounds + * @param {Color} color + * + * @return {Color} The resulting Color. + */ +function GuiColorPanel(bounds, color) { + return r.BindGuiColorPanel( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + color.r, + color.g, + color.b, + color.a + ) +} +raylib.GuiColorPanel = GuiColorPanel + +/** + * Color Bar Alpha control + * + * @param {Rectangle} bounds + * @param {number} alpha + * + * @return {number} The resulting float. + */ +function GuiColorBarAlpha(bounds, alpha) { + return r.BindGuiColorBarAlpha( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + alpha + ) +} +raylib.GuiColorBarAlpha = GuiColorBarAlpha + +/** + * Color Bar Hue control + * + * @param {Rectangle} bounds + * @param {number} value + * + * @return {number} The resulting float. + */ +function GuiColorBarHue(bounds, value) { + return r.BindGuiColorBarHue( + bounds.x, + bounds.y, + bounds.width, + bounds.height, + value + ) +} +raylib.GuiColorBarHue = GuiColorBarHue + +/** + * Load style file over global style variable (.rgs) + * + * @param {string} fileName + * + * @return {undefined} + */ +function GuiLoadStyle(fileName) { + return r.BindGuiLoadStyle( + fileName + ) +} +raylib.GuiLoadStyle = GuiLoadStyle + +/** + * Load style default over global style + * + * @return {undefined} + */ +function GuiLoadStyleDefault() { + return r.BindGuiLoadStyleDefault() +} +raylib.GuiLoadStyleDefault = GuiLoadStyleDefault + +/** + * Get text with icon id prepended (if supported) + * + * @param {number} iconId + * @param {string} text + * + * @return {string} The resulting const char *. + */ +function GuiIconText(iconId, text) { + return r.BindGuiIconText( + iconId, + text + ) +} +raylib.GuiIconText = GuiIconText + +function GuiDrawIcon(iconId, posX, posY, pixelSize, color) { + return r.BindGuiDrawIcon( + iconId, + posX, + posY, + pixelSize, + color.r, + color.g, + color.b, + color.a + ) +} +raylib.GuiDrawIcon = GuiDrawIcon + +/** + * Get full icons data pointer + * + * @return {number} The resulting unsigned int *. + */ +function GuiGetIcons() { + return r.BindGuiGetIcons() +} +raylib.GuiGetIcons = GuiGetIcons + +/** + * Get icon bit data + * + * @param {number} iconId + * + * @return {number} The resulting unsigned int *. + */ +function GuiGetIconData(iconId) { + return r.BindGuiGetIconData( + iconId + ) +} +raylib.GuiGetIconData = GuiGetIconData + +/** + * Set icon bit data + * + * @param {number} iconId + * @param {number} data + * + * @return {undefined} + */ +function GuiSetIconData(iconId, data) { + return r.BindGuiSetIconData( + iconId, + data + ) +} +raylib.GuiSetIconData = GuiSetIconData + +/** + * Set icon pixel value + * + * @param {number} iconId + * @param {number} x + * @param {number} y + * + * @return {undefined} + */ +function GuiSetIconPixel(iconId, x, y) { + return r.BindGuiSetIconPixel( + iconId, + x, + y + ) +} +raylib.GuiSetIconPixel = GuiSetIconPixel + +/** + * Clear icon pixel value + * + * @param {number} iconId + * @param {number} x + * @param {number} y + * + * @return {undefined} + */ +function GuiClearIconPixel(iconId, x, y) { + return r.BindGuiClearIconPixel( + iconId, + x, + y + ) +} +raylib.GuiClearIconPixel = GuiClearIconPixel + +/** + * Check icon pixel value + * + * @param {number} iconId + * @param {number} x + * @param {number} y + * + * @return {boolean} The resulting bool. + */ +function GuiCheckIconPixel(iconId, x, y) { + return r.BindGuiCheckIconPixel( + iconId, + x, + y + ) +} +raylib.GuiCheckIconPixel = GuiCheckIconPixel + +/** + * Update camera position for selected mode + * + * @param {Camera} camera + * + * @return {undefined} + */ +function UpdateCamera(camera) { + const obj = r.BindUpdateCamera( + camera.position.x, + camera.position.y, + camera.position.z, + camera.target.x, + camera.target.y, + camera.target.z, + camera.up.x, + camera.up.y, + camera.up.z, + camera.fovy, + camera.projection + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + camera[key] = obj[key] + } + } +} +raylib.UpdateCamera = UpdateCamera + +/** + * Convert image data to desired format + * + * @param {Image} image + * @param {number} newFormat + * + * @return {undefined} + */ +function ImageFormat(image, newFormat) { + const obj = r.BindImageFormat( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newFormat + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageFormat = ImageFormat + +/** + * Convert image to POT (power-of-two) + * + * @param {Image} image + * @param {Color} fill + * + * @return {undefined} + */ +function ImageToPOT(image, fill) { + const obj = r.BindImageToPOT( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + fill.r, + fill.g, + fill.b, + fill.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageToPOT = ImageToPOT + +/** + * Crop an image to a defined rectangle + * + * @param {Image} image + * @param {Rectangle} crop + * + * @return {undefined} + */ +function ImageCrop(image, crop) { + const obj = r.BindImageCrop( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + crop.x, + crop.y, + crop.width, + crop.height + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageCrop = ImageCrop + +/** + * Crop image depending on alpha value + * + * @param {Image} image + * @param {number} threshold + * + * @return {undefined} + */ +function ImageAlphaCrop(image, threshold) { + const obj = r.BindImageAlphaCrop( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + threshold + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageAlphaCrop = ImageAlphaCrop + +/** + * Clear alpha channel to desired color + * + * @param {Image} image + * @param {Color} color + * @param {number} threshold + * + * @return {undefined} + */ +function ImageAlphaClear(image, color, threshold) { + const obj = r.BindImageAlphaClear( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a, + threshold + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageAlphaClear = ImageAlphaClear + +/** + * Apply alpha mask to image + * + * @param {Image} image + * @param {Image} alphaMask + * + * @return {undefined} + */ +function ImageAlphaMask(image, alphaMask) { + const obj = r.BindImageAlphaMask( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + alphaMask.data, + alphaMask.width, + alphaMask.height, + alphaMask.mipmaps, + alphaMask.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageAlphaMask = ImageAlphaMask + +/** + * Premultiply alpha channel + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageAlphaPremultiply(image) { + const obj = r.BindImageAlphaPremultiply( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageAlphaPremultiply = ImageAlphaPremultiply + +/** + * Resize image (Bicubic scaling algorithm) + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * + * @return {undefined} + */ +function ImageResize(image, newWidth, newHeight) { + const obj = r.BindImageResize( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResize = ImageResize + +/** + * Resize image (Nearest-Neighbor scaling algorithm) + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * + * @return {undefined} + */ +function ImageResizeNN(image, newWidth, newHeight) { + const obj = r.BindImageResizeNN( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResizeNN = ImageResizeNN + +/** + * Resize canvas and fill with color + * + * @param {Image} image + * @param {number} newWidth + * @param {number} newHeight + * @param {number} offsetX + * @param {number} offsetY + * @param {Color} fill + * + * @return {undefined} + */ +function ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, fill) { + const obj = r.BindImageResizeCanvas( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + newWidth, + newHeight, + offsetX, + offsetY, + fill.r, + fill.g, + fill.b, + fill.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageResizeCanvas = ImageResizeCanvas + +/** + * Compute all mipmap levels for a provided image + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageMipmaps(image) { + const obj = r.BindImageMipmaps( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageMipmaps = ImageMipmaps + +/** + * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) + * + * @param {Image} image + * @param {number} rBpp + * @param {number} gBpp + * @param {number} bBpp + * @param {number} aBpp + * + * @return {undefined} + */ +function ImageDither(image, rBpp, gBpp, bBpp, aBpp) { + const obj = r.BindImageDither( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + rBpp, + gBpp, + bBpp, + aBpp + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageDither = ImageDither + +/** + * Flip image vertically + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageFlipVertical(image) { + const obj = r.BindImageFlipVertical( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageFlipVertical = ImageFlipVertical + +/** + * Flip image horizontally + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageFlipHorizontal(image) { + const obj = r.BindImageFlipHorizontal( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageFlipHorizontal = ImageFlipHorizontal + +/** + * Rotate image clockwise 90deg + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageRotateCW(image) { + const obj = r.BindImageRotateCW( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageRotateCW = ImageRotateCW + +/** + * Rotate image counter-clockwise 90deg + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageRotateCCW(image) { + const obj = r.BindImageRotateCCW( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageRotateCCW = ImageRotateCCW + +/** + * Modify image color: tint + * + * @param {Image} image + * @param {Color} color + * + * @return {undefined} + */ +function ImageColorTint(image, color) { + const obj = r.BindImageColorTint( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorTint = ImageColorTint + +/** + * Modify image color: invert + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageColorInvert(image) { + const obj = r.BindImageColorInvert( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorInvert = ImageColorInvert + +/** + * Modify image color: grayscale + * + * @param {Image} image + * + * @return {undefined} + */ +function ImageColorGrayscale(image) { + const obj = r.BindImageColorGrayscale( + image.data, + image.width, + image.height, + image.mipmaps, + image.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorGrayscale = ImageColorGrayscale + +/** + * Modify image color: contrast (-100 to 100) + * + * @param {Image} image + * @param {number} contrast + * + * @return {undefined} + */ +function ImageColorContrast(image, contrast) { + const obj = r.BindImageColorContrast( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + contrast + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorContrast = ImageColorContrast + +/** + * Modify image color: brightness (-255 to 255) + * + * @param {Image} image + * @param {number} brightness + * + * @return {undefined} + */ +function ImageColorBrightness(image, brightness) { + const obj = r.BindImageColorBrightness( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + brightness + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorBrightness = ImageColorBrightness + +/** + * Modify image color: replace color + * + * @param {Image} image + * @param {Color} color + * @param {Color} replace + * + * @return {undefined} + */ +function ImageColorReplace(image, color, replace) { + const obj = r.BindImageColorReplace( + image.data, + image.width, + image.height, + image.mipmaps, + image.format, + color.r, + color.g, + color.b, + color.a, + replace.r, + replace.g, + replace.b, + replace.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + image[key] = obj[key] + } + } +} +raylib.ImageColorReplace = ImageColorReplace + +/** + * Clear image background with given color + * + * @param {Image} dst + * @param {Color} color + * + * @return {undefined} + */ +function ImageClearBackground(dst, color) { + const obj = r.BindImageClearBackground( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageClearBackground = ImageClearBackground + +/** + * Draw pixel within an image + * + * @param {Image} dst + * @param {number} posX + * @param {number} posY + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawPixel(dst, posX, posY, color) { + const obj = r.BindImageDrawPixel( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + posX, + posY, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawPixel = ImageDrawPixel + +/** + * Draw pixel within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} position + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawPixelV(dst, position, color) { + const obj = r.BindImageDrawPixelV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + position.x, + position.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawPixelV = ImageDrawPixelV + +/** + * Draw line within an image + * + * @param {Image} dst + * @param {number} startPosX + * @param {number} startPosY + * @param {number} endPosX + * @param {number} endPosY + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawLine(dst, startPosX, startPosY, endPosX, endPosY, color) { + const obj = r.BindImageDrawLine( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + startPosX, + startPosY, + endPosX, + endPosY, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawLine = ImageDrawLine + +/** + * Draw line within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} start + * @param {Vector2} end + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawLineV(dst, start, end, color) { + const obj = r.BindImageDrawLineV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + start.x, + start.y, + end.x, + end.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawLineV = ImageDrawLineV + +/** + * Draw circle within an image + * + * @param {Image} dst + * @param {number} centerX + * @param {number} centerY + * @param {number} radius + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawCircle(dst, centerX, centerY, radius, color) { + const obj = r.BindImageDrawCircle( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + centerX, + centerY, + radius, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawCircle = ImageDrawCircle + +/** + * Draw circle within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} center + * @param {number} radius + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawCircleV(dst, center, radius, color) { + const obj = r.BindImageDrawCircleV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + center.x, + center.y, + radius, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawCircleV = ImageDrawCircleV + +/** + * Draw rectangle within an image + * + * @param {Image} dst + * @param {number} posX + * @param {number} posY + * @param {number} width + * @param {number} height + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangle(dst, posX, posY, width, height, color) { + const obj = r.BindImageDrawRectangle( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + posX, + posY, + width, + height, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangle = ImageDrawRectangle + +/** + * Draw rectangle within an image (Vector version) + * + * @param {Image} dst + * @param {Vector2} position + * @param {Vector2} size + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleV(dst, position, size, color) { + const obj = r.BindImageDrawRectangleV( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + position.x, + position.y, + size.x, + size.y, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleV = ImageDrawRectangleV + +/** + * Draw rectangle within an image + * + * @param {Image} dst + * @param {Rectangle} rec + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleRec(dst, rec, color) { + const obj = r.BindImageDrawRectangleRec( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + rec.x, + rec.y, + rec.width, + rec.height, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleRec = ImageDrawRectangleRec + +/** + * Draw rectangle lines within an image + * + * @param {Image} dst + * @param {Rectangle} rec + * @param {number} thick + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawRectangleLines(dst, rec, thick, color) { + const obj = r.BindImageDrawRectangleLines( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + rec.x, + rec.y, + rec.width, + rec.height, + thick, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawRectangleLines = ImageDrawRectangleLines + +/** + * Draw a source image within a destination image (tint applied to source) + * + * @param {Image} dst + * @param {Image} src + * @param {Rectangle} srcRec + * @param {Rectangle} dstRec + * @param {Color} tint + * + * @return {undefined} + */ +function ImageDraw(dst, src, srcRec, dstRec, tint) { + const obj = r.BindImageDraw( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + src.data, + src.width, + src.height, + src.mipmaps, + src.format, + srcRec.x, + srcRec.y, + srcRec.width, + srcRec.height, + dstRec.x, + dstRec.y, + dstRec.width, + dstRec.height, + tint.r, + tint.g, + tint.b, + tint.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDraw = ImageDraw + +/** + * Draw text (using default font) within an image (destination) + * + * @param {Image} dst + * @param {string} text + * @param {number} posX + * @param {number} posY + * @param {number} fontSize + * @param {Color} color + * + * @return {undefined} + */ +function ImageDrawText(dst, text, posX, posY, fontSize, color) { + const obj = r.BindImageDrawText( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + text, + posX, + posY, + fontSize, + color.r, + color.g, + color.b, + color.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawText = ImageDrawText + +/** + * Draw text (custom sprite font) within an image (destination) + * + * @param {Image} dst + * @param {Font} font + * @param {string} text + * @param {Vector2} position + * @param {number} fontSize + * @param {number} spacing + * @param {Color} tint + * + * @return {undefined} + */ +function ImageDrawTextEx(dst, font, text, position, fontSize, spacing, tint) { + const obj = r.BindImageDrawTextEx( + dst.data, + dst.width, + dst.height, + dst.mipmaps, + dst.format, + font.baseSize, + font.glyphCount, + font.glyphPadding, + font.texture.id, + font.texture.width, + font.texture.height, + font.texture.mipmaps, + font.texture.format, + font.recs, + font.glyphs, + text, + position.x, + position.y, + fontSize, + spacing, + tint.r, + tint.g, + tint.b, + tint.a + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + dst[key] = obj[key] + } + } +} +raylib.ImageDrawTextEx = ImageDrawTextEx + +/** + * Generate GPU mipmaps for a texture + * + * @param {Texture2D} texture + * + * @return {undefined} + */ +function GenTextureMipmaps(texture) { + const obj = r.BindGenTextureMipmaps( + texture.id, + texture.width, + texture.height, + texture.mipmaps, + texture.format + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + texture[key] = obj[key] + } + } +} +raylib.GenTextureMipmaps = GenTextureMipmaps + +/** + * Upload mesh vertex data in GPU and provide VAO/VBO ids + * + * @param {Mesh} mesh + * @param {boolean} dynamic + * + * @return {undefined} + */ +function UploadMesh(mesh, dynamic) { + const obj = r.BindUploadMesh( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId, + dynamic + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.UploadMesh = UploadMesh + +/** + * Compute mesh tangents + * + * @param {Mesh} mesh + * + * @return {undefined} + */ +function GenMeshTangents(mesh) { + const obj = r.BindGenMeshTangents( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.GenMeshTangents = GenMeshTangents + +/** + * Compute mesh binormals + * + * @param {Mesh} mesh + * + * @return {undefined} + */ +function GenMeshBinormals(mesh) { + const obj = r.BindGenMeshBinormals( + mesh.vertexCount, + mesh.triangleCount, + mesh.vertices, + mesh.texcoords, + mesh.texcoords2, + mesh.normals, + mesh.tangents, + mesh.colors, + mesh.indices, + mesh.animVertices, + mesh.animNormals, + mesh.boneIds, + mesh.boneWeights, + mesh.vaoId, + mesh.vboId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + mesh[key] = obj[key] + } + } +} +raylib.GenMeshBinormals = GenMeshBinormals + +/** + * Set material for a mesh + * + * @param {Model} model + * @param {number} meshId + * @param {number} materialId + * + * @return {undefined} + */ +function SetModelMeshMaterial(model, meshId, materialId) { + const obj = r.BindSetModelMeshMaterial( + model.transform.m0, + model.transform.m4, + model.transform.m8, + model.transform.m12, + model.transform.m1, + model.transform.m5, + model.transform.m9, + model.transform.m13, + model.transform.m2, + model.transform.m6, + model.transform.m10, + model.transform.m14, + model.transform.m3, + model.transform.m7, + model.transform.m11, + model.transform.m15, + model.meshCount, + model.materialCount, + model.meshes, + model.materials, + model.meshMaterial, + model.boneCount, + model.bones, + model.bindPose, + meshId, + materialId + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + model[key] = obj[key] + } + } +} +raylib.SetModelMeshMaterial = SetModelMeshMaterial + +/** + * Convert wave data to desired format + * + * @param {Wave} wave + * @param {number} sampleRate + * @param {number} sampleSize + * @param {number} channels + * + * @return {undefined} + */ +function WaveFormat(wave, sampleRate, sampleSize, channels) { + const obj = r.BindWaveFormat( + wave.frameCount, + wave.sampleRate, + wave.sampleSize, + wave.channels, + wave.data, + sampleRate, + sampleSize, + channels + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + wave[key] = obj[key] + } + } +} +raylib.WaveFormat = WaveFormat + +/** + * Crop a wave to defined samples range + * + * @param {Wave} wave + * @param {number} initSample + * @param {number} finalSample + * + * @return {undefined} + */ +function WaveCrop(wave, initSample, finalSample) { + const obj = r.BindWaveCrop( + wave.frameCount, + wave.sampleRate, + wave.sampleSize, + wave.channels, + wave.data, + initSample, + finalSample + ) + if (typeof obj !== 'undefined') { + for (const key in obj) { + wave[key] = obj[key] + } + } +} +raylib.WaveCrop = WaveCrop + +/** + * Color, 4 components, R8G8B8A8 (32bit) + * + * @param {number} r - Color red value + * @param {number} g - Color green value + * @param {number} b - Color blue value + * @param {number} a - Color alpha value + * + * @return {Color} The new Color. + */ +function Color(r,g,b,a) { + return {r,g,b,a} +} +raylib.Color = Color + +/** + * Vector2, 2 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * + * @return {Vector2} The new Vector2. + */ +function Vector2(x,y) { + return {x,y} +} +raylib.Vector2 = Vector2 + +/** + * Vector3, 3 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * @param {number} z - Vector z component + * + * @return {Vector3} The new Vector3. + */ +function Vector3(x,y,z) { + return {x,y,z} +} +raylib.Vector3 = Vector3 + +/** + * Vector4, 4 components + * + * @param {number} x - Vector x component + * @param {number} y - Vector y component + * @param {number} z - Vector z component + * @param {number} w - Vector w component + * + * @return {Vector4} The new Vector4. + */ +function Vector4(x,y,z,w) { + return {x,y,z,w} +} +raylib.Vector4 = Vector4 + +/** + * Rectangle, 4 components + * + * @param {number} x - Rectangle top-left corner position x + * @param {number} y - Rectangle top-left corner position y + * @param {number} width - Rectangle width + * @param {number} height - Rectangle height + * + * @return {Rectangle} The new Rectangle. + */ +function Rectangle(x,y,width,height) { + return {x,y,width,height} +} +raylib.Rectangle = Rectangle + +/** + * Camera2D, defines position/orientation in 2d space + * + * @param {Vector2} offset - Camera offset (displacement from target) + * @param {Vector2} target - Camera target (rotation and zoom origin) + * @param {number} rotation - Camera rotation in degrees + * @param {number} zoom - Camera zoom (scaling), should be 1.0f by default + * + * @return {Camera2D} The new Camera2D. + */ +function Camera2D(offset,target,rotation,zoom) { + return {offset,target,rotation,zoom} +} +raylib.Camera2D = Camera2D + +/** + * Camera, defines position/orientation in 3d space + * + * @param {Vector3} position - Camera position + * @param {Vector3} target - Camera target it looks-at + * @param {Vector3} up - Camera up vector (rotation over its axis) + * @param {number} fovy - Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + * @param {number} projection - Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + * + * @return {Camera3D} The new Camera3D. + */ +function Camera3D(position,target,up,fovy,projection) { + return {position,target,up,fovy,projection} +} +raylib.Camera3D = Camera3D +raylib.Camera = raylib.Camera3D + +// WRAPPED TYPED SHADER FUNCTIONS + +/** + * Set shader uniform value float + * + * @param {Shader} shader + * @param {number} locIndex + * @param {number} value + * + * @returns {undefined} + */ +function SetShaderFloat(shader, locIndex, value) { + return r.BindSetShaderFloat( + shader.id, + shader.locs, + locIndex, + value + ) +} +raylib.SetShaderFloat = SetShaderFloat + +/** + * Set shader uniform value float + * + * @param {Shader} shader + * @param {number} locIndex + * @param {number} value + * + * @returns {undefined} + */ +function SetShaderInt(shader, locIndex, value) { + return r.BindSetShaderInt( + shader.id, + shader.locs, + locIndex, + value + ) +} +raylib.SetShaderInt = SetShaderInt + +/** + * Set shader uniform value vector2 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector2} value + * + * @returns {undefined} + */ +function SetShaderVec2(shader, locIndex, value) { + return r.BindSetShaderVec2( + shader.id, + shader.locs, + locIndex, + value.x, + value.y + ) +} +raylib.SetShaderVec2 = SetShaderVec2 + +/** + * Set shader uniform value vector3 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector3} value + * + * @returns {undefined} + */ +function SetShaderVec3(shader, locIndex, value) { + return r.BindSetShaderVec3( + shader.id, + shader.locs, + locIndex, + value.x, + value.y, + value.z + ) +} +raylib.SetShaderVec3 = SetShaderVec3 + +/** + * Set shader uniform value vector4 + * + * @param {Shader} shader + * @param {number} locIndex + * @param {Vector4} value + * + * @returns {undefined} + */ +function SetShaderVec4(shader, locIndex, value) { + return r.BindSetShaderVec4( + shader.id, + shader.locs, + locIndex, + value.x, + value.y, + value.z, + value.w + ) +} +raylib.SetShaderVec4 = SetShaderVec4 + +/** + * Set to try enabling V-Sync on GPU + * + * @type {number} + * @constant + */ +raylib.FLAG_VSYNC_HINT = 64 + +/** + * Set to run program in fullscreen + * + * @type {number} + * @constant + */ +raylib.FLAG_FULLSCREEN_MODE = 2 + +/** + * Set to allow resizable window + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_RESIZABLE = 4 + +/** + * Set to disable window decoration (frame and buttons) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_UNDECORATED = 8 + +/** + * Set to hide window + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_HIDDEN = 128 + +/** + * Set to minimize window (iconify) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_MINIMIZED = 512 + +/** + * Set to maximize window (expanded to monitor) + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_MAXIMIZED = 1024 + +/** + * Set to window non focused + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_UNFOCUSED = 2048 + +/** + * Set to window always on top + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_TOPMOST = 4096 + +/** + * Set to allow windows running while minimized + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_ALWAYS_RUN = 256 + +/** + * Set to allow transparent framebuffer + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_TRANSPARENT = 16 + +/** + * Set to support HighDPI + * + * @type {number} + * @constant + */ +raylib.FLAG_WINDOW_HIGHDPI = 8192 + +/** + * Set to try enabling MSAA 4X + * + * @type {number} + * @constant + */ +raylib.FLAG_MSAA_4X_HINT = 32 + +/** + * Set to try enabling interlaced video format (for V3D) + * + * @type {number} + * @constant + */ +raylib.FLAG_INTERLACED_HINT = 65536 + +/** + * Display all logs + * + * @type {number} + * @constant + */ +raylib.LOG_ALL = 0 + +/** + * Trace logging, intended for internal use only + * + * @type {number} + * @constant + */ +raylib.LOG_TRACE = 1 + +/** + * Debug logging, used for internal debugging, it should be disabled on release builds + * + * @type {number} + * @constant + */ +raylib.LOG_DEBUG = 2 + +/** + * Info logging, used for program execution info + * + * @type {number} + * @constant + */ +raylib.LOG_INFO = 3 + +/** + * Warning logging, used on recoverable failures + * + * @type {number} + * @constant + */ +raylib.LOG_WARNING = 4 + +/** + * Error logging, used on unrecoverable failures + * + * @type {number} + * @constant + */ +raylib.LOG_ERROR = 5 + +/** + * Fatal logging, used to abort program: exit(EXIT_FAILURE) + * + * @type {number} + * @constant + */ +raylib.LOG_FATAL = 6 + +/** + * Disable logging + * + * @type {number} + * @constant + */ +raylib.LOG_NONE = 7 + +/** + * Key: NULL, used for no key pressed + * + * @type {number} + * @constant + */ +raylib.KEY_NULL = 0 + +/** + * Key: ' + * + * @type {number} + * @constant + */ +raylib.KEY_APOSTROPHE = 39 + +/** + * Key: , + * + * @type {number} + * @constant + */ +raylib.KEY_COMMA = 44 + +/** + * Key: - + * + * @type {number} + * @constant + */ +raylib.KEY_MINUS = 45 /** - * Draw line within an image + * Key: . * - * @param {Image} dst - * @param {number} startPosX - * @param {number} startPosY - * @param {number} endPosX - * @param {number} endPosY - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_PERIOD = 46 + +/** + * Key: / * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawLine(dst, startPosX, startPosY, endPosX, endPosY, color) { - const obj = r.BindImageDrawLine( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - startPosX, - startPosY, - endPosX, - endPosY, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawLine = ImageDrawLine +raylib.KEY_SLASH = 47 /** - * Draw line within an image (Vector version) + * Key: 0 * - * @param {Image} dst - * @param {Vector2} start - * @param {Vector2} end - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_ZERO = 48 + +/** + * Key: 1 * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawLineV(dst, start, end, color) { - const obj = r.BindImageDrawLineV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - start.x, - start.y, - end.x, - end.y, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawLineV = ImageDrawLineV +raylib.KEY_ONE = 49 /** - * Draw circle within an image + * Key: 2 * - * @param {Image} dst - * @param {number} centerX - * @param {number} centerY - * @param {number} radius - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_TWO = 50 + +/** + * Key: 3 * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawCircle(dst, centerX, centerY, radius, color) { - const obj = r.BindImageDrawCircle( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - centerX, - centerY, - radius, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawCircle = ImageDrawCircle +raylib.KEY_THREE = 51 /** - * Draw circle within an image (Vector version) + * Key: 4 * - * @param {Image} dst - * @param {Vector2} center - * @param {number} radius - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_FOUR = 52 + +/** + * Key: 5 * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawCircleV(dst, center, radius, color) { - const obj = r.BindImageDrawCircleV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - center.x, - center.y, - radius, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawCircleV = ImageDrawCircleV +raylib.KEY_FIVE = 53 /** - * Draw rectangle within an image + * Key: 6 * - * @param {Image} dst - * @param {number} posX - * @param {number} posY - * @param {number} width - * @param {number} height - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_SIX = 54 + +/** + * Key: 7 * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawRectangle(dst, posX, posY, width, height, color) { - const obj = r.BindImageDrawRectangle( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - posX, - posY, - width, - height, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawRectangle = ImageDrawRectangle +raylib.KEY_SEVEN = 55 /** - * Draw rectangle within an image (Vector version) + * Key: 8 * - * @param {Image} dst - * @param {Vector2} position - * @param {Vector2} size - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_EIGHT = 56 + +/** + * Key: 9 * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawRectangleV(dst, position, size, color) { - const obj = r.BindImageDrawRectangleV( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - position.x, - position.y, - size.x, - size.y, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawRectangleV = ImageDrawRectangleV +raylib.KEY_NINE = 57 + +/** + * Key: ; + * + * @type {number} + * @constant + */ +raylib.KEY_SEMICOLON = 59 /** - * Draw rectangle within an image - * - * @param {Image} dst - * @param {Rectangle} rec - * @param {Color} color + * Key: = * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawRectangleRec(dst, rec, color) { - const obj = r.BindImageDrawRectangleRec( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - rec.x, - rec.y, - rec.width, - rec.height, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawRectangleRec = ImageDrawRectangleRec +raylib.KEY_EQUAL = 61 /** - * Draw rectangle lines within an image + * Key: A | a * - * @param {Image} dst - * @param {Rectangle} rec - * @param {number} thick - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_A = 65 + +/** + * Key: B | b * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawRectangleLines(dst, rec, thick, color) { - const obj = r.BindImageDrawRectangleLines( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - rec.x, - rec.y, - rec.width, - rec.height, - thick, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawRectangleLines = ImageDrawRectangleLines +raylib.KEY_B = 66 /** - * Draw a source image within a destination image (tint applied to source) + * Key: C | c * - * @param {Image} dst - * @param {Image} src - * @param {Rectangle} srcRec - * @param {Rectangle} dstRec - * @param {Color} tint + * @type {number} + * @constant + */ +raylib.KEY_C = 67 + +/** + * Key: D | d * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDraw(dst, src, srcRec, dstRec, tint) { - const obj = r.BindImageDraw( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - src.data, - src.width, - src.height, - src.mipmaps, - src.format, - srcRec.x, - srcRec.y, - srcRec.width, - srcRec.height, - dstRec.x, - dstRec.y, - dstRec.width, - dstRec.height, - tint.r, - tint.g, - tint.b, - tint.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDraw = ImageDraw +raylib.KEY_D = 68 /** - * Draw text (using default font) within an image (destination) + * Key: E | e * - * @param {Image} dst - * @param {string} text - * @param {number} posX - * @param {number} posY - * @param {number} fontSize - * @param {Color} color + * @type {number} + * @constant + */ +raylib.KEY_E = 69 + +/** + * Key: F | f * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawText(dst, text, posX, posY, fontSize, color) { - const obj = r.BindImageDrawText( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - text, - posX, - posY, - fontSize, - color.r, - color.g, - color.b, - color.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawText = ImageDrawText +raylib.KEY_F = 70 /** - * Draw text (custom sprite font) within an image (destination) + * Key: G | g * - * @param {Image} dst - * @param {Font} font - * @param {string} text - * @param {Vector2} position - * @param {number} fontSize - * @param {number} spacing - * @param {Color} tint + * @type {number} + * @constant + */ +raylib.KEY_G = 71 + +/** + * Key: H | h * - * @return {undefined} + * @type {number} + * @constant */ -function ImageDrawTextEx(dst, font, text, position, fontSize, spacing, tint) { - const obj = r.BindImageDrawTextEx( - dst.data, - dst.width, - dst.height, - dst.mipmaps, - dst.format, - font.baseSize, - font.glyphCount, - font.glyphPadding, - font.texture.id, - font.texture.width, - font.texture.height, - font.texture.mipmaps, - font.texture.format, - font.recs, - font.glyphs, - text, - position.x, - position.y, - fontSize, - spacing, - tint.r, - tint.g, - tint.b, - tint.a - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - dst[key] = obj[key] - } - } -} -raylib.ImageDrawTextEx = ImageDrawTextEx +raylib.KEY_H = 72 /** - * Generate GPU mipmaps for a texture + * Key: I | i * - * @param {Texture2D} texture + * @type {number} + * @constant + */ +raylib.KEY_I = 73 + +/** + * Key: J | j * - * @return {undefined} + * @type {number} + * @constant */ -function GenTextureMipmaps(texture) { - const obj = r.BindGenTextureMipmaps( - texture.id, - texture.width, - texture.height, - texture.mipmaps, - texture.format - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - texture[key] = obj[key] - } - } -} -raylib.GenTextureMipmaps = GenTextureMipmaps +raylib.KEY_J = 74 + +/** + * Key: K | k + * + * @type {number} + * @constant + */ +raylib.KEY_K = 75 /** - * Upload mesh vertex data in GPU and provide VAO/VBO ids - * - * @param {Mesh} mesh - * @param {boolean} dynamic + * Key: L | l * - * @return {undefined} + * @type {number} + * @constant */ -function UploadMesh(mesh, dynamic) { - const obj = r.BindUploadMesh( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId, - dynamic - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - mesh[key] = obj[key] - } - } -} -raylib.UploadMesh = UploadMesh +raylib.KEY_L = 76 /** - * Compute mesh tangents + * Key: M | m * - * @param {Mesh} mesh + * @type {number} + * @constant + */ +raylib.KEY_M = 77 + +/** + * Key: N | n * - * @return {undefined} + * @type {number} + * @constant */ -function GenMeshTangents(mesh) { - const obj = r.BindGenMeshTangents( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - mesh[key] = obj[key] - } - } -} -raylib.GenMeshTangents = GenMeshTangents +raylib.KEY_N = 78 /** - * Compute mesh binormals + * Key: O | o * - * @param {Mesh} mesh + * @type {number} + * @constant + */ +raylib.KEY_O = 79 + +/** + * Key: P | p * - * @return {undefined} + * @type {number} + * @constant */ -function GenMeshBinormals(mesh) { - const obj = r.BindGenMeshBinormals( - mesh.vertexCount, - mesh.triangleCount, - mesh.vertices, - mesh.texcoords, - mesh.texcoords2, - mesh.normals, - mesh.tangents, - mesh.colors, - mesh.indices, - mesh.animVertices, - mesh.animNormals, - mesh.boneIds, - mesh.boneWeights, - mesh.vaoId, - mesh.vboId - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - mesh[key] = obj[key] - } - } -} -raylib.GenMeshBinormals = GenMeshBinormals +raylib.KEY_P = 80 /** - * Set material for a mesh + * Key: Q | q * - * @param {Model} model - * @param {number} meshId - * @param {number} materialId + * @type {number} + * @constant + */ +raylib.KEY_Q = 81 + +/** + * Key: R | r * - * @return {undefined} + * @type {number} + * @constant */ -function SetModelMeshMaterial(model, meshId, materialId) { - const obj = r.BindSetModelMeshMaterial( - model.transform.m0, - model.transform.m1, - model.transform.m2, - model.transform.m3, - model.transform.m4, - model.transform.m5, - model.transform.m6, - model.transform.m7, - model.transform.m8, - model.transform.m9, - model.transform.m10, - model.transform.m11, - model.transform.m12, - model.transform.m13, - model.transform.m14, - model.transform.m15, - model.meshCount, - model.materialCount, - model.meshes, - model.materials, - model.meshMaterial, - model.boneCount, - model.bones, - model.bindPose, - meshId, - materialId - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - model[key] = obj[key] - } - } -} -raylib.SetModelMeshMaterial = SetModelMeshMaterial +raylib.KEY_R = 82 /** - * Convert wave data to desired format + * Key: S | s * - * @param {Wave} wave - * @param {number} sampleRate - * @param {number} sampleSize - * @param {number} channels + * @type {number} + * @constant + */ +raylib.KEY_S = 83 + +/** + * Key: T | t * - * @return {undefined} + * @type {number} + * @constant */ -function WaveFormat(wave, sampleRate, sampleSize, channels) { - const obj = r.BindWaveFormat( - wave.frameCount, - wave.sampleRate, - wave.sampleSize, - wave.channels, - wave.data, - sampleRate, - sampleSize, - channels - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - wave[key] = obj[key] - } - } -} -raylib.WaveFormat = WaveFormat +raylib.KEY_T = 84 /** - * Crop a wave to defined samples range + * Key: U | u * - * @param {Wave} wave - * @param {number} initSample - * @param {number} finalSample + * @type {number} + * @constant + */ +raylib.KEY_U = 85 + +/** + * Key: V | v * - * @return {undefined} + * @type {number} + * @constant */ -function WaveCrop(wave, initSample, finalSample) { - const obj = r.BindWaveCrop( - wave.frameCount, - wave.sampleRate, - wave.sampleSize, - wave.channels, - wave.data, - initSample, - finalSample - ) - if (typeof obj !== 'undefined') { - for (const key in obj) { - wave[key] = obj[key] - } - } -} -raylib.WaveCrop = WaveCrop +raylib.KEY_V = 86 /** - * Color, 4 components, R8G8B8A8 (32bit) + * Key: W | w * - * @param {number} r - Color red value - * @param {number} g - Color green value - * @param {number} b - Color blue value - * @param {number} a - Color alpha value + * @type {number} + * @constant + */ +raylib.KEY_W = 87 + +/** + * Key: X | x * - * @return {Color} The new Color. + * @type {number} + * @constant */ -function Color(r,g,b,a) { - return {r,g,b,a} -} -raylib.Color = Color +raylib.KEY_X = 88 /** - * Vector2, 2 components - * - * @param {number} x - Vector x component - * @param {number} y - Vector y component + * Key: Y | y * - * @return {Vector2} The new Vector2. + * @type {number} + * @constant */ -function Vector2(x,y) { - return {x,y} -} -raylib.Vector2 = Vector2 +raylib.KEY_Y = 89 /** - * Vector3, 3 components - * - * @param {number} x - Vector x component - * @param {number} y - Vector y component - * @param {number} z - Vector z component + * Key: Z | z * - * @return {Vector3} The new Vector3. + * @type {number} + * @constant */ -function Vector3(x,y,z) { - return {x,y,z} -} -raylib.Vector3 = Vector3 +raylib.KEY_Z = 90 /** - * Vector4, 4 components - * - * @param {number} x - Vector x component - * @param {number} y - Vector y component - * @param {number} z - Vector z component - * @param {number} w - Vector w component + * Key: [ * - * @return {Vector4} The new Vector4. + * @type {number} + * @constant */ -function Vector4(x,y,z,w) { - return {x,y,z,w} -} -raylib.Vector4 = Vector4 +raylib.KEY_LEFT_BRACKET = 91 /** - * Rectangle, 4 components - * - * @param {number} x - Rectangle top-left corner position x - * @param {number} y - Rectangle top-left corner position y - * @param {number} width - Rectangle width - * @param {number} height - Rectangle height + * Key: '\' * - * @return {Rectangle} The new Rectangle. + * @type {number} + * @constant */ -function Rectangle(x,y,width,height) { - return {x,y,width,height} -} -raylib.Rectangle = Rectangle +raylib.KEY_BACKSLASH = 92 /** - * Camera2D, defines position/orientation in 2d space - * - * @param {Vector2} offset - Camera offset (displacement from target) - * @param {Vector2} target - Camera target (rotation and zoom origin) - * @param {number} rotation - Camera rotation in degrees - * @param {number} zoom - Camera zoom (scaling), should be 1.0f by default + * Key: ] * - * @return {Camera2D} The new Camera2D. + * @type {number} + * @constant */ -function Camera2D(offset,target,rotation,zoom) { - return {offset,target,rotation,zoom} -} -raylib.Camera2D = Camera2D +raylib.KEY_RIGHT_BRACKET = 93 /** - * Camera, defines position/orientation in 3d space - * - * @param {Vector3} position - Camera position - * @param {Vector3} target - Camera target it looks-at - * @param {Vector3} up - Camera up vector (rotation over its axis) - * @param {number} fovy - Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - * @param {number} projection - Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + * Key: ` * - * @return {Camera3D} The new Camera3D. + * @type {number} + * @constant */ -function Camera3D(position,target,up,fovy,projection) { - return {position,target,up,fovy,projection} -} -raylib.Camera3D = Camera3D -raylib.Camera = raylib.Camera3D - -// WRAPPED TYPED SHADER FUNCTIONS +raylib.KEY_GRAVE = 96 /** - * Set shader uniform value float - * - * @param {Shader} shader - * @param {number} locIndex - * @param {number} value - * - * @returns {undefined} + * Key: Space + * + * @type {number} + * @constant */ -function SetShaderFloat(shader, locIndex, value) { - return r.BindSetShaderFloat( - shader.id, - shader.locs, - locIndex, - value - ) -} -raylib.SetShaderFloat = SetShaderFloat +raylib.KEY_SPACE = 32 /** - * Set shader uniform value float - * - * @param {Shader} shader - * @param {number} locIndex - * @param {number} value - * - * @returns {undefined} + * Key: Esc + * + * @type {number} + * @constant */ -function SetShaderInt(shader, locIndex, value) { - return r.BindSetShaderInt( - shader.id, - shader.locs, - locIndex, - value - ) -} -raylib.SetShaderInt = SetShaderInt +raylib.KEY_ESCAPE = 256 /** - * Set shader uniform value vector2 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector2} value - * - * @returns {undefined} + * Key: Enter + * + * @type {number} + * @constant */ -function SetShaderVec2(shader, locIndex, value) { - return r.BindSetShaderVec2( - shader.id, - shader.locs, - locIndex, - value.x, - value.y - ) -} -raylib.SetShaderVec2 = SetShaderVec2 +raylib.KEY_ENTER = 257 /** - * Set shader uniform value vector3 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector3} value - * - * @returns {undefined} + * Key: Tab + * + * @type {number} + * @constant */ -function SetShaderVec3(shader, locIndex, value) { - return r.BindSetShaderVec3( - shader.id, - shader.locs, - locIndex, - value.x, - value.y, - value.z - ) -} -raylib.SetShaderVec3 = SetShaderVec3 +raylib.KEY_TAB = 258 /** - * Set shader uniform value vector4 - * - * @param {Shader} shader - * @param {number} locIndex - * @param {Vector4} value - * - * @returns {undefined} + * Key: Backspace + * + * @type {number} + * @constant */ -function SetShaderVec4(shader, locIndex, value) { - return r.BindSetShaderVec4( - shader.id, - shader.locs, - locIndex, - value.x, - value.y, - value.z, - value.w - ) -} -raylib.SetShaderVec4 = SetShaderVec4 +raylib.KEY_BACKSPACE = 259 /** - * Set to try enabling V-Sync on GPU + * Key: Ins * * @type {number} * @constant */ -raylib.FLAG_VSYNC_HINT = 64 +raylib.KEY_INSERT = 260 /** - * Set to run program in fullscreen + * Key: Del * * @type {number} * @constant */ -raylib.FLAG_FULLSCREEN_MODE = 2 +raylib.KEY_DELETE = 261 /** - * Set to allow resizable window + * Key: Cursor right * * @type {number} * @constant */ -raylib.FLAG_WINDOW_RESIZABLE = 4 +raylib.KEY_RIGHT = 262 /** - * Set to disable window decoration (frame and buttons) + * Key: Cursor left * * @type {number} * @constant */ -raylib.FLAG_WINDOW_UNDECORATED = 8 +raylib.KEY_LEFT = 263 /** - * Set to hide window + * Key: Cursor down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_HIDDEN = 128 +raylib.KEY_DOWN = 264 /** - * Set to minimize window (iconify) + * Key: Cursor up * * @type {number} * @constant */ -raylib.FLAG_WINDOW_MINIMIZED = 512 +raylib.KEY_UP = 265 /** - * Set to maximize window (expanded to monitor) + * Key: Page up * * @type {number} * @constant */ -raylib.FLAG_WINDOW_MAXIMIZED = 1024 +raylib.KEY_PAGE_UP = 266 /** - * Set to window non focused + * Key: Page down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_UNFOCUSED = 2048 +raylib.KEY_PAGE_DOWN = 267 /** - * Set to window always on top + * Key: Home * * @type {number} * @constant */ -raylib.FLAG_WINDOW_TOPMOST = 4096 +raylib.KEY_HOME = 268 /** - * Set to allow windows running while minimized + * Key: End * * @type {number} * @constant */ -raylib.FLAG_WINDOW_ALWAYS_RUN = 256 +raylib.KEY_END = 269 /** - * Set to allow transparent framebuffer + * Key: Caps lock * * @type {number} * @constant */ -raylib.FLAG_WINDOW_TRANSPARENT = 16 +raylib.KEY_CAPS_LOCK = 280 /** - * Set to support HighDPI + * Key: Scroll down * * @type {number} * @constant */ -raylib.FLAG_WINDOW_HIGHDPI = 8192 +raylib.KEY_SCROLL_LOCK = 281 /** - * Set to try enabling MSAA 4X + * Key: Num lock * * @type {number} * @constant */ -raylib.FLAG_MSAA_4X_HINT = 32 +raylib.KEY_NUM_LOCK = 282 /** - * Set to try enabling interlaced video format (for V3D) + * Key: Print screen * * @type {number} * @constant */ -raylib.FLAG_INTERLACED_HINT = 65536 +raylib.KEY_PRINT_SCREEN = 283 /** - * Display all logs + * Key: Pause * * @type {number} * @constant */ -raylib.LOG_ALL = 0 +raylib.KEY_PAUSE = 284 /** - * Trace logging, intended for internal use only + * Key: F1 * * @type {number} * @constant */ -raylib.LOG_TRACE = 1 +raylib.KEY_F1 = 290 /** - * Debug logging, used for internal debugging, it should be disabled on release builds + * Key: F2 * * @type {number} * @constant */ -raylib.LOG_DEBUG = 2 +raylib.KEY_F2 = 291 /** - * Info logging, used for program execution info + * Key: F3 * * @type {number} * @constant */ -raylib.LOG_INFO = 3 +raylib.KEY_F3 = 292 /** - * Warning logging, used on recoverable failures + * Key: F4 * * @type {number} * @constant */ -raylib.LOG_WARNING = 4 +raylib.KEY_F4 = 293 /** - * Error logging, used on unrecoverable failures + * Key: F5 * * @type {number} * @constant */ -raylib.LOG_ERROR = 5 +raylib.KEY_F5 = 294 /** - * Fatal logging, used to abort program: exit(EXIT_FAILURE) + * Key: F6 * * @type {number} * @constant */ -raylib.LOG_FATAL = 6 +raylib.KEY_F6 = 295 /** - * Disable logging + * Key: F7 * * @type {number} * @constant */ -raylib.LOG_NONE = 7 +raylib.KEY_F7 = 296 /** - * Key: NULL, used for no key pressed + * Key: F8 * * @type {number} * @constant */ -raylib.KEY_NULL = 0 +raylib.KEY_F8 = 297 /** - * Key: ' + * Key: F9 * * @type {number} * @constant */ -raylib.KEY_APOSTROPHE = 39 +raylib.KEY_F9 = 298 /** - * Key: , + * Key: F10 * * @type {number} * @constant */ -raylib.KEY_COMMA = 44 +raylib.KEY_F10 = 299 /** - * Key: - + * Key: F11 * * @type {number} * @constant */ -raylib.KEY_MINUS = 45 +raylib.KEY_F11 = 300 /** - * Key: . + * Key: F12 * * @type {number} * @constant */ -raylib.KEY_PERIOD = 46 +raylib.KEY_F12 = 301 /** - * Key: / + * Key: Shift left * * @type {number} * @constant */ -raylib.KEY_SLASH = 47 +raylib.KEY_LEFT_SHIFT = 340 /** - * Key: 0 + * Key: Control left * * @type {number} * @constant */ -raylib.KEY_ZERO = 48 +raylib.KEY_LEFT_CONTROL = 341 /** - * Key: 1 + * Key: Alt left * * @type {number} * @constant */ -raylib.KEY_ONE = 49 +raylib.KEY_LEFT_ALT = 342 /** - * Key: 2 + * Key: Super left * * @type {number} * @constant */ -raylib.KEY_TWO = 50 +raylib.KEY_LEFT_SUPER = 343 /** - * Key: 3 + * Key: Shift right * * @type {number} * @constant */ -raylib.KEY_THREE = 51 +raylib.KEY_RIGHT_SHIFT = 344 /** - * Key: 4 + * Key: Control right * * @type {number} * @constant */ -raylib.KEY_FOUR = 52 +raylib.KEY_RIGHT_CONTROL = 345 /** - * Key: 5 + * Key: Alt right * * @type {number} * @constant */ -raylib.KEY_FIVE = 53 +raylib.KEY_RIGHT_ALT = 346 /** - * Key: 6 + * Key: Super right * * @type {number} * @constant */ -raylib.KEY_SIX = 54 +raylib.KEY_RIGHT_SUPER = 347 /** - * Key: 7 + * Key: KB menu * * @type {number} * @constant */ -raylib.KEY_SEVEN = 55 +raylib.KEY_KB_MENU = 348 /** - * Key: 8 + * Key: Keypad 0 * * @type {number} * @constant */ -raylib.KEY_EIGHT = 56 +raylib.KEY_KP_0 = 320 /** - * Key: 9 + * Key: Keypad 1 * * @type {number} * @constant */ -raylib.KEY_NINE = 57 +raylib.KEY_KP_1 = 321 /** - * Key: ; + * Key: Keypad 2 * * @type {number} * @constant */ -raylib.KEY_SEMICOLON = 59 +raylib.KEY_KP_2 = 322 /** - * Key: = + * Key: Keypad 3 * * @type {number} * @constant */ -raylib.KEY_EQUAL = 61 +raylib.KEY_KP_3 = 323 /** - * Key: A | a + * Key: Keypad 4 * * @type {number} * @constant */ -raylib.KEY_A = 65 +raylib.KEY_KP_4 = 324 /** - * Key: B | b + * Key: Keypad 5 * * @type {number} * @constant */ -raylib.KEY_B = 66 +raylib.KEY_KP_5 = 325 /** - * Key: C | c + * Key: Keypad 6 * * @type {number} * @constant */ -raylib.KEY_C = 67 +raylib.KEY_KP_6 = 326 /** - * Key: D | d + * Key: Keypad 7 * * @type {number} * @constant */ -raylib.KEY_D = 68 +raylib.KEY_KP_7 = 327 /** - * Key: E | e + * Key: Keypad 8 * * @type {number} * @constant */ -raylib.KEY_E = 69 +raylib.KEY_KP_8 = 328 /** - * Key: F | f + * Key: Keypad 9 * * @type {number} * @constant */ -raylib.KEY_F = 70 +raylib.KEY_KP_9 = 329 /** - * Key: G | g + * Key: Keypad . * * @type {number} * @constant */ -raylib.KEY_G = 71 +raylib.KEY_KP_DECIMAL = 330 /** - * Key: H | h + * Key: Keypad / * * @type {number} * @constant */ -raylib.KEY_H = 72 +raylib.KEY_KP_DIVIDE = 331 /** - * Key: I | i + * Key: Keypad * * * @type {number} * @constant */ -raylib.KEY_I = 73 +raylib.KEY_KP_MULTIPLY = 332 /** - * Key: J | j + * Key: Keypad - * * @type {number} * @constant */ -raylib.KEY_J = 74 +raylib.KEY_KP_SUBTRACT = 333 /** - * Key: K | k + * Key: Keypad + * * @type {number} * @constant */ -raylib.KEY_K = 75 +raylib.KEY_KP_ADD = 334 /** - * Key: L | l + * Key: Keypad Enter * * @type {number} * @constant */ -raylib.KEY_L = 76 +raylib.KEY_KP_ENTER = 335 /** - * Key: M | m + * Key: Keypad = * * @type {number} * @constant */ -raylib.KEY_M = 77 +raylib.KEY_KP_EQUAL = 336 /** - * Key: N | n + * Key: Android back button * * @type {number} * @constant */ -raylib.KEY_N = 78 +raylib.KEY_BACK = 4 /** - * Key: O | o + * Key: Android menu button * * @type {number} * @constant */ -raylib.KEY_O = 79 +raylib.KEY_MENU = 82 /** - * Key: P | p + * Key: Android volume up button * * @type {number} * @constant */ -raylib.KEY_P = 80 +raylib.KEY_VOLUME_UP = 24 /** - * Key: Q | q + * Key: Android volume down button * * @type {number} * @constant */ -raylib.KEY_Q = 81 +raylib.KEY_VOLUME_DOWN = 25 /** - * Key: R | r + * Mouse button left * * @type {number} * @constant */ -raylib.KEY_R = 82 +raylib.MOUSE_BUTTON_LEFT = 0 /** - * Key: S | s + * Mouse button right * * @type {number} * @constant */ -raylib.KEY_S = 83 +raylib.MOUSE_BUTTON_RIGHT = 1 /** - * Key: T | t + * Mouse button middle (pressed wheel) * * @type {number} * @constant */ -raylib.KEY_T = 84 +raylib.MOUSE_BUTTON_MIDDLE = 2 /** - * Key: U | u + * Mouse button side (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_U = 85 +raylib.MOUSE_BUTTON_SIDE = 3 /** - * Key: V | v + * Mouse button extra (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_V = 86 +raylib.MOUSE_BUTTON_EXTRA = 4 /** - * Key: W | w + * Mouse button fordward (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_W = 87 +raylib.MOUSE_BUTTON_FORWARD = 5 /** - * Key: X | x + * Mouse button back (advanced mouse device) * * @type {number} * @constant */ -raylib.KEY_X = 88 +raylib.MOUSE_BUTTON_BACK = 6 /** - * Key: Y | y + * Default pointer shape * * @type {number} * @constant */ -raylib.KEY_Y = 89 +raylib.MOUSE_CURSOR_DEFAULT = 0 /** - * Key: Z | z + * Arrow shape * * @type {number} * @constant */ -raylib.KEY_Z = 90 +raylib.MOUSE_CURSOR_ARROW = 1 /** - * Key: [ + * Text writing cursor shape * * @type {number} * @constant */ -raylib.KEY_LEFT_BRACKET = 91 +raylib.MOUSE_CURSOR_IBEAM = 2 /** - * Key: '\' + * Cross shape * * @type {number} * @constant */ -raylib.KEY_BACKSLASH = 92 +raylib.MOUSE_CURSOR_CROSSHAIR = 3 /** - * Key: ] + * Pointing hand cursor * * @type {number} * @constant */ -raylib.KEY_RIGHT_BRACKET = 93 +raylib.MOUSE_CURSOR_POINTING_HAND = 4 /** - * Key: ` + * Horizontal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_GRAVE = 96 +raylib.MOUSE_CURSOR_RESIZE_EW = 5 /** - * Key: Space + * Vertical resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_SPACE = 32 +raylib.MOUSE_CURSOR_RESIZE_NS = 6 /** - * Key: Esc + * Top-left to bottom-right diagonal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_ESCAPE = 256 +raylib.MOUSE_CURSOR_RESIZE_NWSE = 7 /** - * Key: Enter + * The top-right to bottom-left diagonal resize/move arrow shape * * @type {number} * @constant */ -raylib.KEY_ENTER = 257 +raylib.MOUSE_CURSOR_RESIZE_NESW = 8 /** - * Key: Tab + * The omni-directional resize/move cursor shape * * @type {number} * @constant */ -raylib.KEY_TAB = 258 +raylib.MOUSE_CURSOR_RESIZE_ALL = 9 /** - * Key: Backspace + * The operation-not-allowed shape * * @type {number} * @constant */ -raylib.KEY_BACKSPACE = 259 +raylib.MOUSE_CURSOR_NOT_ALLOWED = 10 /** - * Key: Ins + * Unknown button, just for error checking * * @type {number} * @constant */ -raylib.KEY_INSERT = 260 +raylib.GAMEPAD_BUTTON_UNKNOWN = 0 /** - * Key: Del + * Gamepad left DPAD up button * * @type {number} * @constant */ -raylib.KEY_DELETE = 261 +raylib.GAMEPAD_BUTTON_LEFT_FACE_UP = 1 /** - * Key: Cursor right + * Gamepad left DPAD right button * * @type {number} * @constant */ -raylib.KEY_RIGHT = 262 +raylib.GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 /** - * Key: Cursor left + * Gamepad left DPAD down button * * @type {number} * @constant */ -raylib.KEY_LEFT = 263 +raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 /** - * Key: Cursor down + * Gamepad left DPAD left button * * @type {number} * @constant */ -raylib.KEY_DOWN = 264 +raylib.GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 /** - * Key: Cursor up + * Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) * * @type {number} * @constant */ -raylib.KEY_UP = 265 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 /** - * Key: Page up + * Gamepad right button right (i.e. PS3: Square, Xbox: X) * * @type {number} * @constant */ -raylib.KEY_PAGE_UP = 266 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 /** - * Key: Page down + * Gamepad right button down (i.e. PS3: Cross, Xbox: A) * * @type {number} * @constant */ -raylib.KEY_PAGE_DOWN = 267 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 /** - * Key: Home + * Gamepad right button left (i.e. PS3: Circle, Xbox: B) * * @type {number} * @constant */ -raylib.KEY_HOME = 268 +raylib.GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 /** - * Key: End + * Gamepad top/back trigger left (first), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_END = 269 +raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 /** - * Key: Caps lock + * Gamepad top/back trigger left (second), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_CAPS_LOCK = 280 +raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 /** - * Key: Scroll down + * Gamepad top/back trigger right (one), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_SCROLL_LOCK = 281 +raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 /** - * Key: Num lock + * Gamepad top/back trigger right (second), it could be a trailing button * * @type {number} * @constant */ -raylib.KEY_NUM_LOCK = 282 +raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 /** - * Key: Print screen + * Gamepad center buttons, left one (i.e. PS3: Select) * * @type {number} * @constant */ -raylib.KEY_PRINT_SCREEN = 283 +raylib.GAMEPAD_BUTTON_MIDDLE_LEFT = 13 /** - * Key: Pause + * Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) * * @type {number} * @constant */ -raylib.KEY_PAUSE = 284 +raylib.GAMEPAD_BUTTON_MIDDLE = 14 /** - * Key: F1 + * Gamepad center buttons, right one (i.e. PS3: Start) * * @type {number} * @constant */ -raylib.KEY_F1 = 290 +raylib.GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 /** - * Key: F2 + * Gamepad joystick pressed button left * * @type {number} * @constant */ -raylib.KEY_F2 = 291 +raylib.GAMEPAD_BUTTON_LEFT_THUMB = 16 /** - * Key: F3 + * Gamepad joystick pressed button right * * @type {number} * @constant */ -raylib.KEY_F3 = 292 +raylib.GAMEPAD_BUTTON_RIGHT_THUMB = 17 /** - * Key: F4 + * Gamepad left stick X axis * * @type {number} * @constant */ -raylib.KEY_F4 = 293 +raylib.GAMEPAD_AXIS_LEFT_X = 0 /** - * Key: F5 + * Gamepad left stick Y axis * * @type {number} * @constant */ -raylib.KEY_F5 = 294 +raylib.GAMEPAD_AXIS_LEFT_Y = 1 /** - * Key: F6 + * Gamepad right stick X axis * * @type {number} * @constant */ -raylib.KEY_F6 = 295 +raylib.GAMEPAD_AXIS_RIGHT_X = 2 /** - * Key: F7 + * Gamepad right stick Y axis * * @type {number} * @constant */ -raylib.KEY_F7 = 296 +raylib.GAMEPAD_AXIS_RIGHT_Y = 3 /** - * Key: F8 + * Gamepad back trigger left, pressure level: [1..-1] * * @type {number} * @constant */ -raylib.KEY_F8 = 297 +raylib.GAMEPAD_AXIS_LEFT_TRIGGER = 4 /** - * Key: F9 + * Gamepad back trigger right, pressure level: [1..-1] * * @type {number} * @constant */ -raylib.KEY_F9 = 298 +raylib.GAMEPAD_AXIS_RIGHT_TRIGGER = 5 /** - * Key: F10 + * Albedo material (same as: MATERIAL_MAP_DIFFUSE) * * @type {number} * @constant */ -raylib.KEY_F10 = 299 +raylib.MATERIAL_MAP_ALBEDO = 0 /** - * Key: F11 + * Metalness material (same as: MATERIAL_MAP_SPECULAR) * * @type {number} * @constant */ -raylib.KEY_F11 = 300 +raylib.MATERIAL_MAP_METALNESS = 1 /** - * Key: F12 + * Normal material * * @type {number} * @constant */ -raylib.KEY_F12 = 301 +raylib.MATERIAL_MAP_NORMAL = 2 /** - * Key: Shift left + * Roughness material * * @type {number} * @constant */ -raylib.KEY_LEFT_SHIFT = 340 +raylib.MATERIAL_MAP_ROUGHNESS = 3 /** - * Key: Control left + * Ambient occlusion material * * @type {number} * @constant */ -raylib.KEY_LEFT_CONTROL = 341 +raylib.MATERIAL_MAP_OCCLUSION = 4 /** - * Key: Alt left + * Emission material * * @type {number} * @constant */ -raylib.KEY_LEFT_ALT = 342 +raylib.MATERIAL_MAP_EMISSION = 5 /** - * Key: Super left + * Heightmap material * * @type {number} * @constant */ -raylib.KEY_LEFT_SUPER = 343 +raylib.MATERIAL_MAP_HEIGHT = 6 /** - * Key: Shift right + * Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_SHIFT = 344 +raylib.MATERIAL_MAP_CUBEMAP = 7 /** - * Key: Control right + * Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_CONTROL = 345 +raylib.MATERIAL_MAP_IRRADIANCE = 8 /** - * Key: Alt right + * Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) * * @type {number} * @constant */ -raylib.KEY_RIGHT_ALT = 346 +raylib.MATERIAL_MAP_PREFILTER = 9 /** - * Key: Super right + * Brdf material * * @type {number} * @constant */ -raylib.KEY_RIGHT_SUPER = 347 +raylib.MATERIAL_MAP_BRDF = 10 /** - * Key: KB menu + * Shader location: vertex attribute: position * * @type {number} * @constant */ -raylib.KEY_KB_MENU = 348 +raylib.SHADER_LOC_VERTEX_POSITION = 0 /** - * Key: Keypad 0 + * Shader location: vertex attribute: texcoord01 * * @type {number} * @constant */ -raylib.KEY_KP_0 = 320 +raylib.SHADER_LOC_VERTEX_TEXCOORD01 = 1 /** - * Key: Keypad 1 + * Shader location: vertex attribute: texcoord02 * * @type {number} * @constant */ -raylib.KEY_KP_1 = 321 +raylib.SHADER_LOC_VERTEX_TEXCOORD02 = 2 /** - * Key: Keypad 2 + * Shader location: vertex attribute: normal * * @type {number} * @constant */ -raylib.KEY_KP_2 = 322 +raylib.SHADER_LOC_VERTEX_NORMAL = 3 /** - * Key: Keypad 3 + * Shader location: vertex attribute: tangent * * @type {number} * @constant */ -raylib.KEY_KP_3 = 323 +raylib.SHADER_LOC_VERTEX_TANGENT = 4 /** - * Key: Keypad 4 + * Shader location: vertex attribute: color * * @type {number} * @constant */ -raylib.KEY_KP_4 = 324 +raylib.SHADER_LOC_VERTEX_COLOR = 5 /** - * Key: Keypad 5 + * Shader location: matrix uniform: model-view-projection * * @type {number} * @constant */ -raylib.KEY_KP_5 = 325 +raylib.SHADER_LOC_MATRIX_MVP = 6 /** - * Key: Keypad 6 + * Shader location: matrix uniform: view (camera transform) * * @type {number} * @constant */ -raylib.KEY_KP_6 = 326 +raylib.SHADER_LOC_MATRIX_VIEW = 7 /** - * Key: Keypad 7 + * Shader location: matrix uniform: projection * * @type {number} * @constant */ -raylib.KEY_KP_7 = 327 +raylib.SHADER_LOC_MATRIX_PROJECTION = 8 /** - * Key: Keypad 8 + * Shader location: matrix uniform: model (transform) * * @type {number} * @constant */ -raylib.KEY_KP_8 = 328 +raylib.SHADER_LOC_MATRIX_MODEL = 9 /** - * Key: Keypad 9 + * Shader location: matrix uniform: normal * * @type {number} * @constant */ -raylib.KEY_KP_9 = 329 +raylib.SHADER_LOC_MATRIX_NORMAL = 10 /** - * Key: Keypad . + * Shader location: vector uniform: view * * @type {number} * @constant */ -raylib.KEY_KP_DECIMAL = 330 +raylib.SHADER_LOC_VECTOR_VIEW = 11 /** - * Key: Keypad / + * Shader location: vector uniform: diffuse color * * @type {number} * @constant */ -raylib.KEY_KP_DIVIDE = 331 +raylib.SHADER_LOC_COLOR_DIFFUSE = 12 /** - * Key: Keypad * + * Shader location: vector uniform: specular color * * @type {number} * @constant */ -raylib.KEY_KP_MULTIPLY = 332 +raylib.SHADER_LOC_COLOR_SPECULAR = 13 /** - * Key: Keypad - + * Shader location: vector uniform: ambient color * * @type {number} * @constant */ -raylib.KEY_KP_SUBTRACT = 333 +raylib.SHADER_LOC_COLOR_AMBIENT = 14 /** - * Key: Keypad + + * Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) * * @type {number} * @constant */ -raylib.KEY_KP_ADD = 334 +raylib.SHADER_LOC_MAP_ALBEDO = 15 /** - * Key: Keypad Enter + * Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) * * @type {number} * @constant */ -raylib.KEY_KP_ENTER = 335 +raylib.SHADER_LOC_MAP_METALNESS = 16 /** - * Key: Keypad = + * Shader location: sampler2d texture: normal * * @type {number} * @constant */ -raylib.KEY_KP_EQUAL = 336 +raylib.SHADER_LOC_MAP_NORMAL = 17 /** - * Key: Android back button + * Shader location: sampler2d texture: roughness * * @type {number} * @constant */ -raylib.KEY_BACK = 4 +raylib.SHADER_LOC_MAP_ROUGHNESS = 18 /** - * Key: Android menu button + * Shader location: sampler2d texture: occlusion * * @type {number} * @constant */ -raylib.KEY_MENU = 82 +raylib.SHADER_LOC_MAP_OCCLUSION = 19 /** - * Key: Android volume up button + * Shader location: sampler2d texture: emission * * @type {number} * @constant */ -raylib.KEY_VOLUME_UP = 24 +raylib.SHADER_LOC_MAP_EMISSION = 20 /** - * Key: Android volume down button + * Shader location: sampler2d texture: height * * @type {number} * @constant */ -raylib.KEY_VOLUME_DOWN = 25 +raylib.SHADER_LOC_MAP_HEIGHT = 21 /** - * Mouse button left + * Shader location: samplerCube texture: cubemap * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_LEFT = 0 +raylib.SHADER_LOC_MAP_CUBEMAP = 22 /** - * Mouse button right + * Shader location: samplerCube texture: irradiance * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_RIGHT = 1 +raylib.SHADER_LOC_MAP_IRRADIANCE = 23 /** - * Mouse button middle (pressed wheel) + * Shader location: samplerCube texture: prefilter * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_MIDDLE = 2 +raylib.SHADER_LOC_MAP_PREFILTER = 24 /** - * Mouse button side (advanced mouse device) + * Shader location: sampler2d texture: brdf * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_SIDE = 3 +raylib.SHADER_LOC_MAP_BRDF = 25 /** - * Mouse button extra (advanced mouse device) + * Shader uniform type: float * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_EXTRA = 4 +raylib.SHADER_UNIFORM_FLOAT = 0 /** - * Mouse button fordward (advanced mouse device) + * Shader uniform type: vec2 (2 float) * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_FORWARD = 5 +raylib.SHADER_UNIFORM_VEC2 = 1 /** - * Mouse button back (advanced mouse device) + * Shader uniform type: vec3 (3 float) * * @type {number} * @constant */ -raylib.MOUSE_BUTTON_BACK = 6 +raylib.SHADER_UNIFORM_VEC3 = 2 /** - * Default pointer shape + * Shader uniform type: vec4 (4 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_DEFAULT = 0 +raylib.SHADER_UNIFORM_VEC4 = 3 /** - * Arrow shape + * Shader uniform type: int * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_ARROW = 1 +raylib.SHADER_UNIFORM_INT = 4 /** - * Text writing cursor shape + * Shader uniform type: ivec2 (2 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_IBEAM = 2 +raylib.SHADER_UNIFORM_IVEC2 = 5 /** - * Cross shape + * Shader uniform type: ivec3 (3 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_CROSSHAIR = 3 +raylib.SHADER_UNIFORM_IVEC3 = 6 /** - * Pointing hand cursor + * Shader uniform type: ivec4 (4 int) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_POINTING_HAND = 4 +raylib.SHADER_UNIFORM_IVEC4 = 7 /** - * Horizontal resize/move arrow shape + * Shader uniform type: sampler2d * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_EW = 5 +raylib.SHADER_UNIFORM_SAMPLER2D = 8 /** - * Vertical resize/move arrow shape + * Shader attribute type: float * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NS = 6 +raylib.SHADER_ATTRIB_FLOAT = 0 /** - * Top-left to bottom-right diagonal resize/move arrow shape + * Shader attribute type: vec2 (2 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NWSE = 7 +raylib.SHADER_ATTRIB_VEC2 = 1 /** - * The top-right to bottom-left diagonal resize/move arrow shape + * Shader attribute type: vec3 (3 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_NESW = 8 +raylib.SHADER_ATTRIB_VEC3 = 2 /** - * The omni-directional resize/move cursor shape + * Shader attribute type: vec4 (4 float) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_RESIZE_ALL = 9 +raylib.SHADER_ATTRIB_VEC4 = 3 /** - * The operation-not-allowed shape + * 8 bit per pixel (no alpha) * * @type {number} * @constant */ -raylib.MOUSE_CURSOR_NOT_ALLOWED = 10 +raylib.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 /** - * Unknown button, just for error checking + * 8*2 bpp (2 channels) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_UNKNOWN = 0 +raylib.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 /** - * Gamepad left DPAD up button + * 16 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_UP = 1 +raylib.PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 /** - * Gamepad left DPAD right button + * 24 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 +raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 /** - * Gamepad left DPAD down button + * 16 bpp (1 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 +raylib.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 /** - * Gamepad left DPAD left button + * 16 bpp (4 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 +raylib.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 /** - * Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) + * 32 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 +raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 /** - * Gamepad right button right (i.e. PS3: Square, Xbox: X) + * 32 bpp (1 channel - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 +raylib.PIXELFORMAT_UNCOMPRESSED_R32 = 8 /** - * Gamepad right button down (i.e. PS3: Cross, Xbox: A) + * 32*3 bpp (3 channels - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 +raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 /** - * Gamepad right button left (i.e. PS3: Circle, Xbox: B) + * 32*4 bpp (4 channels - float) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 +raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 /** - * Gamepad top/back trigger left (first), it could be a trailing button + * 4 bpp (no alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 +raylib.PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 /** - * Gamepad top/back trigger left (second), it could be a trailing button + * 4 bpp (1 bit alpha) * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 +raylib.PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 /** - * Gamepad top/back trigger right (one), it could be a trailing button + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 +raylib.PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 /** - * Gamepad top/back trigger right (second), it could be a trailing button + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 +raylib.PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 /** - * Gamepad center buttons, left one (i.e. PS3: Select) + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE_LEFT = 13 +raylib.PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 /** - * Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE = 14 +raylib.PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 /** - * Gamepad center buttons, right one (i.e. PS3: Start) + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 +raylib.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 /** - * Gamepad joystick pressed button left + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_LEFT_THUMB = 16 +raylib.PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 /** - * Gamepad joystick pressed button right + * 4 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_BUTTON_RIGHT_THUMB = 17 +raylib.PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 /** - * Gamepad left stick X axis + * 8 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_X = 0 +raylib.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 /** - * Gamepad left stick Y axis + * 2 bpp * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_Y = 1 +raylib.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 /** - * Gamepad right stick X axis + * No filter, just pixel aproximation * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_X = 2 +raylib.TEXTURE_FILTER_POINT = 0 /** - * Gamepad right stick Y axis + * Linear filtering * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_Y = 3 +raylib.TEXTURE_FILTER_BILINEAR = 1 /** - * Gamepad back trigger left, pressure level: [1..-1] + * Trilinear filtering (linear with mipmaps) * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_LEFT_TRIGGER = 4 +raylib.TEXTURE_FILTER_TRILINEAR = 2 /** - * Gamepad back trigger right, pressure level: [1..-1] + * Anisotropic filtering 4x * * @type {number} * @constant */ -raylib.GAMEPAD_AXIS_RIGHT_TRIGGER = 5 +raylib.TEXTURE_FILTER_ANISOTROPIC_4X = 3 /** - * Albedo material (same as: MATERIAL_MAP_DIFFUSE) + * Anisotropic filtering 8x * * @type {number} * @constant */ -raylib.MATERIAL_MAP_ALBEDO = 0 +raylib.TEXTURE_FILTER_ANISOTROPIC_8X = 4 /** - * Metalness material (same as: MATERIAL_MAP_SPECULAR) + * Anisotropic filtering 16x * * @type {number} * @constant */ -raylib.MATERIAL_MAP_METALNESS = 1 +raylib.TEXTURE_FILTER_ANISOTROPIC_16X = 5 /** - * Normal material + * Repeats texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_NORMAL = 2 +raylib.TEXTURE_WRAP_REPEAT = 0 /** - * Roughness material + * Clamps texture to edge pixel in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_ROUGHNESS = 3 +raylib.TEXTURE_WRAP_CLAMP = 1 /** - * Ambient occlusion material + * Mirrors and repeats the texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_OCCLUSION = 4 +raylib.TEXTURE_WRAP_MIRROR_REPEAT = 2 /** - * Emission material + * Mirrors and clamps to border the texture in tiled mode * * @type {number} * @constant */ -raylib.MATERIAL_MAP_EMISSION = 5 +raylib.TEXTURE_WRAP_MIRROR_CLAMP = 3 /** - * Heightmap material + * Automatically detect layout type * * @type {number} * @constant */ -raylib.MATERIAL_MAP_HEIGHT = 6 +raylib.CUBEMAP_LAYOUT_AUTO_DETECT = 0 /** - * Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by a vertical line with faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_CUBEMAP = 7 +raylib.CUBEMAP_LAYOUT_LINE_VERTICAL = 1 /** - * Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by an horizontal line with faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_IRRADIANCE = 8 +raylib.CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 /** - * Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + * Layout is defined by a 3x4 cross with cubemap faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_PREFILTER = 9 +raylib.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 /** - * Brdf material + * Layout is defined by a 4x3 cross with cubemap faces * * @type {number} * @constant */ -raylib.MATERIAL_MAP_BRDF = 10 +raylib.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 /** - * Shader location: vertex attribute: position + * Layout is defined by a panorama image (equirectangular map) * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_POSITION = 0 +raylib.CUBEMAP_LAYOUT_PANORAMA = 5 /** - * Shader location: vertex attribute: texcoord01 + * Default font generation, anti-aliased * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TEXCOORD01 = 1 +raylib.FONT_DEFAULT = 0 /** - * Shader location: vertex attribute: texcoord02 + * Bitmap font generation, no anti-aliasing * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TEXCOORD02 = 2 +raylib.FONT_BITMAP = 1 /** - * Shader location: vertex attribute: normal + * SDF font generation, requires external shader * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_NORMAL = 3 +raylib.FONT_SDF = 2 /** - * Shader location: vertex attribute: tangent + * Blend textures considering alpha (default) * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_TANGENT = 4 +raylib.BLEND_ALPHA = 0 /** - * Shader location: vertex attribute: color + * Blend textures adding colors * * @type {number} * @constant */ -raylib.SHADER_LOC_VERTEX_COLOR = 5 +raylib.BLEND_ADDITIVE = 1 /** - * Shader location: matrix uniform: model-view-projection + * Blend textures multiplying colors * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_MVP = 6 +raylib.BLEND_MULTIPLIED = 2 /** - * Shader location: matrix uniform: view (camera transform) + * Blend textures adding colors (alternative) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_VIEW = 7 +raylib.BLEND_ADD_COLORS = 3 /** - * Shader location: matrix uniform: projection + * Blend textures subtracting colors (alternative) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_PROJECTION = 8 +raylib.BLEND_SUBTRACT_COLORS = 4 /** - * Shader location: matrix uniform: model (transform) + * Belnd textures using custom src/dst factors (use rlSetBlendMode()) * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_MODEL = 9 +raylib.BLEND_CUSTOM = 5 /** - * Shader location: matrix uniform: normal + * No gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MATRIX_NORMAL = 10 +raylib.GESTURE_NONE = 0 /** - * Shader location: vector uniform: view + * Tap gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_VECTOR_VIEW = 11 +raylib.GESTURE_TAP = 1 /** - * Shader location: vector uniform: diffuse color + * Double tap gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_DIFFUSE = 12 +raylib.GESTURE_DOUBLETAP = 2 /** - * Shader location: vector uniform: specular color + * Hold gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_SPECULAR = 13 +raylib.GESTURE_HOLD = 4 /** - * Shader location: vector uniform: ambient color + * Drag gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_COLOR_AMBIENT = 14 +raylib.GESTURE_DRAG = 8 /** - * Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) + * Swipe right gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_ALBEDO = 15 +raylib.GESTURE_SWIPE_RIGHT = 16 /** - * Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) + * Swipe left gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_METALNESS = 16 +raylib.GESTURE_SWIPE_LEFT = 32 /** - * Shader location: sampler2d texture: normal + * Swipe up gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_NORMAL = 17 +raylib.GESTURE_SWIPE_UP = 64 /** - * Shader location: sampler2d texture: roughness + * Swipe down gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_ROUGHNESS = 18 +raylib.GESTURE_SWIPE_DOWN = 128 /** - * Shader location: sampler2d texture: occlusion + * Pinch in gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_OCCLUSION = 19 +raylib.GESTURE_PINCH_IN = 256 /** - * Shader location: sampler2d texture: emission + * Pinch out gesture * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_EMISSION = 20 +raylib.GESTURE_PINCH_OUT = 512 /** - * Shader location: sampler2d texture: height + * Custom camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_HEIGHT = 21 +raylib.CAMERA_CUSTOM = 0 /** - * Shader location: samplerCube texture: cubemap + * Free camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_CUBEMAP = 22 +raylib.CAMERA_FREE = 1 /** - * Shader location: samplerCube texture: irradiance + * Orbital camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_IRRADIANCE = 23 +raylib.CAMERA_ORBITAL = 2 /** - * Shader location: samplerCube texture: prefilter + * First person camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_PREFILTER = 24 +raylib.CAMERA_FIRST_PERSON = 3 /** - * Shader location: sampler2d texture: brdf + * Third person camera * * @type {number} * @constant */ -raylib.SHADER_LOC_MAP_BRDF = 25 +raylib.CAMERA_THIRD_PERSON = 4 /** - * Shader uniform type: float + * Perspective projection * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_FLOAT = 0 +raylib.CAMERA_PERSPECTIVE = 0 /** - * Shader uniform type: vec2 (2 float) + * Orthographic projection * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC2 = 1 +raylib.CAMERA_ORTHOGRAPHIC = 1 /** - * Shader uniform type: vec3 (3 float) + * Npatch layout: 3x3 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC3 = 2 +raylib.NPATCH_NINE_PATCH = 0 /** - * Shader uniform type: vec4 (4 float) + * Npatch layout: 1x3 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_VEC4 = 3 +raylib.NPATCH_THREE_PATCH_VERTICAL = 1 /** - * Shader uniform type: int + * Npatch layout: 3x1 tiles * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_INT = 4 +raylib.NPATCH_THREE_PATCH_HORIZONTAL = 2 /** - * Shader uniform type: ivec2 (2 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC2 = 5 +raylib.GUI_STATE_NORMAL = 0 /** - * Shader uniform type: ivec3 (3 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC3 = 6 +raylib.GUI_STATE_FOCUSED = 1 /** - * Shader uniform type: ivec4 (4 int) + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_IVEC4 = 7 +raylib.GUI_STATE_PRESSED = 2 /** - * Shader uniform type: sampler2d + * * * @type {number} * @constant */ -raylib.SHADER_UNIFORM_SAMPLER2D = 8 +raylib.GUI_STATE_DISABLED = 3 /** - * Shader attribute type: float + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_FLOAT = 0 +raylib.GUI_TEXT_ALIGN_LEFT = 0 /** - * Shader attribute type: vec2 (2 float) + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC2 = 1 +raylib.GUI_TEXT_ALIGN_CENTER = 1 /** - * Shader attribute type: vec3 (3 float) + * * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC3 = 2 +raylib.GUI_TEXT_ALIGN_RIGHT = 2 /** - * Shader attribute type: vec4 (4 float) + * Generic control -> populates to all controls when set * * @type {number} * @constant */ -raylib.SHADER_ATTRIB_VEC4 = 3 +raylib.DEFAULT = 0 /** - * 8 bit per pixel (no alpha) + * Used also for: LABELBUTTON * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 +raylib.LABEL = 1 /** - * 8*2 bpp (2 channels) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 +raylib.BUTTON = 2 /** - * 16 bpp + * Used also for: TOGGLEGROUP * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 +raylib.TOGGLE = 3 /** - * 24 bpp + * Used also for: SLIDERBAR * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 +raylib.SLIDER = 4 /** - * 16 bpp (1 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 +raylib.PROGRESSBAR = 5 /** - * 16 bpp (4 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 +raylib.CHECKBOX = 6 /** - * 32 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 +raylib.COMBOBOX = 7 /** - * 32 bpp (1 channel - float) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32 = 8 +raylib.DROPDOWNBOX = 8 /** - * 32*3 bpp (3 channels - float) + * Used also for: TEXTBOXMULTI * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 +raylib.TEXTBOX = 9 /** - * 32*4 bpp (4 channels - float) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 +raylib.VALUEBOX = 10 /** - * 4 bpp (no alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 +raylib.SPINNER = 11 /** - * 4 bpp (1 bit alpha) + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 +raylib.LISTVIEW = 12 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 +raylib.COLORPICKER = 13 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 +raylib.SCROLLBAR = 14 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 +raylib.STATUSBAR = 15 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 +raylib.BORDER_COLOR_NORMAL = 0 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 +raylib.BASE_COLOR_NORMAL = 1 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 +raylib.TEXT_COLOR_NORMAL = 2 /** - * 4 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 +raylib.BORDER_COLOR_FOCUSED = 3 /** - * 8 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 +raylib.BASE_COLOR_FOCUSED = 4 /** - * 2 bpp + * * * @type {number} * @constant */ -raylib.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 +raylib.TEXT_COLOR_FOCUSED = 5 /** - * No filter, just pixel approximation + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_POINT = 0 +raylib.BORDER_COLOR_PRESSED = 6 /** - * Linear filtering + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_BILINEAR = 1 +raylib.BASE_COLOR_PRESSED = 7 /** - * Trilinear filtering (linear with mipmaps) + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_TRILINEAR = 2 +raylib.TEXT_COLOR_PRESSED = 8 /** - * Anisotropic filtering 4x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_4X = 3 +raylib.BORDER_COLOR_DISABLED = 9 /** - * Anisotropic filtering 8x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_8X = 4 +raylib.BASE_COLOR_DISABLED = 10 /** - * Anisotropic filtering 16x + * * * @type {number} * @constant */ -raylib.TEXTURE_FILTER_ANISOTROPIC_16X = 5 +raylib.TEXT_COLOR_DISABLED = 11 /** - * Repeats texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_REPEAT = 0 +raylib.BORDER_WIDTH = 12 /** - * Clamps texture to edge pixel in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_CLAMP = 1 +raylib.TEXT_PADDING = 13 /** - * Mirrors and repeats the texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_MIRROR_REPEAT = 2 +raylib.TEXT_ALIGNMENT = 14 /** - * Mirrors and clamps to border the texture in tiled mode + * * * @type {number} * @constant */ -raylib.TEXTURE_WRAP_MIRROR_CLAMP = 3 +raylib.RESERVED = 15 /** - * Automatically detect layout type + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_AUTO_DETECT = 0 +raylib.TEXT_SIZE = 16 /** - * Layout is defined by a vertical line with faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_LINE_VERTICAL = 1 +raylib.TEXT_SPACING = 17 /** - * Layout is defined by an horizontal line with faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 +raylib.LINE_COLOR = 18 /** - * Layout is defined by a 3x4 cross with cubemap faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 +raylib.BACKGROUND_COLOR = 19 /** - * Layout is defined by a 4x3 cross with cubemap faces + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 +raylib.GROUP_PADDING = 16 /** - * Layout is defined by a panorama image (equirectangular map) + * * * @type {number} * @constant */ -raylib.CUBEMAP_LAYOUT_PANORAMA = 5 +raylib.SLIDER_WIDTH = 16 /** - * Default font generation, anti-aliased + * * * @type {number} * @constant */ -raylib.FONT_DEFAULT = 0 +raylib.SLIDER_PADDING = 17 /** - * Bitmap font generation, no anti-aliasing + * * * @type {number} * @constant */ -raylib.FONT_BITMAP = 1 +raylib.PROGRESS_PADDING = 16 /** - * SDF font generation, requires external shader + * * * @type {number} * @constant */ -raylib.FONT_SDF = 2 +raylib.CHECK_PADDING = 16 /** - * Blend textures considering alpha (default) + * * * @type {number} * @constant */ -raylib.BLEND_ALPHA = 0 +raylib.COMBO_BUTTON_WIDTH = 16 /** - * Blend textures adding colors + * * * @type {number} * @constant */ -raylib.BLEND_ADDITIVE = 1 +raylib.COMBO_BUTTON_PADDING = 17 /** - * Blend textures multiplying colors + * * * @type {number} * @constant */ -raylib.BLEND_MULTIPLIED = 2 +raylib.ARROW_PADDING = 16 /** - * Blend textures adding colors (alternative) + * * * @type {number} * @constant */ -raylib.BLEND_ADD_COLORS = 3 +raylib.DROPDOWN_ITEMS_PADDING = 17 /** - * Blend textures subtracting colors (alternative) + * * * @type {number} * @constant */ -raylib.BLEND_SUBTRACT_COLORS = 4 +raylib.TEXT_INNER_PADDING = 16 /** - * Belnd textures using custom src/dst factors (use rlSetBlendMode()) + * * * @type {number} * @constant */ -raylib.BLEND_CUSTOM = 5 +raylib.TEXT_LINES_PADDING = 17 /** - * No gesture + * * * @type {number} * @constant */ -raylib.GESTURE_NONE = 0 +raylib.COLOR_SELECTED_FG = 18 /** - * Tap gesture + * * * @type {number} * @constant */ -raylib.GESTURE_TAP = 1 +raylib.COLOR_SELECTED_BG = 19 /** - * Double tap gesture + * * * @type {number} * @constant */ -raylib.GESTURE_DOUBLETAP = 2 +raylib.SPIN_BUTTON_WIDTH = 16 /** - * Hold gesture + * * * @type {number} * @constant */ -raylib.GESTURE_HOLD = 4 +raylib.SPIN_BUTTON_PADDING = 17 /** - * Drag gesture + * * * @type {number} * @constant */ -raylib.GESTURE_DRAG = 8 +raylib.ARROWS_SIZE = 16 /** - * Swipe right gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_RIGHT = 16 +raylib.ARROWS_VISIBLE = 17 /** - * Swipe left gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_LEFT = 32 +raylib.SCROLL_SLIDER_PADDING = 18 /** - * Swipe up gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_UP = 64 +raylib.SCROLL_SLIDER_SIZE = 19 /** - * Swipe down gesture + * * * @type {number} * @constant */ -raylib.GESTURE_SWIPE_DOWN = 128 +raylib.SCROLL_PADDING = 20 /** - * Pinch in gesture + * * * @type {number} * @constant */ -raylib.GESTURE_PINCH_IN = 256 +raylib.SCROLL_SPEED = 21 /** - * Pinch out gesture + * * * @type {number} * @constant */ -raylib.GESTURE_PINCH_OUT = 512 +raylib.SCROLLBAR_LEFT_SIDE = 0 /** - * Custom camera + * * * @type {number} * @constant */ -raylib.CAMERA_CUSTOM = 0 +raylib.SCROLLBAR_RIGHT_SIDE = 1 /** - * Free camera + * * * @type {number} * @constant */ -raylib.CAMERA_FREE = 1 +raylib.LIST_ITEMS_HEIGHT = 16 /** - * Orbital camera + * * * @type {number} * @constant */ -raylib.CAMERA_ORBITAL = 2 +raylib.LIST_ITEMS_PADDING = 17 /** - * First person camera + * * * @type {number} * @constant */ -raylib.CAMERA_FIRST_PERSON = 3 +raylib.SCROLLBAR_WIDTH = 18 /** - * Third person camera + * * * @type {number} * @constant */ -raylib.CAMERA_THIRD_PERSON = 4 +raylib.SCROLLBAR_SIDE = 19 /** - * Perspective projection + * * * @type {number} * @constant */ -raylib.CAMERA_PERSPECTIVE = 0 +raylib.COLOR_SELECTOR_SIZE = 16 /** - * Orthographic projection + * Right hue bar width * * @type {number} * @constant */ -raylib.CAMERA_ORTHOGRAPHIC = 1 +raylib.HUEBAR_WIDTH = 17 /** - * Npatch layout: 3x3 tiles + * Right hue bar separation from panel * * @type {number} * @constant */ -raylib.NPATCH_NINE_PATCH = 0 +raylib.HUEBAR_PADDING = 18 /** - * Npatch layout: 1x3 tiles + * Right hue bar selector height * * @type {number} * @constant */ -raylib.NPATCH_THREE_PATCH_VERTICAL = 1 +raylib.HUEBAR_SELECTOR_HEIGHT = 19 /** - * Npatch layout: 3x1 tiles + * Right hue bar selector overflow * * @type {number} * @constant */ -raylib.NPATCH_THREE_PATCH_HORIZONTAL = 2 +raylib.HUEBAR_SELECTOR_OVERFLOW = 20 raylib.LIGHTGRAY = { r: 200, g: 200, b: 200, a: 255 } raylib.GRAY = { r: 130, g: 130, b: 130, a: 255 } diff --git a/tools/extras/easings.js b/tools/extras/easings.js deleted file mode 100644 index 53d5281..0000000 --- a/tools/extras/easings.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Generates the function definitions for easings.h - * - * @see https://github.com/raysan5/raylib/blob/master/src/extras/easings.h - */ -function getDefEasings () { - const functions = [] - const easingsDefaults = { - name: 'FunctionName', - description: 'FuntionName', - returnType: 'float', - params: [ - { type: 'float', name: 't' }, - { type: 'float', name: 'b' }, - { type: 'float', name: 'c' }, - { type: 'float', name: 'd' } - ] - } - const functionNames = [ - 'EaseLinearNone', - 'EaseLinearIn', - 'EaseLinearOut', - 'EaseLinearInOut', - 'EaseSineIn', - 'EaseSineOut', - 'EaseSineInOut', - 'EaseCircIn', - 'EaseCircOut', - 'EaseCircInOut', - 'EaseCubicIn', - 'EaseCubicOut', - 'EaseCubicInOut', - 'EaseQuadIn', - 'EaseQuadOut', - 'EaseQuadInOut', - 'EaseExpoIn', - 'EaseExpoOut', - 'EaseExpoInOut', - 'EaseBackIn', - 'EaseBackOut', - 'EaseBackInOut', - 'EaseBounceOut', - 'EaseBounceIn', - 'EaseBounceInOut', - 'EaseElasticIn', - 'EaseElasticOut', - 'EaseElasticInOut' - ] - for (const funcName of functionNames) { - const func = Object.assign({}, easingsDefaults) - func.name = funcName - func.description = `Easing: ${funcName}.` - functions.push(func) - } - return functions -} - -module.exports = { - functions: getDefEasings() -} diff --git a/tools/generate.js b/tools/generate.js index 9f8a791..f33d2c8 100644 --- a/tools/generate.js +++ b/tools/generate.js @@ -1,32 +1,40 @@ // this will generate the wrappers & type-adapters in src/generated const { writeFileSync } = require('fs') +const raylibApi = require('@raylib/api') const path = require('path') -const fetch = require('cross-fetch') // use this to keep from wrapping things const blocklist = [ - // error: invalid conversion from ‘void (*)(int, const char*, ...)’ to ‘void (*)()’ [-fpermissive] + // Error: invalid conversion from ‘void (*)(int, const char*, ...)’ to ‘void (*)()’ [-fpermissive] 'TraceLog', 'TextFormat', - // edge case: need additional wrapping to function + // Edge case: need additional wrapping to function 'SetShaderValue', 'SetShaderValueV', - // DataCallback types not implemented in JSON? + // Callbacks: Not supported yet 'SetTraceLogCallback', 'SetLoadFileDataCallback', 'SetSaveFileDataCallback', 'SetLoadFileTextCallback', 'SetSaveFileTextCallback', - // these appear to not be defined, even though they are in JSON - 'SetWindowOpacity', - 'GetRenderWidth', - 'GetRenderHeight', - 'ExportFontAsCode' + // Structs + // @todo Verify Structs that have array properties + 'VrStereoConfig', // Matrix[2], float[2] + 'VrDeviceInfo', // float[4] + 'Material', // float[4] + // raymath + // @todo Fix helper structs for float arrays + 'Vector3ToFloatV', // float3 + 'MatrixToFloatV', // float16 + + // raygui + 'UnloadGuiStyle', // Commented out + 'LoadGuiStyle' // Commented out ] // these functions expect the first argument to be passed as a reference in C++ @@ -93,95 +101,98 @@ const rSize = /\[([0-9]+)\]/g // pre-process the data for later analysis function getDefs () { - console.log('Downloading definitions') - - return fetch('https://raw.githubusercontent.com/raysan5/raylib/2e3cfdcc2f5c70e82536caa57d4aa72e3f00fd40/parser/raylib_api.json') - .then(r => r.json()) - .then(defs => { - const { structs, enums, functions } = defs - for (const struct of structs) { - // take multi-fields (like in Matrix) and make them all distinct fields - - // temporary fix for building on Mac/Win? Wonder why this is necessary - if (struct.name === 'BoneInfo') { - struct.fields[1].type = 'char' - } - - let newfields = [] - for (const i in struct.fields) { - const field = struct.fields[i] - - if (field.name.includes(',')) { - newfields = [...newfields, ...field.name.split(',').map(n => { - return { - ...field, - name: n.trim() - } - })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) - } else { - newfields.push(field) - } - } - struct.fields = newfields - - // find all arrays in structs, and give all fields a size and stripped name for later - for (const field of struct.fields) { - const n = [...field.name.matchAll(rSize)] - if (n.length) { - field.size = parseInt(n[0][1]) - field.name = field.name.replace(rSize, '') - } else { - field.size = 1 + const { structs, enums, functions } = raylibApi.raylib + for (const struct of structs) { + // take multi-fields (like in Matrix) and make them all distinct fields + + // temporary fix for building on Mac/Win? Wonder why this is necessary + if (struct.name === 'BoneInfo') { + struct.fields[0].type = 'char' + struct.fields[1].type = 'char' + } + + let newfields = [] + for (const i in struct.fields) { + const field = struct.fields[i] + + if (field.name.includes(',')) { + newfields = [...newfields, ...field.name.split(',').map(n => { + return { + ...field, + name: n.trim() } - const type = field.type.replace(/[* ]+/g, '') - if (typeAliases[type]) { - field.type = typeAliases[type] - } - } - - // TODO: should I also process *-refs to seperate name & the fact it's a ref? + })].sort((a, b) => a.name.match(/\d+/)[0] - b.name.match(/\d+/)[0]) + } else { + newfields.push(field) } - - // aliases - // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) - - // XXX: Since array support isn't complete, just filter out all structs & functions that use them, - // so we get an (incomplete) wrapper that will build. - - for (const struct of structs) { - const usesArray = struct.fields.find(f => f.size !== 1) - if (usesArray) { - blocklist.push(struct.name) - } + } + struct.fields = newfields + + // find all arrays in structs, and give all fields a size and stripped name for later + for (const field of struct.fields) { + const n = [...field.name.matchAll(rSize)] + if (n.length) { + field.size = parseInt(n[0][1]) + field.name = field.name.replace(rSize, '') + } else { + field.size = 1 } - - // filter out all functions that use blocked types - for (const f of functions) { - if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + const type = field.type.replace(/[* ]+/g, '') + if (typeAliases[type]) { + field.type = typeAliases[type] + } + } + + // TODO: should I also process *-refs to seperate name & the fact it's a ref? + } + + // aliases + // structs.push({ ...structs.find(s => s.name === 'Vector4'), name: 'Quaternion' }) + + // XXX: Since array support isn't complete, just filter out all structs & functions that use them, + // so we get an (incomplete) wrapper that will build. + + for (const struct of structs) { + const usesArray = struct.fields.find(f => f.size !== 1) + if (usesArray) { + blocklist.push(struct.name) + } + } + + // filter out all functions that use blocked types + for (const f of functions) { + if (blocklist.includes(f.returnType.replace(/[* ]/g, ''))) { + blocklist.push(f.name) + } else { + for (const param of (f.params || [])) { + if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { blocklist.push(f.name) - } else { - for (const param of (f.params || [])) { - if (blocklist.includes(param.type.replace(/[* ]/g, ''))) { - blocklist.push(f.name) - break - } - } + break } } + } + } + + // Add the Easings API + const easings = raylibApi.easings + functions.push(...easings.functions) + + // Add Raymath + const raymath = raylibApi.raymath + functions.push(...raymath.functions) - // Add the Easings API - const easings = require('./extras/easings') - functions.push(...easings.functions) + // Add Raygui + const raygui = raylibApi.raygui + functions.push(...raygui.functions) + enums.push(...raygui.enums) - return { structs, enums, functions } - }) + return { structs, enums, functions } } -getDefs().then(({ structs, enums, functions }) => { - const GenBindings = require('./generate_templates/node-raylib-bindings.js') - const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') - const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) - writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) -}) +const { structs, enums, functions } = getDefs() +const GenBindings = require('./generate_templates/node-raylib-bindings.js') +const GenWrapper = require('./generate_templates/node-raylib-wrapper.js') +const GenTSDefs = require('./generate_templates/node-raylib-definitions.js') +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.cc'), GenBindings({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.js'), GenWrapper({ enums, blocklist, functions, structs, byreflist })) +writeFileSync(path.join(__dirname, '..', 'src', 'generated', 'node-raylib.d.ts'), GenTSDefs({ enums, blocklist, functions, structs, byreflist })) diff --git a/tools/generate_templates/ArgumentTypeConversion.js b/tools/generate_templates/ArgumentTypeConversion.js index cc0fcc3..d8f828c 100644 --- a/tools/generate_templates/ArgumentTypeConversion.js +++ b/tools/generate_templates/ArgumentTypeConversion.js @@ -5,6 +5,7 @@ function ArgumentTypeConversion (arg) { if (arg === 'char') { return 'string' } if (arg === 'char *') { return 'string' } if (arg === 'const char *') { return 'string' } + if (arg === 'char[32]') { return 'string' } if (arg === 'int') { return 'number' } if (arg === 'float') { return 'number' } diff --git a/tools/generate_templates/node-raylib-bindings.js b/tools/generate_templates/node-raylib-bindings.js index 181a688..42312a0 100644 --- a/tools/generate_templates/node-raylib-bindings.js +++ b/tools/generate_templates/node-raylib-bindings.js @@ -5,6 +5,21 @@ * @returns */ const SanitizeTypeName = name => { + if (name === 'const Vector3') { + return 'Vector3' + } + if (name === 'float[2]') { + return 'pointer' + } + if (name === 'char[32]') { + return 'pointer' + } + if (name === 'float[4]') { + return 'pointer' + } + if (name === 'Matrix[2]') { + return 'pointer' + } if (name === 'const char *') { return 'string' } @@ -17,6 +32,9 @@ const SanitizeTypeName = name => { if (name === 'Camera') { return 'Camera3D' } + if (name === 'Quaternion') { + return 'Vector4' + } if (name === 'Texture2D') { return 'Texture' } @@ -165,6 +183,11 @@ module.exports = ({ functions, structs, enums, blocklist, byreflist }) => ` #include #include "raylib.h" #include "extras/easings.h" +#include "raymath.h" + +#define RAYGUI_IMPLEMENTATION +#include "extras/raygui.h" + using namespace Napi; inline Napi::Value ToValue(Napi::Env env, bool value) { @@ -199,10 +222,13 @@ inline Napi::Value ToValue(Napi::Env env, void * value) { } inline float floatFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().FloatValue(); } inline int intFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Int32Value(); +} +inline double doubleFromValue(const Napi::CallbackInfo& info, int index) { + return info[index].As().DoubleValue(); } uintptr_t pointerFromValue(const Napi::CallbackInfo& info, int index) { return (uintptr_t) info[index].As().Int64Value(); @@ -211,7 +237,7 @@ inline unsigned char unsignedcharFromValue(const Napi::CallbackInfo& info, int i return info[index].As().Uint32Value(); } inline unsigned int unsignedintFromValue(const Napi::CallbackInfo& info, int index) { - return info[index].As(); + return info[index].As().Uint32Value(); } inline bool boolFromValue(const Napi::CallbackInfo& info, int index) { return info[index].As(); @@ -229,11 +255,13 @@ inline char charFromValue(const Napi::CallbackInfo& info, int index) { // Convert structs from Napi::Values in info[] arguments ${structs + .filter(({ name }) => !blocklist.includes(name)) .map(struct => { return FromValue(structs, struct) }) .join('\n') } // Convert structs to Napi::Objects for output to JS ${structs + .filter(({ name }) => !blocklist.includes(name)) .map(ToValue) .join('\n') }