Commit Graph

313 Commits

Author SHA1 Message Date
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
Ray
1d3e4ef437 Corrected issue on file extension check 2018-05-17 00:04:12 +02: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
6045062a05 Renamed some functions
- Renamed Begin3dMode() --> BeginMode3D()
- Renamed Begin2dMode() --> BeginMode2D()
- Renamed End3dMode() --> EndMode3D()
- Renamed End2dMode() --> EndMode2D()
2018-05-04 16:54:05 +02:00
raysan5
dff1028466 Replaced ColorToFloat() by ColorNormalize() 2018-04-29 18:39:46 +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
Ray
76a6bf6c52 Review spacing for cosistency 2018-04-19 20:19:53 +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
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
Ray San
fe1c04d1b8 Removed old code 2018-04-03 12:42:28 +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
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
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
6c6d6776c0
Merge pull request #482 from a3f/master
raymath.h: Use C99 inline semantics
2018-03-15 12:27:40 +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
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
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
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
Ray
cd5e2e0f17 Corrected cursor issue for Wayland 2018-02-22 00:01:13 +01:00
Ray
36750ffb9a BREAKING CHANGE: Renamed function for consistency
Rename: GetHexValue() renamed to ColorToInt()
Added: ColorToHSV()
2018-02-12 11:55:22 +01:00
Ray
d90a33b850 Some reviews for Android compilation 2018-02-11 01:48:53 +01:00
Ahmad Fatoum
468309d06c
Early-exit InitWindow if InitGraphicsDevice fails
Otherwise we may run into LoadDefaultFont and crash in rlLoadTexture
Also moves InitTimer() before InitGraphicsDevice(), to allow it to be
tested even if InitWindow ultimately fails.
2018-02-09 22:54:35 +01:00
Ahmad Fatoum
a976e76ae6
InitWindow: return false if no monitor found
Otherwise we run into an assertion failure inside GLFW's glfwGetVideoMode.
Example:
http://www.cpantesters.org/cpan/report/b4ba5894-0bdb-11e8-841e-2c60b04e1d2d

This is related to #456.
2018-02-08 12:06:21 +01:00
raysan5
3a11cc5e31 Incremeted version to align with CMake 2018-02-04 13:44:41 +01:00
raysan5
6dc2f979cc Updated raylib version
Note that this version is under development and could be buggy on some
platforms...
2018-02-04 12:33:46 +01:00
raysan5
c32ed921a2 Security check in case window initialization fails 2018-02-04 12:31:16 +01:00