Commit Graph

1635 Commits

Author SHA1 Message Date
Ray
dfb8837c46 Support aliased font texture generation
Useful for bitmaps pixelated fonts where anti-aliasing is not desired!
Change also enables additional font generation mechanisms in a future (cleartype, hinting...).
2018-09-06 16:56:21 +02:00
Ray
1fcb3c0317 Started working on IQM/glTF loaders 2018-09-05 10:59:05 +02:00
Ray
ac31f51c5e Corrected issue with font tint 2018-09-05 10:47:57 +02:00
Ray
d0608b031a Corrected issue with types 2018-09-05 10:47:40 +02:00
raysan5
207b5a26b1 Create release directory if not exist 2018-08-25 18:25:51 +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
Oğuzhan Çankaya
2bef76735d
lerp for vector2 and float 2018-08-21 04:14:43 +03:00
Justin Clift
699cadcf98 Add the remaining numeric keypad keys, and a few other missing ones 2018-08-19 18:00:16 +01:00
Justin Clift
6a5dbeace8 Add the plus and minus keys on both the main keyboard and keypad 2018-08-19 14:40:30 +01:00
Ray
506b7b8d7c Corrected issue with batch overflows
When a batch reach its vertex limit, a draw call is issued and batch restarted for refilling but if the draw call was issued for vertex data accumulated inside rlPushMatrix/rlPopMatrix, draw call was issued before the rlPopMatrix, consequently modelview matrix was not properly recovered before the draw call... obviously, it only happened the following draw calls, not the first one...

Now it works ok but this system needs to reviewed, noticed and important frames drop when processing around 20 dynamic batch draw calls, it means filling MAX_QUADS_BATCH (8192) quads of data 20 times per frame, including data updating and sending for draw processing.

Doing some maths, it means:
Vertex data (float) -----> 8192 quads * 4 vertex * 3 comp * 4 byte = 393216 bytes
Texcoords data (float) -> 8192 quads * 4 vertex * 2 comp * 4 byte = 262144 bytes
Color data (uchar) -----> 8192 quads * 4 vertex * 4 comp * 1 byte = 131072 bytes

Thats a total of 786432 bytes (0.75MB) sent to GPU 20 times per frame for processing... I'm testing in an Intel HD Graphics integrated, I imagine is too much data to be sent and and it causes stalls, so the frames drop...
2018-08-17 13:55:46 +02:00
Ray
732b775a1d Proper variables initialization 2018-08-17 11:41:49 +02:00
Ray
4c84208644 Working on batch reset issue
Corrected memory leak!
2018-08-17 01:34:45 +02:00
Ray
eef44fd930
Merge pull request #625 from ChrisDill/master
Raymath dllexport fix
2018-08-16 23:04:17 +02:00
ChrisDill
c669c6762f Improved raymath defines
- Using raylib.h as reference, added define checks for BUILD_LIBTYPE_SHARED and USE_LIBTYPE_SHARED.
2018-08-16 18:20:49 +01:00
ChrisDill
a187361c6f Raymath dllexport fix if _WIN32 defined
- Added check for dllexport to compile if _WIN32 defined.
- If not defined then use the original RMDEF.
2018-08-16 12:54:45 +01:00
ChrisDill
42b52ecdb1 Raymath dllexport fix
- Added __declspec(dllexport) to RMDEF in raymath.h. This allows them to be accessed when importing from raylib.dll.
2018-08-16 11:29:30 +01:00
Ray
b88bfa7267 Review PR formatting 2018-08-14 09:57:31 +02:00
Joseph-Eugene Winzer
1cef8ea1bf Shapes: Simplifies CheckCollisionRecs
By comparing the edges of the rectangles relative to each other we can
determine if they intersect or not.
2018-08-14 00:14:06 +02:00
David Reid
3200b23469 Update mini_al.
This should improve the Raspberry Pi experience.
2018-08-12 13:45:12 +10:00
Ray
00f5f2ead2
Merge pull request #616 from overdev/master
[Feature Request] 9-patch drawing function
2018-08-09 22:42:05 +02:00
Jorge A. Gomes
dab78d59f3
Update textures.c
See raylib/examples/textures/textures_image_9patch.c for how to use `DrawTextureNPatch` function.
2018-08-08 16:42:39 -03:00
Jorge A. Gomes
5f89e35d1c
Update raylib.h 2018-08-08 16:39:10 -03:00
Ray
7634cbeb22 Updated mini_al
Corrected issue with sound playing (pop sound at the end)
2018-08-08 18:26:05 +02:00
Ray
b042fe12e6 Reviewed spacings on latest PR 2018-08-06 20:49:47 +02:00
Ray
61b32e45ed
Merge pull request #618 from kimkulling/fix_compiler_warnings
Fix compiler warnings
2018-08-06 20:43:28 +02:00
Kim Kulling
f5f7ed79b8 Fix compiler warnings of lib 2018-08-05 23:53:34 +02:00
Kim Kulling
b2cac82fa0 Fix compiler warings in texture.c and more. 2018-08-05 00:34:35 +02:00
Kim Kulling
ecf8bff4aa Fix compiler warnings, first part 2018-08-04 10:32:16 +02:00
Jorge A. Gomes
28424141f0
Update textures.c
Added support form vertical and horizontal 3-patches.
Corrected the distortion caused when destRec size is smaller than 4x4. Now even 1x10 or 0x0 sizes are drawn correctly.
2018-08-03 20:53:15 -03:00
Jorge A. Gomes
6ef03ea4e8
Update raylib.h
Added support form vertical and horizontal 3-patches.
Corrected the distortion caused when destRec size is smaller than 4x4. Now even 1x10 or 0x0 sizes are drawn correctly.
2018-08-03 20:50:13 -03:00
Ray
d4bb444fe5
Merge pull request #609 from pamarcos/fix_physac_examples
[physac] Fix Physac examples to be run without creating new thread
2018-08-03 12:47:53 +02:00
Jorge A. Gomes
7cc2a5585b
Update textures.c
Added DrawNinePatch() function implementation.
2018-08-03 04:51:26 -03:00
Jorge A. Gomes
c9ca14e659
Update raylib.h
Added NinePatch struc definition and function prototype.
2018-08-03 04:48:46 -03:00
Ahmad Fatoum
286c41af52
Sync with upstream GLFW pull request
The GLFW tree distributed with raylib has two modifications:

