Update raylib and raygui binding.

This commit is contained in:
TSnake41 2021-01-28 23:42:11 +01:00
parent 57f8548f4d
commit 88b7d0f17e
6 changed files with 29 additions and 17 deletions

2
raygui

@ -1 +1 @@
Subproject commit f5bd6c08f8d761b625890e4256339ff93c770ac1 Subproject commit 28d7584fc1ad11aff3bb59de130ffca45b4dd7b3

2
raylib

@ -1 +1 @@
Subproject commit e25e380e80a117f2404d65b37700fb620dc1f990 Subproject commit bc332018f67fc6dcefd9f236b9147f20f17f86ab

View File

@ -660,11 +660,8 @@ ffi.cdef [[
-- Physac cdef -- Physac cdef
ffi.cdef [[ ffi.cdef [[
typedef enum PhysicsShapeType { PHYSICS_CIRCLE = 0, PHYSICS_POLYGON } PhysicsShapeType;
typedef struct PhysicsBodyData *PhysicsBody; typedef struct PhysicsBodyData *PhysicsBody;
typedef enum PhysicsShapeType {
PHYSICS_CIRCLE,
PHYSICS_POLYGON
} PhysicsShapeType;
typedef struct Matrix2x2 { typedef struct Matrix2x2 {
float m00; float m00;
@ -673,18 +670,18 @@ ffi.cdef [[
float m11; float m11;
} Matrix2x2; } Matrix2x2;
typedef struct PolygonData { typedef struct PhysicsVertexData {
unsigned int vertexCount; unsigned int vertexCount;
Vector2 positions[24]; Vector2 positions[24];
Vector2 normals[24]; Vector2 normals[24];
} PolygonData; } PhysicsVertexData;
typedef struct PhysicsShape { typedef struct PhysicsShape {
PhysicsShapeType type; PhysicsShapeType type;
PhysicsBody body; PhysicsBody body;
PhysicsVertexData vertexData;
float radius; float radius;
Matrix2x2 transform; Matrix2x2 transform;
PolygonData vertexData;
} PhysicsShape; } PhysicsShape;
typedef struct PhysicsBodyData { typedef struct PhysicsBodyData {
@ -708,6 +705,19 @@ ffi.cdef [[
bool freezeOrient; bool freezeOrient;
PhysicsShape shape; PhysicsShape shape;
} PhysicsBodyData; } PhysicsBodyData;
typedef struct PhysicsManifoldData {
unsigned int id;
PhysicsBody bodyA;
PhysicsBody bodyB;
float penetration;
Vector2 normal;
Vector2 contacts[2];
unsigned int contactsCount;
float restitution;
float dynamicFriction;
float staticFriction;
} PhysicsManifoldData, *PhysicsManifold;
]] ]]
-- gestures cdef -- gestures cdef

View File

@ -33,7 +33,6 @@
#include <raygui.h> #include <raygui.h>
#define PHYSAC_IMPLEMENTATION #define PHYSAC_IMPLEMENTATION
#define PHYSAC_NO_THREADS
#include <physac.h> #include <physac.h>
#include "autogen/bind.c" #include "autogen/bind.c"

View File

@ -25,6 +25,7 @@ void *GetWindowHandle(void)
int GetScreenWidth(void) int GetScreenWidth(void)
int GetScreenHeight(void) int GetScreenHeight(void)
int GetMonitorCount(void) int GetMonitorCount(void)
int GetCurrentMonitor(void)
Vector2 GetMonitorPosition(int monitor) Vector2 GetMonitorPosition(int monitor)
int GetMonitorWidth(int monitor) int GetMonitorWidth(int monitor)
int GetMonitorHeight(int monitor) int GetMonitorHeight(int monitor)
@ -117,6 +118,7 @@ bool IsGamepadButtonUp(int gamepad, int button)
int GetGamepadButtonPressed(void) int GetGamepadButtonPressed(void)
int GetGamepadAxisCount(int gamepad) int GetGamepadAxisCount(int gamepad)
float GetGamepadAxisMovement(int gamepad, int axis) float GetGamepadAxisMovement(int gamepad, int axis)
int SetGamepadMappings(const char *mappings)
bool IsMouseButtonPressed(int button) bool IsMouseButtonPressed(int button)
bool IsMouseButtonDown(int button) bool IsMouseButtonDown(int button)
bool IsMouseButtonReleased(int button) bool IsMouseButtonReleased(int button)
@ -154,6 +156,7 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) void DrawLineV(Vector2 startPos, Vector2 endPos, Color color)
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color)
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color)
void DrawLineStrip(Vector2 *points, int pointsCount, Color color) void DrawLineStrip(Vector2 *points, int pointsCount, Color color)
void DrawCircle(int centerX, int centerY, float radius, Color color) void DrawCircle(int centerX, int centerY, float radius, Color color)
void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color) void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color)
@ -347,6 +350,7 @@ void UnloadModelKeepMeshes(Model model)
Mesh *LoadMeshes(const char *fileName, int *meshCount) Mesh *LoadMeshes(const char *fileName, int *meshCount)
bool ExportMesh(Mesh mesh, const char *fileName) bool ExportMesh(Mesh mesh, const char *fileName)
void UnloadMesh(Mesh mesh) void UnloadMesh(Mesh mesh)
void UploadMesh(Mesh *mesh)
Material *LoadMaterials(const char *fileName, int *materialCount) Material *LoadMaterials(const char *fileName, int *materialCount)
Material LoadMaterialDefault(void) Material LoadMaterialDefault(void)
void UnloadMaterial(Material material) void UnloadMaterial(Material material)

View File

@ -1,20 +1,19 @@
void InitPhysics(void) void InitPhysics(void)
void RunPhysicsStep(void) void UpdatePhysics(void)
void ResetPhysics(void)
void ClosePhysics(void)
void SetPhysicsTimeStep(double delta) void SetPhysicsTimeStep(double delta)
bool IsPhysicsEnabled(void)
void SetPhysicsGravity(float x, float y) void SetPhysicsGravity(float x, float y)
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density) PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density) PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density) PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
void DestroyPhysicsBody(PhysicsBody body)
void PhysicsAddForce(PhysicsBody body, Vector2 force) void PhysicsAddForce(PhysicsBody body, Vector2 force)
void PhysicsAddTorque(PhysicsBody body, float amount) void PhysicsAddTorque(PhysicsBody body, float amount)
void PhysicsShatter(PhysicsBody body, Vector2 position, float force) void PhysicsShatter(PhysicsBody body, Vector2 position, float force)
int GetPhysicsBodiesCount(void) void SetPhysicsBodyRotation(PhysicsBody body, float radians)
PhysicsBody GetPhysicsBody(int index) PhysicsBody GetPhysicsBody(int index)
int GetPhysicsBodiesCount(void)
int GetPhysicsShapeType(int index) int GetPhysicsShapeType(int index)
int GetPhysicsShapeVerticesCount(int index) int GetPhysicsShapeVerticesCount(int index)
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex) Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex)
void SetPhysicsBodyRotation(PhysicsBody body, float radians)
void DestroyPhysicsBody(PhysicsBody body)
void ResetPhysics(void)
void ClosePhysics(void)