Commit Graph

1667 Commits

Author SHA1 Message Date
Ray
93471b0a7c WARNING: Renamed module: audio -> raudio
Planning to promote raudio module as a simple and easy-to-use front-end for the amazing mini_al library, so the name change.

Name comes from raylib-audio but in spanish it also remembers to word "raudo", meaning  "very fast", an analogy that fits perfectly to the usefulness and performance of the library!

Consequently, raylib version has been bumped to 2.4-dev.
2019-01-10 16:32:40 +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
Ray
64fd131ed5 Some improvements on SetShaderValue()
- Unsigned int not supported on OpenGL ES 2.0 -> Removed
- Reorganized enum -> Removed BOOL (not uniformType)
- Support sample2D uniform type
2019-01-10 12:28:23 +01:00
Ray
55f8dbc755 WARNING: Redesigned SetShaderValue() 2019-01-10 11:25:26 +01:00
Ray
35bcbd1b60
Merge pull request #718 from MarcoLizza/shaders-uniforms-array
Shaders uniforms array
2019-01-09 17:01:59 +01:00
Marco Lizza
73597332b6 Adding uniform array support for shaders. 2019-01-09 16:18:00 +01:00
Ray
010c655f79 Added required define on TCC compiler 2019-01-08 10:10:20 +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
Ahmad Fatoum
c3d2b1b184 glfw: Update GLFW to current master
glfw/glfw@5595fa3ae6 implements a proper fix for the macOS Mojave
problem of OpenGL windows not being rendered until moved or manually
updated.

Pull in the current master and rebase the three patches we have on top:
- two commits we have for reuse of the GLFW CMake build system for Wayland
It hasn't yet to be acknowledged upstream.
- one commit removing #include <windows.h> in glfw3native.h to avoid
duplicate declarations.