- GLFW_PKG_{DEPS,LIBS} are exported to PARENT_SCOPE, so we can use them
  in our pkg-config file
- An intermediary glfw_objlib target is added, so we can reexport GLFW
  symbols from libraylib.a

rglfw can fix the second point, but for Wayland usage, we would have to
replicate protocol generation, so we just leverage GLFW's existing
support instead.

To make maintenance easier, I have submitted a pull request for
including these modifications to upstream GLFW.
And to make that one easier, this patch dog-foods the modifications,
so raylib users can help find regressions. :-)

glfw/glfw#1307
2018-07-29 23:56:16 +02:00
Ray
7154a83313
Merge pull request #610 from pamarcos/fix_chdir_macos
[games] Prevent GLFW changing working dir to 'Resources'
2018-07-29 23:40:13 +02:00
Pablo Marcos Oltra
907e27ef4e Fix Physac examples to be run without creating new thread 2018-07-29 21:32:39 +02:00
Ahmad Fatoum
78487f7521
CMake: Make the raylib project as a whole embeddable
So user code can use add_subdirectory to build it (similar to what we do
with GLFW or what the projects/CMake/CMakeLists.txt can do).
2018-07-29 21:28:23 +02:00
Pablo Marcos Oltra
89cec68565 Prevent GLFW changing working dir to 'Resources' 2018-07-29 18:38:31 +02:00
Ahmad Fatoum
e82505b873
Add projects/CMake example
The CMakeLists.txt checks for an installed raylib and downloads and
installs one if none is found. Afterwards, it builds core_basic_window.c
2018-07-29 18:27:59 +02:00
Ahmad Fatoum
548dbeb1ca
Fix typo (s/proedural/procedural) 2018-07-29 13:04:16 +02:00
Ahmad Fatoum
2ae6df47fc
CMake: Set -DMACOS_FATLIB=OFF by default
Homebrew doesn't ship 32-bit libraries anymore, so using both
-DUSE_EXTERNAL_GLFW and -DMACOS_FATLIB with a Homebrew GLFW would fail.
With -DUSE_EXTERNAL_GLFW=OFF, this is not a problem, but I think keeping
it off by default makes more sense. If someone wants universal
libraries, they can just toggle it.
2018-07-29 12:35:36 +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
Ahmad Fatoum
3f09726331
CMake: Major cleanup to support find_package(raylib)
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes #471, #606.
- Makes code less confusing by removing the double use of PLATFORM (#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
2018-07-29 12:35:35 +02:00
Ahmad Fatoum
3e5093eab0
CI: Build with all optional formats enabled
also makes one configuration shared-only

dr_flac is not built on i386, because GCC 4.8 complains about asm("cpuid"
clobbering ebx, as it's using ebx for PIC.

Instead of downloading a newer GCC (and multilib),
disable FLAC for that one configuration...
2018-07-29 12:13:01 +02:00
Ahmad Fatoum
69e147417b
Travis CI: Add OpenAL-Configuration 2018-07-29 12:13:00 +02:00
Michael Vetter
186c1b157e Fix bug in LoadMusicStream
free() and NULL at the end.
2018-07-29 09:52:18 +02:00
raysan5
7964b28fac Corrected bug LoadMusicStream() 2018-07-28 18:19:53 +02:00
raysan5
0cf92c59d7 Corrected timing typo 2018-07-28 18:13:19 +02:00
raysan5
dc3327fba8 Reviewed music loading 2018-07-28 18:07:06 +02:00
raysan5
6f61e26a3c Reviewed custom logging functionality 2018-07-28 17:57:05 +02:00
Michael Vetter
7a5b1b13e2 Deal with failed LoadMusicStream
It would be good to have a way to continue execution even when loading a stream didn't work.
 Free music and set it to NULL in case something went wrong, so that users can check for it.
2018-07-27 15:58:27 +02:00
Pablo Marcos Oltra
c69f7953c7 Add SetTraceLogCallback to enable users setting custom logging (#597) 2018-07-26 21:57:45 +02:00
Pablo Marcos Oltra
8d134edaf7 Fix rlgl.h to be used as a standalone 2018-07-25 10:36:18 +02:00
Ray
361d878b4c Updated animations support 2018-07-24 18:52:56 +02:00
Ray
198a023527 First working version of IQM animations
Still a work in progress but it already works...
Current riqm API could be simplified...
2018-07-24 18:28:58 +02:00
Ahmad Fatoum
2b8c9f9a17
CMake: Fail when -D{PLATFORM,OPENGL_VERSION}=INVALID_VALUE
as well as -DUSE_EXTERNAL_GLFW.

Nips issues like #584 in the bud.
2018-07-23 21:00:48 +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
raysan5
7dc66d2d3f Looking for a place for raylib resource file 2018-07-21 16:18:33 +02:00
Ray
6e812cf147 Working on MP3 support 2018-07-19 23:15:46 +02:00
Ray
103044926b Avoid config.h in standalone mode 2018-07-16 19:24:40 +02:00
Ray
6efb89c51e Updated to latest mini_al dev 2018-07-16 19:21:54 +02:00
Ray
98273f0152 Reviewed compilation options 2018-07-16 18:43:24 +02:00
Ray
5b37178af9 Reviewed rlgl_standalone example 2018-07-16 18:22:03 +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
Ray
0c631e6b5a Corrected comment 2018-07-15 21:24:59 +02:00
Ray
292499bdeb Reviewed LoadFontData() and GenImageFontAtlas() 2018-07-15 20:03:05 +02:00
Ray
9e2c418a92 Removed dev from version 2018-07-11 16:40:08 +02:00
Ray
eb296a5605 Reviewed shared library generation 2018-07-11 16:39:41 +02:00
Ray
43178f3488 Updated mini_al to latest dev version
Corrects issue with audio on RPI
2018-07-11 16:39:26 +02:00
Ahmad Fatoum
414bb6018b
CMake: Add Libs.private to Libs if installing static only
pkg-config --libs --static raylib and pkg-config --libs raylib
should give the same result if there is no shared raylib installed.
2018-07-10 21:20:01 +02:00
raysan5
3c02a9fc66 Support multiple data type aliases
Vector4 -> Quaternion
Texture2D -> Texture
RenderTexture2D -> RenderTexture
Camera3D -> Camera
SpriteFont -> Font
2018-07-09 10:23:53 +02:00
raysan5
f939378764 Support ARM and ARM64 Android building 2018-07-09 03:00:52 +02:00
raysan5
c6d188a09a Reviewed latest commit for Android gamepad support 2018-07-07 10:15:19 +02:00
Ray
50088bf49b
Merge pull request #570 from SethArchambault/master
SNES-like GAMEPAD Support added for Android, Makefile has optional support for 32bit
2018-07-07 09:38:19 +02:00
David Reid
8651e14955 Update mini_al with a fix for macOS. 2018-07-07 10:36:19 +10:00
Seth Archambault
fa36c5294a Merge branch 'master' of https://github.com/raysan5/raylib 2018-07-06 13:37:17 -04:00
Seth Archambault
f981daf1df Added SNES-style GAMEPAD SUPPORT 2018-07-06 13:33:46 -04:00
Ahmad Fatoum
7f040009ee
Add null statement after goto label to pacify CI
Fixes: #568
2018-07-06 02:30:38 +02:00
Ray
0ab3d85aa0
Merge pull request #568 from mackron/dr/mini_al
Update Audio Libraries
2018-07-06 00:31:21 +02:00
raysan5
103bc7dfc6 Corrected issue with GetFontDefault()
Note for me: Replace All is NOT your friend...
2018-07-05 19:17:06 +02:00
raysan5
d881c73257 Renamed GetDefaultFont() to GetFontDefault()
Library consistency rename... yes, I know, it breaks the API...
2018-07-05 19:08:24 +02: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
David Reid
b7d7704098 Update mini_al to version 0.8. 2018-07-05 23:12:20 +10:00
David Reid
6c96fa6301 Update external audio libraries. 2018-07-05 22:57:45 +10:00
David Reid
c598701873 Fix bug with FLAC music streams. 2018-07-05 22:57:17 +10:00
David Reid
1d354bc704 Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al 2018-07-05 22:33:16 +10:00
Ahmad Fatoum
c3aeaf4a49
Travis CI: Add test case for pkg-config 2018-07-03 21:35:28 +02:00
Ahmad Fatoum
61747508b0
CMake: Reuse libraries found by glfw CMake config
if (${PLATFORM} MATCHES "Desktop")
  target_link_libraries(${RAYLIB}_shared glfw ${GLFW_LIBRARIES})

was never true because PLATFORM STREQUAL "PLATFORM_DESKTOP"...

This fixes #551 and makes the changes suggested in #552 (commited as 965cc8ab)
unnecessary.
2018-07-03 21:35:27 +02:00
Ahmad Fatoum
33c830353b CMake: Fix regression in USE_EXTERNAL_GLFW=IF_POSSIBLE
Fixes: e1e036a6 ("Disable glfw only when it is not found and not external", #558)
2018-07-03 09:24:31 +02:00
Ray
74fd0e7ca4 Added function: ImageColorReplace() 2018-07-03 00:57:58 +02:00
Ray
7b971e0623 Added Quaternion typedef 2018-07-02 18:53:46 +02:00
Ray
276974de05 Removed function prototype
This function was added in text module as GenImageFontAtlas()
2018-07-02 16:39:04 +02:00
Ray
7dedb84fd0 Added function: Vector3RotateByQuaternion()
Rotate a Vector3 by a Quaternion
2018-06-30 22:00:16 +02:00
Ray
d0166c9d45 Spacing tweaks 2018-06-30 21:56:26 +02:00
Ray
afe81d94ce Re-added: LoadFontEx() 2018-06-30 19:58:44 +02:00
Michael Campagnaro
859b1cf574 Fix incorrect log agent names 2018-06-28 18:41:32 -04:00
Ray
dbfd8d713f Reviewed comments section 2018-06-26 01:36:13 +02:00
Ray
bd957c7442
Merge pull request #557 from Martinfx/max-support-bsd-os
Added support OpenBSD, NetBSD, DragonFly OS
2018-06-24 12:44:58 +02:00
maficccc@gmail.com
59ebe1b7c3 Added support OpenBSD, NetBSD, DragonFly 2018-06-23 17:02:07 +02:00
maficccc@gmail.com
965cc8ab6f Added support DragonFly os from BSD family 2018-06-23 17:02:04 +02:00
Yuri
e1e036a602
Fisable glfw only when it is not found and not external. 2018-06-23 07:30:35 -07:00
Ray
0e135118fd Improved GenImageFontAtlas() 2018-06-21 00:18:13 +02:00
Ray
75ba5aca55 Improved font generation and SDF
Added: data to CharInfo struct
Added: LoadFontData()
Added: GenImageFontAtlas()
Removed: LoadFontEx()
Removed: LoadTTF() [internal]
Some code tweaks
2018-06-20 00:52:14 +02:00
Ray
372e4a1139 Reviewed some functions
- GetImageData()
- GetImageDataNormalized()
2018-06-12 16:30:03 +02:00
Ray San
64804f30e6 Comment review 2018-06-12 13:27:41 +02:00
Ray San
0c01c08718 Corrected issue, flag not supported...
...by emscripten glfw javascript implementation
2018-06-12 13:21:36 +02:00
Ray San
59fd261491 Added function: GetImageDataNormalized()
Reviewed: GetImageData()
Reviewed: ImageFormat()
2018-06-12 13:13:09 +02:00
Ray San
7d0e09ff4c Corrected bug 2018-06-12 12:05:28 +02:00
Ray San
b588af5ce2 Corrected breaking build 2018-06-12 10:45:00 +02:00
raysan5
b48d225a43 Propose new function: GenImageFont() 2018-06-10 19:29:01 +02:00
Ray
817ae07505 Some comments cleaning
ImageDraw() code tweak
2018-06-06 00:43:52 +02:00
Ray
0e6458cfee Added ImageRotate*() functions 2018-06-03 21:05:01 +02:00
Ray
61a1c59472 Corrected possible issue with CMake for GLFW 2018-06-02 18:47:19 +02:00
Ray
9688c677de Review window creation hints 2018-06-02 18:26:57 +02:00
Ray
c7d6a44e33 Update GLFW to latest dev version (master branch) 2018-06-02 18:26:29 +02:00
Ray
b1b4a11bdb Corrected issue with function definition 2018-06-02 13:05:23 +02:00
Ray
afc4181752 Work on ImageResizeCanvas() 2018-06-02 12:47:05 +02:00
Ray
2536bea379 Added: ImageResizeCanvas() -WIP-
Added note idea on ImageFormat() for future redesign (to support
16bit-32bit pixel-formats)
2018-06-01 00:53:40 +02:00
Ray
129c890a28 Removed assert()
Not used in raylib this mechanism
2018-05-30 00:06:23 +02:00
Ray
8f4b53384c Replaced tabs by spaces 2018-05-29 09:09:40 +02:00
Ray
d873314c27 Reviewed Windows resource file name 2018-05-29 00:52:08 +02:00
Ray
0148432588 fabsf() not working with TCC
Replaced by fabs() that seem to work ok
2018-05-28 00:48:45 +02:00
Ray
dbff40944a Corrected issue with floats on TCC
It seems TCC was not casting correctly int values to float in some
specific situations
2018-05-28 00:48:07 +02:00
Ray
1f0cc57ec7 Corrected issue with compiler param
Added android_native_app_glue module to raylib compilation instead of
compiling it as static lib at apk generation.
2018-05-27 19:06:14 +02:00
Ray San
8f4fa5006b Added a note 2018-05-22 12:09:12 +02:00
Ray San
f454af08bb Review include (already included) 2018-05-22 12:08:58 +02:00
raysan5
559b9b8cc3 Corrected possible memory leak 2018-05-21 18:57:54 +02:00
raysan5
44181baf04 Working on Android APK building 2018-05-21 18:13:52 +02:00
David Reid
63cf43b729 Fix some warnings. 2018-05-21 20:46:22 +10:00
David Reid
647c08ef4c Fix a copy paste typo. 2018-05-21 20:39:42 +10:00
David Reid
f1b624d38b Update mini_al. 2018-05-21 20:39:19 +10:00
David Reid
6d8cc250bd Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al 2018-05-21 20:26:28 +10: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
ff55af14f9
CMake: Move reusable code to new cmake/ directory 2018-05-21 01:08:29 +02:00
Ahmad Fatoum
ae26e083b4
CMake: Add default build type if none specified
Release, unless we are in a Git repo, then it's Debug.
2018-05-21 01:08:28 +02:00
Ahmad Fatoum
20ddc6a2bb
Move utils.cmake to separate cmake/ directory 2018-05-21 01:08:28 +02:00
raysan5
a752092055 Removed 32bit arm Android library
From 2019 64bit support will be mandatory to publish an Android app.
Google plans to require that new apps target Oreo (API level 26) in
August of 2018.
2018-05-20 19:13:10 +02:00
raysan5
8e0cd51afb Support shared library building on Android 2018-05-20 18:49:58 +02:00
raysan5
ca69068814 Added function: rlCheckBufferLimit() 2018-05-20 01:55:46 +02:00
raysan5
3b70b66a08 Love OpenGL gotchas... make my life more enjoyable! 2018-05-20 00:41:12 +02:00
raysan5
24adca4ad0 Manual mipmap generation review
On OpenGL 1.1 only is supported for 32bit RGBA textures
2018-05-20 00:39:56 +02:00
raysan5
25d5e907ec Some code review (mainly comments) 2018-05-20 00:37:16 +02:00
Michael Vetter
5cfbb53f6c Increase API version
Please do this whenever necessary. And adapt it before releasing a new
RC. The RC should already have the correct one.
2018-05-18 16:04:18 +02:00
Ray
fb4265f646 Reviewed Android pipeline
Now defaults to Clang, ARM64 and API 21
2018-05-17 00:59:53 +02:00
Ray
0b05169aa7 Some warnings review 2018-05-17 00:58:58 +02:00
Ray
88c2337225 Preliminary support for MP3 fileformat -WIP- 2018-05-17 00:04:58 +02:00
Ray
2aae62cea2 Header tweak and comments 2018-05-17 00:04:36 +02:00
Ray
1d3e4ef437 Corrected issue on file extension check 2018-05-17 00:04:12 +02:00
Ray
bb43755a9d
Corrected issue on LoadASTC() 2018-05-12 23:33:03 +02:00
Ahmad Fatoum
eed170f852
CMake: Fix typo... s/USE_PIC/WITH_PIC/ 2018-05-12 19:05:30 +02:00
Ahmad Fatoum
0f1aaa474a
CMake: (Properly) build glfw separately with CMake
This reverts commit 2d6fb5c628,
and adds a fix for Alien::raylib's test failures.

The tests failed because the resulting static library didn't reexport
GLFW symbols. As a fix, we now have GLFW create a CMake "object library"
target that we can link with both the static and shared raylib.

This is arguably ugly... Proper fix would probably be a GLFW upstream
object library target.

Closes #536.
2018-05-12 18:38:20 +02:00
Ahmad Fatoum
2d6fb5c628
Revert "CMake: Build glfw separately with CMake"
This reverts commit 0adb4b67de,
because it failed tests for Alien::raylib:
http://www.cpantesters.org/distro/A/Alien-raylib.html
2018-05-11 23:43:35 +02:00
Ray
aa76985c0d Review raylib version to 2.0
Review raylib_icon resource
2018-05-11 18:14:19 +02:00
Ahmad Fatoum
0adb4b67de
CMake: Build glfw separately with CMake
Makes it easier to support Wayland later on.
2018-05-11 01:24:27 +02:00
Ahmad Fatoum
0df501be91
Add GLFW source tree to src/external
We need the CMake stuff for wayland configuration.
Otherwise, we would have to replicate that ourselves.
This is the full 7ef34eb06de54dd9186d3d21a401b2ef819b59e7 tree except
for tests/ examples/ and docs/
2018-05-10 23:07:26 +02:00
Ahmad Fatoum
b8ca51fd01
CMake: Don't create symlinks on unsupporting file systems (#539)
Panders to the idiosyncrasies of my work flow:
I have my raylib build directory mounted as a VirtualBox vboxfs for use
with my Linux VM, but vboxfs doesn't support symlinks, while raylib shared
library versioning on Unix expects symlinks to work.
If this happens, library versioning is now disabled on Unix with
an error message instead of just failing the build.
2018-05-10 21:03:43 +02:00
Ray
f26a38a9e1 Merge branch 'master' of https://github.com/raysan5/raylib 2018-05-09 00:24:08 +02:00
Ray
9ea2a69bfd Corrected issue on rectangle drawing 2018-05-09 00:23:56 +02:00
Ray
3a803ac95e
Removed unnecesary define 2018-05-08 23:04:13 +02:00
Sherjil Ozair
8e9ff75f1c Use fabsf for floats, and avoid implicit type casting 2018-05-06 12:47:46 -04:00
Ray
f14492432d Avoid exposing native GLFW3 functionality
Try to avoid types conflict with Font
2018-05-04 23:03:56 +02:00
Ray San
ec33e7d705 BREAKING CHANGE: Renamed SpriteFont type to Font
- Preparing MP3 files support
- Jumped version to raylib 2.0-dev (too many breaking changes...)
2018-05-04 16:59:48 +02:00
Ray San
6045062a05 Renamed some functions
- Renamed Begin3dMode() --> BeginMode3D()
- Renamed Begin2dMode() --> BeginMode2D()
- Renamed End3dMode() --> EndMode3D()
- Renamed End2dMode() --> EndMode2D()
2018-05-04 16:54:05 +02:00
Ray San
6324697ffd Rectangle parameters changed to float
- Some examples tweaks
- Reviewed ImageFormat()
- Use float for text fontSize
2018-05-04 16:25:31 +02:00
Ray San
9d103b7c2f Removed line breaks from functions
Useful to parse raylib.h to generate raylib-lua and Notepad++
intellisense XML info
2018-05-03 19:19:35 +02:00
raysan5
198d739256 BREAKING CHANGE: Renamed Camera -> Camera3D
Just added a fallback in the meantime...
2018-05-01 12:31:03 +02:00
raysan5
400c345f96 Added tangent computation alternative method
As stated in the note, I'm not sure if math is right, just followed a
reference implementation...
2018-04-30 11:21:44 +02:00
raysan5
23e335d933 Implemented MeshTangents()
- Added Vector3OrthoNormalize() to raymath.h - not sure if it is correct
- Implemented MeshBinormals() - Mesh struct has not a place for them...
- Updated model_material_pbr example - tested but not working on my GPU
(old Intel HD), actually, it never worked on it...
2018-04-30 02:47:48 +02:00
raysan5
c51203ae7e Corrected alpha blending on ImageDraw() 2018-04-29 18:39:57 +02:00
raysan5
dff1028466 Replaced ColorToFloat() by ColorNormalize() 2018-04-29 18:39:46 +02:00
raysan5
8d81b6e4e4 Support shapes drawing using only QUADS
Also added new compilation FLAGS for that pourpose
2018-04-29 12:53:32 +02:00
raysan5
ada6668b24 Expose file-dropping functions symbols 2018-04-29 11:49:10 +02:00
raysan5
ca5f7ebd10 Added compile flag: SUPPORT_SCREEN_CAPTURE
Allow compiling the library with support for automatic screen capture
(KEY_F12)
2018-04-29 11:37:39 +02:00
David Reid
3ca5047c82 Update mini_al. 2018-04-22 07:24:18 +10:00
David Reid
af4d23aa82 Update mini_al. 2018-04-21 22:13:02 +10:00
David Reid
24cab8f920 Update mini_al. 2018-04-21 20:39:31 +10:00
David Reid
0febaa2446 Update external audio libraries. 2018-04-21 18:57:00 +10:00
Ray
847bdaf682 Implemented default mesh
In case mesh loading fails, a cube is generated instead!
2018-04-19 20:20:34 +02:00
Ray
76a6bf6c52 Review spacing for cosistency 2018-04-19 20:19:53 +02:00
lumaio teon
5ef6cc1fb9
Add more key definitions 2018-04-13 17:14:04 -04:00
Ahmad Fatoum
3f59bdfc76
mini_al: Use WinAPI interlocked ops with tcc
Seems tcc doesn't provide __sync_*. See #435.
2018-04-11 11:29:49 +02:00
Ahmad Fatoum
8b0fef6c34
raymath: Workaround tcc inline function limitation
Reported in #435, tcc generates out-of-line definitions for inline
symbols, something it shouldn't.  This fix punishes tcc for that
by making applications it compiles (slightly) larger...
2018-04-11 10:43:27 +02:00
Ray San
4cc12ef2b3 Review camera definition on examples 2018-04-11 10:13:00 +02:00
Ray San
cc3b8645df Updated release version 2018-04-10 10:37:48 +02:00
Ray
8e44f7b3c7 Reviewed config.h formatting
Added raylib version to config
2018-04-09 23:01:20 +02:00
Ray
54e24d905a Init frame timming measure variables 2018-04-09 22:28:41 +02:00
Ray
cd616258c6
Merge pull request #522 from a3f/master
Refactor all #define SUPPORT_* into a config.h
2018-04-08 22:46:44 +02:00
Ray
9e7dedf5af
Merge pull request #521 from TheLumaio/master
Added GetCollisionRayModel
2018-04-08 22:28:19 +02:00
Ahmad Fatoum
1dbce35247
CMake: Generate config.h from CMakeOptions.txt
I would have liked config.h to be selected by include dir configuration,
but this way is less intrusive.
2018-04-07 23:39:53 +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 (#461).
2018-04-07 23:37:48 +02:00
Ahmad Fatoum
d88523f03a
Split CMake options into separate CMakeOptions.txt 2018-04-07 22:41:43 +02:00
Milan Nikolic
3caa044bf2 Add GNUInstallDirs and USE_AUDIO/USE_WAYLAND options to CMake (#518) 2018-04-07 16:32:14 +02:00
lumaio teon
d2cc5b88df
Removed useless GetCollisionRayMesh and libraylib.a 2018-04-07 03:49:56 -04:00
lumaio teon
d003c23ecf
Added GetCollisionRayModel 2018-04-06 12:04:09 -04:00
Ray
b8bd1d2ea6 Remove unnecesary NPOT check
Now PLATFORM checks only used on core and utils modules
2018-04-05 19:22:45 +02:00
Ray
005f2ffb75 Simplified some code 2018-04-05 19:18:44 +02:00
Ray
931b672c92 Added: ImageDrawRectangle()
Renamed SaveImageAs() to ExportImage() for consistency on what actually happens with data.
2018-04-04 12:02:20 +02:00
Ray
6edf15b9f9 Added funtion: ExportMesh() 2018-04-04 12:00:54 +02:00
Ray
9393d1d76f Merge branch 'master' of https://github.com/raysan5/raylib 2018-04-03 12:43:42 +02:00
Ray San
fe1c04d1b8 Removed old code 2018-04-03 12:42:28 +02:00
Ray
533780aadf Review ImageDraw() alpha blending
Not sure if math is ok... just left a commented piece of code that uses pre-multiplied alpha.
2018-04-03 12:42:22 +02:00
Ray
3e0de31424
Merge pull request #504 from Martinfx/master
Fix potential bugs from static analysis
2018-04-02 18:10:38 +02:00
raysan5
375adf86a6 Review math usage to reduce temp variables 2018-04-02 15:16:45 +02:00
raysan5
bbdf9f4880 Review InitWindow() to avoid void pointer
Reviewed for PLATFORM_ANDROID and PLATFORM_UWP
2018-04-02 14:49:01 +02:00
maficccc@gmail.com
201007e426 Fix sscanf() without field limits can crash with huge input data 2018-04-02 13:30:20 +02:00
maficccc@gmail.com
db98dba10f Fix Allocator sizeof operand mismatch 2018-04-02 13:30:20 +02:00
maficccc@gmail.com
03ca9508bf Fix Dead initialization 2018-04-02 13:30:20 +02:00
maficccc@gmail.com
44eedf235d Redundant assignment of 'angle' to itself 2018-04-02 13:30:20 +02:00
maficccc@gmail.com
ca9e652f8b Remove dead assignment 2018-04-02 13:30:19 +02:00
Martinfx
28a9a181cb Fix use after free 2018-04-02 13:30:19 +02:00
maficccc@gmail.com
e659336c11 Fix value stored to 'num_channels' is never read 2018-04-02 13:30:19 +02:00
Ray
e72b96ada1
Merge pull request #508 from a3f/master
Allow use of main instead of android_main
2018-04-02 10:48:02 +02:00
Ray
564baa22d6
Merge pull request #513 from autious/master
Add orthographic 3d rendering mode
2018-04-01 00:27:20 +02:00
Jacques Heunis
b4e2f5b45c Initialize the timer after the graphics device on desktop and web platforms. (#516)
This is already the order that is used for Android. It doesn't appear to
make a difference on desktop but on web using the timer before it's been
initialized (by glfwInit, inside InitGraphicsDevice) causes the a long
(and variable but often several seconds) sleep between the first and
second frame.

Fixes: 468309d ("Early-exit InitWindow if InitGraphicsDevice fails")
2018-03-31 12:22:44 +02:00
Max Danielsson
6c049fdd76 Move deduplicate aspect variable in begin render.
Changes motivated by commentary in pull request 513
2018-03-27 19:59:54 +02:00
Max Danielsson
5ecee69088 Add 3d orthographic projection mode 2018-03-25 18:33:19 +02:00
David Reid
a8e2c7de9c
Fix an infinite loop in ALSA backend of mini_al. 2018-03-20 18:39:21 +10:00
Ray
deffad1701 Review tabs issue when compiling...
...PLATFORM_ANDROID on Windows, using MinGW-w64 (x86) provided Make (GCC
7.2)
2018-03-19 23:49:14 +01:00
David Reid
4a69c2d75e
Fix a buffer overflow in the OSS/BSD backend. 2018-03-18 14:37:41 +10:00
Ahmad Fatoum
2c219fb814
Allow use of main instead of android_main
Inspired by #504.
Instead of requiring the user to do PLATFORM_ANDROID #ifdefery,
have the android_main entry point exported by raylib and call
the user-defined main. This way many games could (in theory)
run unmodified on Android and elsewhere.

This is untested!
2018-03-16 21:37:22 +01:00
Ray
61e0e4b4f3 Complete review of raymath for API consistency 2018-03-16 13:47:01 +01:00
Ray San
9318dc98ce Support case-insensitive extension check 2018-03-16 13:09:49 +01:00
Ray
487bc613fd Updated raylib dev version 2018-03-15 12:37:52 +01:00
Ray
9d8f15c19d Reviewed raymath changes 2018-03-15 12:37:23 +01:00
Ray
6c6d6776c0
Merge pull request #482 from a3f/master
raymath.h: Use C99 inline semantics
2018-03-15 12:27:40 +01:00
Ray
8bc2813b0c
Merge pull request #500 from victorfisac/fork/master
[fork/master] Fixed some memory leaks and add null checks for consistency
2018-03-11 10:51:15 +01:00
raysan5
a0127d8300 Corrected typo 2018-03-11 10:49:51 +01:00
raysan5
fd5e457bb4 Correct issue with triangleCount 2018-03-11 10:41:49 +01:00
victorfisac
d6fee9da29 Fixed compilation code comment in header 2018-03-10 19:30:25 +01:00
victorfisac
3201bad65a Fixed memory leaks in physics step operations 2018-03-10 19:25:17 +01:00
Ray San
df50eada53 Added new functions
- SetWindowSize() to scale Windows in runtime
- SetMouseScale() to scale mouse input, useful when rendering game to a
RenderTexture2D that will be scaled to Window size (used on rFXGen tool)
2018-03-09 11:43:53 +01:00
raysan5
85850a955a Removed additional code
GLFW has been updated to latest version, probably this code is not
required any more due to already been integrated into library... but it
needs to be tested...
2018-03-03 16:01:24 +01:00
raysan5
3b4a64f2d6 Updated GLFW library to latest version 2018-03-03 15:58:44 +01:00
Ray
fd2adbe62d Renamed CalculateBoundingBox() to MeshBoundingBox()
Renamed function for consistency with a possible Mesh manipulation functions (maybe added in a future). Naming follows Image*() manipulation functions.
2018-02-26 12:10:45 +01:00
Ray
a7207dc6d4 Removed tangents generation
It has no sense to be inside LoadOBJ(), mesh processing moved to own functions: MeshTangents() and MeshBinormals(). Not exposed to user yet.
2018-02-26 12:02:05 +01:00
Ahmad Fatoum
3f48ffb1b6
Fix two memory leaks in jar_xm.h
Found by LeakSanitizer in #494.
2018-02-26 00:14:19 +01:00
RDR8
18f61948ce Update Makefile
$ make clean
Makefile:296: *** missing separator.  Stop.
2018-02-25 22:27:32 +01:00
Ahmad Fatoum
80bf636f81
Don't exceed signed int range when shifting left
Fixes UB in #489, found by UBSan.
2018-02-25 03:17:57 +01:00
Ahmad Fatoum
76aca9b0d1
Fix possible buffer overflow in LoadBMFont
Width specifier doesn't include NUL terminator.
Fixes #487 found by AddressSanitizer.
2018-02-25 03:03:37 +01:00
Ahmad Fatoum
1430d01906
jar_xm: Workaround for unaligned pointer accesses
jar_xm.h does some shady pointer casts leading to unaligned accesses
and breaking strict aliasing. x86 has special circuitry for doing
unaligned accesses, but on other architectures, it may trap and require
kernel fix-up or crash outright. With this patch, one obstacle in
porting raylib to the GameBoy Advance has been removed. Go for it ;-)

To avoid having to rewrite that `mempool' code, insert padding before
structs and instruct the compiler (GCC, most importantly), to be gentle
when optimizing.

This fixes #490 (Unless we got ourselves 256-bit pointers, if so,
hello future!)
2018-02-24 23:59:56 +01:00
Ahmad Fatoum
f52d2de582
raymath.h: Use C99 inline semantics
RAYMATH_EXTERN_INLINE was renamed to RAYMATH_HEADER_ONLY, which user code
may define if they want to use it as header-only library. If multiple
files in the same project define RAYMATH_HEADER_ONLY, they might each
have duplicate out-of-line definitions of the same functions.

By default, raymath.h exposes inline definitions, which instructs the
compiler _not_ to generate out-of-line definitons, if out-of-line
definitions are required, those of the file defined with
RAYLIB_IMPLEMENTATION are used instead. There may be only one such file.

In C++ mode, the compiler will select only one out-of-line definition
automatically, so no need to define a RAYLIB_IMPLEMENTATION.

Unfortunately, we have to remove raymath function declaration from
raylib.h as those declarations would lead to duplicate out-of-line
definitions which would yield linker errors. This problem didn't
exist with GNU89 or C++, because there multiple defintions are ok,
but in C99 they aren't.
2018-02-24 23:39:23 +01:00
Ahmad Fatoum
ed6962edd3
Make MatrixToFloat and Vector3ToFloat reentrant
Besides making it thread-safe, it suppresses a GCC warning
when making them static inline in an upcoming patch.
2018-02-24 23:39:17 +01:00
RDR8
2b5fc12036 Update Makefiles. Enable example usage of staged libraylib.so. 2018-02-24 14:24:55 -06:00
Ahmad Fatoum
a5881fb9cc
Revert "raymath.h: Use C99 inline semantics"
This reverts commit 6ffc8cb799.
and commit e4d7bbec1e.
which I pushed by mistake...
2018-02-24 15:40:08 +01:00
Ahmad Fatoum
c9043b5a87
CMake: Add options to use -fsanitize={address,undefined}
To make bugs like #485, #486, #487 and #488 easier to find in future.
2018-02-24 15:37:38 +01:00
Ahmad Fatoum
6ffc8cb799
raymath.h: Use C99 inline semantics
RAYMATH_EXTERN_INLINE was renamed to RAYMATH_HEADER_ONLY, which user code
may define if they want to use it as header-only library. If multiple
files in the same project define RAYMATH_HEADER_ONLY, they might each
have duplicate out-of-line definitions of the same functions.

By default, raymath.h exposes inline definitions, which instructs the
compiler _not_ to generate out-of-line definitons, if out-of-line
definitions are required, those of the file defined with
RAYLIB_IMPLEMENTATION are used instead. There may be only one such file.

In C++ mode, the compiler will select only one out-of-line definition
automatically, so no need to define a RAYLIB_IMPLEMENTATION.

Unfortunately, we have to remove raymath function declaration from
raylib.h as those declarations would lead to duplicate out-of-line
definitions which would yield linker errors. This problem didn't
exist with GNU89 or C++, because there multiple defintions are ok,
but in C99 they aren't.
2018-02-24 15:37:37 +01:00
Ahmad Fatoum
e4d7bbec1e
Make MatrixToFloat and Vector3ToFloat reentrant
Besides making it thread-safe, it suppresses a GCC warning
when making them static inline in an upcoming patch.
2018-02-24 15:37:37 +01:00