raylib-bindings 0.1.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/config.rb ADDED
@@ -0,0 +1,98 @@
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+ SUPPORT_MODULE_RSHAPES = 1
15
+ SUPPORT_MODULE_RTEXTURES = 1
16
+ SUPPORT_MODULE_RTEXT = 1 # WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures
17
+ SUPPORT_MODULE_RMODELS = 1
18
+ SUPPORT_MODULE_RAUDIO = 1
19
+ SUPPORT_CAMERA_SYSTEM = 1
20
+ SUPPORT_GESTURES_SYSTEM = 1
21
+ SUPPORT_MOUSE_GESTURES = 1
22
+ SUPPORT_SSH_KEYBOARD_RPI = 1
23
+ SUPPORT_WINMM_HIGHRES_TIMER = 1
24
+ SUPPORT_PARTIALBUSY_WAIT_LOOP = 1
25
+ SUPPORT_SCREEN_CAPTURE = 1
26
+ SUPPORT_GIF_RECORDING = 1
27
+ SUPPORT_COMPRESSION_API = 1
28
+ MAX_FILEPATH_CAPACITY = 8192 # Maximum file paths capacity
29
+ MAX_FILEPATH_LENGTH = 4096 # Maximum length for filepaths (Linux PATH_MAX default value)
30
+ MAX_KEYBOARD_KEYS = 512 # Maximum number of keyboard keys supported
31
+ MAX_MOUSE_BUTTONS = 8 # Maximum number of mouse buttons supported
32
+ MAX_GAMEPADS = 4 # Maximum number of gamepads supported
33
+ MAX_GAMEPAD_AXIS = 8 # Maximum number of axis supported (per gamepad)
34
+ MAX_GAMEPAD_BUTTONS = 32 # Maximum number of buttons supported (per gamepad)
35
+ MAX_TOUCH_POINTS = 8 # Maximum number of touch points supported
36
+ MAX_KEY_PRESSED_QUEUE = 16 # Maximum number of keys in the key input queue
37
+ MAX_CHAR_PRESSED_QUEUE = 16 # Maximum number of characters in the char input queue
38
+ MAX_DECOMPRESSION_SIZE = 64 # Max size allocated for decompression in MB
39
+ RL_DEFAULT_BATCH_BUFFERS = 1 # Default number of batch buffers (multi-buffering)
40
+ RL_DEFAULT_BATCH_DRAWCALLS = 256 # Default number of batch draw calls (by state changes: mode, texture)
41
+ RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
42
+ RL_MAX_MATRIX_STACK_SIZE = 32 # Maximum size of internal Matrix stack
43
+ RL_MAX_SHADER_LOCATIONS = 32 # Maximum number of shader locations supported
44
+ RL_CULL_DISTANCE_NEAR = 0.01 # Default projection matrix near cull distance
45
+ RL_CULL_DISTANCE_FAR = 1000.0 # Default projection matrix far cull distance
46
+ RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition" # Binded by default to shader location: 0
47
+ RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord" # Binded by default to shader location: 1
48
+ RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal" # Binded by default to shader location: 2
49
+ RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor" # Binded by default to shader location: 3
50
+ RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent" # Binded by default to shader location: 4
51
+ RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2" # Binded by default to shader location: 5
52
+ RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp" # model-view-projection matrix
53
+ RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView" # view matrix
54
+ RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION = "matProjection" # projection matrix
55
+ RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel" # model matrix
56
+ RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal" # normal matrix (transpose(inverse(matModelView))
57
+ RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse" # color diffuse (base tint color, multiplied by texture color)
58
+ RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0" # texture0 (texture slot active 0)
59
+ RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1" # texture1 (texture slot active 1)
60
+ RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2" # texture2 (texture slot active 2)
61
+ SUPPORT_QUADS_DRAW_MODE = 1
62
+ SUPPORT_FILEFORMAT_PNG = 1
63
+ SUPPORT_FILEFORMAT_GIF = 1
64
+ SUPPORT_FILEFORMAT_QOI = 1
65
+ SUPPORT_FILEFORMAT_DDS = 1
66
+ SUPPORT_FILEFORMAT_HDR = 1
67
+ SUPPORT_IMAGE_EXPORT = 1
68
+ SUPPORT_IMAGE_GENERATION = 1
69
+ SUPPORT_IMAGE_MANIPULATION = 1
70
+ SUPPORT_DEFAULT_FONT = 1
71
+ SUPPORT_FILEFORMAT_FNT = 1
72
+ SUPPORT_FILEFORMAT_TTF = 1
73
+ SUPPORT_TEXT_MANIPULATION = 1
74
+ MAX_TEXT_BUFFER_LENGTH = 1024 # Size of internal static buffers used on some functions:
75
+ MAX_TEXTSPLIT_COUNT = 128 # Maximum number of substrings to split: TextSplit()
76
+ SUPPORT_FILEFORMAT_OBJ = 1
77
+ SUPPORT_FILEFORMAT_MTL = 1
78
+ SUPPORT_FILEFORMAT_IQM = 1
79
+ SUPPORT_FILEFORMAT_GLTF = 1
80
+ SUPPORT_FILEFORMAT_VOX = 1
81
+ SUPPORT_FILEFORMAT_M3D = 1
82
+ SUPPORT_MESH_GENERATION = 1
83
+ MAX_MATERIAL_MAPS = 12 # Maximum number of shader maps supported
84
+ MAX_MESH_VERTEX_BUFFERS = 7 # Maximum vertex buffers (VBO) per mesh
85
+ SUPPORT_FILEFORMAT_WAV = 1
86
+ SUPPORT_FILEFORMAT_OGG = 1
87
+ SUPPORT_FILEFORMAT_XM = 1
88
+ SUPPORT_FILEFORMAT_MOD = 1
89
+ SUPPORT_FILEFORMAT_MP3 = 1
90
+ AUDIO_DEVICE_FORMAT = "ma_format_f32" # Device output format (miniaudio: float-32bit)
91
+ AUDIO_DEVICE_CHANNELS = 2 # Device output channels: stereo
92
+ AUDIO_DEVICE_SAMPLE_RATE = 0 # Device sample rate (device default)
93
+ MAX_AUDIO_BUFFER_POOL_CHANNELS = 16 # Maximum number of audio pool channels
94
+ SUPPORT_STANDARD_FILEIO = 1
95
+ SUPPORT_TRACELOG = 1
96
+ MAX_TRACELOG_MSG_LENGTH = 128 # Max length of one trace-log message
97
+
98
+ end
Binary file
data/lib/libraylib.dll CHANGED
Binary file
data/lib/libraylib.dylib CHANGED
Binary file
Binary file
Binary file
data/lib/physac.dll CHANGED
Binary file
data/lib/physac.dylib CHANGED
Binary file
data/lib/physac.rb CHANGED
@@ -1,224 +1,222 @@
1
- # Yet another raylib wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/raylib-bindings
4
- #
5
- # [NOTICE] Autogenerated. Do not edit.
6
-
7
- require 'ffi'
8
-
9
- module Raylib
10
- extend FFI::Library
11
-
12
- # Define/Macro
13
-
14
- PHYSAC_MAX_BODIES = 64 # Maximum number of physic bodies supported
15
- PHYSAC_MAX_MANIFOLDS = 4096 # Maximum number of physic bodies interactions (64x64)
16
- PHYSAC_MAX_VERTICES = 24 # Maximum number of vertex for polygons shapes
17
- PHYSAC_DEFAULT_CIRCLE_VERTICES = 24 # Default number of vertices for circle shapes
18
- PHYSAC_COLLISION_ITERATIONS = 100
19
- PHYSAC_PENETRATION_ALLOWANCE = 0.05
20
- PHYSAC_PENETRATION_CORRECTION = 0.4
21
- PHYSAC_PI = 3.14159265358979323846
22
-
23
- # Enum
24
-
25
- PHYSICS_CIRCLE = 0
26
- PHYSICS_POLYGON = 1
27
-
28
- # Typedef
29
-
30
- typedef :int, :PhysicsShapeType
31
- typedef :pointer, :PhysicsBody
32
- typedef :pointer, :PhysicsManifold
33
-
34
- # Struct
35
-
36
- # Matrix2x2 type (used for polygon shape rotation matrix)
37
- class Matrix2x2 < FFI::Struct
38
- layout(
39
- :m00, :float,
40
- :m01, :float,
41
- :m10, :float,
42
- :m11, :float,
43
- )
44
- end
45
-
46
- class PhysicsVertexData < FFI::Struct
47
- layout(
48
- :vertexCount, :uint, # Vertex count (positions and normals)
49
- :positions, [Vector2, 24], # Vertex positions vectors
50
- :normals, [Vector2, 24], # Vertex normals vectors
51
- )
52
- end
53
-
54
- class PhysicsShape < FFI::Struct
55
- layout(
56
- :type, :int, # Shape type (circle or polygon)
57
- :body, :pointer, # Shape physics body data pointer
58
- :vertexData, PhysicsVertexData, # Shape vertices data (used for polygon shapes)
59
- :radius, :float, # Shape radius (used for circle shapes)
60
- :transform, Matrix2x2, # Vertices transform matrix 2x2
61
- )
62
- end
63
-
64
- class PhysicsBodyData < FFI::Struct
65
- layout(
66
- :id, :uint, # Unique identifier
67
- :enabled, :bool, # Enabled dynamics state (collisions are calculated anyway)
68
- :position, Vector2, # Physics body shape pivot
69
- :velocity, Vector2, # Current linear velocity applied to position
70
- :force, Vector2, # Current linear force (reset to 0 every step)
71
- :angularVelocity, :float, # Current angular velocity applied to orient
72
- :torque, :float, # Current angular force (reset to 0 every step)
73
- :orient, :float, # Rotation in radians
74
- :inertia, :float, # Moment of inertia
75
- :inverseInertia, :float, # Inverse value of inertia
76
- :mass, :float, # Physics body mass
77
- :inverseMass, :float, # Inverse value of mass
78
- :staticFriction, :float, # Friction when the body has not movement (0 to 1)
79
- :dynamicFriction, :float, # Friction when the body has movement (0 to 1)
80
- :restitution, :float, # Restitution coefficient of the body (0 to 1)
81
- :useGravity, :bool, # Apply gravity force to dynamics
82
- :isGrounded, :bool, # Physics grounded on other body state
83
- :freezeOrient, :bool, # Physics rotation constraint
84
- :shape, PhysicsShape, # Physics body shape information (type, radius, vertices, transform)
85
- )
86
- end
87
-
88
- class PhysicsManifoldData < FFI::Struct
89
- layout(
90
- :id, :uint, # Unique identifier
91
- :bodyA, :pointer, # Manifold first physics body reference
92
- :bodyB, :pointer, # Manifold second physics body reference
93
- :penetration, :float, # Depth of penetration from collision
94
- :normal, Vector2, # Normal direction vector from 'a' to 'b'
95
- :contacts, [Vector2, 2], # Points of contact during collision
96
- :contactsCount, :uint, # Current collision number of contacts
97
- :restitution, :float, # Mixed restitution during collision
98
- :dynamicFriction, :float, # Mixed dynamic friction during collision
99
- :staticFriction, :float, # Mixed static friction during collision
100
- )
101
- end
102
-
103
-
104
- # Function
105
-
106
- def self.setup_physac_symbols(output_error = false)
107
- entries = [
108
-
109
- # InitPhysics : Initializes physics system
110
- # @return [void]
111
- [:InitPhysics, :InitPhysics, [], :void],
112
-
113
- # UpdatePhysics : Update physics system
114
- # @return [void]
115
- [:UpdatePhysics, :UpdatePhysics, [], :void],
116
-
117
- # ResetPhysics : Reset physics system (global variables)
118
- # @return [void]
119
- [:ResetPhysics, :ResetPhysics, [], :void],
120
-
121
- # ClosePhysics : Close physics system and unload used memory
122
- # @return [void]
123
- [:ClosePhysics, :ClosePhysics, [], :void],
124
-
125
- # SetPhysicsTimeStep : Sets physics fixed time step in milliseconds. 1.666666 by default
126
- # @param delta [double]
127
- # @return [void]
128
- [:SetPhysicsTimeStep, :SetPhysicsTimeStep, [:double], :void],
129
-
130
- # SetPhysicsGravity : Sets physics global gravity force
131
- # @param x [float]
132
- # @param y [float]
133
- # @return [void]
134
- [:SetPhysicsGravity, :SetPhysicsGravity, [:float, :float], :void],
135
-
136
- # CreatePhysicsBodyCircle : Creates a new circle physics body with generic parameters
137
- # @param pos [Vector2]
138
- # @param radius [float]
139
- # @param density [float]
140
- # @return [PhysicsBody]
141
- [:CreatePhysicsBodyCircle, :CreatePhysicsBodyCircle, [Vector2.by_value, :float, :float], :pointer],
142
-
143
- # CreatePhysicsBodyRectangle : Creates a new rectangle physics body with generic parameters
144
- # @param pos [Vector2]
145
- # @param width [float]
146
- # @param height [float]
147
- # @param density [float]
148
- # @return [PhysicsBody]
149
- [:CreatePhysicsBodyRectangle, :CreatePhysicsBodyRectangle, [Vector2.by_value, :float, :float, :float], :pointer],
150
-
151
- # CreatePhysicsBodyPolygon : Creates a new polygon physics body with generic parameters
152
- # @param pos [Vector2]
153
- # @param radius [float]
154
- # @param sides [int]
155
- # @param density [float]
156
- # @return [PhysicsBody]
157
- [:CreatePhysicsBodyPolygon, :CreatePhysicsBodyPolygon, [Vector2.by_value, :float, :int, :float], :pointer],
158
-
159
- # DestroyPhysicsBody : Destroy a physics body
160
- # @param body [PhysicsBody]
161
- # @return [void]
162
- [:DestroyPhysicsBody, :DestroyPhysicsBody, [:pointer], :void],
163
-
164
- # PhysicsAddForce : Adds a force to a physics body
165
- # @param body [PhysicsBody]
166
- # @param force [Vector2]
167
- # @return [void]
168
- [:PhysicsAddForce, :PhysicsAddForce, [:pointer, Vector2.by_value], :void],
169
-
170
- # PhysicsAddTorque : Adds an angular force to a physics body
171
- # @param body [PhysicsBody]
172
- # @param amount [float]
173
- # @return [void]
174
- [:PhysicsAddTorque, :PhysicsAddTorque, [:pointer, :float], :void],
175
-
176
- # PhysicsShatter : Shatters a polygon shape physics body to little physics bodies with explosion force
177
- # @param body [PhysicsBody]
178
- # @param position [Vector2]
179
- # @param force [float]
180
- # @return [void]
181
- [:PhysicsShatter, :PhysicsShatter, [:pointer, Vector2.by_value, :float], :void],
182
-
183
- # SetPhysicsBodyRotation : Sets physics body shape transform based on radians parameter
184
- # @param body [PhysicsBody]
185
- # @param radians [float]
186
- # @return [void]
187
- [:SetPhysicsBodyRotation, :SetPhysicsBodyRotation, [:pointer, :float], :void],
188
-
189
- # GetPhysicsBody : Returns a physics body of the bodies pool at a specific index
190
- # @param index [int]
191
- # @return [PhysicsBody]
192
- [:GetPhysicsBody, :GetPhysicsBody, [:int], :pointer],
193
-
194
- # GetPhysicsBodiesCount : Returns the current amount of created physics bodies
195
- # @return [int]
196
- [:GetPhysicsBodiesCount, :GetPhysicsBodiesCount, [], :int],
197
-
198
- # GetPhysicsShapeType : Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
199
- # @param index [int]
200
- # @return [int]
201
- [:GetPhysicsShapeType, :GetPhysicsShapeType, [:int], :int],
202
-
203
- # GetPhysicsShapeVerticesCount : Returns the amount of vertices of a physics body shape
204
- # @param index [int]
205
- # @return [int]
206
- [:GetPhysicsShapeVerticesCount, :GetPhysicsShapeVerticesCount, [:int], :int],
207
-
208
- # GetPhysicsShapeVertex : Returns transformed position of a body shape (body position + vertex transformed position)
209
- # @param body [PhysicsBody]
210
- # @param vertex [int]
211
- # @return [Vector2]
212
- [:GetPhysicsShapeVertex, :GetPhysicsShapeVertex, [:pointer, :int], Vector2.by_value],
213
- ]
214
- entries.each do |entry|
215
- begin
216
- attach_function entry[0], entry[1], entry[2], entry[3]
217
- rescue FFI::NotFoundError => error
218
- $stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
219
- end
220
- end
221
- end
222
-
223
- end
224
-
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+ PHYSAC_MAX_BODIES = 64 # Maximum number of physic bodies supported
15
+ PHYSAC_MAX_MANIFOLDS = 4096 # Maximum number of physic bodies interactions (64x64)
16
+ PHYSAC_MAX_VERTICES = 24 # Maximum number of vertex for polygons shapes
17
+ PHYSAC_DEFAULT_CIRCLE_VERTICES = 24 # Default number of vertices for circle shapes
18
+ PHYSAC_COLLISION_ITERATIONS = 100
19
+ PHYSAC_PENETRATION_ALLOWANCE = 0.05
20
+ PHYSAC_PENETRATION_CORRECTION = 0.4
21
+ PHYSAC_PI = 3.14159265358979323846
22
+
23
+ # Enum
24
+
25
+ # enum PhysicsShapeType
26
+ PHYSICS_CIRCLE = 0
27
+ PHYSICS_POLYGON = 1
28
+
29
+
30
+ # Typedef
31
+
32
+ typedef :int, :PhysicsShapeType
33
+ typedef :pointer, :PhysicsBody
34
+ typedef :pointer, :PhysicsManifold
35
+
36
+ # Struct
37
+
38
+ # Matrix2x2 type (used for polygon shape rotation matrix)
39
+ class Matrix2x2 < FFI::Struct
40
+ layout(
41
+ :m00, :float,
42
+ :m01, :float,
43
+ :m10, :float,
44
+ :m11, :float,
45
+ )
46
+ end
47
+
48
+ class PhysicsVertexData < FFI::Struct
49
+ layout(
50
+ :vertexCount, :uint, # Vertex count (positions and normals)
51
+ :positions, [Vector2, 24], # Vertex positions vectors
52
+ :normals, [Vector2, 24], # Vertex normals vectors
53
+ )
54
+ end
55
+
56
+ class PhysicsShape < FFI::Struct
57
+ layout(
58
+ :type, :int, # Shape type (circle or polygon)
59
+ :body, :pointer, # Shape physics body data pointer
60
+ :vertexData, PhysicsVertexData, # Shape vertices data (used for polygon shapes)
61
+ :radius, :float, # Shape radius (used for circle shapes)
62
+ :transform, Matrix2x2, # Vertices transform matrix 2x2
63
+ )
64
+ end
65
+
66
+ class PhysicsBodyData < FFI::Struct
67
+ layout(
68
+ :id, :uint, # Unique identifier
69
+ :enabled, :bool, # Enabled dynamics state (collisions are calculated anyway)
70
+ :position, Vector2, # Physics body shape pivot
71
+ :velocity, Vector2, # Current linear velocity applied to position
72
+ :force, Vector2, # Current linear force (reset to 0 every step)
73
+ :angularVelocity, :float, # Current angular velocity applied to orient
74
+ :torque, :float, # Current angular force (reset to 0 every step)
75
+ :orient, :float, # Rotation in radians
76
+ :inertia, :float, # Moment of inertia
77
+ :inverseInertia, :float, # Inverse value of inertia
78
+ :mass, :float, # Physics body mass
79
+ :inverseMass, :float, # Inverse value of mass
80
+ :staticFriction, :float, # Friction when the body has not movement (0 to 1)
81
+ :dynamicFriction, :float, # Friction when the body has movement (0 to 1)
82
+ :restitution, :float, # Restitution coefficient of the body (0 to 1)
83
+ :useGravity, :bool, # Apply gravity force to dynamics
84
+ :isGrounded, :bool, # Physics grounded on other body state
85
+ :freezeOrient, :bool, # Physics rotation constraint
86
+ :shape, PhysicsShape, # Physics body shape information (type, radius, vertices, transform)
87
+ )
88
+ end
89
+
90
+ class PhysicsManifoldData < FFI::Struct
91
+ layout(
92
+ :id, :uint, # Unique identifier
93
+ :bodyA, :pointer, # Manifold first physics body reference
94
+ :bodyB, :pointer, # Manifold second physics body reference
95
+ :penetration, :float, # Depth of penetration from collision
96
+ :normal, Vector2, # Normal direction vector from 'a' to 'b'
97
+ :contacts, [Vector2, 2], # Points of contact during collision
98
+ :contactsCount, :uint, # Current collision number of contacts
99
+ :restitution, :float, # Mixed restitution during collision
100
+ :dynamicFriction, :float, # Mixed dynamic friction during collision
101
+ :staticFriction, :float, # Mixed static friction during collision
102
+ )
103
+ end
104
+
105
+
106
+ # Function
107
+
108
+ def self.setup_physac_symbols
109
+ entries = [
110
+
111
+ # InitPhysics : Initializes physics system
112
+ # @return [void]
113
+ [:InitPhysics, :InitPhysics, [], :void],
114
+
115
+ # UpdatePhysics : Update physics system
116
+ # @return [void]
117
+ [:UpdatePhysics, :UpdatePhysics, [], :void],
118
+
119
+ # ResetPhysics : Reset physics system (global variables)
120
+ # @return [void]
121
+ [:ResetPhysics, :ResetPhysics, [], :void],
122
+
123
+ # ClosePhysics : Close physics system and unload used memory
124
+ # @return [void]
125
+ [:ClosePhysics, :ClosePhysics, [], :void],
126
+
127
+ # SetPhysicsTimeStep : Sets physics fixed time step in milliseconds. 1.666666 by default
128
+ # @param delta [double]
129
+ # @return [void]
130
+ [:SetPhysicsTimeStep, :SetPhysicsTimeStep, [:double], :void],
131
+
132
+ # SetPhysicsGravity : Sets physics global gravity force
133
+ # @param x [float]
134
+ # @param y [float]
135
+ # @return [void]
136
+ [:SetPhysicsGravity, :SetPhysicsGravity, [:float, :float], :void],
137
+
138
+ # CreatePhysicsBodyCircle : Creates a new circle physics body with generic parameters
139
+ # @param pos [Vector2]
140
+ # @param radius [float]
141
+ # @param density [float]
142
+ # @return [PhysicsBody]
143
+ [:CreatePhysicsBodyCircle, :CreatePhysicsBodyCircle, [Vector2.by_value, :float, :float], :pointer],
144
+
145
+ # CreatePhysicsBodyRectangle : Creates a new rectangle physics body with generic parameters
146
+ # @param pos [Vector2]
147
+ # @param width [float]
148
+ # @param height [float]
149
+ # @param density [float]
150
+ # @return [PhysicsBody]
151
+ [:CreatePhysicsBodyRectangle, :CreatePhysicsBodyRectangle, [Vector2.by_value, :float, :float, :float], :pointer],
152
+
153
+ # CreatePhysicsBodyPolygon : Creates a new polygon physics body with generic parameters
154
+ # @param pos [Vector2]
155
+ # @param radius [float]
156
+ # @param sides [int]
157
+ # @param density [float]
158
+ # @return [PhysicsBody]
159
+ [:CreatePhysicsBodyPolygon, :CreatePhysicsBodyPolygon, [Vector2.by_value, :float, :int, :float], :pointer],
160
+
161
+ # DestroyPhysicsBody : Destroy a physics body
162
+ # @param body [PhysicsBody]
163
+ # @return [void]
164
+ [:DestroyPhysicsBody, :DestroyPhysicsBody, [:pointer], :void],
165
+
166
+ # PhysicsAddForce : Adds a force to a physics body
167
+ # @param body [PhysicsBody]
168
+ # @param force [Vector2]
169
+ # @return [void]
170
+ [:PhysicsAddForce, :PhysicsAddForce, [:pointer, Vector2.by_value], :void],
171
+
172
+ # PhysicsAddTorque : Adds an angular force to a physics body
173
+ # @param body [PhysicsBody]
174
+ # @param amount [float]
175
+ # @return [void]
176
+ [:PhysicsAddTorque, :PhysicsAddTorque, [:pointer, :float], :void],
177
+
178
+ # PhysicsShatter : Shatters a polygon shape physics body to little physics bodies with explosion force
179
+ # @param body [PhysicsBody]
180
+ # @param position [Vector2]
181
+ # @param force [float]
182
+ # @return [void]
183
+ [:PhysicsShatter, :PhysicsShatter, [:pointer, Vector2.by_value, :float], :void],
184
+
185
+ # SetPhysicsBodyRotation : Sets physics body shape transform based on radians parameter
186
+ # @param body [PhysicsBody]
187
+ # @param radians [float]
188
+ # @return [void]
189
+ [:SetPhysicsBodyRotation, :SetPhysicsBodyRotation, [:pointer, :float], :void],
190
+
191
+ # GetPhysicsBody : Returns a physics body of the bodies pool at a specific index
192
+ # @param index [int]
193
+ # @return [PhysicsBody]
194
+ [:GetPhysicsBody, :GetPhysicsBody, [:int], :pointer],
195
+
196
+ # GetPhysicsBodiesCount : Returns the current amount of created physics bodies
197
+ # @return [int]
198
+ [:GetPhysicsBodiesCount, :GetPhysicsBodiesCount, [], :int],
199
+
200
+ # GetPhysicsShapeType : Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
201
+ # @param index [int]
202
+ # @return [int]
203
+ [:GetPhysicsShapeType, :GetPhysicsShapeType, [:int], :int],
204
+
205
+ # GetPhysicsShapeVerticesCount : Returns the amount of vertices of a physics body shape
206
+ # @param index [int]
207
+ # @return [int]
208
+ [:GetPhysicsShapeVerticesCount, :GetPhysicsShapeVerticesCount, [:int], :int],
209
+
210
+ # GetPhysicsShapeVertex : Returns transformed position of a body shape (body position + vertex transformed position)
211
+ # @param body [PhysicsBody]
212
+ # @param vertex [int]
213
+ # @return [Vector2]
214
+ [:GetPhysicsShapeVertex, :GetPhysicsShapeVertex, [:pointer, :int], Vector2.by_value],
215
+ ]
216
+ entries.each do |entry|
217
+ attach_function entry[0], entry[1], entry[2], entry[3]
218
+ rescue FFI::NotFoundError => e
219
+ warn "[Warning] Failed to import #{entry[0]} (#{e})."
220
+ end
221
+ end
222
+ end
Binary file
Binary file
data/lib/raygui.dll CHANGED
Binary file
data/lib/raygui.dylib CHANGED
Binary file