From 8d7f4b0dbce38d0c697c1fdc747daaf18c03652c Mon Sep 17 00:00:00 2001 From: Astie Teddy Date: Sat, 5 Sep 2020 16:15:31 +0200 Subject: [PATCH] Update binding, more compatibility informations. --- README.md | 6 ++++-- makefile | 2 +- raylib | 2 +- src/compat.lua | 3 +++ src/raylib.lua | 4 +++- tools/api.h | 5 +++++ tools/raymath.h | 1 + tools/rlgl.h | 2 +- 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9523de9..cb5592b 100644 --- a/README.md +++ b/README.md @@ -110,9 +110,11 @@ rl.CloseWindow() ### Compatibility -raylib-lua (raylua) currently uses raylib 3.0 API. +raylib-lua (raylua) currently uses raylib 3.1-dev API with some 3.0 API compatibility +(see [compat.lua](https://github.com/TSnake41/raylib-lua/blob/master/src/compat.lua)). physac and rlgl modules are built-in by default. -There is currently no support for raygui but it may be considered in the future. +raygui is supported, but is minimally tested, please report any issues you have +with raygui with raylib-lua (raylua) on GitHub or raylib Discord (#raylib-lua channel) #### Global API diff --git a/makefile b/makefile index 193ce99..4a6a85f 100644 --- a/makefile +++ b/makefile @@ -7,7 +7,7 @@ LUA ?= luajit/src/luajit WINDRES ?= windres CFLAGS += -Iluajit/src -Iraylib/src -Iraygui/src -LDFLAGS += -Lluajit/src -Lraylib/src -lraylib +LDFLAGS += -Lluajit/src -Lraylib -lraylib MODULES := raymath rlgl easings gestures physac raygui diff --git a/raylib b/raylib index ccdd8b5..be03613 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit ccdd8b5f28f4aaffda2b637e9cb7602ca167ba5f +Subproject commit be03613d1b6f9b0051d78c790f97df069150c65f diff --git a/src/compat.lua b/src/compat.lua index 457e902..bd5ad47 100644 --- a/src/compat.lua +++ b/src/compat.lua @@ -24,6 +24,9 @@ rawset(rl, "LoadImageEx", function (pixels, width, height) return image end) +-- rlUnproject moved to Vector3Unproject +rawset(rl, "rlUnproject", rl.Vector3Unproject) + -- math metamethods local new = ffi.new diff --git a/src/raylib.lua b/src/raylib.lua index ae3ed33..8549824 100644 --- a/src/raylib.lua +++ b/src/raylib.lua @@ -563,7 +563,9 @@ ffi.cdef [[ BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED, - BLEND_ADD_COLORS + BLEND_ADD_COLORS, + BLEND_SUBTRACT_COLORS, + BLEND_CUSTOM } BlendMode; typedef enum { diff --git a/tools/api.h b/tools/api.h index 546afcb..cd36fb6 100644 --- a/tools/api.h +++ b/tools/api.h @@ -3,6 +3,7 @@ bool WindowShouldClose(void) void CloseWindow(void) bool IsWindowReady(void) bool IsWindowMinimized(void) +bool IsWindowMaximized(void) bool IsWindowFocused(void) bool IsWindowResized(void) bool IsWindowHidden(void) @@ -10,6 +11,10 @@ bool IsWindowFullscreen(void) void ToggleFullscreen(void) void UnhideWindow(void) void HideWindow(void) +void DecorateWindow(void) +void UndecorateWindow(void) +void MaximizeWindow(void) +void RestoreWindow(void) void SetWindowIcon(Image image) void SetWindowTitle(const char *title) void SetWindowPosition(int x, int y) diff --git a/tools/raymath.h b/tools/raymath.h index e9b5274..d12db3a 100644 --- a/tools/raymath.h +++ b/tools/raymath.h @@ -88,3 +88,4 @@ void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle) Quaternion QuaternionFromEuler(float roll, float pitch, float yaw) Vector3 QuaternionToEuler(Quaternion q) Quaternion QuaternionTransform(Quaternion q, Matrix mat) +Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view) diff --git a/tools/rlgl.h b/tools/rlgl.h index 96420ca..21fb70f 100644 --- a/tools/rlgl.h +++ b/tools/rlgl.h @@ -49,8 +49,8 @@ void rlCheckErrors(void) int rlGetVersion(void) bool rlCheckBufferLimit(int vCount) void rlSetDebugMarker(const char *text) +void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation) void rlLoadExtensions(void *loader) -Vector3 rlUnproject(Vector3 source, Matrix proj, Matrix view) unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount) unsigned int rlLoadTextureDepth(int width, int height, int bits, bool useRenderBuffer) unsigned int rlLoadTextureCubemap(void *data, int size, int format)