Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rcore] Clipboard Image Support #4459

Merged
merged 17 commits into from
Nov 9, 2024
Merged

[rcore] Clipboard Image Support #4459

merged 17 commits into from
Nov 9, 2024

Conversation

evertonse
Copy link
Contributor

@evertonse evertonse commented Nov 1, 2024

[rcore] Clipboard Image

Overview

I've implemented a small start for Clipboard Image functionality for raylib. The implementation is only for desktop Windows OS and it's only GetClipboardImage. I want to implement SetClipboardImage, but I need to know a few things first regarding whether my approach is proper for the project.

2024-11-01.15-47-40.mp4

You'll see I created rcore_clipboard_win32 that implements this from scracth using winapi.
We can question "Why not use already implemented clipboard functions from platform abstractions such as GLFW, SDL, and RGFW and adpated to our needs?" Because they either did not implement it, or it is only available on the bleeding edge (SDL3).

  • From what I've seen, SDL has clipboard image support but only since SDL 3.1.3 SDL_clipboard.h from SDL3. In that case, I check for the major and minor version and implement using SDL functions; otherwise, it just returns NULL (I could add a warning or implement using rcore_clipboard_win32). Also, SDL3 has a migration section, so I'm not even sure that the current raylib SDL platform is suited for SDL3. Just to double-check, there's no SDL_GetClipboardData in SDL2 SDL_clipboard.h from SDL2.

  • RGFW only supports clipboard Unicode text from what I could see: RGFW.h - Line 643.

  • GLFW is still in the process of implementing clipboard image functionality: GLFW Pull Request #2385.

How it is structured

In this PR, works like this: if we detect that the platform is either GLFW or RGFW and we're on Windows, then we include rcore_clipboard_win32.c. The file rcore_clipboard_win32.c went the route of defining windgi.h structs that are needed, taking care of any name collisions.

Takeaway

What I'm thinking is that when clipboard image manipulation becomes a stable feature for GLFW, we can easily add it to rcore_desktop_glfw. But for platforms that don't support it (such as SDL2, RGFW, and current GLFW) we could have "utils" platform functions such as GetClipboardImage (next would be SetClipboardImage) implemented seperatly such as in this PR.

Concerns

Another thing to add is that now it couples rcore and rtexture by the Image struct and the LoadImageFromMemory function. Furthermore, it is required to have SUPPORT_FILEFORMAT_BMP enabled.

Finally, the whole implementation is behind the flag SUPPORT_CLIPBOARD_IMAGE, which in this branch I've enabled by default in config.h.

I've added core_clipboard_image example to make it easy to check it out (it doesn't have to be permanent, also it hasn't updated its related files besides the examples Makefile)

This is kind of a draft. Sorry for the wall of text, I just tought it was important to share this to aid your decision and allow further development.

Update comment

@evertonse evertonse marked this pull request as draft November 1, 2024 19:40
@raysan5
Copy link
Owner

raysan5 commented Nov 3, 2024

@evertonse This is an amazing addition! Thanks for working on it! About the best way to address this addition, it should be addressed by every supported rcore backend platform in a different way:

  • RGFW: I think it could be directly added to RGFW.h library, probably its creator @ColleagueRiley can help on that.
  • SDL: Functionality is already provided by the library so it can be directly supported by rcore_desktop_sdl backend, as already implemented.
  • GLFW: This is the most tricky backend at the moment because despite there is an open PR on the base library it could take a lot of time to be merged. I'd prefer to avoid the current approach of implementing it in rcore_clipboard_win32.c, maybe it can be directly implemented in rcore_desktop_glfw.c? Another option could be rglfw.c module or move it to a separate external/win32_clipboard.c library.

Please, let me know your thoughts!

@ColleagueRiley
Copy link
Contributor

@evertonse I'll look into this for RGFW ASAP 👍

@evertonse
Copy link
Contributor Author

evertonse commented Nov 7, 2024

Update

I've worked on the desktop platforms much in the way it was suggested.

TLDR

Created an SDL3 layer to enable GetClipboardImage functionality , with the bonus that it works on Linux with SDL3. Additionally, for GLFW and RGFW, it was created a separate file, ./external/win32_clipboard.h to be used by both platforms.

SDL

To support clipboard images on the SDL platform, we need SDL3.
As I've suspected, the current implementation for rcore_platform_sdl is not compatible with SDL3.
To allow compilation with both versions (SDL2 and SDL3), it was created a compatibility layer following the SDL3 Migration Guide. Now it's possible to compile with both SDL2 or SDL3.

I have successfully ported the functionality as far as I could test, allowing GetClipboardImage function to work on Wayland Ubuntu, as shown below:

Untitled.video.-.Made.with.Clipchamp.1.mp4

Another benefit of adding SDL3 support is that some raylib functions that were previously unsupported on that platform are now available, such as GetWindowScaleDPI.

With SDL3, we now check for additional MIME types. I noticed that on Wayland Ubuntu, the clipboard saves images as PNG, so we now check for the following MIME types:

  • image/bmp
  • image/png
  • image/jpg
  • image/tiff

