Skip to content

Commit fb93d5f

Browse files
update raylib and docs
1 parent dbddc94 commit fb93d5f

File tree

11 files changed

+3966
-8080
lines changed

11 files changed

+3966
-8080
lines changed

create_stub_pyray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from inspect import ismethod, getmembers, isbuiltin
1818
import inflection, sys, json
1919

20-
f = open("raylib_api.json", "r")
20+
f = open("raylib.json", "r")
2121
js = json.load(f)
2222

2323
def ctype_to_python_type(t):

create_stub_static.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from inspect import ismethod, getmembers, isbuiltin
1818
import inflection, sys, json
1919

20-
f = open("raylib_api.json", "r")
20+
f = open("raylib.json", "r")
2121
js = json.load(f)
2222

2323

make_docs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22

3+
gcc raylib-c/parser/raylib_parser.c
4+
./a.out -i raylib-c/src/extras/raygui.h -o raygui.json -f JSON
5+
./a.out -i raylib-c/src/extras/physac.h -o physac.json -f JSON
6+
./a.out -i raylib-c/src/raylib.h -o raylib.json -f JSON
7+
38
python3 raylib/build.py
49
pip3 install sphinx-autoapi myst_parser sphinx_rtd_theme
510
python3 create_stub_pyray.py > pyray/__init__.pyi

pyray/__init__.pyi

Lines changed: 1434 additions & 142 deletions
Large diffs are not rendered by default.

raylib-c

Submodule raylib-c updated 49 files

raylib/__init__.pyi

Lines changed: 1372 additions & 123 deletions
Large diffs are not rendered by default.

raylib/physac.h.modified

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@
1616
* If not defined, the library is in header only mode and can be included in other headers
1717
* or source files without problems. But only ONE file should hold the implementation.
1818
*
19-
* #define PHYSAC_STATIC (defined by default)
20-
* The generated implementation will stay private inside implementation file and all
21-
* internal symbols and functions will only be visible inside that file.
22-
*
2319
* #define PHYSAC_DEBUG
2420
* Show debug traces log messages about physic bodies creation/destruction, physic system errors,
25-
* some calculations results and NULL reference exceptions
26-
*
27-
* #define PHYSAC_DEFINE_VECTOR2_TYPE
28-
* Forces library to define struct Vector2 data type (float x; float y)
21+
* some calculations results and NULL reference exceptions.
2922
*
3023
* #define PHYSAC_AVOID_TIMMING_SYSTEM
3124
* Disables internal timming system, used by UpdatePhysics() to launch timmed physic steps,
@@ -141,28 +134,28 @@ typedef struct PhysicsManifoldData {
141134
// Module Functions Declaration
142135
//----------------------------------------------------------------------------------
143136
// Physics system management
144-
extern /* Functions visible from other files*/ void InitPhysics(void); // Initializes physics system
145-
extern /* Functions visible from other files*/ void UpdatePhysics(void); // Update physics system
146-
extern /* Functions visible from other files*/ void ResetPhysics(void); // Reset physics system (global variables)
147-
extern /* Functions visible from other files*/ void ClosePhysics(void); // Close physics system and unload used memory
148-
extern /* Functions visible from other files*/ void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default
149-
extern /* Functions visible from other files*/ void SetPhysicsGravity(float x, float y); // Sets physics global gravity force
137+
void InitPhysics(void); // Initializes physics system
138+
void UpdatePhysics(void); // Update physics system
139+
void ResetPhysics(void); // Reset physics system (global variables)
140+
void ClosePhysics(void); // Close physics system and unload used memory
141+
void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default
142+
void SetPhysicsGravity(float x, float y); // Sets physics global gravity force
150143
// Physic body creation/destroy
151-
extern /* Functions visible from other files*/ PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters
152-
extern /* Functions visible from other files*/ PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters
153-
extern /* Functions visible from other files*/ PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters
154-
extern /* Functions visible from other files*/ void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body
144+
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters
145+
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters
146+
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters
147+
void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body
155148
// Physic body forces
156-
extern /* Functions visible from other files*/ void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body
157-
extern /* Functions visible from other files*/ void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body
158-
extern /* Functions visible from other files*/ void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force
159-
extern /* Functions visible from other files*/ void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter
149+
void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body
150+
void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body
151+
void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force
152+
void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter
160153
// Query physics info
161-
extern /* Functions visible from other files*/ PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index
162-
extern /* Functions visible from other files*/ int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies
163-
extern /* Functions visible from other files*/ int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
164-
extern /* Functions visible from other files*/ int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape
165-
extern /* Functions visible from other files*/ Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position)
154+
PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index
155+
int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies
156+
int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
157+
int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape
158+
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position)
166159
/***********************************************************************************
167160
*
168161
* PHYSAC IMPLEMENTATION

0 commit comments

Comments
 (0)