update raylib and docs
This commit is contained in:
parent
dbddc940e8
commit
fb93d5f330
11 changed files with 3956 additions and 8070 deletions
|
@ -17,7 +17,7 @@ from raylib import rl, ffi
|
|||
from inspect import ismethod, getmembers, isbuiltin
|
||||
import inflection, sys, json
|
||||
|
||||
f = open("raylib_api.json", "r")
|
||||
f = open("raylib.json", "r")
|
||||
js = json.load(f)
|
||||
|
||||
def ctype_to_python_type(t):
|
||||
|
|
|
@ -17,7 +17,7 @@ from raylib import rl, ffi
|
|||
from inspect import ismethod, getmembers, isbuiltin
|
||||
import inflection, sys, json
|
||||
|
||||
f = open("raylib_api.json", "r")
|
||||
f = open("raylib.json", "r")
|
||||
js = json.load(f)
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
gcc raylib-c/parser/raylib_parser.c
|
||||
./a.out -i raylib-c/src/extras/raygui.h -o raygui.json -f JSON
|
||||
./a.out -i raylib-c/src/extras/physac.h -o physac.json -f JSON
|
||||
./a.out -i raylib-c/src/raylib.h -o raylib.json -f JSON
|
||||
|
||||
python3 raylib/build.py
|
||||
pip3 install sphinx-autoapi myst_parser sphinx_rtd_theme
|
||||
python3 create_stub_pyray.py > pyray/__init__.pyi
|
||||
|
|
1566
pyray/__init__.pyi
1566
pyray/__init__.pyi
File diff suppressed because it is too large
Load diff
2
raylib-c
2
raylib-c
|
@ -1 +1 @@
|
|||
Subproject commit 8e599908d9cca8f2f96f53790837f49abcea2745
|
||||
Subproject commit cd61463d23263ffb8d2d87846f38c83c6d0d5cd4
|
1485
raylib/__init__.pyi
1485
raylib/__init__.pyi
File diff suppressed because it is too large
Load diff
|
@ -16,16 +16,9 @@
|
|||
* If not defined, the library is in header only mode and can be included in other headers
|
||||
* or source files without problems. But only ONE file should hold the implementation.
|
||||
*
|
||||
* #define PHYSAC_STATIC (defined by default)
|
||||
* The generated implementation will stay private inside implementation file and all
|
||||
* internal symbols and functions will only be visible inside that file.
|
||||
*
|
||||
* #define PHYSAC_DEBUG
|
||||
* Show debug traces log messages about physic bodies creation/destruction, physic system errors,
|
||||
* some calculations results and NULL reference exceptions
|
||||
*
|
||||
* #define PHYSAC_DEFINE_VECTOR2_TYPE
|
||||
* Forces library to define struct Vector2 data type (float x; float y)
|
||||
* some calculations results and NULL reference exceptions.
|
||||
*
|
||||
* #define PHYSAC_AVOID_TIMMING_SYSTEM
|
||||
* Disables internal timming system, used by UpdatePhysics() to launch timmed physic steps,
|
||||
|
@ -141,28 +134,28 @@ typedef struct PhysicsManifoldData {
|
|||
// Module Functions Declaration
|
||||
//----------------------------------------------------------------------------------
|
||||
// Physics system management
|
||||
extern /* Functions visible from other files*/ void InitPhysics(void); // Initializes physics system
|
||||
extern /* Functions visible from other files*/ void UpdatePhysics(void); // Update physics system
|
||||
extern /* Functions visible from other files*/ void ResetPhysics(void); // Reset physics system (global variables)
|
||||
extern /* Functions visible from other files*/ void ClosePhysics(void); // Close physics system and unload used memory
|
||||
extern /* Functions visible from other files*/ void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default
|
||||
extern /* Functions visible from other files*/ void SetPhysicsGravity(float x, float y); // Sets physics global gravity force
|
||||
void InitPhysics(void); // Initializes physics system
|
||||
void UpdatePhysics(void); // Update physics system
|
||||
void ResetPhysics(void); // Reset physics system (global variables)
|
||||
void ClosePhysics(void); // Close physics system and unload used memory
|
||||
void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default
|
||||
void SetPhysicsGravity(float x, float y); // Sets physics global gravity force
|
||||
// Physic body creation/destroy
|
||||
extern /* Functions visible from other files*/ PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters
|
||||
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
|
||||
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
|
||||
extern /* Functions visible from other files*/ void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body
|
||||
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters
|
||||
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters
|
||||
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters
|
||||
void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body
|
||||
// Physic body forces
|
||||
extern /* Functions visible from other files*/ void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body
|
||||
extern /* Functions visible from other files*/ void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body
|
||||
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
|
||||
extern /* Functions visible from other files*/ void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter
|
||||
void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body
|
||||
void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body
|
||||
void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force
|
||||
void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter
|
||||
// Query physics info
|
||||
extern /* Functions visible from other files*/ PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index
|
||||
extern /* Functions visible from other files*/ int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies
|
||||
extern /* Functions visible from other files*/ int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
|
||||
extern /* Functions visible from other files*/ int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape
|
||||
extern /* Functions visible from other files*/ Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position)
|
||||
PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index
|
||||
int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies
|
||||
int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
|
||||
int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape
|
||||
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position)
|
||||
/***********************************************************************************
|
||||
*
|
||||
* PHYSAC IMPLEMENTATION
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,7 @@
|
|||
* #define GRAPHICS_API_OPENGL_11
|
||||
* #define GRAPHICS_API_OPENGL_21
|
||||
* #define GRAPHICS_API_OPENGL_33
|
||||
* #define GRAPHICS_API_OPENGL_43
|
||||
* #define GRAPHICS_API_OPENGL_ES2
|
||||
* Use selected OpenGL graphics backend, should be supported by platform
|
||||
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
|
||||
|
@ -41,6 +42,9 @@
|
|||
* #define RLGL_SHOW_GL_DETAILS_INFO
|
||||
* Show OpenGL extensions and capabilities detailed logs on init
|
||||
*
|
||||
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
|
||||
* Enable debug context (only available on OpenGL 4.3)
|
||||
*
|
||||
* rlgl capabilities could be customized just defining some internal
|
||||
* values before library inclusion (default values listed):
|
||||
*
|
||||
|
@ -108,6 +112,7 @@
|
|||
// Security check in case multiple GRAPHICS_API_OPENGL_* defined
|
||||
// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality
|
||||
// WARNING: Specific parts are checked with #if defines
|
||||
// OpenGL 4.3 uses OpenGL 3.3 Core functionality
|
||||
// Support framebuffer objects by default
|
||||
// NOTE: Some driver implementation do not support it, despite they should
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -123,6 +128,8 @@
|
|||
// Matrix modes (equivalent to OpenGL)
|
||||
// Primitive assembly draw modes
|
||||
// GL equivalent data types
|
||||
// Buffer usage hint
|
||||
// GL Shader type
|
||||
//----------------------------------------------------------------------------------
|
||||
// Types and Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -130,6 +137,7 @@ typedef enum {
|
|||
OPENGL_11 = 1,
|
||||
OPENGL_21,
|
||||
OPENGL_33,
|
||||
OPENGL_43,
|
||||
OPENGL_ES_20
|
||||
} rlGlVersion;
|
||||
typedef enum {
|
||||
|
@ -415,7 +423,7 @@ typedef enum {
|
|||
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo)
|
||||
unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap
|
||||
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data
|
||||
void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats
|
||||
void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType); // Get OpenGL internal formats
|
||||
const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format
|
||||
void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory
|
||||
void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps); // Generate mipmap data for selected texture
|
||||
|
@ -428,7 +436,7 @@ typedef enum {
|
|||
void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU
|
||||
// Shaders management
|
||||
unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings
|
||||
unsigned int rlCompileShader(const char *shaderCode, int type); // Compile custom shader and return shader id (type: GL_VERTEX_SHADER, GL_FRAGMENT_SHADER)
|
||||
unsigned int rlCompileShader(const char *shaderCode, int type); // Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
|
||||
unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId); // Load custom shader program
|
||||
void rlUnloadShaderProgram(unsigned int id); // Unload shader program
|
||||
int rlGetLocationUniform(unsigned int shaderId, const char *uniformName); // Get shader location uniform
|
||||
|
|
6668
raylib_api.json
6668
raylib_api.json
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
|||
__version__ = "4.0a7"
|
||||
__version__ = "4.0a8"
|
Reference in a new issue