Fixes #655 and #665.
2019-01-08 09:03:22 +01:00
Ahmad Fatoum
f719de4bf8 external: glfw: Ignore {docs/examples/tests}/ directories 2019-01-08 09:03:22 +01:00
raysan5
1036de389a Some minor tweaks analyzing code
Specific textures generation code is quite redundant and not flexible for the user, I'm trying to figure out some easy way to allow raylib users to do the same without needing those functions (very specific and shader dependant). RenderTexture loading and Cubemap textures support must be improved.
2019-01-06 21:07:09 +01:00
raysan5
f4fe7f4d4c Review BRDF texture generation
Actually, that function should be redesigned...
2019-01-06 15:49:29 +01:00
raysan5
5c614f6975 Some code tweaks 2019-01-05 19:24:42 +01:00
raysan5
a41cc08f9b Support screenshots and GIF capturing on Android and Web 2019-01-05 18:03:09 +01:00
raysan5
1038e79b36 Corrected issue with text measure on Latin-1 chars
Considering chars inputs come in UTF8 form!
2019-01-05 15:04:18 +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
Ray
0333e5b6c2
Merge pull request #711 from ChrisDill/SetMouseOffset
Added SetMouseOffset
2019-01-03 13:35:28 +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
Ray
30e79b4727
Merge pull request #708 from BaZom/master
utils: declare funopen only on Android
2019-01-02 17:41:43 +01:00
raysan5
63f9f91ea8 Avoid crashing if music file not loaded 2019-01-02 14:05:20 +01: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
d5735720b0 Update Makefile for Emscripten 2019-01-01 20:53:30 +01:00
raysan5
9740b1eb70 Update mini_al to latest version (Web Audio / AAudio backends) 2019-01-01 20:52:57 +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
raysan5
d0d99d3503 Corrected issue with MOD/XM loop 2018-12-29 15:07:03 +01:00
raysan5
0619571149 ADDED: DrawTextRec() and example 2018-12-29 14:44:28 +01:00
raysan5
95d3f24c68 Use QUADS for DrawPolyEx() 2018-12-29 00:29:28 +01:00
raysan5
a072385c6d Corrected issue on draws resetting 2018-12-29 00:00:52 +01:00
raysan5
414c3ee1f9 ADDED: DrawTextureQuad()
Useful for tiling and offset parameters definition.
2018-12-26 23:44:16 +01:00
raysan5
91a7b0e5ef Corrected typo 2018-12-26 13:57:10 +01: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
9a8320c52b REVIEWED: DrawRectanglePro() 2018-12-26 10:51:13 +01:00
raysan5
af4a177af4 Corrected issue with internal buffer
Problem aligning provided vertex data to multiples of four, because main buffer is intended to bu used with indexed quads... but also shared with triangles and lines.
2018-12-26 10:34:45 +01:00
raysan5
7b8965eb38 Support float texture data on OpenGL ES 2.0 2018-12-25 15:19:25 +01:00
raysan5
35a6e9a074 Corrected issue with MOD playing
Despite issue is corrected, now module loop doesn't work...
2018-12-25 15:18:35 +01:00
raysan5
96207a8a02 REVIEWED: LoadFontEx()
Changed parameters order for consistency with LoadFontData() and other functions when an array is passed by parameter and array size is the following parameter.
2018-12-25 15:17:42 +01:00
raysan5
7fb2459916 Added some TODO note
OpenGL extensions loading could be improved...
2018-12-24 17:45:34 +01:00
raysan5
47358fe5ce Tweaks to support OpenGL ES 2.0 desktop 2018-12-24 17:09:46 +01:00
raysan5
92f68ac6be Review DrawPolyEx()
Also reviewed rlCheckBufferLimit()
2018-12-24 14:09:51 +01:00
Ray
4ec4dc691f Use stb_vorbis.h as header only 2018-12-21 00:17:44 +01:00
Ray
e48f2f9d43 Delete libraylib.a 2018-12-20 12:59:00 +01:00
Ray
87ad244ee0 Exposed LoadFontFromImage() 2018-12-20 12:58:27 +01:00
Ray
788bb78989 Some tweaks 2018-12-20 10:40:28 +01:00
Ray
b6d2f96645 Corrected issue 2018-12-19 18:08:59 +01:00
Ray
af33e3848e Improved BeginScissorMode()
Now rectangle coordinates refer to upper-left corner instead of bottom-left
2018-12-19 17:06:23 +01:00
Ray
49055a9b17 Keep reviewing RPI keyboard input... 2018-12-19 15:31:20 +01:00
Ray
66c360d385 Corrected issue on plane drawing 2018-12-19 11:55:58 +01:00
Ray
a22ee0c0e1 Review RPI keyboard inputs -WIP- 2018-12-18 19:11:12 +01:00
Ray
39c05e30d0 Reviewed rlReadTexturePixels() for OpenGL ES 2.0
Now it should work... but this behaviour could be driver dependant...
2018-12-18 18:20:20 +01:00
Ray
965a91cebb Support PIC image format loading 2018-12-18 18:18:40 +01:00
Ray
db96cf4a8b Corrected bug on OpenGL ES quads drawing 2018-12-18 16:52:18 +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
fe346fa8d8 Added a possible dependency include path for glfw 2018-12-16 00:44:09 +01:00
Ray
7d81e673ed ADDED: GenMeshPoly()
To generate 2D polygonal shape
2018-12-15 23:31:56 +01:00
Ray
4008a075a8 Added scissor functionality
To draw only in defined area of the screen
ADDED: BeginScissorMode(), EndScissorMode()
2018-12-15 23:30:55 +01:00
Ray
cbbd67ab5a Some code tweaks
- Reorganized some variables: Not used on OpenGL 1.1
- Now mipmaps can be generated on OpenGL 1.1 backend
- Renamed whiteTexture to defaultTextureId
2018-12-14 10:00:44 +01:00
Ray
97e40ced57 WARNING: BIG rewrite of rlgl module
This commit implements a big update of rlgl module, intended to optimize some parts. This change could break some code bases... hopefully not, but it could.
The BIG changes to the module are:
 - Replaced LINES-TRIANGLES-QUADS buffers by a single one, now all vertex data is accumulated on a single buffer and managed with registered draw calls. LINES-TRIANGLES-QUADS could be used the same way as before, rlgl will manage them carefully. That's a big improvement of the system.
 - Support multi-buffering if required. Just define MAX_BATCH_BUFFERING desired size (currently set to 1 batch). Should be enough for most of the situations.
 - Removed temporal accumulative buffers for matrix transformations, now transformations are directly applied to vertex when on rlVertex3f()
 - Reviewed rlPushMatrix()/rlPopMatrix() to be consistent with OpenGL 1.1, probably I should remove that ancient behaviour but... well, it was not consistent and now it is.
 - Minor tweaks: LoadText(), I broke it in last update... also multiple comments reviewed.
 - TODO: MAX_BATCH_ELEMENTS checking should probably be reviewed... done some tests and it works but...
2018-12-11 18:54:48 +01:00
Ray
7361ed24e2 Added support for .otf fonts
stb_truetype supports some .otf fonts, just exposed that functionality.
2018-12-10 00:29:52 +01:00
Ray
a8ac6e2ef9 Increase text management buffers size 2018-12-04 13:15:42 +01:00
Ray
5ef4661216 Comments removed 2018-12-03 16:48:01 +01:00
Ray
8b75a1a990 Improved textures wrap support 2018-12-03 12:00:05 +01:00
Ray
f552d43547 Reviewed some comments 2018-12-03 11:24:11 +01:00
Ray
5086c60e2f Replaced #defines by enums 2018-12-03 11:04:32 +01:00
Ray
1774260dab Some tweaks 2018-11-30 01:57:53 +01:00
Ray
874c0910e3 Replaced default release paths 2018-11-28 17:35:42 +01:00
Ray
ab0287bd4e Some tweaks to LoadText() 2018-11-28 12:34:03 +01:00
Ray
0bf82ff6f4 free memory for extList 2018-11-27 12:23:41 +01:00
Ray
b5c6736592 Reimplement ImageAlphaCrop() 2018-11-27 10:20:41 +01:00
Ray
69ae794465 Updated stb libs to latest version 2018-11-27 09:23:30 +01:00
Ray
969e48e3dd Enable SDL2 library for audio on Web
Solves audio cracking issues
2018-11-26 17:15:43 +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
2deb35be27 Review emscripten path 2018-11-23 17:03:07 +01:00
Ray
bc8d3f30ec Updated to latest mini_al 2018-11-23 17:02:54 +01:00
Ray
83d90c6e49 Review totalSampleCount for OGG and FLAC 2018-11-23 11:58:45 +01:00
Ray
31d0fd820d Avoid program crash on audio device fail 2018-11-20 11:27:10 +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
fcb2b74342 Corrected issue with MSAA 2018-11-19 09:23:38 +01:00
Ray
de02f14283 Updated mini_al 2018-11-17 10:04:12 +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
Ray
6428317739 Corrected 1px thick issue 2018-11-07 22:50:27 +01:00
Ray
e17bd422fa Corrected issue with line drawing 2018-11-07 22:31:35 +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
b356ef5564 Modifies some Image functions
REVIEWED: ImageDrawRectangle()
ADDED: ImageDrawRectangleLines()
2018-11-07 17:58:26 +01:00
Ray
065994219e Review parameter issue with MSVC 2018-11-06 16:11:11 +01:00
Ray
fc1c9505ba Remove end-line spaces 2018-11-06 15:10:50 +01:00
Ray
e340517a73 Support custom texture on shapes drawing
By default, internal white texture was used to draw most of the shapes; some time ago, support for white font character from default internal font was added. That way, all basic drawing (shapes, text) could be performed without a texture change and in a single drawing pass.

Now, we move a step further and we allow configuring the texture (and rectangle) used to do the shapes drawing.
2018-11-06 15:06:01 +01:00