75 Commits

Author SHA1 Message Date
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
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
Reece Mackie
4b03860810
UWP rework ()
* 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
90fb53bccc Review android_fopen() to support SDCard access 2020-04-05 17:51:27 +02:00
Dani Martin
62cdb2299b
[cppcheck] Improvements in SaveStorageValue() in core.c ()
* [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
28da2522fe [utils] Review TRACELOG() messages, categorized 2020-03-27 17:15:26 +01:00
raysan5
7ae7a87f8a Remove trail spaces 2020-03-25 19:41:51 +01:00
Ray
fb2ed693e4 Android: Support file saving to internal data storage 2020-03-05 18:12:41 +01:00
Ray
74c486201d ADDED: LoadFileText() and SaveFileText()
Improved file access checks
2020-03-04 00:21:46 +01:00
Ray
5ff0776235 Remove trail spaces and some tweaks 2020-02-27 13:33:09 +01:00
Ray
23bde477e5 REDESIGN: LoadStorageValue()/SaveStorageValue()
Using new file I/O ABI
2020-02-27 13:18:15 +01:00
Ray
1046449339 ADDED: LoadFileData(), SaveFileData() 2020-02-26 20:29:33 +01:00
raysan5
90c129fd61 Review some libc dependency comments 2020-02-09 16:11:11 +01:00
Ray
b5fe41f41a Review libc dependencies and remove when possible
Just for clarification, no plans to remove libc dependency, just did some code analysis to see how much raylib depend on stardard C library. My conclusions:

 - stdlib.h: primary dependency is for malloc() and free()
 - stdio.h: primary dependency is for FILE access, maybe it could go through a custom ABI?
 - string.h: just around 8 functions required
 - math.h: just around 8 functions required
 - others: 1-2 functions required for some other headers
2020-02-04 16:55:24 +01:00
Ray
cde26c743c Replace TraceLog() function by TRACELOG macro
Added SUPPORT_TRACELOG_DEBUG config
2020-02-03 19:13:24 +01:00
Ray
4211056354 Reviewed some comments 2020-01-08 18:21:08 +01:00
raysan5
21c30f43d4 Update year to 2020 2020-01-05 20:01:54 +01:00
Ray
1b249ac1e1 Define some globals 2019-06-19 15:43:35 +02:00
raysan5
40940f4398 Some formatting review 2019-04-28 16:45:23 +02:00
raysan5
e8c413b7cd Review UWP implementation
Basically, formating review and some variables naming to follow raylib conventions.
2019-04-27 22:47:03 +02:00
Reece Mackie
2de1f31821 UWP Support Overhaul ()
* Working build

* Fix build again, stop deleting files

* Hotfix crash, needs investigating

* Remove VS2015.UWP, I cannot update the project

* Lots of UWP work, added keyboard and mouse press support. Still need to finish scroll wheel, mouse position and cursor hiding, plus other stuff that I haven't seen yet.

* Implemented a ton more things, added BaseApp.h to provide common code to UWP apps.

* Remove constant window dimensions

* Enable and Disable cursor support.

* Actually use mouse delta

* Gamepad Support

* Cleaning and small tweaks

* Restore original example.

* Update comment

* Use 'Messages' to handle the cursor functions so code is more portable.

* Comment

* Comment unused message fields and use vector for mouse pos instead.

* Move messages to utils.h and use messages for everything. No more plat-specific code in raylib.h

* Working build

* Fix build again, stop deleting files

* Hotfix crash, needs investigating

* Remove VS2015.UWP, I cannot update the project

* Lots of UWP work, added keyboard and mouse press support. Still need to finish scroll wheel, mouse position and cursor hiding, plus other stuff that I haven't seen yet.

* Implemented a ton more things, added BaseApp.h to provide common code to UWP apps.

* Remove constant window dimensions

* Enable and Disable cursor support.

* Actually use mouse delta

* Gamepad Support

* Cleaning and small tweaks

* Restore original example.

* Update comment

* Use 'Messages' to handle the cursor functions so code is more portable.

* Comment

* Comment unused message fields and use vector for mouse pos instead.

* Move messages to utils.h and use messages for everything. No more plat-specific code in raylib.h

* Tested some desktop stuff and added projection matrix updates for window resizing.

* Fixed big bad mouse bug

* Fix alt buttons and add hack to combat flickery key presses (far from perfect)

* Remove debug code

* Final commit

* Well, so I thought

* Wow, i am bad

* Remove packages folder

* Remove useless include

* Apply requested changes and fix linux build

* Try to stop packages folder

* Have we fixed the formatting properly?

* Third time's the charm?

* Where did this come from?

* Re-fix

* Autoformat is gonna kill

* Fixed XBOX ONE Support

* Fix tabs
2019-04-27 20:33:51 +02:00
Ray
e67ebabb02 Support custom memory management macros
Users can define their custom memory management macros.

NOTE: Most external libraries support custom macros in the same way, raylib should redefine those macros to raylib ones, to unify custom memory loading. That redefinition is only implemented as example for stb_image.h in [textures] module.
2019-04-23 14:55:35 +02:00
ChillerDragon
f21761fbbb Happy new year 2019 2019-04-07 17:49:12 +02:00
Ray
477ea4d660 Support external config flags 2019-03-12 16:00:26 +01:00
Ray
9740e5d3ed Update utils.c 2019-01-29 12:45:10 +01:00
Ray
3363cfa61a Corrected log naming 2019-01-29 12:33:08 +01:00
Ray
4467292a2d Review last PR formatting 2019-01-21 10:32:14 +01:00
Marco Lizza
343fef4aa4 Changing enums, now referenced as int. 2019-01-21 10:05:40 +01:00
Marco Lizza
f1d13aa469 Adding function to control the "exit-on-error" behaviour. 2019-01-20 22:24:41 +01:00
Marco Lizza
932e9dbd09 Fixing logging level configuration API. 2019-01-20 22:24:09 +01:00
Marco Lizza
78904d2bcc Fixing TraceLog function to work on levels. 2019-01-20 22:23:07 +01:00
Ray
c93bf336fe Update utils.c 2019-01-15 12:32:41 +01:00
Marco Lizza
efcb68ceca Fixing LOG_OTHER missing. 2019-01-14 17:09:41 +01:00
Marco Lizza
ce98cc6285 Adding MACRO constant to specify the internal buffer size. 2019-01-14 17:09:17 +01:00
Basem Abughallya
9a40529ae7 utils: declare funopen only on Android
funopen is only needed on Android, so declare it
only there. This fixes following MinGW build failure:

utils.c:50:7: error: conflicting types for ‘funopen’
 FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int),
       ^~~~~~~
In file included from utils.c:45:0:
/usr/include/stdio.h:586:7: note: previous declaration of ‘funopen’ was here
 FILE *funopen (const void *__cookie,
       ^~~~~~~
2018-12-29 17:44:47 +01:00
Ray
ec5c9686b3 Improved data export capabilities!
REVIEWED: ExportImage()
REVIEWED: ExportMesh()
ADDED: ExportWave()
REMOVED: Internal funcs: SavePNG(), SaveBMP()

NOTE: These changes break the API (parameters order)
2018-09-17 16:56:02 +02:00
Pablo Marcos Oltra
c69f7953c7 Add SetTraceLogCallback to enable users setting custom logging () 2018-07-26 21:57:45 +02:00
Ahmad Fatoum
e025e62445 cmake: Fix PLATFORM_WEB build
Did this ever work? Surely, doesn't look like it...
2018-05-21 12:15:39 +02:00
Ahmad Fatoum
ad8509732c
CMake: Fix (Add?) Android support
Not sure if this ever worked, but now it at least compiles.
2018-05-21 01:08:29 +02:00
Ahmad Fatoum
1841afad11
Refactor all #define SUPPORT_* into a config.h
That way, a user needs only to touch a single file to configure what
features raylib is built with.
Include guards are left out intentionally, because config.h should only
be included in source files, not headers.

Later on, config.h can also define the raylib version ().
2018-04-07 23:37:48 +02:00
Ray
005f2ffb75 Simplified some code 2018-04-05 19:18:44 +02:00
raysan5
0bd06eec51 Renamed function to SetTraceLog()
I think is clearer this way...
2017-12-24 16:49:54 +01:00
raysan5
e517d8fd16 Added function SetTraceLogTypes()
Trace log messages could be configured with this function to select wich
ones are shown
2017-12-24 16:47:33 +01:00
Ray San
00c34a035c Updated copyright year 2017-12-20 12:37:08 +01:00
Ray
a6f9cc5629 Remove rres support
Let the user choose if using rres external library
2017-12-11 11:55:02 +01:00
Ray San
c45eeb8024 Code tweaks and comments for Android 2017-09-29 13:56:37 +02:00
raysan5
9f09f6f550 Rename enum LogType names...
...to avoid possible conflicting symbols
2017-07-02 12:35:13 +02:00
Ray
0a33fbf8bb Corrected TraceLog issue 2017-04-01 00:48:40 +02:00
Ray
080a79f0b0 Added IsFileExtension()
Replaced old GetExtension() function
Make IsFileExtension() public to the API
2017-03-29 00:35:42 +02:00
Ray
b7a8a40e71 Work on configuration flags 2017-03-26 22:49:01 +02:00