From f501ca9512cf2d48aede5ba9afcbf401b7fab2b4 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sun, 17 Oct 2021 00:00:01 +0200 Subject: [PATCH] Update binding Build by default for OpenGL 4.3 (may be changed in the future) Now consider LUA_PATH environment variable. --- build/buildRaylib.lua | 6 +++--- makefile | 2 +- raylib | 2 +- src/raylib.lua | 12 ++++++++---- src/raylua.lua | 4 ++++ tools/api.h | 4 +++- tools/rlgl.h | 2 +- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/build/buildRaylib.lua b/build/buildRaylib.lua index 29309e8..f969a62 100644 --- a/build/buildRaylib.lua +++ b/build/buildRaylib.lua @@ -13,8 +13,8 @@ local include_paths = "-I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw" local los = require "los" local consts = { - RAYLIB_VERSION = "3.7.0", - RAYLIB_API_VERSION = "370", + RAYLIB_VERSION = "4.0.0", + RAYLIB_API_VERSION = "400", } local vars = saphire.map({ @@ -23,7 +23,7 @@ local vars = saphire.map({ { "RAYLIB_LIB_NAME", "raylib" }, { "RAYLIB_RES_FILE", "./raylib.dll.rc.data" }, { "PLATFORM", "PLATFORM_DESKTOP" }, - { "GRAPHICS", "GRAPHICS_API_OPENGL_33" }, + { "GRAPHICS", "GRAPHICS_API_OPENGL_43" }, { "USE_EXTERNAL_GLFW", "FALSE" }, { "USE_WAYLAND_DISPLAY", "FALSE" } }, function (v) diff --git a/makefile b/makefile index fb4cb1e..705f777 100644 --- a/makefile +++ b/makefile @@ -13,7 +13,7 @@ MODULES := raymath rlgl easings gestures physac raygui # raylib settings PLATFORM ?= PLATFORM_DESKTOP -GRAPHICS ?= GRAPHICS_API_OPENGL_33 +GRAPHICS ?= GRAPHICS_API_OPENGL_43 USE_WAYLAND_DISPLAY ?= FALSE USE_EXTERNAL_GLFW ?= FALSE diff --git a/raylib b/raylib index 9b3d74d..99f6707 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit 9b3d74db6bd9e38bc1447f636897990bbd698b4b +Subproject commit 99f6707e2c80be2ac4c169fd6986ff2fd8d181a7 diff --git a/src/raylib.lua b/src/raylib.lua index fd5cb6f..4468e61 100644 --- a/src/raylib.lua +++ b/src/raylib.lua @@ -644,6 +644,14 @@ ffi.cdef [[ -- rlgl cdef ffi.cdef [[ + typedef enum { + OPENGL_11 = 1, + OPENGL_21, + OPENGL_33, + OPENGL_43, + OPENGL_ES_20 + } rlGlVersion; + typedef enum { RL_LOG_ALL = 0, RL_LOG_TRACE, @@ -773,10 +781,6 @@ ffi.cdef [[ typedef struct rlVertexBuffer { int elementCount; - int vCounter; - int tcCounter; - int cCounter; - float *vertices; float *texcoords; unsigned char *colors; diff --git a/src/raylua.lua b/src/raylua.lua index 979e511..0ce10a7 100644 --- a/src/raylua.lua +++ b/src/raylua.lua @@ -45,6 +45,10 @@ end package.path = "?.lua;?/init.lua" +if os.getenv "LUA_PATH" then + package.path = package.path .. ";" .. os.getenv "LUA_PATH" +end + if raylua.loadfile then -- Change the second loader to load files using raylua.loadfile package.loaders[2] = function (name) diff --git a/tools/api.h b/tools/api.h index 6b1aee1..a18b002 100644 --- a/tools/api.h +++ b/tools/api.h @@ -217,6 +217,7 @@ bool CheckCollisionPointRec(Vector2 point, Rectangle rec) bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius) bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint) +bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold) Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) Image LoadImage(const char *fileName) Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize) @@ -233,7 +234,6 @@ Image GenImageGradientH(int width, int height, Color left, Color right) Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer) Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2) Image GenImageWhiteNoise(int width, int height, float factor) -Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale) Image GenImageCellular(int width, int height, int tileSize) Image ImageCopy(Image image) Image ImageFromImage(Image image, Rectangle rec) @@ -368,7 +368,9 @@ void DrawSphere(Vector3 centerPos, float radius, Color color) void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color) void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color) void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) +void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color) +void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color) void DrawPlane(Vector3 centerPos, Vector2 size, Color color) void DrawRay(Ray ray, Color color) void DrawGrid(int slices, float spacing) diff --git a/tools/rlgl.h b/tools/rlgl.h index 3665918..ae314f1 100644 --- a/tools/rlgl.h +++ b/tools/rlgl.h @@ -96,7 +96,7 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer) unsigned int rlLoadTextureCubemap(void *data, int size, int format) void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data) -void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType) +void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType) const char *rlGetPixelFormatName(unsigned int format) void rlUnloadTexture(unsigned int id) void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps)