Commit Graph

449 Commits

Author SHA1 Message Date
Ray
374811c440 Change ternary operator formatting 2019-02-22 13:13:11 +01:00
Ray
a886f5e743 Remove TABS 2019-02-22 12:12:21 +01:00
Ray
641895b5ba Remove end-line spaces 2019-02-21 18:45:19 +01:00
Ray
75298b50fb Corrected issue with OpenURL()
It was not working on Windows 10
2019-02-21 11:28:10 +01:00
Ray
bc86b0f78b Corrected path issue 2019-02-14 00:06:05 +01:00
Ray
981be58d03 Corrected issue #750 2019-02-13 17:49:02 +01:00
Ray
e996fe2ff5 ADDED: GetClipboardText(), SetClipboardText() 2019-02-11 18:03:06 +01:00
Ray
c200642887 Review issue with aspect ratio...
...while using a RenderTexture combined with 3d mode
2019-02-04 17:10:12 +01:00
Rob Loach
d897e14161
Revert the screenWidth change 2019-01-23 20:08:51 -05:00
Rob Loach
feb6afcd61
Fix clang++ compilation errors
clang was complaining about the type conversions. For example...
```
node_modules/raylib-src/src/core.c:1888:15: error: cannot initialize a variable of type 'char *' with an
      rvalue of type 'void *'
        char *cmd = calloc(strlen(url) + 10, sizeof(char));
              ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2019-01-23 20:07:47 -05:00
Ray
3703430f57 Renamed ShowWindow() to UnhideWindow() -WIP-
Function provisional renaming... that's not the end of this issue...
2019-01-17 16:29:36 +01:00
Ray
a43f87e391 Crazy test 2019-01-16 17:25:48 +01:00
Ray
42bfa7e3ff Make sure no parameters can be passed 2019-01-14 13:49:56 +01:00
Ray
e811279a75 Review code formatting on ColorFromHSV()
Following raylib notation rules
2019-01-14 13:49:17 +01:00
Demizdor
da1714f411 Added ColorFromHSV() 2019-01-14 12:49:00 +02:00
Ray
7132ba44db Reviewed latest PR 2019-01-10 17:06:26 +01:00
Ray
56173d7cf4
Merge branch 'master' into window-visibility 2019-01-10 16:57:15 +01:00
Marco Lizza
6056a2a5cf Reworking API upon suggestion. 2019-01-10 16:43:21 +01:00
Marco Lizza
a15251bcdb Adding window visibility functions. 2019-01-10 14:55:19 +01:00
Marco Lizza
5adcc30a2e Adding window visibility configuration flag. 2019-01-10 14:54:55 +01:00
Ahmad Fatoum
8bc4050377 Revert "core: workaround window not being rendered till moved on macOS Mojave"
This reverts commit 1fe6d9fc06.

Because upstream GLFW now contains a fix.
2019-01-08 09:03:22 +01:00
raysan5
a41cc08f9b Support screenshots and GIF capturing on Android and Web 2019-01-05 18:03:09 +01:00
raysan5
0bacc978c3 Corrected issue on web 2019-01-04 15:48:25 +01:00
raysan5
644eddda11 REMOVED: ShowLogo()
Same functionality could be achieved using FLAGS... but also considering removing raylib logo animation...
2019-01-03 13:55:59 +01:00
raysan5
d427f17210 REVIEWED some functions parameters
Decided to allow user to provide values directly instead of requiring a Vector2 struct, probably more confortable to use.

 - SetMousePosition()
 - SetMouseOffset()
 - SetMouseScale()
2019-01-03 13:53:20 +01:00
ChrisDill
f9c43dc379 Mouse functions changed
- SetMouseScale changed to take in a Vector2.
- Added mouseOffset global which is used in mouse read functions.
2019-01-02 19:09:34 +00:00
ChrisDill
a707574f33 Default mouseScale fixed
- Didn't set X and Y values correctly.
2019-01-02 10:46:19 +00:00
ChrisDill
8933298864 Added SetMouseOffset
- Changed mouseScale to Vector2.
- Added SetMouseOffset to change XY of mouseScale.
2019-01-02 10:14:55 +00:00
raysan5
01338b0a14 WARNING: BREAKING CHANGE
Added a bunch of useful text management functions.
Consequently, some already available functions like `FormatText()` and `SubText()` has been renamed for consistency. Created temporal fallbacks for old names.
raylib version bumped to 2.3.
2018-12-26 13:26:34 +01:00
raysan5
47358fe5ce Tweaks to support OpenGL ES 2.0 desktop 2018-12-24 17:09:46 +01:00
Ray
49055a9b17 Keep reviewing RPI keyboard input... 2018-12-19 15:31:20 +01:00
Ray
a22ee0c0e1 Review RPI keyboard inputs -WIP- 2018-12-18 19:11:12 +01:00
Ray
f822650a3b Support externally provided compilation flags
Useful in case raylib compilation want to be automated and compilation config flags provided by command line.
2018-12-18 00:20:08 +01:00
Ray
5ef4661216 Comments removed 2018-12-03 16:48:01 +01:00
Ray
1774260dab Some tweaks 2018-11-30 01:57:53 +01:00
Ray
c6b526de66 Support file drag & drop on Web
Using by default memory filesystem (MEMFS), provided by Emscripten
2018-11-26 17:15:00 +01:00
Ray
ac23af9bf0 Review resources naming
raylib resource data file for Windows platform (containing raylib icon and metadata for executable file) has been renamed to a more consistent name: raylib.rc.data

Also required to work with tcc compiler.
2018-11-19 15:18:11 +01:00
Ray
ed269b8d9a Review RenderTexture drawing usage
Now `BeginTextureMode()` does not clean buffers automatically, that behaviour has been changed because there could be some case (i.e. painting software) where texture buffer does not ned to be cleared; user is responsible of clearing buffers using `ClearBackground()`
2018-11-19 09:40:01 +01:00
Ray
829538249f
Merge pull request #683 from iwoplaza/patch-1
Update core.c
2018-11-19 09:27:45 +01:00
Ray
6351971c7f Corrected typo 2018-11-17 10:03:40 +01:00
Ray
c8385aba83 Review SetWindowIcon() 2018-11-17 00:46:42 +01:00
Michael Vetter
8f70c3baed Check for single apostrophe in OpenURL()
When doing a8dffc63fb I was not aware that
printing a warning and not executing the code would be an option. I only
learned that through 618f220851.

So I propose that we allow all URLs except if the string contains a `'`.
Which could end the URL and call another command via `system()`.

Related to https://github.com/raysan5/raylib/issues/686
2018-11-13 10:59:52 +01:00
Ray
618f220851 OpenURL() - Added small security check 2018-11-12 14:59:31 +01:00
Michael Vetter
a8dffc63fb Add warning to OpenURL()
See https://github.com/raysan5/raylib/issues/686
2018-11-12 12:32:41 +01:00
Ray
30a1edd40e Review OpenURL() 2018-11-12 00:34:32 +01:00
Michael Vetter
80dbe636cd core: OpenURL() fix xdg-open call
Calling just `xdg-open` is not right. One needs to pack the URL in `'`.
If we don't do this then some special characters (like ampersand) will
be executed.

Maybe this is true for Windows and Apple case too, but I don't own any
such system. So please merge this, and if it's true for more cases let's
use `sprintf()` in the other cases too.
2018-11-10 08:36:15 +01:00
Michael Vetter
4c83cee810 core: Use dynamic string in OpenURL()
OpenURL() is a function that most games probably will never need.
Wasting 512 bytes to store of a static char to store an the URL is not
wise.

I propose to have it dynamic building the string on the fly.
2018-11-10 08:29:53 +01:00
Ray
5167f78d5f ADDED: OpenURL()
Corrected bug on ImageDrawRectangleLines()
2018-11-09 23:09:02 +01:00
GoblinBob
8e219272e5
Update core.c
Some projects need the buffer to not be empited when drawing to the render texture. I would suggest making maybe a variation of the function if you'd like to keep backwards compatibility, maybe like: BeginTextureModeNoClear() ?
2018-11-07 21:06:00 +01:00
Ray
fc1c9505ba Remove end-line spaces 2018-11-06 15:10:50 +01:00
Ray
0f6f326a86 Add flag: SUPPORT_EVENTS_WAITING
Wait for input events passively (sleep) instead of polling events actively every frame
2018-10-31 23:19:29 +01:00
Ray
298203a41a ADDED: Some functions...
text:     IsEqualText() -WIP-
audio:  SaveWAV()
audio:  ExportWaveAsCode()
textures:  ExportImageAsCode()
2018-10-29 16:18:06 +01:00
Michael Vetter
b13c9716e4 Fix GetDirectoryFiles description
The comment sais it allows max 256 files, but the MAX_DIRECTORY_FILES
define actually is set to 512.
2018-10-25 16:18:44 +02:00
Michael Vetter
65b5de962d Use seperate blog for MAX_FILEPATH_LENGTH define
Let's have a seperate if linux block for this. Since we will need to
define MAX_FILEPATH_LENGTH for all other cases. And its more readable
like this.
2018-10-25 16:16:44 +02:00
Michael Vetter
9bad248b54 Use filepath define
On Linux systems the length of the path is defined in linux/limits.h as
PATH_MAX.
Lets use that for MAX_FILEPATH_LENGTH, which is a define that we can
find in some comments in the code that is actually never used. Instead
often we see 256 handwritten.
So lets have MAX_FILEPATH_LENGTH as a proper define, being set to
PATH_MAX on Linux and to 256 on Windows systems.
2018-10-25 16:09:38 +02:00
Ray
72431c6c36 Code tweaks 2018-10-24 13:45:17 +02:00
Ray
b5bcf2c934 Review code formatting for RPI inputs 2018-10-22 11:48:16 +02:00
Berni8k
3d825eb973 Added RaspberryPi option to ignore duplicate touchscreens (On by default) 2018-10-21 15:06:40 +01:00
Berni8k
e07ec6a2e8 Overhaul mouse and touch for RaspberryPi \n\nNow all '/dev/input/event*' devices are now used for input. No longer uses '/dev/input/mouse*', keyboard and gamepad continue to use existing method\nMultitouch is now supported on RPi with 10 point multitouch\nFixed bugs with IsMouseButtonPressed(Used to constantly fire when holding button) and GetMouseWheelMove(Did not work)\n Fixed exesive CPU usage of GamepadThread 2018-10-21 00:09:17 +01:00
Ray
161b18edea Reviewed possible issue with external libs 2018-10-20 12:30:37 +02:00
Ray
764766bfb2 Some formatting tweaks 2018-10-18 16:00:11 +02:00
Ray
b8b8936cd7 Review defines 2018-10-16 10:53:01 +02:00
Michael Vetter
d8331bde3a Add FileExists() function 2018-10-14 14:21:02 +02:00
raysan5
c7b601b624 Renamed new PR function
RENAME: GetLastWriteTime() to GetFileModTime()
2018-10-13 15:59:17 +02:00
ChrisDill
c2b36af60f Added GetLastWriteTime to allow for file reloading
- Added a function to get the last write time of a file. I used this so I can reload files or resources if the time since they were last loaded changes.
2018-10-12 13:53:36 +01:00
Ray
126ab49221 Minor tweaks 2018-10-10 23:55:36 +02:00
Ray
a511337ce8 ADDED: GetFileNameWithoutExt 2018-10-10 12:01:59 +02:00
Ray
4f5937e89b OSX native window keeps breaking... 2018-10-08 18:51:41 +02:00
Ray
717cf77129 Corrected issue with dirent.h inclusion...
...and MacOSX OBJC types definition...
2018-10-08 18:38:39 +02:00
Ray
2652e7d1c1 Avoid multiple gl.h inclusions
Expose native Cocoa Window again...
2018-10-08 18:08:39 +02:00
Ray
6e4bd60978 Trying to include dirent.h for MSVC 2018-10-08 16:25:47 +02:00
Ray
2d324f22a7 Corrected issue with native window handler on OSX
Could not be retrieved for now...
2018-10-08 16:12:09 +02:00
Ray
97f6454982 Corrected issue with native handler on OSX 2018-10-08 13:29:42 +02:00
Ray
ca1e309d9d Corrected issue with GetWindowHandle()
Not supported for the moment, issues with Linux (symbol `Font` redefined) and OSX (NSGL type redefined)
2018-10-08 13:14:15 +02:00
Ray
2feea87b61 Multiple changes, check description
REVIEW: Reorganized global variables for consistency
ADDED: GetWindowHandle() to get native window handle
ADDED: GetDirectoryFiles() to get files list for a DIR
2018-10-08 12:29:02 +02:00
Ahmad Fatoum
1fe6d9fc06
core: workaround window not being rendered till moved on macOS Mojave
Apple ought to fix their OpenGL implementation, but with OpenGL now
deprecated this might not happen.