Compilation

Also I have modified the src/Makefile and examples/Makefile to enable compilation for SDL3.

After building and installing SDL3 on /usr/local, I was able to compile raylib and all examples with the following command (on Linux):

make PLATFORM=PLATFORM_DESKTOP_SDL  \
SDL_INCLUDE_PATH=/usr/local/include/SDL3/ \
SDL_LIBRARY_PATH=/usr/local/lib SDL_LIBRARIES=-lSDL3
export LD_LIBRARY_PATH=/usr/local/lib # libSDL3.so is located here

On MinGW, I used the following command to compile on Windows.
Consider SDL3 installed on ```~/.local/": we now need EXTRA_INCLUDE_PATHS because of the include style in SDL3.h (`<SDL3/file.h>`) as opposed to SDL2.h ("file.h"):

make PLATFORM=PLATFORM_DESKTOP_SDL  \
SDL_INCLUDE_PATH="$HOME/.local/include/SDL3/" EXTRA_INCLUDE_PATHS="-I$HOME/.local/include/"  \
SDL_LIBRARY_PATH=$HOME/.local/lib SDL_LIBRARIES=-lSDL3

We need to be aware that when compiling raylib with SDL3 on Windows, there is currently a chance of getting corrupted bitmaps from the clipboard in SDL3 version 3.1.6. I've opened a PR about this issue, and it has been added as a milestone for SDL 3.2.

It might be important to say that compiling SDL3 statically with raylib create's name colision now, because of these Matrix functions. It's still possible do compile statically if we use objcopy --redefine-sym on libSDL3.a

RGFW & GLFW

I followed your advice and created a header-only library in ./src/external/ for Windows only, which I used for the RGFW and GLFW platforms. As soon as both libraries implement this functionality we can roll back and implement GetClipboardImage in terms of those platforms.

Finally

If this approach is proper, I can continue working on the SetClipboardImage function. I consider this PR now ready for further review.

Quick example to test it

#include "raylib.h"

int main(int argc, char *argv[])
{
    InitWindow(800, 450, "[core] raylib clipboard image");
    SetTraceLogLevel(LOG_TRACE);
    SetTargetFPS(60);

    Image img = {0};
    Texture tex = {0};
    while(!WindowShouldClose())
    {
        if (IsKeyDown(KEY_LEFT_CONTROL) && IsKeyPressed(KEY_V))
        {
            img = GetClipboardImage();
            tex = LoadTextureFromImage(img);
            if(!IsTextureValid(tex))
            {
                TraceLog(LOG_WARNING, "Could not get clipboard image");
            }
        }

        BeginDrawing();
            ClearBackground(RAYWHITE);
            if (IsTextureValid(tex))
            {
                DrawTexture(tex, 0, 10 + 21, WHITE);
            }
            DrawText("Print Screen and Crtl+V", 10, 10, 21, BLACK);
        EndDrawing();
    }
}

@evertonse evertonse marked this pull request as ready for review November 7, 2024 03:33
@evertonse evertonse changed the title [rcore] Draft: Clipboard Image Support [rcore] Clipboard Image Support Nov 7, 2024
@raysan5
Copy link
Owner

raysan5 commented Nov 8, 2024

@evertonse Thank you very much for all the work put into this improvement!

It's a quite big PR containing many improvements; probably SDL3 support should be moved to a separate PR, but still, it looks clean and organized so it would be ok.

@ColleagueRiley could probably take a look to the win32_clipboard.h and rcore_desktop_rgfw.c implementations, some code could be moved RGFW.h base library.

If this approach is proper, I can continue working on the SetClipboardImage function. I consider this PR now ready for further review.

Sure, that would be fantastic.

Please, let me know if you plan any further work on this PR or I can merge it.

@evertonse
Copy link
Contributor Author

Please, let me know if you plan any further work on this PR or I can merge it.

@raysan5 It's all good now, you can merge it.
I'll work on SetClipboardImage on a separate PR as it might take a bit of work.
Thank you for the support, sincerely :).

@raysan5 raysan5 merged commit 00396e3 into raysan5:master Nov 9, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Nov 9, 2024

@evertonse thanks for this great improvement!!!

@Not-Nik
Copy link
Contributor

Not-Nik commented Nov 10, 2024

This breaks building on Windows when CUSTOMIZE_BUILD is specified.

@raysan5
Copy link
Owner

raysan5 commented Nov 10, 2024

@Not-Nik I can't reproduce, what configuration do you mean?

@Not-Nik
Copy link
Contributor

Not-Nik commented Nov 10, 2024

git clone raylib
cd raylib
mkdir build
cd build
cmake -DCUSTOMIZE_BUILD=ON ..
cmake --build .

System is

  • Visual Studio 17 2022
  • Windows SDK version 10.0.22000.0 to target Windows 10.0.19045
  • MSVC 19.35.32216.1
  • MSBuild version 17.5.1+f6fdcf537

and the error I get reads

fatal  error C1189: #error  "To enabled SUPPORT_CLIPBOARD_IMAGE, it also needs SUPPORT_FILEFORMAT_BMP, SUPPORT_MODULE_RTEXTURES and STBI_REQUIRED to be defined. It should have been defined earlier"

@evertonse
Copy link
Contributor Author

evertonse commented Nov 10, 2024

and the error I get reads

We can turn that #error into #warning and make it compile (file src/rcore.c line 516).

Basically means one of these are not defined in the CUSTOMIZED build: SUPPORT_FILEFORMAT_BMP, STBI_REQUIRED SUPPORT_MODULE_RTEXTURES. Not defining these makes getting clipboard image less reliable, or may cause it to not work at all.

@Not-Nik
Copy link
Contributor

Not-Nik commented Nov 11, 2024

The issue was more that I didn't enable SUPPORT_CLIPBOARD_IMAGE, so if it is somehow enabled by default, all its dependencies should also be enabled.

@evertonse
Copy link
Contributor Author

evertonse commented Nov 11, 2024

so if it is somehow enabled by default, all its dependencies should also be enabled.

And they are, on config.h, but I think somehow -DCUSTOMIZE_BUILD doesn't pull config.h.
I guess I could enable its dependecies on rcore.c instead of config.h that might help.

For now I just made it into a warning in this PR

psxdev pushed a commit to raylib4Consoles/raylib that referenced this pull request Nov 18, 2024
* [rcore] add 'GetClipboardImage' for windows

* [rcore] GetClipboardImage removed some unneeded defines

* [rcore] PLATFORM_SDL: create a compatility layer for SDL3

* external: add win32_clipboard.h header only lib

* [rcore] using win32_clipboard on platforms rlfw and rgfw

* [rcore] fix warnings in SDL3 compatibility layer

* Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* [rcore]: PLATFORM_SDL: improve clipboard data retrieval

* external: remove unused function from win32_clipboard.h

* Makefile: allow for extra flags necessary when compiling for SDL3

* [rcore]: fix string typo

* [rcore]: Properly handle NULL dpi passing. As is allowed in SDL2

* external: fix arch finding on win32_clipboard.h to allow compilation on msvc cmake CI

* [rcore]: PLATFORM_SDL: Treat monitor as an ID in SDL3 as opposed to an index as in SDL2

* [rcore]: typo
Qoen1 added a commit to Qoen1/raylib-cpp-group-h that referenced this pull request Dec 26, 2024
* ADDED: `isGpuReady` flag, allow font loading with no GPU acceleration

* [RCORE] Update comments on fullscreen and boderless window to describe what they do (raysan5#4280)

* Update raylib_api.* by CI

* update fullscreen and borderless comments to better describe what they do.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [rcore][desktop_glfw] Keeping CORE.Window.position properly in sync with glfw window position (raysan5#4190)

* WindowPosCallback added.

CORE.Window.position is now properly kept in sync with the glfw window position.

* Update rcore_desktop_glfw.c

Comments updated.

* Setting CORE.Window.position correctly in InitPlatform() as well.

This also fixes not centering the window correctly when the high dpi flag was enabled.

* Fixes centering the window in the SetWindowMonitor() function.

Here the render size has to be used again in case the high dpi flag is enabled.

* Update Window Position

Update Window Position right away in ToggleFullscreen() & ToggleBorderlessWindowed() functions

* rlgl.h: glint64 did not exist before OpenGL 3.2 (raysan5#4284)

Compilation breaks on rlgl.h for early OpenGL versions.
Glint64 did not exist on those versions (< OpenGL 3.2)

* Examples makefiles: align /usr/local with /src Makefile (raysan5#4286)

* align /usr/local with src Makefile

Align /usr/local with the /src Makefile, where it can be overriden.

* /usr/local: allow override

align /usr/local with the /src Makefile, where it can be overriden

* Update raylib.h

* ADDED: more uniform data type options raysan5#4137

* Update rlgl.h

* Update rtext.c

* [rModels] Correctly split obj meshes by material (raysan5#4285)

* Correctly split meshes from tinyobj by material so they can be represented by raylib correctly

* PR Feedback

* fix(rcore/android): Allow main() to return it its caller on configuration changes. (raysan5#4288)

* Fix missing equal sign (raysan5#4294)

I just noticed there is a missing equal sign. This PR fixes this.

* Add uConsole mapping (raysan5#4297)

* fix: In certain cases the connector status is reported UNKNOWN, should be conisdered as CONNECTED (raysan5#4305)

Co-authored-by: Michal Jaskolski <michal.jaskolski@hexagon.com>

* Fix seg fault with long comment lines (raysan5#4306)

raysan5#4304

* Change implicit conversion to explicit conversion to remove warning (raysan5#4308)

* fix vld1q_f16 undeclared in arm on stb_image_resize2.h v2.10 (raysan5#4309)

* Update BINDINGS.md (raysan5#4311)

I've updated the bindings

* fix for hardcoded index values in vboID array (raysan5#4312)

changing any of the #defines in CONFIG.H would cause issues when rendering.

* chore: GetApplicationDirectory definition for FreeBSD (raysan5#4318)

* [rtextures] add MixColors. a function to mix 2 colors together (raysan5#4310)

* added MixColors function to mix 2 colors together (Line 1428 raylib.h and Line 4995 in rtextures.c)

* renamed MixColors to ColorLerp (raysan5#4310 (comment))

* changed ColorLerp to be more like other functions

---------

Co-authored-by: CI <-ci@not-real.com>

* Update raylib_api.* by CI

* REVIEWED: `ColorLerp()` formatting raysan5#4310

* Update raylib_api.* by CI

* Update rtextures.c

* [rcore] Add filtering folders to `LoadDirectoryFilesEx()`/`ScanDirectoryFiles()` (raysan5#4302)

* Add filtering folders in ScanDirectoryFiles and ScanDirectoryFilesRecursively

Add define FILTER_FOLDER for that purpose
Fix folder names matching filter being added to result

* Move FILTER_FOLDER define to internals of rcore and document option in comment

* Update raylib_api.* by CI

* REVIEWED: `DrawTexturePro()` to avoid negative dest rec raysan5#4316

* REVIEWED: Directory filter tag raysan5#4323

* Reviewed raysan5#4323

* Update raylib.h

* Update raylib_api.* by CI

* [BINDINGS.md] Added raylib-bqn, moved rayed-bqn (raysan5#4331)

* [BINDINGS.md] Added raylib-bqn, moved rayed-bqn

rayed-bqn has had a lot of progress and I've realized it has diverged too much from raylib, and so I made raylib-bqn to be a simple binding, while rayed-bqn will be a utility wrapper.

* removed accidental newline

* [rmodels] Optional GPU skinning (raysan5#4321)

* Added optional GPU skinning

* Added skinned bone matrices support for different file formats.

* Moved new shader locations to end of enum to avoid breaking existing examples. Added gpu skinning on drawing of instanced meshes.

* Added GPU skinning example.

* Removed variable declaration to avoid shadowing warning.

* Update raylib_api.* by CI

* Some minor tweaks

* Fix rlgl standalone defaults (raysan5#4334)

* Projects: Fix CMake example project  (raysan5#4332)

* Update CMakeLists.txt

Add missing link flags

* Update README.md

Remove unneeded flag because this flag is defined in the updated CMakeList file

* Update CMakeLists.txt

* Update parser's readme to mirror fixed help text (raysan5#4336)

* Update BINDINGS.md (raysan5#4337)

Updated Lean4 bindings

* `LoadFontDefault()`: Initialize glyphs and recs to zero raysan5#4319

* ADDED: `MakeDirectory()`

* Update raylib_api.* by CI

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Update rcore.c

* Fix isGpuReady flag on android (raysan5#4340)

* [SHAPES] Add more detail to comment for DrawPixel (raysan5#4344)

* Update raylib_api.* by CI

* Add comment that draw pixel uses geometry and may be slow

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix raysan5#4349

* [MODELS] Disable GPU skinning for MacOS platform (raysan5#4348)

* Update raylib_api.* by CI

* Disable GPU skinning on MacOS
Add GPU skinning example to MSVC Projects.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Complements the raysan5#4348 GPU skinning fix (raysan5#4352)

* Fixes GetClipboardText() memory leak for PLATFORM_DESKTOP_SDL (raysan5#4354)

* [MODELS] Better fix for GPU skinning issues (raysan5#4353)

* Make the max VBO match the animation flag.

* re-enable GPU skinning for mac, and fix the max buffer to be correct based on the GPU skinning support flag.

* [rlgl] Fix rlgl standalone defaults (raysan5#4357)

* Fix rlgl standalone defaults

* Fix rmodels

* Typo fix (raysan5#4356)

Seemed to be a typo. Hope this helps.

* Allow Zig build script to change desktop backend (raysan5#4358)

* [build] CMake: Fix GRAPHICS check (raysan5#4359)

* updated camera speeds with GetFrameTime (raysan5#4362)

* taken from FluxFlus PR (raysan5#4363)

* Fix raysan5#4355

* [example] Input virtual controls example (raysan5#4342)

* Add files via upload

* Update core_input_gamepad_virtual.c

* Add files via upload

* Update and rename core_input_gamepad_virtual.c to core_virtual_Dpad.c

* Update and rename core_virtual_Dpad.c to core_input_virtual_controls.c

* Delete examples/core/core_input_gamepad_virtual.png

* Add files via upload

* Update Makefile

* Update Makefile.Web

* Update README.md

* Update README.md

* Create core_input_virtual_controls.vcxproj

* Delete projects/VS2022/examples/core_input_virtual_controls.vcxproj

* [zig] Fix build.zig bug (raysan5#4366)

* fixed zig config.h bug

* zig fmt

* removed old comment (raysan5#4370)

* Update CHANGELOG

* updated makefile to disable wayland by default (raysan5#4369)

* Update RGFW  (raysan5#4372)

* (rcore_desktop_rgfw.c) fix errors when compiling with mingw

* define WideCharToMultiByte

* update RGFW

* move stdcall def to windows only

* fix raw cursor input

* Removed tabs and triple line-breaks

* Some update to gltf loading (raysan5#4373)

Only warns when there are more animations than currently implemented
Allows mesh indices to be unsigned char

* Fix build.zig (raysan5#4374)

* build.zig: Improve logic (raysan5#4375)

* build.zig: Fix `@src` logic

* build.zig: Clarify build error

* build.zig: Add option for enabling `raygui`

* build.zig: Expose `Options` type

* `WARNING`: REMOVED: SVG files loading and drawing, moving it to raylib-extras

* REMOVED: `LoadImageSvg()`

* Update raylib_api.* by CI

* Update BINDINGS.md (raysan5#4378)

* build.zig: Fix `@src` logic and a few things (raysan5#4380)

* REVIEWED: `CodepointToUTF8()`, clean static buffer raysan5#4379

* build.zig: Very minor fixes (raysan5#4381)

* Fix the type mismatch caused due to unsupported `?[]const u8` (raysan5#4383)

Co-authored-by: Yuval Herman <yuvalherman99@gmail.com>

* qoi: Added support for image of channels 3 (raysan5#4384)

* Fix rectangle width and height check to account for squares (raysan5#4382)

* ADDED: Utility functions: `ComputeCRC32()` and `ComputeMD5()`

* Update raylib_api.* by CI

* WARNING: BREAKING: Renamed several functions for data validation raysan5#3930

* Update raylib_api.* by CI

* Fix raysan5#4388 (raysan5#4392)

* Fix VSCode Makefile to support multiple .c files (raysan5#4391)

Updated the VSCode Makefile to allow compilation of multiple .c files instead of just one (main.c).
- Replaced `SRC` and `OBJS` definitions to dynamically include all .c and .h files in the project.
- This change enables automatic handling of any number of source files specifically in the VSCode setup.

* [rcore] added sha1 implementation (raysan5#4390)

* added sha1 implementation

* added missing part

* fixed issue

* fix to match other implementations

* Update raylib_api.* by CI

* build.zig: Clean up my mess (raysan5#4387)

* [rl_gputex] Correctly load mipmaps from DDS files (raysan5#4399)

* correction of comments (raysan5#4400)

The indication of locations for bone ids and bone weights did not correspond to their default values ​​in config.h

* build.zig: Fix various issues around `-Dconfig` (raysan5#4398)

* build.zig: Fix various issues around `-Dconfig`

* build.zig: Parse all relevant flags from `src/config.h` at comptime

* Adds MaximizeWindow() and RestoreWindow() implementation for PLATFORM_WEB (raysan5#4397)

* [rtextures] ImageDraw(): Don't try to blend images without alpha (raysan5#4395)

* removed extra update command (raysan5#4401)

* [rcore] [web] Updates `SetWindowState()` and `ClearWindowState()` to handle `FLAG_WINDOW_MAXIMIZED` for `PLATFORM_WEB` (raysan5#4402)

* Updates SetWindowState() and ClearWindowState() to handle FLAG_WINDOW_MAXIMIZED for PLATFORM_WEB

* Update MaximizeWindow() and RestoreWindow() to set/unset the FLAG_WINDOW_MAXIMIZED

* Fix MaximizeWindow() for PLATFORM_WEB (raysan5#4404)

* Adds SetWindowOpacity() implementation for PLATFORM_WEB (raysan5#4403)

* build.zig: Merge `src/build.zig` to `build.zig` (raysan5#4393)

* build.zig: Move `src/build.zig` to `build.zig`

* build.zig: Remove uses of `@src`

* build.zig: Update entry point

* [Raymath] Add C++ operator overloads for common math function (raysan5#4385)

* Update raylib_api.* by CI

* Add math operators for C++ to raymath

* better #define for disabling C++ operators

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* REVIEWED: Formatting and raymath version raysan5#4385

* Updated instanced rendering support loading (raysan5#4408)

* Reviewed formatting raysan5#4408

* Removed trailing spaces

* Update raymath.h

* [Raymath] Add matrix operators to raymath for C++ (raysan5#4409)

* Add matrix operators to raymath for C++

* Fix spaces

* REVIEWED: `GetGestureHoldDuration()` comments

* Update raylib_api.* by CI

* [rcore] Adds implementation to `SetGamepadVibration()` on `PLATFORM_WEB` and updates it on `PLATFORM_DESKTOP_SDL` to handle duration (raysan5#4410)

* Updates SetGamepadVibration()

* Handle MAX_GAMEPAD_VIBRATION_TIME

* Revert low/high parameters back to left/rightMotor

* Fix missin semicolon

* Convert duration to seconds

* Add SetGamepadVibration() implementation to PLATFORM_WEB

* Update raylib_api.* by CI

* moved update out of draw area (raysan5#4413)

* REVIEWED: skinning shader for GLSL 100 raysan5#4412

* build.zig: Better specify Linux dependencies (raysan5#4406)

* Simplify EmscriptenResizeCallback() (raysan5#4415)

* build.zig: Re-add OpenGL to Linux deps (raysan5#4417)

* build.zig: Fix a minor issue with `-Dconfig` (raysan5#4418)

* Reviewed skinning shaders raysan5#4412

* Update config.h

* Update raylib.h

* Update raylib_api.* by CI

* Update core_input_gamepad example (raysan5#4416)

* [rcore] Fix raysan5#4405 (raysan5#4420)

* Fix raysan5#4405 at runtime

* Add parameter validation

* Remove default global deadzone

* [examples] Add deadzone handling to `core_input_gamepad` example (raysan5#4422)

* Add deadzone handling to core_input_gamepad example

* Rename variables

* Grammar fix in CONTRIBUTING.md (raysan5#4423)

"Can you write some tutorial/example?"
"Can you write some tutorials/examples?"

* Fix typo in rshapes.c (raysan5#4421)

* Add drawing for generic gamepad on core_input_gamepad example (raysan5#4424)

* Update skinning.fs

* Reviewed and reverted unneeded module check, `rtextures` should not depend on `rtext`

* ADDED: CHANGELOG for raylib 5.5 -WIP-

* Update CHANGELOG

* Update Makefile

* Update Makefile

* [RTEXTURES] Remove the panorama cubemap layout option (raysan5#4425)

* Remove the panorama cubemap layout, it was not implemented.
Left a todo in the code for some aspiring developer to finish.

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update HISTORY.md

* Update CHANGELOG

* Update raylib.h

* Update raylib_api.* by CI

* Update CHANGELOG

* Update raylib.h

* Update Makefile

* Update raylib_api.* by CI

* Update raylib.h

* Update raylib_api.* by CI

* REVIEWED: GPU skninning on Web, some gotchas! raysan5#4412

* Update rlgl.h

* REVIEWED: `UpdateModelAnimationBoneMatrices()` comments

* Update raylib_api.* by CI

* Update emsdk paths to latest versions

* [rshapes] Review `DrawRectangleLines()` pixel offset (raysan5#4261)

* [rshapes] Remove `DrawRectangleLines()`'s + 1 offset

* ... and replace it with a -/+ 0.5 offset divided by current cam's zoom.

* REVIEWED: `DrawRectangleLines()`, considering view matrix for lines "alignment"

* Use free camera in model shader example (raysan5#4428)

* Add shadow map example to MSVC projects (raysan5#4430)

* Use the vertex color as part of the base shader in GLSL330 (raysan5#4431)

* Add input_virtual_controls to MSVC projects (raysan5#4433)

Fix input_virtual_controls example to use correct default font sizes

* [build] CMake: Don't build for wayland by default (raysan5#4432)

This is to align with the behavior of raysan5#4369, see raysan5#4371 for rationale on
disabling Wayland by default.

* [build] [web] Fix examples `Makefile` for `PLATFORM_WEB` (raysan5#4434)

* Fix examples Makefile for PLATFORM_WEB

* Replace shell with assignment operator

* Replace tab with spaces

* Update Makefile.Web

* REVIEWED: WebGL2 (OpenGL ES 3.0) backend flags (PLATFORM_WEB) raysan5#4330

* Minor format tweaks

* Use mingw32-make for Windows (raysan5#4436)

* [rtextures/rlgl] Load mipmaps for cubemaps (raysan5#4429)

* [rlgl] Load cubemap mipmaps

* [rtextures] Only generate mipmaps that don't already exist

* [rtextures] ImageDraw(): Implement drawing to mipmaps

* [rtextures] Load cubemap mipmaps

* Reviewed formating to follow raylib conventions raysan5#4429

* Reviewed formatting, remove end-line points, for consistency with comments

* Update cgltf.h

* Update dr_mp3.h

* Update dr_wav.h

* Update qoa.h

* Update stb_image.h

* Update stb_image_resize2.h

* Update stb_truetype.h

* Fix examples Makefile for NetBSD (raysan5#4438)

* fix makefile

* moving to LDPATHS

* fix clean and ldlibs stuff

* Update Makefile

* REVIEWED: `LoadTextureCubemap()` to avoid crash raysan5#4429

* fix (raysan5#4440)

* [rtextures] LoadTextureCubemap(): Copy image before generating mipmaps, to avoid dangling re-allocated pointers (raysan5#4439)

* Fix MSVC errors for PLATFORM_DESKTOP_RGFW (raysan5#4441)

* (rcore_desktop_rgfw.c) fix errors when compiling with mingw

* define WideCharToMultiByte

* update RGFW

* move stdcall def to windows only

* fix raw cursor input

* Fix warnings, update RGFW, fix msvc errors (make sure windows macro _WIN32 is correct)

* Fix signed/unsigned mismatch in rlgl (raysan5#4443)

* Update README.md

* Fix empty input string for MeasureTextEx (raysan5#4448)

* Fix inconsistent dll linkage warning on windows (raysan5#4447)

* Update rcore_desktop_glfw.c

* Update rtext.c

* [shapes] Add `shapes_rectangle_advanced ` example implementing a `DrawRectangleRoundedGradientH` function (raysan5#4435)

* [rshapes] Add  function

* "[shapes] rectangle advanced: fix screen width and height to fit with other examples"

* fix the issue with GetScreenWidth/GetScreenHeight that was identified on other platforms (raysan5#4451)

* Fix SetWindowSize() for PLATFORM_WEB (raysan5#4452)

* Update HISTORY.md

* Update Makefile

* Update rmodels.c - 'fix' for GenMeshSphere artifact (raysan5#4460)

When creating a new sphere mesh with high number of slices/rings the top and bottom parts of the generated sphere are removed. This happens because the triangles in those parts, due to high resolution, end up being very small and are removed as part of the 'par_shapes' library's optimization. Adding par_shapes_set_epsilon_degenerate_sphere(0.0); before generating the sphere mesh sets the threshold for removal of small triangles is removed and the sphere is returned to raylib correctly.

* Added last week commits info

* RENAMED: `UpdateModelAnimationBoneMatrices()` to `UpdateModelAnimationBones()`

Still, not fully convinced of those functions naming, despite quite descriptive, sounds a bit confusing to me...

* Update raylib_api.* by CI

* Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (raysan5#4461)

* Update CHANGELOG

* implemented new linear gradient generation function (raysan5#4462)

* Update Makefile.Web

* Update core_2d_camera_mouse_zoom.c

* fix float casting warnings (raysan5#4471)

* UpdateModelAnimation speedup (raysan5#4470)

If we borrow from the GPU skinned animation code, we can just multiply the vertex by the matrix * weight and shave a chunk of CPU time.

* Improve cross-compilation with zig builds (raysan5#4468)

- Add xcode_frameworks when cross compiling for mac (ref:
https://github.com/hexops/mach/blob/main/build.zig)
- Add emsdk when cross compiling for wasm (ref:
https://github.com/floooh/sokol-zig/blob/master/build.zig)

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>

* [rcore]  Clipboard Image Support  (raysan5#4459)

* [rcore] add 'GetClipboardImage' for windows

* [rcore] GetClipboardImage removed some unneeded defines

* [rcore] PLATFORM_SDL: create a compatility layer for SDL3

* external: add win32_clipboard.h header only lib

* [rcore] using win32_clipboard on platforms rlfw and rgfw

* [rcore] fix warnings in SDL3 compatibility layer

* Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW

* [rcore]: PLATFORM_SDL: improve clipboard data retrieval

* external: remove unused function from win32_clipboard.h

* Makefile: allow for extra flags necessary when compiling for SDL3

* [rcore]: fix string typo

* [rcore]: Properly handle NULL dpi passing. As is allowed in SDL2

* external: fix arch finding on win32_clipboard.h to allow compilation on msvc cmake CI

* [rcore]: PLATFORM_SDL: Treat monitor as an ID in SDL3 as opposed to an index as in SDL2

* [rcore]: typo

* Update raylib_api.* by CI

* build.zig: Remove addRaylib and fix raygui builds when using raylib as dep (raysan5#4475)

- addRaylib just duplicates what adding raylib as dependency already does
  so it do not needs to exist
- move raygui build to standard build process when flag is enabled. this
  works correctly when using raylib as dependency and having raygui as
  dependency as well. problem with previous approach was that raygui was in
  options but it was doing nothing because you had to also use addRaygui for
  it to be effective

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>

* Improved logos size

* Fix the X axis of the second vertex of the Y negative cap of a cylinders, triangle fan (raysan5#4478)

* Fix a typecast warning in glfw clipboard access (raysan5#4479)

* [rcore]: Issue an warning instead of an error when checking SUPPORT_CLIPBOARD_IMAGE necessary support detection (raysan5#4477)

* Fix the example lighting shaders to use both frag and diffuse colors so they work with shapes and meshes. (raysan5#4482)

* Update CHANGELOG

* build.zig: remove raygui from options and re add adding raygui as a (raysan5#4485)

function

* Fix Makefile.Web (raysan5#4487)

* Update CHANGELOG

* Update HISTORY.md

* Update CHANGELOG

* Fix touch count reset (raysan5#4488)

* Update raygui.h

* Updated Notepad++ autocomplete list for raylib 5.5

* Commented code issuing warnings on w64devkit (GCC)

Tested with w64devkit/MSVC and all seem to work as expected

* Updated raylib resource data

* Update raylib.ico

* Update emsdk path on Windows to match new raylib installer package

* Fix warnings in examples (raysan5#4492)

Move shapes/shapes_rectangle_advanced to the correct folder in MSVC project
Add core_input_virtual_controls.vcxproj back into sln file

* Fix typo in BINDINGS.md (raysan5#4493)

* Fixing an OBJ loader bug that fragmented the loaded meshes (raysan5#4494)

The nextShapeEnd integer is a pointer in the OBJ data structures.
The faceVertIndex is a vertex index counter for the mesh we are
about to create. Both integers are not compatible, which causes
the code to finish the meshes too early, thus writing the OBJ data
incompletely into the target meshes.

It wasn't noticed because for the last mesh, it process all remaining
data, causing the last mesh to contain all remaining triangles.

This would have been noticed if the OBJ meshes used different textures
for each mesh.

* Update CHANGELOG

* Update HISTORY.md

* Thanks @everyone for everything 😄

* Update HISTORY.md

* Update core_basic_window.c

* Update raylib.h

* Update raylib_api.* by CI

* Update webassembly.yml

* Update HISTORY.md

* removed workflows

* merge master

---------

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Co-authored-by: Ray <raysan5@gmail.com>
Co-authored-by: Jeffery Myers <jeffm2501@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dave Green <34277803+SoloByte@users.noreply.github.com>
Co-authored-by: Tchan0 <61758157+Tchan0@users.noreply.github.com>
Co-authored-by: Hesham Abourgheba <hisham.abourgheba@gmail.com>
Co-authored-by: hanaxars <156359933+hanaxars@users.noreply.github.com>
Co-authored-by: carverdamien <carverdamien@gmail.com>
Co-authored-by: Michał Jaskólski <michal@jaskolski.pro>
Co-authored-by: Michal Jaskolski <michal.jaskolski@hexagon.com>
Co-authored-by: Chris Warren-Smith <cwarrensmith@gmail.com>
Co-authored-by: masnm <49545838+masnm@users.noreply.github.com>
Co-authored-by: Alex <alexandervelez7245@gmail.com>
Co-authored-by: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com>
Co-authored-by: base <git@thecortexmancer.org>
Co-authored-by: SusgUY446 <129160115+SusgUY446@users.noreply.github.com>
Co-authored-by: CI <-ci@not-real.com>
Co-authored-by: foxblock <foxblock+github@gmail.com>
Co-authored-by: Brian E <72316548+Brian-ED@users.noreply.github.com>
Co-authored-by: Daniel Holden <theonlydancingbanana@hotmail.com>
Co-authored-by: Asdqwe <asdqwe@asdqwe.com>
Co-authored-by: Ridge3Dproductions <78836162+Ridge3Dproductions@users.noreply.github.com>
Co-authored-by: Daniil Kisel <56605335+KislyjKisel@users.noreply.github.com>
Co-authored-by: Menno van der Graaf <mennovandergraaf@hotmail.com>
Co-authored-by: Ashley Chekhov <70078024+FluxFlu@users.noreply.github.com>
Co-authored-by: Nikolas <nik.wipper@gmx.de>
Co-authored-by: Kacper Zybała <zyperpl@gmail.com>
Co-authored-by: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com>
Co-authored-by: Magnus Oblerion <82583559+oblerion@users.noreply.github.com>
Co-authored-by: Visen <48253336+VisenDev@users.noreply.github.com>
Co-authored-by: Colleague Riley <colleagueRiley@gmail.com>
Co-authored-by: Harald Scheirich <hscheirich@yahoo.com>
Co-authored-by: William Culver <39485061+cedeon@users.noreply.github.com>
Co-authored-by: Sage Hane <sage@sagehane.com>
Co-authored-by: Anand Swaroop <72886192+Anut-py@users.noreply.github.com>
Co-authored-by: yuval_dev <47389924+yuval-herman@users.noreply.github.com>
Co-authored-by: Yuval Herman <yuvalherman99@gmail.com>
Co-authored-by: R-YaTian <47445484+R-YaTian@users.noreply.github.com>
Co-authored-by: Jojaby <josh.jessopsmith@gmail.com>
Co-authored-by: Alan Arrecis <arrecis@users.noreply.github.com>
Co-authored-by: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com>
Co-authored-by: Rapha <134700614+rapha-s@users.noreply.github.com>
Co-authored-by: Cypress <140924725+cypressru@users.noreply.github.com>
Co-authored-by: Franz <franztt@users.noreply.github.com>
Co-authored-by: RadsammyT <32146976+RadsammyT@users.noreply.github.com>
Co-authored-by: IcyLeave6109 <33421921+juliohq@users.noreply.github.com>
Co-authored-by: Peter0x44 <peter0x44@disroot.org>
Co-authored-by: NishiOwO <89888985+NishiOwO@users.noreply.github.com>
Co-authored-by: mpv-enjoyer <123133847+mpv-enjoyer@users.noreply.github.com>
Co-authored-by: Everton Jr. <69195288+evertonse@users.noreply.github.com>
Co-authored-by: Arche Washi <166983671+archewashi@users.noreply.github.com>
Co-authored-by: MikiZX1 <161243635+MikiZX1@users.noreply.github.com>
Co-authored-by: waveydave <dave@dscho.com>
Co-authored-by: decromo <gh@dieg.one>
Co-authored-by: Tomas Slusny <slusnucky@gmail.com>
Co-authored-by: kimierik <105240664+kimierik@users.noreply.github.com>
Co-authored-by: Oussama Teyib <oussama.teyib@gmail.com>
Co-authored-by: Eike Decker <zet23t@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants