Skip to content

Commit 3212add

Browse files
authored
Update bindings (#168)
* Update & mangle bindings * Wrap raylib
1 parent 607468b commit 3212add

29 files changed

Lines changed: 13170 additions & 11288 deletions

src/raylib.nim

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ type
321321
LeftThumb ## Gamepad joystick pressed button left
322322
RightThumb ## Gamepad joystick pressed button right
323323

324-
GamepadAxis* {.size: sizeof(int32).} = enum ## Gamepad axis
324+
GamepadAxis* {.size: sizeof(int32).} = enum ## Gamepad axes
325325
LeftX ## Gamepad left stick X axis
326326
LeftY ## Gamepad left stick Y axis
327327
RightX ## Gamepad right stick X axis
@@ -842,7 +842,7 @@ proc maximizeWindow*() {.importc: "MaximizeWindow", sideEffect.}
842842
proc minimizeWindow*() {.importc: "MinimizeWindow", sideEffect.}
843843
## Set window state: minimized, if resizable
844844
proc restoreWindow*() {.importc: "RestoreWindow", sideEffect.}
845-
## Set window state: not minimized/maximized
845+
## Restore window from being minimized/maximized
846846
proc setWindowIcon*(image: Image) {.importc: "SetWindowIcon", sideEffect.}
847847
## Set icon for window (single image, RGBA 32bit)
848848
proc setWindowIconsImpl(images: ptr UncheckedArray[Image], count: int32) {.importc: "SetWindowIcons", sideEffect.}
@@ -1060,9 +1060,9 @@ proc isGamepadButtonUp*(gamepad: int32, button: GamepadButton): bool {.importc:
10601060
proc getGamepadButtonPressed*(): GamepadButton {.importc: "GetGamepadButtonPressed", sideEffect.}
10611061
## Get the last gamepad button pressed
10621062
proc getGamepadAxisCount*(gamepad: int32): int32 {.importc: "GetGamepadAxisCount", sideEffect.}
1063-
## Get gamepad axis count for a gamepad
1063+
## Get axis count for a gamepad
10641064
proc getGamepadAxisMovement*(gamepad: int32, axis: GamepadAxis): float32 {.importc: "GetGamepadAxisMovement", sideEffect.}
1065-
## Get axis movement value for a gamepad axis
1065+
## Get movement value for a gamepad axis
10661066
proc setGamepadMappingsImpl(mappings: cstring): int32 {.importc: "SetGamepadMappings", sideEffect.}
10671067
proc setGamepadVibration*(gamepad: int32, leftMotor: float32, rightMotor: float32, duration: float32) {.importc: "SetGamepadVibration", sideEffect.}
10681068
## Set gamepad vibration for both motors (duration in seconds)
@@ -1159,8 +1159,12 @@ proc drawCircleLines*(center: Vector2, radius: float32, color: Color) {.importc:
11591159
## Draw circle outline (Vector version)
11601160
proc drawEllipse*(centerX: int32, centerY: int32, radiusH: float32, radiusV: float32, color: Color) {.importc: "DrawEllipse", sideEffect.}
11611161
## Draw ellipse
1162+
proc drawEllipse*(center: Vector2, radiusH: float32, radiusV: float32, color: Color) {.importc: "DrawEllipseV", sideEffect.}
1163+
## Draw ellipse (Vector version)
11621164
proc drawEllipseLines*(centerX: int32, centerY: int32, radiusH: float32, radiusV: float32, color: Color) {.importc: "DrawEllipseLines", sideEffect.}
11631165
## Draw ellipse outline
1166+
proc drawEllipseLines*(center: Vector2, radiusH: float32, radiusV: float32, color: Color) {.importc: "DrawEllipseLinesV", sideEffect.}
1167+
## Draw ellipse outline (Vector version)
11641168
proc drawRing*(center: Vector2, innerRadius: float32, outerRadius: float32, startAngle: float32, endAngle: float32, segments: int32, color: Color) {.importc: "DrawRing", sideEffect.}
11651169
## Draw ring
11661170
proc drawRingLines*(center: Vector2, innerRadius: float32, outerRadius: float32, startAngle: float32, endAngle: float32, segments: int32, color: Color) {.importc: "DrawRingLines", sideEffect.}
@@ -1177,7 +1181,7 @@ proc drawRectangleGradientV*(posX: int32, posY: int32, width: int32, height: int
11771181
## Draw a vertical-gradient-filled rectangle
11781182
proc drawRectangleGradientH*(posX: int32, posY: int32, width: int32, height: int32, left: Color, right: Color) {.importc: "DrawRectangleGradientH", sideEffect.}
11791183
## Draw a horizontal-gradient-filled rectangle
1180-
proc drawRectangleGradient*(rec: Rectangle, topLeft: Color, bottomLeft: Color, topRight: Color, bottomRight: Color) {.importc: "DrawRectangleGradientEx", sideEffect.}
1184+
proc drawRectangleGradient*(rec: Rectangle, topLeft: Color, bottomLeft: Color, bottomRight: Color, topRight: Color) {.importc: "DrawRectangleGradientEx", sideEffect.}
11811185
## Draw a gradient-filled rectangle with custom vertex colors
11821186
proc drawRectangleLines*(posX: int32, posY: int32, width: int32, height: int32, color: Color) {.importc: "DrawRectangleLines", sideEffect.}
11831187
## Draw rectangle outline

src/raylib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(JoinPaths)
88

99
# Sets build type if not set by now
1010
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
11-
if(RAYLIB_IS_MAIN)
11+
if(PROJECT_IS_TOP_LEVEL)
1212
set(default_build_type Debug)
1313
else()
1414
message(WARNING "Default build type is not set (CMAKE_BUILD_TYPE)")

src/raylib/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
#define MAX_KEYBOARD_KEYS 512 // Maximum number of keyboard keys supported
105105
#define MAX_MOUSE_BUTTONS 8 // Maximum number of mouse buttons supported
106106
#define MAX_GAMEPADS 4 // Maximum number of gamepads supported
107-
#define MAX_GAMEPAD_AXIS 8 // Maximum number of axis supported (per gamepad)
107+
#define MAX_GAMEPAD_AXES 8 // Maximum number of axes supported (per gamepad)
108108
#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad)
109109
#define MAX_GAMEPAD_VIBRATION_TIME 2.0f // Maximum vibration time in seconds
110110
#define MAX_TOUCH_POINTS 8 // Maximum number of touch points supported

0 commit comments

Comments
 (0)