This has been reported upstream in GLFW in glfw/glfw#1334.
The workaround comes from kovidgoyal/kitty@b82e74f99

This also fixes the HiDPI (Retina) scaling issues reported in #497,
so the workaround is enabled anywhere __APPLE__ is defined.
2018-10-07 02:14:30 +02:00
ChrisDill
67dc50ef00 Changed monitor functions to use a index
- Using same idea as SetWindowMonitor to take in a index with 0 being the primary monitor.
2018-09-30 15:20:02 +01:00
ChrisDill
6b84b76b70 Forgot #else in platform check
- Added else so return not compiled twice.
2018-09-29 14:28:07 +01:00
ChrisDill
ed95337eb8 Added platform check
- Added PLATFORM_DESKTOP check for Monitor functions to try to fix issue on android.
- Not sure what return types should be when not on desktop. Added rough guess for now.
2018-09-29 14:10:29 +01:00
ChrisDill
ed79d53e1a Changed tabs to spaces
- Fixed tabs used instead of 4 spaces
2018-09-27 16:23:11 +01:00
ChrisDill
73701c12b2 Merge remote-tracking branch 'upstream/master' 2018-09-27 15:54:02 +01:00
ChrisDill
1836e02c1e Added monitor functions
- Get number of monitors
- Get size, physical size and name of primary monitor. Could pass monitor id instead not sure.
2018-09-27 15:52:56 +01:00
Ray
abfbc42df7 PNG image size optimization 2018-09-25 12:53:31 +02: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
Ray
5b09630d45 Update mini_al to v0.8.8
Some minor tweaks around
2018-09-14 12:47:31 +02:00
raysan5
af919e5c9f Review naming to follow raylib conventions
strprbrk() does not follow raylib function name convention but as it is
very similar to the standard strpbrk(), we'll keep the naming... also,
don't like to mix static functions with API functions but as strprbrk()
is just used in the two functions below, it's ok to be there... maybe it
could be refactored in a future or even move the logic inside the
required functions...
2018-08-25 17:55:25 +02:00
Ahmad Fatoum
85213795d1
GetDirectoryPath: return NULL, don't crash when no slash
Noted in #634.
2018-08-25 09:27:41 +02:00
Ahmad Fatoum
5dda105a79
core: Support slashes as well in GetFileName & GetDirectoryPath
Fixes #634.
2018-08-25 09:23:40 +02:00
Kim Kulling
b2cac82fa0 Fix compiler warings in texture.c and more. 2018-08-05 00:34:35 +02:00
Pablo Marcos Oltra
89cec68565 Prevent GLFW changing working dir to 'Resources' 2018-07-29 18:38:31 +02:00
Ahmad Fatoum
4d209d45aa
core: Don't use GLFW_TRANSPARENT_FRAMEBUFFER with older GLFWs
PLATFORM_WEB is not the only platform that doesn't define
GLFW_TRANSPARENT_FRAMEBUFFER, it's also recent enough that it's not
included in the most recent GLFW 3.2.1 release, so this error can creep
up when using USE_EXTERNAL_GLFW.
2018-07-29 12:35:36 +02:00
raysan5
4c15515ba6 Support examples with Emterpreter
Examples can be compiled for web with no code change at all! Usually
examples need to be refactored for web... using emscripten code
interpreter (emterpreter), it can manage synchronous while() loops
internally... as a downside, execution is very slow...
2018-07-21 17:13:59 +02:00
Ray
096fd6f2c3 Converted rlgl module in header-only
This change allows rlgl.h usage as independent single-file header-only module... still some tweaks required, like removing GLAD dependency... required extensions could be manually loaded!

Also removed shader_distortion.h, embedded in rlgl.h
2018-07-16 17:53:47 +02:00
raysan5
c6d188a09a Reviewed latest commit for Android gamepad support 2018-07-07 10:15:19 +02:00
Seth Archambault
f981daf1df Added SNES-style GAMEPAD SUPPORT 2018-07-06 13:33:46 -04:00
raysan5
1f1d8eeeeb Checking Android input functionality
Joystick support is not implemented just yet, not difficult but it
requires some work...
2018-07-05 19:00:49 +02:00
maficccc@gmail.com
59ebe1b7c3 Added support OpenBSD, NetBSD, DragonFly 2018-06-23 17:02:07 +02:00
Ray San
0c01c08718 Corrected issue, flag not supported...
...by emscripten glfw javascript implementation
2018-06-12 13:21:36 +02:00
Ray
9688c677de Review window creation hints 2018-06-02 18:26:57 +02:00
Ray
0b05169aa7 Some warnings review 2018-05-17 00:58:58 +02:00