From 3c9f7263e572a9d21076de821ae8f66d583e352e Mon Sep 17 00:00:00 2001 From: kernelkinetic <67117582+kernelkinetic@users.noreply.github.com> Date: Tue, 13 Oct 2020 22:26:40 +0200 Subject: [PATCH 1/8] fixed mouse movements are bound to the screen resolution (https://github.com/raysan5/raylib/issues/1392) (#1410) --- src/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index 952af5610..f1d7241a4 100644 --- a/src/core.c +++ b/src/core.c @@ -5338,11 +5338,14 @@ static void *EventThread(void *arg) } // Screen confinement - if (CORE.Input.Mouse.position.x < 0) CORE.Input.Mouse.position.x = 0; - if (CORE.Input.Mouse.position.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.position.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x; + if (!CORE.Input.Mouse.cursorHidden) + { + if (CORE.Input.Mouse.position.x < 0) CORE.Input.Mouse.position.x = 0; + if (CORE.Input.Mouse.position.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.position.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x; - if (CORE.Input.Mouse.position.y < 0) CORE.Input.Mouse.position.y = 0; - if (CORE.Input.Mouse.position.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.position.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y; + if (CORE.Input.Mouse.position.y < 0) CORE.Input.Mouse.position.y = 0; + if (CORE.Input.Mouse.position.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.position.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y; + } // Gesture update if (gestureUpdate) From 5df08daa3f779021dc70743267a087c863044d3b Mon Sep 17 00:00:00 2001 From: Rabia Alhaffar Date: Tue, 20 Oct 2020 22:03:19 +0300 Subject: [PATCH 2/8] Added Boo bindings for raylib! (#1412) --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 0c1a712d2..e1f5d08ec 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -10,6 +10,7 @@ Here it is a list with the ones I'm aware of: | raylib-cpp | 3.1-dev | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp | | Raylib-cs | 3.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs | | raylib-cppsharp | ? | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | +| raylib-boo | 3.0 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo | | RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS | | raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d | | raylib-d | 3.0 | [D](https://dlang.org/) | https://github.com/onroundit/raylib-d | From eb3e9e4df53c0908a4ae3dd91cbe0e3a42134794 Mon Sep 17 00:00:00 2001 From: Rabia Alhaffar Date: Wed, 21 Oct 2020 01:13:39 +0300 Subject: [PATCH 3/8] Added version of raylib-cppsharp via used raylib license date! (#1413) It's 2.5 @raysan5 Oh...There are 4 bindings has license date of 2016, But unsure if 1.6.0 or 1.5.0 or 1.4.0 :( Co-authored-by: Ray --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index e1f5d08ec..851b2ea4c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -9,7 +9,7 @@ Here it is a list with the ones I'm aware of: | raylib | **3.1-dev** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib | | raylib-cpp | 3.1-dev | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp | | Raylib-cs | 3.0 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs | -| raylib-cppsharp | ? | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | +| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp | | raylib-boo | 3.0 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo | | RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS | | raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d | From 9833fe45eb5cd6cfd3593b7f4d1aae9cf7367729 Mon Sep 17 00:00:00 2001 From: Chance Snow Date: Wed, 21 Oct 2020 03:55:52 -0500 Subject: [PATCH 4/8] Added desktop cursor getter and setter functions (#1407) * [core] Added desktop cursor getter and setter functions * Example: Set mouse cursor in text input box * Setup standard cursors _after_ GLFW window initialization * Remove old `int GetMouseWheelMove` declaration --- examples/text/text_input_box.c | 7 +++ .../raylib_npp_parser/raylib_to_parse.h | 2 + src/core.c | 53 ++++++++++++++++++- src/raylib.h | 23 ++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index 650ca2078..b68f762cf 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -43,6 +43,9 @@ int main(void) if (mouseOnText) { + // Set the window's cursor to the I-Beam + SetMouseCursor(MOUSE_CURSOR_IBEAM); + // Get pressed key (character) on the queue int key = GetKeyPressed(); @@ -67,6 +70,10 @@ int main(void) if (letterCount < 0) letterCount = 0; } } + else if (GetMouseCursor() != MOUSE_CURSOR_DEFAULT) + { + SetMouseCursor(MOUSE_CURSOR_DEFAULT); + } if (mouseOnText) framesCounter++; else framesCounter = 0; diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 7ef12f939..a03d5b8f2 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -148,6 +148,8 @@ RLAPI void SetMousePosition(int x, int y); // Set mouse posit RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y +RLAPI MouseCursor GetMouseCursor(void); // Returns mouse cursor +RLAPI void SetMouseCursor(MouseCursor cursor); // Set mouse cursor // Input-related functions: touch RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) diff --git a/src/core.c b/src/core.c index f1d7241a4..3534caedf 100644 --- a/src/core.c +++ b/src/core.c @@ -423,6 +423,8 @@ typedef struct CoreData { Vector2 offset; // Mouse offset Vector2 scale; // Mouse scaling + MouseCursor cursor; // Tracks current mouse cursor + void* standardCursors[10]; // Opaque pointers to GLFW cursors bool cursorHidden; // Track if cursor is hidden bool cursorOnScreen; // Tracks if cursor is inside client area @@ -653,8 +655,9 @@ void InitWindow(int width, int height, const char *title) // Initialize required global values different than 0 CORE.Input.Keyboard.exitKey = KEY_ESCAPE; CORE.Input.Mouse.scale = (Vector2){ 1.0f, 1.0f }; + CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW; CORE.Input.Gamepad.lastButtonPressed = -1; - + #if defined(PLATFORM_UWP) // The axis count is 6 (2 thumbsticks and left and right trigger) CORE.Input.Gamepad.axisCount = 6; @@ -753,6 +756,26 @@ void InitWindow(int width, int height, const char *title) #endif #endif +#if defined(PLATFORM_DESKTOP) + // Initialize GLFW's standard cursors + const int shapes[] = { + 0x00036001, // MOUSE_CURSOR_ARROW + 0x00036002, // MOUSE_CURSOR_IBEAM + 0x00036003, // MOUSE_CURSOR_CROSSHAIR + 0x00036004, // MOUSE_CURSOR_POINTING_HAND + 0x00036005, // MOUSE_CURSOR_RESIZE_EW + 0x00036006, // MOUSE_CURSOR_RESIZE_NS + 0x00036007, // MOUSE_CURSOR_RESIZE_NWSE + 0x00036008, // MOUSE_CURSOR_RESIZE_NESW + 0x00036009, // MOUSE_CURSOR_RESIZE_ALL + 0x0003600A, // MOUSE_CURSOR_NOT_ALLOWED + }; + for (int i = 0; i < sizeof(CORE.Input.Mouse.standardCursors) / sizeof(CORE.Input.Mouse.standardCursors[0]); i += 1) + { + CORE.Input.Mouse.standardCursors[i] = glfwCreateStandardCursor(shapes[i]); + } +#endif + #if defined(PLATFORM_WEB) // Detect fullscreen change events emscripten_set_fullscreenchange_callback("#canvas", NULL, 1, EmscriptenFullscreenChangeCallback); @@ -797,6 +820,11 @@ void CloseWindow(void) rlglClose(); // De-init rlgl +#if defined(PLATFORM_DESKTOP) + for (int i = 0; i < sizeof(CORE.Input.Mouse.standardCursors) / sizeof(CORE.Input.Mouse.standardCursors[0]); i += 1) + glfwDestroyCursor(CORE.Input.Mouse.standardCursors[i]); +#endif + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwDestroyWindow(CORE.Window.handle); glfwTerminate(); @@ -2733,6 +2761,29 @@ float GetMouseWheelMove(void) #endif } +// Returns mouse cursor +MouseCursor GetMouseCursor(void) +{ + return CORE.Input.Mouse.cursor; +} + +// Set mouse cursor +// NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP +void SetMouseCursor(MouseCursor cursor) +{ +#if defined(PLATFORM_DESKTOP) + CORE.Input.Mouse.cursor = cursor; + if (cursor == MOUSE_CURSOR_DEFAULT) + { + glfwSetCursor(CORE.Window.handle, NULL); + } + else + { + glfwSetCursor(CORE.Window.handle, CORE.Input.Mouse.standardCursors[cursor]); + } +#endif +} + // Returns touch position X for touch point 0 (relative to screen size) int GetTouchX(void) { diff --git a/src/raylib.h b/src/raylib.h index f0eef587d..bb5a3c473 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -617,6 +617,27 @@ typedef enum { MOUSE_MIDDLE_BUTTON = 2 } MouseButton; +// Mouse cursor types +typedef enum { + MOUSE_CURSOR_DEFAULT = -1, + MOUSE_CURSOR_ARROW = 0, + MOUSE_CURSOR_IBEAM = 1, + MOUSE_CURSOR_CROSSHAIR = 2, + MOUSE_CURSOR_POINTING_HAND = 3, + // The horizontal resize/move arrow shape. + MOUSE_CURSOR_RESIZE_EW = 4, + // The vertical resize/move arrow shape. + MOUSE_CURSOR_RESIZE_NS = 5, + // The top-left to bottom-right diagonal resize/move arrow shape. + MOUSE_CURSOR_RESIZE_NWSE = 6, + // The top-right to bottom-left diagonal resize/move arrow shape. + MOUSE_CURSOR_RESIZE_NESW = 7, + // The omni-directional resize/move cursor shape. + MOUSE_CURSOR_RESIZE_ALL = 8, + // The operation-not-allowed shape. + MOUSE_CURSOR_NOT_ALLOWED = 9 +} MouseCursor; + // Gamepad number typedef enum { GAMEPAD_PLAYER1 = 0, @@ -1016,6 +1037,8 @@ RLAPI void SetMousePosition(int x, int y); // Set mouse posit RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y +RLAPI MouseCursor GetMouseCursor(void); // Returns mouse cursor +RLAPI void SetMouseCursor(MouseCursor cursor); // Set mouse cursor // Input-related functions: touch RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) From f12db180cd84553bd26c11f4e6585f81c3e611c3 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 21 Oct 2020 11:08:37 +0200 Subject: [PATCH 5/8] Reviewed PR #1407 --- examples/text/text_input_box.c | 5 +---- src/core.c | 40 +++++----------------------------- src/raylib.h | 32 +++++++++++---------------- 3 files changed, 20 insertions(+), 57 deletions(-) diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index b68f762cf..174c38d6a 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -70,10 +70,7 @@ int main(void) if (letterCount < 0) letterCount = 0; } } - else if (GetMouseCursor() != MOUSE_CURSOR_DEFAULT) - { - SetMouseCursor(MOUSE_CURSOR_DEFAULT); - } + else if (GetMouseCursor() != MOUSE_CURSOR_DEFAULT) SetMouseCursor(MOUSE_CURSOR_DEFAULT); if (mouseOnText) framesCounter++; else framesCounter = 0; diff --git a/src/core.c b/src/core.c index 3534caedf..917c8b321 100644 --- a/src/core.c +++ b/src/core.c @@ -423,8 +423,7 @@ typedef struct CoreData { Vector2 offset; // Mouse offset Vector2 scale; // Mouse scaling - MouseCursor cursor; // Tracks current mouse cursor - void* standardCursors[10]; // Opaque pointers to GLFW cursors + int cursor; // Tracks current mouse cursor bool cursorHidden; // Track if cursor is hidden bool cursorOnScreen; // Tracks if cursor is inside client area @@ -756,26 +755,6 @@ void InitWindow(int width, int height, const char *title) #endif #endif -#if defined(PLATFORM_DESKTOP) - // Initialize GLFW's standard cursors - const int shapes[] = { - 0x00036001, // MOUSE_CURSOR_ARROW - 0x00036002, // MOUSE_CURSOR_IBEAM - 0x00036003, // MOUSE_CURSOR_CROSSHAIR - 0x00036004, // MOUSE_CURSOR_POINTING_HAND - 0x00036005, // MOUSE_CURSOR_RESIZE_EW - 0x00036006, // MOUSE_CURSOR_RESIZE_NS - 0x00036007, // MOUSE_CURSOR_RESIZE_NWSE - 0x00036008, // MOUSE_CURSOR_RESIZE_NESW - 0x00036009, // MOUSE_CURSOR_RESIZE_ALL - 0x0003600A, // MOUSE_CURSOR_NOT_ALLOWED - }; - for (int i = 0; i < sizeof(CORE.Input.Mouse.standardCursors) / sizeof(CORE.Input.Mouse.standardCursors[0]); i += 1) - { - CORE.Input.Mouse.standardCursors[i] = glfwCreateStandardCursor(shapes[i]); - } -#endif - #if defined(PLATFORM_WEB) // Detect fullscreen change events emscripten_set_fullscreenchange_callback("#canvas", NULL, 1, EmscriptenFullscreenChangeCallback); @@ -820,11 +799,6 @@ void CloseWindow(void) rlglClose(); // De-init rlgl -#if defined(PLATFORM_DESKTOP) - for (int i = 0; i < sizeof(CORE.Input.Mouse.standardCursors) / sizeof(CORE.Input.Mouse.standardCursors[0]); i += 1) - glfwDestroyCursor(CORE.Input.Mouse.standardCursors[i]); -#endif - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwDestroyWindow(CORE.Window.handle); glfwTerminate(); @@ -2762,24 +2736,22 @@ float GetMouseWheelMove(void) } // Returns mouse cursor -MouseCursor GetMouseCursor(void) +int GetMouseCursor(void) { return CORE.Input.Mouse.cursor; } // Set mouse cursor // NOTE: This is a no-op on platforms other than PLATFORM_DESKTOP -void SetMouseCursor(MouseCursor cursor) +void SetMouseCursor(int cursor) { #if defined(PLATFORM_DESKTOP) CORE.Input.Mouse.cursor = cursor; - if (cursor == MOUSE_CURSOR_DEFAULT) - { - glfwSetCursor(CORE.Window.handle, NULL); - } + if (cursor == MOUSE_CURSOR_DEFAULT) glfwSetCursor(CORE.Window.handle, NULL); else { - glfwSetCursor(CORE.Window.handle, CORE.Input.Mouse.standardCursors[cursor]); + // NOTE: We are relating internal GLFW enum values to our MouseCursor enum values + glfwSetCursor(CORE.Window.handle, glfwCreateStandardCursor(0x00036000 + cursor)); } #endif } diff --git a/src/raylib.h b/src/raylib.h index bb5a3c473..36a9b63de 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -619,23 +619,17 @@ typedef enum { // Mouse cursor types typedef enum { - MOUSE_CURSOR_DEFAULT = -1, - MOUSE_CURSOR_ARROW = 0, - MOUSE_CURSOR_IBEAM = 1, - MOUSE_CURSOR_CROSSHAIR = 2, - MOUSE_CURSOR_POINTING_HAND = 3, - // The horizontal resize/move arrow shape. - MOUSE_CURSOR_RESIZE_EW = 4, - // The vertical resize/move arrow shape. - MOUSE_CURSOR_RESIZE_NS = 5, - // The top-left to bottom-right diagonal resize/move arrow shape. - MOUSE_CURSOR_RESIZE_NWSE = 6, - // The top-right to bottom-left diagonal resize/move arrow shape. - MOUSE_CURSOR_RESIZE_NESW = 7, - // The omni-directional resize/move cursor shape. - MOUSE_CURSOR_RESIZE_ALL = 8, - // The operation-not-allowed shape. - MOUSE_CURSOR_NOT_ALLOWED = 9 + MOUSE_CURSOR_DEFAULT = 0, + MOUSE_CURSOR_ARROW = 1, + MOUSE_CURSOR_IBEAM = 2, + MOUSE_CURSOR_CROSSHAIR = 3, + MOUSE_CURSOR_POINTING_HAND = 4, + MOUSE_CURSOR_RESIZE_EW = 5, // The horizontal resize/move arrow shape + MOUSE_CURSOR_RESIZE_NS = 6, // The vertical resize/move arrow shape + MOUSE_CURSOR_RESIZE_NWSE = 7, // The top-left to bottom-right diagonal resize/move arrow shape + MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape + MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape + MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape } MouseCursor; // Gamepad number @@ -1037,8 +1031,8 @@ RLAPI void SetMousePosition(int x, int y); // Set mouse posit RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y -RLAPI MouseCursor GetMouseCursor(void); // Returns mouse cursor -RLAPI void SetMouseCursor(MouseCursor cursor); // Set mouse cursor +RLAPI int GetMouseCursor(void); // Returns mouse cursor if (MouseCursor enum) +RLAPI void SetMouseCursor(int cursor); // Set mouse cursor // Input-related functions: touch RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) From e820aae80b826391097122d91dc2fef41c58c321 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 21 Oct 2020 23:27:00 +0200 Subject: [PATCH 6/8] Added raylib 3.5 CHANGELOG -WIP- --- CHANGELOG | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 780f80893..654be846e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,156 @@ changelog Current Release: raylib 3.0.0 (01 April 2020) +------------------------------------------------------------------------- +Release: raylib 3.5 - 7th Anniversary Edition (November 2020) -WIP- +------------------------------------------------------------------------- +KEY CHANGES: + - [core] NEW platform supported: PLATFORM_DRM (#1388) by @kernelkinetic + - [rlgl] ADDED RenderBatch type and related functions to allow custom batching + - [rlgl] REDESIGN framebuffers API to support multiple attachment types (#721) + - [textures] REDESIGNED Image*() functions, big performance improvements (software rendering) + - [*] REVIEWED multiple functions to replace file accesses by memory accesses + - [*] NEW GitHub Actions CI to support multiple raylib build configurations + +Detailed changes: +[core] ADDED: IsWindowFocused() +[core] ADDED: GetWindowScaleDPI() +[core] ADDED: GetMonitorRefreshRate() (#1289) by @Shylie +[core] ADDED: IsCursorOnScreen() (#1262) by @ChrisDill +[core] ADDED: SetMouseCursor() and GetMouseCursor() for standard Desktop mouse cursors (#1407) by @chances +[core] REMOVED: struct RenderTexture2D: depthTexture variable +[core] RENAMED: GetExtension() to GetFileExtension() +[core] REVIEWED: Several structs to reduce size and padding +[core] REVIEWED: struct Texture maps to Texture2D and TextureCubemap +[core] REVIEWED: ToggleFullscreen() (#1287) +[core] REVIEWED: InitWindow(), support empty title for window (#1323) +[core] REVIEWED: RPI: Mouse movements are bound to the screen resolution (#1392) (#1410) by @kernelkinetic +[core] REVIEWED: GetPrevDirectoryPath() fixes on Unix-like systems (#1246) by @ivan-cx +[core] REDESIGNED: GetMouseWheelMove(): Return float movement for precise scrolling where possible (#1397) by @Doy-lee +[core] UWP rework with improvements (#1231) by @Rover656 +[core] Gamepad axis bug fixes and improvement (#1228) by @mmalecot +[core] Updated joystick mappings with latest version of gamecontrollerdb (#1381) by @coderoth +[rlgl] Corrected issue with OpenGL 1.1 support +[rlgl] ADDED: rlDrawMeshInstanced() (#1318) by @seanpringle +[rlgl] ADDED: rlCheckErrors (#1321) by @seanpringle +[rlgl] ADDED: BLEND_SET blending mode (#1251) by @RandomErrorMessage +[rlgl] RENAMED: rlUnproject() to Vector3Unproject() [raymath] +[rlgl] REVIEWED: Replace rlglDraw() calls by DrawRenderBatch() internal calls +[rlgl] REVIEWED: GenTextureCubemap(), use rlgl functionality only +[rlgl] REVIEWED: rlFramebufferAttach() to support texture layers +[rlgl] REVIEWED: GenDrawCube() and GenDrawQuad() +[rlgl] REVIEWED: Issues with vertex batch overflow (#1223) +[rlgl] REDESIGNED: GenTexture*() to use the new fbo API (#721) +[raymath] ADDED: Normalize() and Remap() functions (#1247) by @NoorWachid +[raymath] ADDED: Vector2Reflect() (#1400) by @daniel-junior-dube +[raymath] ADDED: Vector2LengthSqr() and Vector3LengthSqr() (#1248) by @ThePituLegend +[raymath] ADDED: Vector2MoveTowards() function (#1233) by @anatagawa +[raymath] REVIEWED: Some functions consistency (#1197) by @Not-Nik +[raymath] REVIEWED: QuaternionFromVector3ToVector3() (#1263) by @jvocaturo +[text] Avoid [textures] functions dependencies +[text] ADDED: Config flag: SUPPORT_TEXT_MANIPULATION +[text] ADDED: LoadFontFromMemory() (TTF only) (#1327) +[text] RENAMED: FormatText() -> TextFormat() +[text] REVIEWED: TextJoin() +[text] REVIEWED: TextReplace() (#1172) +[text] REVIEWED: LoadBMFont() to load data from memory (#1232) +[text] REVIEWED: GenImageFontAtlas(), fixed offset (#1171) +[text] REDESIGNED: LoadFontData() +[text] REDESIGNED: LoadFontDefault(), some code simplifications +[text] REDESIGNED: LoadFontFromImage(), avoid LoadImageEx() +[text] REDESIGNED: LoadFontData(), avoid GenImageColor(), ImageFormat() +[text] REDESIGNED: LoadBMFont(), avoid ImageCopy(), ImageFormat(), ImageAlphaMask() +[textures] Move Color functions from [core] to [textures] module +[textures] ADDED: ColorAlphaBlend() +[textures] ADDED: GetPixelColor() +[textures] ADDED: SetPixelColor() +[textures] ADDED: LoadImageFromMemory() (#1327) +[textures] ADDED: LoadImageAnim() to load animated sequence of images +[textures] ADDED: DrawTextureTiled() (#1291) - @Demizdor +[textures] ADDED: UpdateTextureRec() +[textures] REMOVED: Config flag: SUPPORT_IMAGE_DRAWING +[textures] REMOVED: LoadImageEx() +[textures] REMOVED: LoadImagePro() +[textures] RENAMED: ImageExtractPalette() to GetImagePalette() +[textures] RENAMED: Fade() to ColorAlpha(), added #define for compatibility +[textures] REVIEWED: GetPixelDataSize() to consider compressed data properly +[textures] REVIEWED: GetTextureData(), allow retrieving 32bit float data +[textures] REVIEWED: ImageDrawText*() params order +[textures] REVIEWED: ColorAlphaBlend(), support tint color +[textures] REVIEWED: ColorAlphaBlend(), integers-version, optimized (#1218) +[textures] REVIEWED: ImageDraw(), consider negative source offset properly (#1283) +[textures] REVIEWED: ImageDraw(), optimizations test (#1218) +[textures] REVIEWED: ImageResizeCanvas(), optimization (#1218) +[textures] REVIEWED: ExportImage(), optimized +[textures] REVIEWED: ImageAlphaPremultiply(), optimization +[textures] REVIEWED: ImageAlphaClear(), minor optimization +[textures] REVIEWED: ImageToPOT(), renamed parameter +[textures] REVIEWED: ImageCrop() (#1218) +[textures] REVIEWED: ImageToPOT() (#1218) +[textures] REVIEWED: ImageAlphaCrop() (#1218) +[textures] REVIEWED: ExportImage(), optimized (#1218) +[textures] REDESIGNED: ImageCrop(), optimized (#1218) +[textures] REDESIGNED: ImageRotateCCW(), optimized (#1218) +[textures] REDESIGNED: ImageRotateCW(), optimized (#1218) +[textures] REDESIGNED: ImageFlipHorizontal(), optimized (#1218) +[textures] REDESIGNED: ImageFlipVertical(), optimized (#1218) +[textures] REDESIGNED: ImageResizeCanvas(), optimized (#1218) +[textures] REDESIGNED: ImageDrawPixel(), optimized +[textures] REDESIGNED: ImageDrawLine(), optimized +[textures] REDESIGNED: ImageDraw(), optimized (#1218) +[textures] REDESIGNED: ImageResize(), optimized (#1218) +[textures] REDESIGNED: ImageFromImage(), optimized (#1218) +[textures] REDESIGNED: ImageDraw(), optimization (#1218) +[textures] REDESIGNED: ImageAlphaClear(), optimized (#1218) +[textures] REDESIGNED: ExportImageAsCode() to use memory buffer (#1232) +[textures] REDESIGNED: ColorFromHSV() +[models] ADDED: DrawTriangle3D() and DrawTriangleStrip3D() +[models] REVIEWED: LoadModel(), avoid loading texcoords and normals from model if not existent +[models] REVIEWED: GenMeshCubicmap(), added comments and simplification +[models] REVIEWED: GenMeshCubicmap(), fixed generated normals (#1244) by @GoldenThumbs +[models] REVIEWED: GenMeshPoly(), fixed buffer overflow (#1269) by @frithrah +[models] REVIEWED: LoadOBJ(): Allow for multiple materials in obj files (#1408) by @chriscamacho and @codifies +[models] REVIEWED: LoadIQM() materials loading (#1227) by @sikor666 +[models] REVIEWED: LoadGLTF() to read from memory buffer +[models] REVIEWED: UpdateMesh(), fix extra memory allocated when updating color buffer (#1271) by @4yn +[models] REVIEWED: MeshNormalsSmooth() (#1317) by @seanpringle +[models] REDESIGNED: ExportMesh() to use memory buffer (#1232) +[models] REDESIGNED: LoadIQM() and LoadModelAnimations() to use memory buffers +[audio] ADDED: LoadWaveFromMemory() (#1327) +[audio] REMOVED: SetMusicLoopCount() +[audio] REVIEWED: SaveWAV() to use memory write insted of file +[audio] REVIEWED: LoadMusicStream(), support WAV music streaming (#1198) +[audio] REVIEWED: Support multiple WAV sampleSize for MusicStream (#1340) +[audio] REDESIGNED: Audio looping system +[audio] REDESIGNED: LoadSound(): Use memory loading (WAV, OGG, MP3, FLAC) (#1312) +[audio] REDESIGNED: ExportWaveAsCode() to use memory buffers +[utils] REVIEWED: android_fopen() to support SDCard access +[rmem] REVIEWED: MemPool and other allocators optimization (#1211) by @assyrianic +[examples] ADDED: others/embedded_files_loading +[examples] ADDED: shaders/shaders_hot_reloading (#1198) +[examples] ADDED: textures/textures_blend_modes (#1261) by @accidentalrebel +[examples] REVIEWED: models/models_skybox to work on OpenGL ES 2.0 +[examples] REVIEWED: textures/textures_raw_data (#1286) +[examples] REVIEWED: others/raudio_standalone.c +[examples] REVIEWED: audio/resources, use open license resources +[examples] REVIEWED: textures/textures_sprite_explosion, replace resources +[examples] REVIEWED: textures/textures_particles_blending, replace resources +[build] REMOVED: ANGLE VS2017 template project +[build] Avoided all MSVC compile warnings +[build] Additional config.h configuration options exposing multiple #define values +[build] Updated Makefile for web (#1332) by @rfaile313 +[build] Updated build pipelines to use latest emscripten and android ndk +[build] Updated emscriptem build script to generate .a on WebAssembly +[build] Fixed Android build for Linux, supporting ANDROID_NDK to be modified at compile time by @branlix3000 +[build] Updated VSCode project template tasks +[build] Updated VS2017.UWP project template by @Rover656 +[build] Updated Android build pipeline +[*] Moved raysan5/raylib/games to independent repo: raysan5/raylib-games +[*] Replaced several examples resources with more open licensed alternatives +[*] Updated BINDINGS.md with NEW bindings and added raylib version binding! +[*] Updated all external libraries to latest versions +[*] Multiple code improvements and small fixes + ----------------------------------------------- Release: raylib 3.0 (01 April 2020) ----------------------------------------------- From 88dbaae3bec18c6fd2d2154b1feeefb28086a09a Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 21 Oct 2020 23:32:24 +0200 Subject: [PATCH 7/8] Update CHANGELOG --- CHANGELOG | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 654be846e..9cacc0a0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,7 +19,7 @@ Detailed changes: [core] ADDED: GetWindowScaleDPI() [core] ADDED: GetMonitorRefreshRate() (#1289) by @Shylie [core] ADDED: IsCursorOnScreen() (#1262) by @ChrisDill -[core] ADDED: SetMouseCursor() and GetMouseCursor() for standard Desktop mouse cursors (#1407) by @chances +[core] ADDED: SetMouseCursor() and GetMouseCursor() for standard Desktop cursors (#1407) by @chances [core] REMOVED: struct RenderTexture2D: depthTexture variable [core] RENAMED: GetExtension() to GetFileExtension() [core] REVIEWED: Several structs to reduce size and padding @@ -28,7 +28,7 @@ Detailed changes: [core] REVIEWED: InitWindow(), support empty title for window (#1323) [core] REVIEWED: RPI: Mouse movements are bound to the screen resolution (#1392) (#1410) by @kernelkinetic [core] REVIEWED: GetPrevDirectoryPath() fixes on Unix-like systems (#1246) by @ivan-cx -[core] REDESIGNED: GetMouseWheelMove(): Return float movement for precise scrolling where possible (#1397) by @Doy-lee +[core] REDESIGNED: GetMouseWheelMove() to return float movement for precise scrolling (#1397) by @Doy-lee [core] UWP rework with improvements (#1231) by @Rover656 [core] Gamepad axis bug fixes and improvement (#1228) by @mmalecot [core] Updated joystick mappings with latest version of gamecontrollerdb (#1381) by @coderoth @@ -143,7 +143,7 @@ Detailed changes: [build] Updated Makefile for web (#1332) by @rfaile313 [build] Updated build pipelines to use latest emscripten and android ndk [build] Updated emscriptem build script to generate .a on WebAssembly -[build] Fixed Android build for Linux, supporting ANDROID_NDK to be modified at compile time by @branlix3000 +[build] Updated Android build for Linux, supporting ANDROID_NDK at compile time by @branlix3000 [build] Updated VSCode project template tasks [build] Updated VS2017.UWP project template by @Rover656 [build] Updated Android build pipeline From 482b8a5e7e569c7abd665645b7678468bafa2e1a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 24 Oct 2020 10:37:15 +0200 Subject: [PATCH 8/8] Some tweaks --- src/core.c | 5 +++-- src/raylib.h | 32 ++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/core.c b/src/core.c index 917c8b321..9b3cf5576 100644 --- a/src/core.c +++ b/src/core.c @@ -5769,7 +5769,7 @@ void UWPGestureTouch(int pointer, float x, float y, bool touch) #endif // PLATFORM_UWP #if defined(PLATFORM_DRM) - +// Search matching DRM mode in connector's mode list static int FindMatchingConnectorMode(const drmModeConnector *connector, const drmModeModeInfo *mode) { if (NULL == connector) return -1; @@ -5795,6 +5795,7 @@ static int FindMatchingConnectorMode(const drmModeConnector *connector, const dr #undef BINCMP } +// Search exactly matching DRM connector mode in connector's list static int FindExactConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced) { TRACELOG(LOG_TRACE, "searching exact connector mode for %ux%u@%u, selecting an interlaced mode is allowed: %s", width, height, fps, allowInterlaced ? "yes" : "no"); @@ -5823,6 +5824,7 @@ static int FindExactConnectorMode(const drmModeConnector *connector, uint width, return -1; } +// Search the nearest matching DRM connector mode in connector's list static int FindNearestConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced) { TRACELOG(LOG_TRACE, "searching nearest connector mode for %ux%u@%u, selecting an interlaced mode is allowed: %s", width, height, fps, allowInterlaced ? "yes" : "no"); @@ -5880,5 +5882,4 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt TRACELOG(LOG_TRACE, "returning nearest mode: %d", nearestIndex); return nearestIndex; } - #endif diff --git a/src/raylib.h b/src/raylib.h index 36a9b63de..f8a203bc3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -640,7 +640,7 @@ typedef enum { GAMEPAD_PLAYER4 = 3 } GamepadNumber; -// Gamepad Buttons +// Gamepad buttons typedef enum { // This is here just for error checking GAMEPAD_BUTTON_UNKNOWN = 0, @@ -676,6 +676,7 @@ typedef enum { GAMEPAD_BUTTON_RIGHT_THUMB } GamepadButton; +// Gamepad axis typedef enum { // Left stick GAMEPAD_AXIS_LEFT_X = 0, @@ -690,7 +691,7 @@ typedef enum { GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) } GamepadAxis; -// Shader location point type +// Shader location points typedef enum { LOC_VERTEX_POSITION = 0, LOC_VERTEX_TEXCOORD01, @@ -735,7 +736,7 @@ typedef enum { UNIFORM_SAMPLER2D } ShaderUniformDataType; -// Material map type +// Material maps typedef enum { MAP_ALBEDO = 0, // MAP_DIFFUSE MAP_METALNESS = 1, // MAP_SPECULAR @@ -791,7 +792,15 @@ typedef enum { FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x } TextureFilterMode; -// Cubemap layout type +// Texture parameters: wrap mode +typedef enum { + WRAP_REPEAT = 0, // Repeats texture in tiled mode + WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode + WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode + WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode +} TextureWrapMode; + +// Cubemap layouts typedef enum { CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type CUBEMAP_LINE_VERTICAL, // Layout is defined by a vertical line with faces @@ -801,14 +810,6 @@ typedef enum { CUBEMAP_PANORAMA // Layout is defined by a panorama image (equirectangular map) } CubemapLayoutType; -// Texture parameters: wrap mode -typedef enum { - WRAP_REPEAT = 0, // Repeats texture in tiled mode - WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode - WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode - WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode -} TextureWrapMode; - // Font type, defines generation method typedef enum { FONT_DEFAULT = 0, // Default font generation, anti-aliased @@ -857,7 +858,7 @@ typedef enum { CAMERA_ORTHOGRAPHIC } CameraType; -// Type of n-patch +// N-patch types typedef enum { NPT_9PATCH = 0, // Npatch defined by 3x3 tiles NPT_3PATCH_VERTICAL, // Npatch defined by 1x3 tiles @@ -898,6 +899,7 @@ RLAPI void DecorateWindow(void); // Decorate th RLAPI void UndecorateWindow(void); // Undecorate the window (only PLATFORM_DESKTOP) RLAPI void MaximizeWindow(void); // Maximize the window, if resizable (only PLATFORM_DESKTOP) RLAPI void RestoreWindow(void); // Restore the window, if resizable (only PLATFORM_DESKTOP) + RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) @@ -916,8 +918,8 @@ RLAPI int GetMonitorRefreshRate(int monitor); // Get primary RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor -RLAPI const char *GetClipboardText(void); // Get clipboard text content RLAPI void SetClipboardText(const char *text); // Set clipboard text content +RLAPI const char *GetClipboardText(void); // Get clipboard text content // Cursor-related functions RLAPI void ShowCursor(void); // Shows cursor @@ -957,10 +959,12 @@ RLAPI double GetTime(void); // Returns ela // Misc. functions RLAPI void SetConfigFlags(unsigned int flags); // Setup window configuration flags (view FLAGS) + RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) + RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)