Commit Graph

504 Commits

Author SHA1 Message Date
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
8933298864 Added SetMouseOffset
- Changed mouseScale to Vector2.
- Added SetMouseOffset to change XY of mouseScale.
2019-01-02 10:14:55 +00:00
raysan5
0619571149 ADDED: DrawTextRec() and example 2018-12-29 14:44:28 +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
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
92f68ac6be Review DrawPolyEx()
Also reviewed rlCheckBufferLimit()
2018-12-24 14:09:51 +01:00
Ray
87ad244ee0 Exposed LoadFontFromImage() 2018-12-20 12:58:27 +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
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
5167f78d5f ADDED: OpenURL()
Corrected bug on ImageDrawRectangleLines()
2018-11-09 23:09:02 +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
Ray
298203a41a ADDED: Some functions...
text:     IsEqualText() -WIP-
audio:  SaveWAV()
audio:  ExportWaveAsCode()
textures:  ExportImageAsCode()
2018-10-29 16:18:06 +01:00
Ray
550dd40cb3 ADDED: SplitText() function 2018-10-23 15:43:19 +02: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
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
68d2b0c071 Corrected description 2018-10-13 16:30:44 +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
noshbar
ccaf462cbf GenImageFontAtlas prototype in raylib.h is incorrect.
The prototype of GenImageFontAtlas() in the main raylib.h header has a set of swapped parameter names.
Going through the usage of the function within raylib itself, it appears as if the correct order is:
1) charsCount
2) fontSize

However, it's exposed to the world as the other way around, which may cause some major confusion.
2018-10-10 22:28:17 +02:00
Ray
a511337ce8 ADDED: GetFileNameWithoutExt 2018-10-10 12:01:59 +02:00
Ray
2320c2febf ADDED: ImageExtractPalette() 2018-10-08 18:57:33 +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
6572d5ff8c
raylib.h: include <stdbool.h> if available
Previously, if <raylib.h> was #included prior to another header that
defined bool, the compilation would fail.
This is e.g. the case for <perl.h> and <objc/objc.h> which both fall
back to the <stdbool.h> if C99 is available.

The following commit includes <objc/objc.h> in src/core.c, which causes
the same problem.

Avoid this by checking for C99 bool like we already do for C++'s.
2018-10-07 00:39:51 +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
ed79d53e1a Changed tabs to spaces
- Fixed tabs used instead of 4 spaces
2018-09-27 16:23:11 +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
27c3afd91c enjoy! 2018-09-18 21:30:52 +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
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
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
Jorge A. Gomes
5f89e35d1c
Update raylib.h 2018-08-08 16:39:10 -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
Jorge A. Gomes
c9ca14e659
Update raylib.h
Added NinePatch struc definition and function prototype.
2018-08-03 04:48:46 -03:00
raysan5
0cf92c59d7 Corrected timing typo 2018-07-28 18:13:19 +02:00
raysan5
6f61e26a3c Reviewed custom logging functionality 2018-07-28 17:57:05 +02:00
Pablo Marcos Oltra
c69f7953c7 Add SetTraceLogCallback to enable users setting custom logging (#597) 2018-07-26 21:57:45 +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
Ray
0c631e6b5a Corrected comment 2018-07-15 21:24:59 +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
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
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
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
d0166c9d45 Spacing tweaks 2018-06-30 21:56:26 +02:00
Ray
afe81d94ce Re-added: LoadFontEx() 2018-06-30 19:58:44 +02:00
Ray
dbfd8d713f Reviewed comments section 2018-06-26 01:36:13 +02:00
maficccc@gmail.com
59ebe1b7c3 Added support OpenBSD, NetBSD, DragonFly 2018-06-23 17:02:07 +02: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 San
59fd261491 Added function: GetImageDataNormalized()
Reviewed: GetImageData()
Reviewed: ImageFormat()
2018-06-12 13:13:09 +02:00
Ray
0e6458cfee Added ImageRotate*() functions 2018-06-03 21:05:01 +02:00
Ray
9688c677de Review window creation hints 2018-06-02 18:26:57 +02:00
Ray
b1b4a11bdb Corrected issue with function definition 2018-06-02 13:05:23 +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 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
dff1028466 Replaced ColorToFloat() by ColorNormalize() 2018-04-29 18:39:46 +02:00
lumaio teon
5ef6cc1fb9
Add more key definitions 2018-04-13 17:14:04 -04:00
Ray San
4cc12ef2b3 Review camera definition on examples 2018-04-11 10:13:00 +02:00
Ray
8e44f7b3c7 Reviewed config.h formatting
Added raylib version to config
2018-04-09 23:01:20 +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
931b672c92 Added: ImageDrawRectangle()
Renamed SaveImageAs() to ExportImage() for consistency on what actually happens with data.
2018-04-04 12:02:20 +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
Max Danielsson
5ecee69088 Add 3d orthographic projection mode 2018-03-25 18:33:19 +02:00
Ray
61e0e4b4f3 Complete review of raymath for API consistency 2018-03-16 13:47:01 +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
raysan5
a0127d8300 Corrected typo 2018-03-11 10:49:51 +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
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
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
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
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
Ray
077bef4286 Support 4 components mesh.tangent data
Added struct Vector4 for convenience
2018-02-24 12:31:32 +01:00
raysan5
4492a70a4b Support UTF8 basic characters on ImageTextEx()
Supported UTF8 range equivalent to [128..255] (80h..FFh)
Exposed and renamed text function GetGlyphIndex()
Renamed spriteFont parameter name to simply font
Small security check on transmission mission ending screen
2018-02-18 18:07:57 +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
4d5d1e0434 Added function LoadShaderCode()
Allows loading of shader from text code string directly
2018-02-05 01:03:13 +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
70e0070a85 Reviewed window initialization
In case graphic device could not be created it returns false instead of
failing with an error tracelog (and consequently closing the program).
Window initialization success could be checked with new function
IsWindowReady()
2018-02-04 12:26:28 +01:00