Commit Graph

594 Commits

Author SHA1 Message Date
raysan5 c32ae480af RENAMED: FormatText() -> TextFormat()
This function was renamed for consistency in raylib 3.0, just unified all examples to use TextFormat() instead of FormatText()
2020-08-16 11:28:15 +02:00
raysan5 2c7dc70878 Reset close status for next frame #1339 2020-08-06 11:47:46 +02:00
Ray b5eb104b08 Consider empty title for window #1323 2020-07-24 18:20:37 +02:00
raysan5 feedf332a8 Issue with render size assignment on RPI/Android #1314 2020-07-17 18:39:31 +02:00
Random 7760575d3f fix emcc warning (-Wparentheses-equality) (#1310) 2020-07-14 21:25:21 +02:00
seanpringle a9d676a5fd scale perspective top calc for near culing plane (#1309) 2020-07-14 10:36:22 +02:00
raysan5 7199dd570f REVIEW: Pointer lock emscripten API does not work #1241
It seems some internals change recently due to web security reasons and some emscripten HTML5 funtionalities like pointerLock or fullscreen modes behave very weird or just don't work as expected
2020-07-10 18:23:17 +02:00
Ray 5986eee6ab Expose additional configuration options
Some internal defines have been exposed in config.h
2020-06-30 11:05:09 +02:00
Ray eae6e6a828 Minor format tweak 2020-06-27 14:11:21 +02:00
Shylie 25fb24ba7d [add] GetMonitorRefreshRate(int monitor); (#1289) 2020-06-24 18:28:57 +02:00
Ray 38530ebf12 REVIEWED: ToggleFullscreen(), issue #1287 2020-06-23 00:39:06 +02:00
raysan5 ad954dc7ab WARNING: BIG CHANGE: Move Color functions to texture module
WARNING: Some functions ADDED and some RENAMED:
- RENAMED: Fade() -> ColorAlpha() [Added #define for compatibility]
- ADDED: ColorAlphaBlend()
- ADDED: GetPixelColor()
- ADDED: SetPixelColor()
2020-06-15 12:02:50 +02:00
Chang Si Yuan 6264c4901b Fix wrong height used when using scissor mode with render texture of different height from window (#1272) 2020-06-08 10:32:23 +02:00
raysan5 5d0b2c796e Remove warning from GetDirectoryPath() 2020-06-07 11:50:03 +02:00
raysan5 a4333035c7 Use TRACELOG() macro instead of TraceLog() function 2020-06-02 23:07:42 +02:00
ChrisDill aff47d1564 Added bool IsCursorOnScreen(void). (#1262)
- The Mouse struct already stores cursorOnScreen. This function simply exposes it to the usage code.
2020-05-26 11:59:25 +02:00
raysan5 94789dd24a Review usage of sizeof(), unify conventions
All functions requiring sizeof() now follow the same convention:

NUM_ELEMENTS*NUM_SUBELEMENTS*sizeof()
2020-05-23 19:23:40 +02:00
raysan5 7b001164ef Review formatting GetPRevDirectoryPath() 2020-05-14 17:37:54 +02:00
raysan5 64d44d131d Emscripten fullscreen -WIP- 2020-05-14 17:35:26 +02:00
ivn 730375faf7 fix bug in GetPrevDirectoryPath on Unix-like systems (#1246) 2020-05-14 17:30:32 +02:00
raysan5 913ef1d56f Misc code reviews 2020-05-09 13:05:54 +02:00
Mickaël Malécot 0bd64b7975 Gamepad axis bug fixes and improvement (#1228)
* Fix gamepad axis count

* Fix Xbox axis drawing

* Ignore low axis values

* Revert "Fix gamepad axis count"

This reverts commit f08ae4bf

* Fix GamepadAxis API

* Fix conflict with master

* Revert Gamepad MAX definitions

* Revert MAX_GAMEPAD_AXIS update
2020-05-09 12:39:41 +02:00
raysan5 fdad1f023b Avoid all MSVC compile warnings
Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
2020-05-06 19:12:09 +02:00
raysan5 526c85773f Replace deprectared usleep() calls 2020-05-06 11:33:08 +02:00
raysan5 51c3bef497 Review exposed #defines and allow user re-defining
There are multiple #define values around raylib, usually not exposed for redefinition, just reviewed all of them to allow users redefining them on compile time if required.

Also, multiple #define have been renamed and commented.
2020-05-01 17:31:44 +02:00
raysan5 1c15dc7292 Reviewed UWP update
Mostly code formatting tweaks
2020-04-30 21:00:09 +02:00
raysan5 0981dde9d4 Remove strcmp() requirement 2020-04-30 20:17:16 +02:00
Reece Mackie 4b03860810 UWP rework (#1231)
* First draft of UWP rework.

* Read desc

- Moved UWP specific functions to uwp_events.h
- Removed BaseApp.
- Implemented example UWP lifecycle.

* Added GIF recording and screenshot support.

* Character inputs and filesystem stuff

* Fix game closing on Xbox when B is pressed.

* Fix the gamepad binding hack

* Add as many keys as I believe are possible.

* Implemented mouse locking of a sort.

* Remove rogue todo, the rest are for a game dev using this example.

* Implemented touch how I "think" it should work. I cant test this.

* Review.
2020-04-30 19:48:39 +02:00
raysan5 ac8f436c3b Init CORE.Window.focused 2020-04-29 20:55:17 +02:00
raysan5 6e2d39c51b ADDED: IsWindowFocused() 2020-04-27 17:41:29 +02:00
raysan5 72cc3e0530 Corrected issue #1203 2020-04-26 13:23:03 +02:00
raysan5 8e59ecb50c ADDED: GetWindowScaleDPI() 2020-04-24 23:17:32 +02:00
raysan5 baf5e02f43 Remove comment 2020-04-16 13:48:47 +02:00
raysan5 8d51ad567f Review UWP project -WIP- 2020-04-13 16:40:04 +02:00
raysan5 d419602c99 Review display size init for RPI 2020-04-09 23:50:00 +02:00
raysan5 4ceb4d3bf3 Some code tweaks, comments and defines 2020-04-05 17:50:37 +02:00
raysan5 e8a8d544c5 Review formating and signegness issues 2020-03-30 14:38:16 +02:00
Dani Martin 62cdb2299b [cppcheck] Improvements in SaveStorageValue() in core.c (#1160)
* [cppcheck] Improvements in SaveStorageValue() in core.c

in file core.c cppcheck shows errors only in function SaveStorageValue():

* Common realloc mistake: 'fileData' nulled but not freed upon failure
* Memory pointed to by 'fileData' is freed twice.

Validation:
* Tested examples/core/core_storage_values.c
* Launched Unit Test for this function
* Rerun CPPCHECK afer fix

* [cppcheck] Change functions header to accept only positive position in files

Changes:
* Functions SaveStorageValue(), LoadStorageValue() (core.c)
* Functions LoadFileData(), SaveFileData() (utils.c)
* Headers in raylib.h

Validation:
* Tested examples/core/core_storage_values.c
* Launched Unit Test for these functions
* Rerun CPPCHECK afer fix
2020-03-30 13:51:36 +02:00
raysan5 d28e73849b Review TRACELOG() messages 2020-03-27 18:49:21 +01:00
raysan5 c7e9951795 [core] Review TRACELOG() messages, categorized 2020-03-27 18:06:09 +01:00
raysan5 7ae7a87f8a Remove trail spaces 2020-03-25 19:41:51 +01:00
raysan5 3d41c1b6cd Minor tweaks 2020-03-25 19:38:55 +01:00
raysan5 96005f2566 ADDED: IsWindowFullscreen() 2020-03-25 18:52:38 +01:00
raysan5 51a8e1d692 Remove define not required 2020-03-24 13:26:34 +01:00
Doyle da836a732c Android: Better track touch input returned from IsMouse*() (#1144)
* Android: Better track touch input returned from IsMouse*()

Switch to actually tracking touch input to use for "mouse" input rather
than the gestures system. The gesture system as an abstraction ontop of
raw touch input loses some information needed to map to "mouse"
input.

Before,
- IsMouseButtonReleased() triggers immediately after the initial touch
(because GESTURE_TAP activates immediately on touch) instead of waiting for the
touch to be released.
- IsMouseButtonUp() returns false, when it should just be the opposite
of IsMouseButtonDown().
- IsMouseButtonDown() returns true only after GESTURE_HOLD (which
activates after some period of time after GESTURE_TAP), when instead it
should just be true whenever there is touch input i.e. gesture !=
GESTURE_NONE or alternatively when any input is received on the screen.

After this PR, touches map closer to mouse input.
- IsMouseButtonReleased() triggers when touch is released (last frame
was touched, this frame not touched).
- IsMouseButtonUp() returns the opposite of IsMouseButtonDown()
- IsMouseButtonDown() is true when
(AMOTION_EVENT_ACTION_DOWN || AMOTION_EVENT_ACTION_MOVE) and false when
(AMOTION_EVENT_ACTION_UP)

* RPI: Include index check for RPI in GetTouchPosition()
2020-03-24 13:23:34 +01:00
raysan5 8f45370073 Comment tweaks 2020-03-23 20:24:09 +01:00
Doyle 01e035e28b Android: Track touch motion across screen (#1137)
This was working in 2.6 but no longer does in current git tree.
It appears touch position is only tracked on
AMOTION_EVENT_ACTION_[DOWN|UP], which only registers the initial touch
on the screen. Subsequent movement is not tracked into CORE.

Touch position and the Gesture System appears to be updated twice in
AndroidInputCallback in what looks like perhaps a copy paste error (code
is identical) with the exception of tracking AMOTION_EVENT_ACTION_UP in
the 2nd copy of the code (but this is not necessary to track).

If you need to track the first touch or release touch position, you can
do so with checking IsMouseButton[Pressed|Released] on the same frame.

This patch makes it so the touch position is always updated, and merges the
duplicated code into 1 singular code path.
2020-03-19 16:56:48 +01:00
raysan5 2344941974 Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
2020-03-17 13:40:07 +01:00
Doyle 427be604b9 Android: Set display.[width, height] before screen size check (#1132)
In `InitGraphicsDevice(...)`, the Android section has a screen security check
like other platforms- but CORE.display.width, CORE.display.height are
not set yet, so the security check sets it to 0. So ensure we query the
device's screen width and height before the screen size security check.

This also gives you the ability to run a proper full-screen application
on Android without any scaling and guess work on the target device by
setting screen width and height to 0 in `InitWindow(...)` and using
`GetScreen[Width|Height]()` to get the actual values.
2020-03-15 15:56:43 +01:00
Ray d57b5ac89a Added note on transparent framebuffer w/o X11 on RPI 2020-03-12 17:47:35 +01:00