Commit Graph

7525 Commits

Author SHA1 Message Date
Peter0x44 ecf863969c
[build] CMake: Fix warnings in projects/CMake/CMakeLists.txt (#4278)
Currently, when building, the cmake example in projects/CMake gives this
warning, with CMake 3.30.2

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(raylib) is deprecated, call
  FetchContent_MakeAvailable(raylib) instead.  Policy CMP0169 can be set to
  OLD to allow FetchContent_Populate(raylib) to be called directly for now,
  but the ability to call it with declared details will be removed completely
  in a future version.
Call Stack (most recent call first):
  CMakeLists.txt:20 (FetchContent_Populate)
This warning is for project developers.  Use -Wno-dev to suppress it.

Changing FetchContent_Populate to FetchContent_MakeAvailable didn't
cause any issues I could observe when building. I'm not sure why it
wasn't like that to begin with.
2024-08-23 22:29:40 +02:00
Bugsia 77172e34db
Fixing GenImagePerlinNoise() being stretched, if Image is not rectangular (#4276) 2024-08-23 22:22:36 +02:00
Peter0x44 74350fa7cf
[build] CMake: Delete BuildOptions.cmake (#4277)
This file seems to not do anything useful. From what I can tell the
OSX_FATLIB option sets CMAKE_OSX_ARCHITECTURES to "x86_64;i386". This
doesn't account for the arm that apple now has, as well as 32 bit
support being completely removed, and I think it's entirely reasonable
to expect users to pass the necessary architectures they want
themselves. It's possible this could break some users who rely on this,
but I sincerely doubt anyone does. The solution is trivial either way
(put -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" on the command line
yourself)

The second part of BuildOptions.cmake claims to set PLATFORM to "Web" if
the emscripten toolchain file is used (if (EMSCRIPTEN)), but it does not
work correctly anyway. Currently, glfw searches for wayland and x11
libraries and fails likeso:

CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:
   - wayland-client>=0.2.7
   - wayland-cursor>=0.2.7
   - wayland-egl>=0.2.7
   - xkbcommon>=0.5.0

Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  src/external/glfw/src/CMakeLists.txt:163 (pkg_check_modules)

Considering this code doesn't work as described, it's okay to delete it.
I think a better check should be implemented, but that is for a
different PR.
2024-08-23 22:21:22 +02:00
listeria cc88e0b780
rtext: always multiply by sign in TextToFloat() (#4273)
Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
2024-08-21 17:45:14 +02:00
Jeffery Myers c8bee7c439
[rmodels] Add a warning when loading an OBJ with multiple materials. (#4271)
* Update raylib_api.* by CI

* Add a temp warning about material assignments during OBJ loading if the file has more than one material. To be replaced when the OBJ translation code is fixed.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-21 17:11:59 +02:00
github-actions[bot] bae0af241e Update raylib_api.* by CI 2024-08-21 12:08:09 +00:00
Paperdomo101 fa3f73d881
[rshapes] Review DrawGradient color parameter names (#4270)
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);

Have been changed to:

void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer);
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom);
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right);
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight);
2024-08-21 14:07:52 +02:00
Ray 039df36f4b REVIEWED: Automation events mouse wheel #4263 2024-08-20 19:13:18 +02:00
hanaxars 7fab03c0b4
Fix warnings (#4264)
Fix following gcc warnings when SVG enabled:

rtextures.c: In function 'LoadImageSvg':
rtextures.c:374:52: warning: pointer targets in passing argument 1 of 'nsvgParse' differ in signedness [-Wpointer-sign]
  374 |             struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
      |                                                    ^~~~~~~~
      |                                                    |
      |                                                    unsigned char *
In file included from rtextures.c:230:
external/nanosvg.h:2952:28: note: expected 'char *' but argument is of type 'unsigned char *'
 2952 | NSVGimage* nsvgParse(char* input, const char* units, float dpi)
      |                      ~~~~~~^~~~~
rtextures.c:407:43: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
  407 |         if (isSvgStringValid && (fileData != fileNameOrString)) UnloadFileData(fileData);
      |                                           ^~
rtextures.c: In function 'LoadImageFromMemory':
rtextures.c:614:52: warning: passing argument 1 of 'nsvgParse' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  614 |             struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
      |                                                    ^~~~~~~~
external/nanosvg.h:2952:28: note: expected 'char *' but argument is of type 'const unsigned char *'
 2952 | NSVGimage* nsvgParse(char* input, const char* units, float dpi)
      |                      ~~~~~~^~~~~
2024-08-19 13:41:20 +02:00
Colleague Riley b432aa2b9c
Update RGFW (#4259)
* update RGFW

* fix bug with GetCurrentMonitor

* update RGFW

* update RGFW

* clean up merge

* update RGFW
2024-08-17 14:00:54 +02:00
Lázaro Albuquerque 308b77cd42
Fix warnings (#4251)
* Update rmodels.c

fix these warnings:

```
/src/rmodels.c:5744:17: warning: missing initializer for field 'w' of 'Vector4' [-Wmissing-field-initializers]
[build]  5744 |                 Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2]};
[build]       |                 ^~~~~~~
```

* Update rcore_web.c

fix warnings
2024-08-17 01:07:23 +02:00
Ray f70d8a33cb REVIEWED: Shader load failing returns 0, instead of fallback 2024-08-17 00:46:08 +02:00
Ray fa374f9cc9 Update webassembly.yml 2024-08-17 00:44:33 +02:00
Brian E 63ae57d2e3
Added raylib-APL to BINDINGS.md (#4253)
* Added raylib-APL to BINDINGS.md

* added back the newline

* Made APL binding be version 5.0 instead of auto

Also alligned the bars of the new entry.
2024-08-15 10:05:34 +02:00
Lázaro Albuquerque 6e644a27fc
Change some global variables to have internal linkage (#4252)
* Change some global variables to have internal linkage

* Update rcore.c

* Update rcore.c
2024-08-13 19:16:07 +02:00
hanaxars 65c4003546
Make camera movement independant of framerate (#4247)
Instead of moving camera with constant speed per frame, speed is multiplied with delta time before movement.
2024-08-12 18:47:52 +02:00
Anthony Carbajal 418b878053
[Examples] set FPS to 60 (#4235)
* set FPS to 60

* remove extra commented lines
2024-08-10 20:07:23 +02:00
Asdqwe 46cb6af437
Fix core_input_gamepad_info example so all buttons are displayed within the window (#4241) 2024-08-09 19:03:14 +02:00
Maxim Knyazkin 13491a485a
Fixed compilation for OpenGL ES (#4243) 2024-08-09 19:02:18 +02:00
Anthony Carbajal e4529ff8f9
update text input box (#4229) 2024-08-09 09:18:00 +02:00
Anthony Carbajal 3c5bdae7ab
update shapes bouncing ball (#4226) 2024-08-09 09:16:05 +02:00
Anthony Carbajal 06aeb21429
update shaders basic pbr (#4225) 2024-08-09 09:15:07 +02:00
Anthony Carbajal 85c6489d81
update models box collisions (#4224) 2024-08-09 09:12:26 +02:00
Anthony Carbajal 243801c2d1
update text writing anim (#4230) 2024-08-09 09:07:56 +02:00
Maxim Knyazkin 2590a30d04
[rlgl] Adding warnings in case OpenGL 4.3 is not enabled (#4202)
* Adding warnings for OpenGL 4.3

* Removed logging from frequently called functions
2024-08-09 09:05:46 +02:00
NishiOwO fe9e371f27
[miniaudio] Fixing miniaudio and Makefile for NetBSD (#4212)
* fixing miniaudio

* another fix for NetBSD

* adding wl-r. should not affect other bsd
2024-08-09 09:04:18 +02:00
Anthony Carbajal 070c1c9d63
update examples missing unloadtexture (#4234) 2024-08-09 09:03:27 +02:00
Anthony Carbajal 5233b80fb7
update raygui (#4238) 2024-08-09 08:55:16 +02:00
Jeffery Myers 9ef678d90a
Fix warnings (#4239)
* Update raylib_api.* by CI

* Fix typecast warnings

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-09 08:54:22 +02:00
freakmangd cae0946764
Fix build.zig and use zig fmt (#4242)
+ `std.mem.split` is deprecated, `splitScalar` seems like the intended choice here
+ zig files should be formatted according to `zig fmt`
2024-08-09 08:53:29 +02:00
kai-z99 97c02b2425
[examples] Fix some examples (#4211)
* Add text

* small typo
2024-08-07 01:05:53 +02:00
Ray 5af331d708 REVIEWED #4206 2024-08-07 01:01:45 +02:00
Ray db8b199363 Reviewed shader 2024-08-06 18:32:14 +02:00
CDM15y b44b759b8f
[examples][shaders_raymarching] Add `raymarching.fs` for GLSL120 (#4183)
* Create raymarching.fs

* Update raymarching.fs

* Update raymarching.fs

* Update raymarching.fs

Remove `fragColor` as it is unused

Move the license to the top of the code to improve readability.
2024-08-06 18:30:15 +02:00
Anthony Carbajal 4b84b5563e
Update audio mixed processor (#4214)
* updated audio mixed processor

* remove float cast, better parenthesis
2024-08-06 18:29:10 +02:00
lnc3l0t 8b714e9dd9
[build.zig] check if wayland-scanner is installed (#4217)
#4150 introduced a default value for linux_display_backend,
which makes X11-only systems fail to build.
2024-08-06 18:28:33 +02:00
Ray 9c2ba3bfb7 REVIEWED: possible overflow... again #4206 2024-08-04 23:22:27 +02:00
Ray 923f983719 REVIEWED: Possible overflow #4206 2024-08-04 22:08:38 +02:00
Ray b657001e0d REVIEWED: shaders_vertex_displacement 2024-08-04 22:06:20 +02:00
lnc3l0t b2d48ff172
[build.zig] Override config.h definitions (#4193)
* [build.zig] Overridable definitions from config.h
The new Options field "config" holds a string the user can set in the
format "-Dflag_a=1 -Dflag_b=0 ..." to override the values set in
`config.h`.
The file is parsed and the default values are appended to the
compilation flags, if the user doesn't override them.
The user string is appended to the compilation flags.
The "-DEXTERNAL_CONFIG_FLAGS" is added to prevent "config.h" inclusion.

Note: a certain format is assumed for the formatting of config.h
Note: this commit references the closed issue #3516

* [build.zig] Only SUPPORT_* definitions are overridable

Lines from `config.h` which contains "SUPPORT" are added to compilation after being parsed:
- remove whitespace
- format to preprocessor option https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

The user supplied flags have priority over the ones read from the file.

NOTE: extension to commit 4da7f82e6f, the logic is simplified
because the SUPPORT flags only have binary values, which makes them easier to parse.
2024-08-04 22:01:28 +02:00
Dave Green 596cc3a645
[rcore][desktop_glfw] Set AUTO_ICONIFY flag to false per default (#4188)
* GLFW AUTO_ICONIFY flag is now set to false per default.

Previously AUTO_ICONIFY was only disabled if the user requested a Fullscreen window from the start. After that it was not possible to change this behavior on the user side anymore, even when changing to a Fullscreen window.

The AUTO_ICONIFY causes problems on macOS. On macOS if the window is minimized because of AUTO_ICONIFY than the only way to restore it is to click on the icon in the dock. In other words when AUTO_ICONIFY is enabled alt/cmd-tabbing through windows does not work correctly. On windows it works even when AUTO_ICONIFY is enabled.

Additionally if a raylib window is in Fullscreen mode on another monitor the AUTO_ICONIFY behavior is a problem because the user might want to window to stay on the monitor even if it loses focus. (problem on all OS's)

AUTO_ICONIFY also restores the monitor hardware resolution if a fullscreen window loses focus.

* Update rcore_desktop_glfw.c

Extra space removed and comments updated with a space at the beginning
2024-08-04 21:59:48 +02:00
Alex ZH 43b0c9410e
[examples] Add new example: `shaders_vertex_displacement` (#4186)
* shaders-vertex_displacement init

* implement simulation of wave in ocean

* update examples/README & add some comments

* update comments

* add gl100 shaders
2024-08-04 21:58:26 +02:00
Randy Palamar 92f60a99f6
[rlgl] use GLint64 for glGetBufferParameteri64v (#4197) 2024-08-04 21:53:56 +02:00
Anthony Carbajal 6595bab8ff
update make for examples (#4209) 2024-08-04 21:45:50 +02:00
Rico P a8ec8472ff
replace unicode characters by ascii characters in jar_xml to avoid warning in MSVC (#4196) 2024-08-02 21:04:33 +02:00
maxmutant 9e39788e07
[rcore] fix gamepad axis movement and its automation event recording (#4184)
* [rcore] fix gamepad axis movement and its automation event recording

This commit fixes 2 issues:
- Automation events aren't recorded for negative axis movements on
  gamepads (e.g. stick going left/up)
- 'GetGamepadAxisMovement' drift check isn't working correctly for
  triggers. Axis values between [-0.1, 0.1] are clamped to 0.0

Behaviour change:
- 'GetGamepadAxisMovement' returns default value for each axis, even
  if gamepad isn't attached.

* [rcore] inline body of 'GetGamepadAxisMovementDefault' and remove it
2024-07-28 22:07:47 +02:00
Dave Green e5a1fc4f20
No longer set the RL_TEXTURE_FILTER_LINEAR when high dpi flag is enabled. (#4189) 2024-07-27 20:19:05 +02:00
Ray efce4d69ce Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-25 11:44:59 +02:00
Ray 5041d20f00 Update rcore_desktop_glfw.c 2024-07-25 11:44:49 +02:00
Jutastre f5d2f8d545
Warning on invalid image data (#4179)
* Adds log warnings on invalid file data

* Separate error on missing file extension

* Changed LOG_ERROR to LOG_WARNING

---------

Co-authored-by: Jutastre <pukarlindgren@gmail.com>
2024-07-24 21:21:45 +02:00