547 Commits
1.6.0 ... 1.8.0

Author SHA1 Message Date
Ray
8380c488be Merge pull request #371 from raysan5/develop
Integrate Develop branch
2017-10-22 20:43:57 +02:00
Ray
2ba43b595e Update file 2017-10-22 20:07:40 +02:00
Ray
ad31730b6a Added cross-compiler RPI libs 2017-10-22 20:00:38 +02:00
Ray
6cec382f65 Comments tweak 2017-10-22 20:00:18 +02:00
Ray
b6c9b54316 Simplified desktop examples compilation 2017-10-22 12:09:00 +02:00
Ray
551de156bb Name tweak 2017-10-22 12:08:42 +02:00
Ray
a483e17f50 Adapted games to compile for Android 2017-10-22 11:48:41 +02:00
Ray
3f9d76f227 Updated Makefile to support Android 2017-10-22 11:12:10 +02:00
Ray
33da9bc8f6 Simplified flags 2017-10-22 11:07:55 +02:00
Ray
368b0320c6 Added resource config file 2017-10-22 11:07:17 +02:00
Ray San
df67e799dd Updated release versions for raylib 1.8 2017-10-20 17:14:58 +02:00
Ray
18601f7619 Merge pull request #369 from raysan5/develop
Integrate Develop branch
2017-10-20 16:15:23 +02:00
Ray
1ef818b032 Update example 2017-10-20 13:59:08 +02:00
Ray
d9d9546ee5 Updated to latest library version 2017-10-20 12:13:21 +02:00
Ray
1375a616b2 Some examples code tweaks 2017-10-20 00:18:21 +02:00
Ray San
037fbc571a Remove unused file 2017-10-19 14:37:00 +02:00
Ray San
e3dcccb936 Updated raylib release 1.8 2017-10-19 14:19:04 +02:00
Ray San
86df9168e7 Updated raylib VS2015 project 2017-10-19 14:14:18 +02:00
Ray San
1474172b4a Updated for raylib 1.8 2017-10-19 13:25:51 +02:00
Ray
53280a56e3 Merge pull request #367 from raysan5/develop
Integrate Develop branch
2017-10-18 00:12:27 +02:00
Ray
5b71e5b3d1 Update CHANGELOG 2017-10-17 13:37:07 +02:00
Ray San
7057d08369 Review VR functionality
To be more generic and configurable
2017-10-17 13:32:15 +02:00
Ray San
8ace02c2ff Added new examples to build...
...and reviewed some details
2017-10-17 13:30:41 +02:00
Ray San
76c821a68d Add screenshot 2017-10-17 11:52:01 +02:00
Ray San
5dc216f419 Improved some examples 2017-10-17 11:51:50 +02:00
Ray San
b065edc878 Review issue with resources folder 2017-10-16 13:40:48 +02:00
Ray San
7f602c9e1e Updated libraries for Windows 2017-10-16 13:37:25 +02:00
Ray San
a6ccc14d39 Corrected issue with OpenAL Soft static 2017-10-16 13:37:10 +02:00
Ray
63507d5f81 Review some issues
It seems there are some platform-dependant issues
2017-10-14 18:04:21 +02:00
raysan5
0a3473a2a9 Reverted to old OpenAL libraries
mingw32 libraries provided were compiled with a different GCC version
(different computer) and seemed to be incompatible on linkage (missing
symbols).
2017-10-14 12:29:02 +02:00
raysan5
afea7e2aff Web release for raylib 1.8 2017-10-14 12:26:00 +02:00
raysan5
4909f9711c Small tweak, remove tabs 2017-10-14 12:25:36 +02:00
raysan5
0d8a994d95 Review templates for Android
- Removed useless templates
- Reviewed all Makefiles
- Rework some code for Android support
- Added resources to advance template
2017-10-14 12:25:08 +02:00
raysan5
d012316b87 NEW self-contained Android Makefile for APK build 2017-10-14 00:14:57 +02:00
raysan5
ba4b39a025 Working on game templates 2017-10-14 00:14:24 +02:00
raysan5
5430d5d52e Review Makefiles 2017-10-14 00:13:23 +02:00
raysan5
975e611bb8 Added new logo sizes (required for Android) 2017-10-14 00:11:58 +02:00
raysan5
9446746001 Corrected issues on examples 2017-10-14 00:11:37 +02:00
raysan5
ea5f4eabf8 Remove android_project template 2017-10-14 00:10:55 +02:00
raysan5
dffe635fd3 Remove basic_test template 2017-10-14 00:10:03 +02:00
Ray
c043226b56 Merge pull request #366 from a3f/develop
Fix warning about unsequenced modification of variable
2017-10-13 14:03:15 +02:00
Ahmad Fatoum
107294f3e6 Fix bug, add some whitespace 2017-10-13 13:55:01 +02:00
Ahmad Fatoum
cd6d752217 Fix warning about unsequenced modification of variable
Variable t was read and modified without interleaving sequence points,
technically undefined behavior. Report by Clang's -Wunsequenced
2017-10-12 19:51:21 +02:00
raysan5
8928248c71 Review comments about raylib 2017-10-12 14:07:31 +02:00
raysan5
c63051bd9e Added glfw3 msvc lib 2017-10-12 13:56:42 +02:00
Ray
d649ff0823 Update README.md 2017-10-12 13:51:29 +02:00
Ray
dc6e559bf6 Merge pull request #365 from a3f/develop
Add Travis CI integration
2017-10-12 11:29:09 +02:00
Ahmad Fatoum
f4a2d1ef29 Add Travis CI integration
Also adds commented-out deployment on tag specification
(push build artifacts to Github releases page).
2017-10-12 10:16:30 +02:00
Ray
e129d52897 Update README.md 2017-10-11 22:47:46 +02:00
Ray San
399d4b5f46 Check to avoid bool redefinition 2017-10-11 13:29:01 +02:00
Ray San
7114c1b1f3 Updated compilation output paths 2017-10-11 13:28:38 +02:00
Ray San
32d855470d Updated release libraries for win32/mingw32 2017-10-11 13:28:16 +02:00
Ray San
1bab8f05cc Cleaning Android project template
Notice that requries libraries are directly taken from
raylib/release/libs/android folder and nativeLoader.java is generated by
Makefile on the go
2017-10-11 12:15:40 +02:00
Ray San
d302316e51 Reorganize release and dependencies 2017-10-11 11:22:49 +02:00
Ray San
ef6674a99d More work on Android building... 2017-10-10 14:06:21 +02:00
raysan5
2051be3825 Add mesh generation example -IN PROGRESS- 2017-10-09 10:13:02 +02:00
Ray San
7b63b0b132 Android APK building...
Using shared libraries just don't work...
2017-10-05 14:04:22 +02:00
Ray
9640a7d7df Update CONTRIBUTORS.md 2017-10-05 13:07:37 +02:00
Ray San
9000fc28a3 Keep working on Android shared libs... 2017-10-04 12:51:53 +02:00
Ray San
412c52499a Reverted change that breaks 3D drawing
It should be reviewed more carefully...
2017-10-04 12:13:32 +02:00
Ray San
ddea9d68bf Review VR simulator
Requires some work, distortion shader could be move out of raylib to
example code...
2017-10-04 12:11:40 +02:00
Ray San
ca0ff82046 Keep working on Makefiles... 2017-10-03 15:02:32 +02:00
Ray
c273fe9756 Update HISTORY.md 2017-10-02 23:46:57 +02:00
Ray
6dd97409d6 Update HISTORY.md 2017-10-02 23:36:50 +02:00
Ray San
b2789949ee Working on Makefiles... 2017-10-02 14:12:03 +02:00
Ray San
1288d6a5df Updated android_native_app_glue 2017-10-02 13:06:34 +02:00
Ray San
ea0decece8 Updated OpenAL Soft headers 2017-10-02 13:06:19 +02:00
Ray San
144b0ed695 Renamed gif writting library 2017-10-02 13:06:04 +02:00
Ray
515a7c3526 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-10-02 00:12:55 +02:00
Ray
b043c5e277 Trying to correct drawing issues... 2017-10-02 00:12:52 +02:00
Ray
52f7ee6b5f Update ROADMAP.md 2017-09-30 00:56:22 +02:00
Ray
87920111aa Update CHANGELOG 2017-09-30 00:47:16 +02:00
Ray
4f9de9527f Review gradient rectangle drawing
Added: DrawRectangleGradientV()
Added: DrawRectangleGradientH()
2017-09-30 00:46:31 +02:00
Ray
639f41cf54 Renamed example file 2017-09-30 00:45:03 +02:00
Ray
541dceb87b Updated libraries for release
OpenAL Soft and raylib compiled for release and stripped
2017-09-29 23:45:21 +02:00
Ray
1c7416910e Default to OpenAL static lib 2017-09-29 23:44:31 +02:00
Ray San
2fbc2eede6 Updated to work! 2017-09-29 14:13:17 +02:00
Ray San
c418aa2fb0 Keep working on Android custom building...
...almost there! raylib already works, issues with OpenAL Soft
linkage...
2017-09-29 13:58:49 +02:00
Ray San
ccd6271a7f Added some compiler flags for Android 2017-09-29 13:57:00 +02:00
Ray San
c45eeb8024 Code tweaks and comments for Android 2017-09-29 13:56:37 +02:00
Ray San
becddd7725 Updated raylib Android release 2017-09-29 13:56:15 +02:00
Ray San
dc4dba4857 Strip down functionality for testing 2017-09-28 17:12:34 +02:00
Ray San
f5dcb51efe Work on custom Android build
- Renamed some folders
- Added some files for testing
- Removed useless files
2017-09-28 17:05:43 +02:00
Ray San
e284adcfc1 Added verbose output 2017-09-27 14:35:17 +02:00
Ray San
96b8c9dd5a More work on Android APK building...
For some reason it's not working properly... :(
2017-09-26 12:00:50 +02:00
Ray San
42db9584de Working on Android APK building... 2017-09-26 11:18:58 +02:00
Ray
8068b86742 Merge pull request #361 from raysan5/master
Integrate master changes into develop...
2017-09-26 09:14:04 +02:00
Ray
4a63e5dfb3 Merge pull request #360 from raysan5/develop
Integrate Develop branch
2017-09-26 09:13:16 +02:00
Ray
5ace947a80 Create CONTRIBUTORS.md 2017-09-26 09:12:47 +02:00
Ray
7ca90d87f9 Move CONTRIBUTORS list to own file 2017-09-26 09:12:02 +02:00
Ray
2068037417 Code tweak 2017-09-26 00:51:31 +02:00
Ray
ed9744756e Updated ( 2017-09-26 00:38:34 +02:00
Ray
934e6c01ab Merge pull request #359 from jubalh/develop
Increment version in meson build file
2017-09-25 12:23:03 +02:00
Michael Vetter
4a406fa94b Increment version in meson build file
Increment raylib version and so lib version number.
2017-09-25 12:15:48 +02:00
raysan5
8462ed73fe Added JAVA_HOME 2017-09-23 19:41:02 +02:00
raysan5
b0f033b43a Some work on rres... 2017-09-23 19:30:42 +02:00
Ray
4a8644e999 Update Android libs and building 2017-09-23 18:40:30 +02:00
Ray
c317ffeca6 Updated comments and paths 2017-09-23 18:24:58 +02:00
Ray
86ebb877fe Working on project Makefile for Android 2017-09-23 18:08:19 +02:00
Ray
00274f070f Working on Android APK building with Makefile 2017-09-23 00:25:31 +02:00
Ray
ff9b486ebe Removed matrix resetting...
to emulate OpenGL funcionality
2017-09-22 13:53:29 +02:00
Ray
b9250cc47b Update HELPME.md 2017-09-18 01:22:24 +02:00
Ray
42505f0d0a Update ROADMAP.md 2017-09-18 01:19:28 +02:00
raysan5
20968830c0 Added mesh generation functions 2017-09-18 00:59:22 +02:00
Ray
1d91a46008 Corrected out-of-bounds array issue 2017-09-13 22:23:24 +02:00
raysan5
f3f6d3fd8e Added new functions
SetWindowTitle()
GetExtension()
2017-09-08 09:35:54 +02:00
Ray
fb334e2fd1 Testing shapes generation using additional library 2017-09-02 17:42:22 +02:00
raysan5
12cb3afd9e Added function DrawRectangleGradientEx()
Moved function DrawRectangleT() from text module to shapes
Added some comments
2017-08-27 21:02:24 +02:00
Ray
b951f8700e Merge pull request #349 from raysan5/master
Integrate master changes into develop branch
2017-08-27 20:59:55 +02:00
Ray
958fed26c9 Merge pull request #348 from define-private-public/cmake_partial
CMake based build system.
2017-08-27 20:58:49 +02:00
ASDF
e173db19f7 CMake based build system.
Some people might find this handly
2017-08-27 13:28:02 -04:00
Ray
c074783861 Merge pull request #346 from raysan5/develop
Integrate Develop branch
2017-08-25 01:53:15 +02:00
raysan5
0fc1323c80 Renamed modelviewprojection matrix 2017-08-25 01:43:55 +02:00
raysan5
74fd671763 Remove old comment... 2017-08-24 23:57:34 +02:00
raysan5
b0adac96b7 Review issue with mipmaps setup
On DDS files mipmapCount header parameter could be unused and set to 0,
resulting in a wrong mipmap count and wrong compressed texture loading.
2017-08-24 20:33:30 +02:00
raysan5
93a4b5e851 Added compiler flag...
...to avoid issue on Arch Linux
2017-08-24 18:27:31 +02:00
Ray
f78747130c Merge pull request #345 from JellyPixelGames/fix-typos
Fix typo in raymath.h
2017-08-24 11:52:44 +02:00
Michael Campagnaro
18bf0ac044 Fix typo in raymath.h 2017-08-23 22:55:43 -04:00
raysan5
88839b093c Added function DrawRectangleT()
Usefult to draw rectangles using default font texture
2017-08-06 10:44:50 +02:00
raysan5
0169b72bdc Minor tweaks 2017-08-06 10:43:43 +02:00
raysan5
6369b47f11 Force OpenGL 3.3 on OSX if selected OpenGL 2.1 2017-08-04 19:18:55 +02:00
raysan5
ae35c37c8a Corrected game to run on OpenGL 1.1 2017-08-04 18:56:36 +02:00
raysan5
eeca607506 Review transforms to match OpenGL 1.1 2017-08-04 18:34:51 +02:00
raysan5
1f310f7d4b new example added: models_plane_rotations 2017-08-04 13:38:21 +02:00
raysan5
2ec8880197 Updated stb libs to latest version 2017-08-04 12:58:39 +02:00
raysan5
fba117e3cd Removed old tool
Not usable any more, raylib changed internally
2017-07-31 19:42:26 +02:00
Ray
7045ceaaed Merge pull request #342 from define-private-public/patch-2
Make physac work on OS X
2017-07-31 08:09:01 +02:00
Benjamin Summerton
71d9426565 Make physac work on OS X
Physac wasn't working on OS X.  It looks like the necessary timing code wasn't being compiled in by the preprocessor.

fixes #340
2017-07-30 23:56:58 -04:00
Ray
d071418cba Added Vector3MultiplyV()
To multiply Vector3 by Vector3
2017-07-28 20:58:38 +02:00
Ray
2a263f7b5f Corrected compilation on OpenGL ES 2.0 2017-07-28 19:59:04 +02:00
raysan5
17d40b2f37 Corrected function name 2017-07-25 18:26:22 +02:00
Ray
c59651bff0 Update README.md 2017-07-25 18:20:26 +02:00
raysan5
c764b3d03e Some tweaks 2017-07-25 18:10:07 +02:00
Ray
1fcca40db5 Update README.md 2017-07-25 11:40:04 +02:00
Ray
98f447f714 Update README.md 2017-07-25 11:28:22 +02:00
raysan5
072684d276 Removed webpage from raylib repo
Moved to own repo at @raysan5/raylib.com
2017-07-24 20:04:54 +02:00
raysan5
b2712b6db7 Corrected issue on QuaternionFromVector3ToVector3() 2017-07-23 17:29:51 +02:00
raysan5
f57367e786 Implemented some changes 2017-07-23 13:20:35 +02:00
raysan5
a766e2c480 Updated Vector math to new naming 2017-07-22 22:15:50 +02:00
raysan5
3655c6e466 Renamed Vector*() functions to Vector3*()
For consistency!
2017-07-22 22:13:26 +02:00
raysan5
2227742e96 Corrected bug on texture rotation 2017-07-22 18:10:34 +02:00
raysan5
814f665bc1 Reviewed features list 2017-07-22 16:58:22 +02:00
raysan5
2fc7bc9504 Reviewed example with new maths 2017-07-22 13:02:02 +02:00
raysan5
cbb134946c Corrected GetMouseRay() and rlUnproject()
Now it works great with reviewed maths
2017-07-22 11:02:40 +02:00
raysan5
c756227e11 Remove BOM from file encoding 2017-07-22 10:44:24 +02:00
raysan5
00d2768bc9 Corrected bug on MatrixPerspective()
Some other tweaks...
2017-07-22 10:35:49 +02:00
Ray
bee980e90f Merge pull request #333 from define-private-public/patch-1
Update Makefile in `examples/`
2017-07-22 09:48:59 +02:00
Benjamin Summerton
c43caeccb6 Update Makefile in examples/
We need to grab the OS name before determining what the path should be.
2017-07-21 19:30:24 -04:00
raysan5
c6cd07c373 Some tweaks raymath related 2017-07-21 17:46:44 +02:00
raysan5
e52032f646 Complete review of raymath
Now it should be coherent with OpenGL math standards
2017-07-21 17:19:28 +02:00
raysan5
9040526f17 Adapt to new materials system 2017-07-21 17:17:37 +02:00
raysan5
38d9fcb08e Moved some functions to raymath
Exposed some raymath useful functions to raylib API
2017-07-21 15:25:35 +02:00
raysan5
980d9d4cd4 rlgl usable as standalone library 2017-07-21 10:42:57 +02:00
raysan5
84aff31973 MatrixPerspective() angle required in radians
Consistent with similar functions in raymath
2017-07-21 10:42:41 +02:00
raysan5
163339991c Review heightmap example for raylib 1.8 2017-07-21 09:55:10 +02:00
raysan5
92729662f4 Additional path check 2017-07-21 09:49:23 +02:00
raysan5
2679c4ae9b Review mesh loading and textures generation 2017-07-21 09:34:09 +02:00
raysan5
63fd96354e Simplify a bit GenTexture*() functions
Still shader dependant, locations set should be moved out
2017-07-20 14:27:59 +02:00
raysan5
4c06725461 Removed useless functions
SetMaterialTexture() and UnsetMaterialTexture()... too shader
dependant...
2017-07-20 14:27:17 +02:00
raysan5
52cd5c6324 Corrected some issues
Corrected compilation for OpenGL 1.1
Review mesh data uploading to GPU
2017-07-20 12:26:25 +02:00
raysan5
0dabb2708b Reorganized a couple of functions 2017-07-19 19:53:53 +02:00
raysan5
76c6f0b1e6 Working on PBR system
Moved PBR material loading to example, right decision?
2017-07-19 18:55:32 +02:00
Ray
e8b65422c4 Merge pull request #329 from define-private-public/328.shared-library-on-os-x
Able to make a .dylib for OS X
2017-07-19 10:14:36 +02:00
raysan5
d368403a13 Working on PBR materials, renamed some data 2017-07-19 10:09:34 +02:00
Benjamin N. Summerton
ba32d6a753 Able to make a .dylib for OS X 2017-07-18 22:37:09 -04:00
Ray
8f569e59b1 Review shared library generation 2017-07-17 14:16:23 +02:00
Ray
bf169f7f42 Added PBR required resources 2017-07-17 14:06:27 +02:00
raysan5
e893f3629e Corrected some issues 2017-07-17 12:02:46 +02:00
Ray
6546474fa4 Manual integration of material-pbr into develop 2017-07-17 00:33:40 +02:00
Ray
025dab9907 Updated twitter address 2017-07-16 23:11:59 +02:00
raysan5
8ca8550739 Removed function reference 2017-07-08 14:22:48 +02:00
raysan5
013f80f3a3 Added command line compiling with MSVC
That's just a reference file, needs review
2017-07-08 14:20:05 +02:00
raysan5
53fbeeea71 Corected some issues with jar_xm
Problems when compiling with VS2015
Probably DEBUG(...) macro is not the best naming...
2017-07-08 14:19:27 +02:00
raysan5
36fcffeaae Incremented version number for reference 2017-07-02 19:29:21 +02:00
raysan5
6589c808b5 Review some formatting for consistency 2017-07-02 19:29:01 +02:00
raysan5
5f0f87ecce Added VS2015 raylib release files 2017-07-02 14:41:14 +02:00
raysan5
65cf3080a5 Review VS2015 projects configurations 2017-07-02 14:33:40 +02:00
raysan5
c04cb0a65e Review TraceLog() usage 2017-07-02 12:43:49 +02:00
raysan5
9f09f6f550 Rename enum LogType names...
...to avoid possible conflicting symbols
2017-07-02 12:35:13 +02:00
raysan5
bfa66f446a Review raylib path on rpi 2017-07-02 12:09:02 +02:00
Ray
c949b74114 Merge pull request #315 from joeld42/obj-loader-fix
Fix for OBJ loading
2017-07-01 10:23:47 +02:00
Joel Davis
e0c95ede50 Prevent bogus triangle being added when there is whitespace at end of .OBJ file 2017-06-30 23:37:19 -07:00
Ray
83b4b13a2c Merge pull request #314 from nounoursheureux/develop
Fix some typos (lenght -> length)
2017-06-29 16:31:40 +02:00
Wilhem Barbier
056a494baf Fix some other typos 2017-06-29 10:36:58 +02:00
Wilhem Barbier
aba3739c13 Fix some typos in raymath.h 2017-06-29 10:30:21 +02:00
Ray
495b6d8883 Merge pull request #313 from nounoursheureux/develop
Removed an unwanted file and fixed an example
2017-06-29 09:05:46 +02:00
Wilhem Barbier
3c9aa780f9 Removed an unwanted file and fixed an example 2017-06-28 19:14:20 +02:00
Ray
5f5bd20f07 Merge pull request #312 from nounoursheureux/image_gen
Add a density parameter to GenImageRadialGradient
2017-06-28 18:27:55 +02:00
Wilhem Barbier
786cd63057 Add a density parameter to GenImageRadialGradient 2017-06-28 17:27:47 +02:00
Ray
c3049a9b06 Merge pull request #311 from nounoursheureux/image_gen
Add more image generation functions: radial gradient and perlin noise
2017-06-28 16:20:25 +02:00
Ray
c51f63f661 Merge pull request #310 from nounoursheureux/save_image
Add the SaveImageAs function
2017-06-28 15:58:05 +02:00
Wilhem Barbier
3fe268d004 Swap the two parameters 2017-06-28 15:38:34 +02:00
Wilhem Barbier
a0ac8ee2c4 Add more image generation functions: radial gradient and perlin noise 2017-06-28 15:29:56 +02:00
Wilhem Barbier
954757532a Add the SaveImageAs function 2017-06-28 14:32:44 +02:00
Ray
92ca68aac8 Merge pull request #309 from nounoursheureux/image_gen
Add some image generation functions
2017-06-28 13:39:18 +02:00
Wilhem Barbier
fcd13fd5d2 Add some functions to generate images
Namely:
- GenImageHorizontalV
- GenImageHorizontalH
- GenImageChecked
- GenImageWhiteNoise
- GenImageCellular

The gradient implementation may be a bit naive, for example it doesn't do any gamma correction.
2017-06-28 12:56:04 +02:00
Ray
c46abd34d4 Merge pull request #305 from jubalh/mesondepv
Add version info to glfw dependency
2017-06-13 16:33:11 +02:00
Michael Vetter
03c4ed6b3f Add version info to glfw dependency
glfwSetWindowMonitor and some other functions are only available from 3.2
onwards.
2017-06-13 16:07:57 +02:00
Ray
8c1f32f2fe Additional check on file open 2017-06-12 14:21:50 +02:00
Ray
eee8393eb0 Merge pull request #303 from jubalh/mesongnu
Meson: use gnu99
2017-06-11 23:59:29 +02:00
Ray
5370fe18e0 Additional check for bool header definition 2017-06-11 23:58:46 +02:00
Michael Vetter
4fad1607ed Meson: use gnu99
We use variable init in for loops, so need c99.
2017-06-11 23:53:03 +02:00
Ray
4b1bc7f65e Merge pull request #301 from jubalh/time
Add define to have CLOCK_MONOTONIC work in c99
2017-06-11 16:22:53 +02:00
Michael Vetter
272073785f Add define to have CLOCK_MONOTONIC work in c99
If we compile with c99 without gnu extensions (gnu99) we need this
define, to have CLOCK_MONOTONIC and similar macros available
2017-06-11 11:20:30 +02:00
Ray
b6d7fa9bb0 Merge pull request #299 from jubalh/soversion
Add library versioning
2017-06-08 22:18:10 +02:00
Michael Vetter
1a61dc2c77 Meson: build library with so version
This should always be the number of the raylib release.
Especially when the new version is ABI incompatible the major version
should be bumped.
2017-06-08 17:03:25 +02:00
Ray
9dd3c03153 Merge pull request #297 from jubalh/meson
Initial meson support
2017-06-08 13:19:41 +02:00
raysan5
402a8bfd68 Added note about transposing 2017-06-05 18:53:53 +02:00
raysan5
43cb6414f6 Added note about transposing 2017-06-05 18:53:37 +02:00
Michael Vetter
567831a693 Allow static/dynamic library building with meson
Using the library() function instead of shared_library() allows changing
of the library type via the default_library option.
This allows for easy change between static and dynamic library building.

Use 'meson --default-library=static builddir' to build as static, if no builddir yet exists.
Use 'mesonconf -Ddefault_library=static builddir' to change the type for
an existing builddir.
2017-06-05 14:35:44 +02:00
Michael Vetter
9c524ee3a6 Add meson files for basic Linux building 2017-06-05 14:34:47 +02:00
Michael Campagnaro
1adc031301 Fix link in readme 2017-06-05 14:33:47 +02:00
Ray
99c7ca4f4a Merge pull request #296 from sir-pinecone/fix-readme-link
Fix link in readme
2017-05-31 12:21:41 +02:00
Michael Campagnaro
60f0d78170 Fix link in readme 2017-05-31 05:51:18 -04:00
Ray
a08cf1ce63 Merge pull request #295 from jubalh/cflags
Accept external CFLAGS
2017-05-29 20:47:03 +02:00
Michael Vetter
6809380d3d Accept external CFLAGS
Some distributions build the programs with a specific set of CFLAGS.
Lets allow that by adding raylibs flags.
2017-05-29 19:00:53 +02:00
Ray
d5c43099cd Upload image 2017-05-28 21:29:59 +02:00
raysan5
f54501a355 Review gif recording (simplified) 2017-05-27 14:40:05 +02:00
raysan5
90f3f870c2 Added bunnymark example 2017-05-22 20:47:28 +02:00
raysan5
d0190af69f Renamed file (issues with Makefile) 2017-05-22 20:47:17 +02:00
Ray
07534497e6 Updated libs 2017-05-19 10:34:42 +02:00
Ray
910b4b5d53 Merge pull request #290 from raysan5/develop
Added patron to list
2017-05-19 01:02:01 +02:00
Ray
95b39e5345 Added patron to list 2017-05-19 00:59:21 +02:00
Ray
9f8a2e4612 Merge pull request #289 from raysan5/develop
Integrate develop branch
2017-05-19 00:56:03 +02:00
Ray
413d059fd8 Some tweaks and additions 2017-05-19 00:55:02 +02:00
Ray
afb841b7dd Reverted to previous OpenAL version
Issues when pausin musing and trying to resume (not resuming!)
2017-05-18 23:26:20 +02:00
Ray
c068de183b Added Android lib 2017-05-18 23:00:34 +02:00
Ray
949ed3f9f8 Merge pull request #288 from raysan5/develop
Integrate develop branch
2017-05-18 19:25:44 +02:00
Ray
9b24120cd9 Updated libs 2017-05-18 19:24:24 +02:00
Ray
d033c87d27 Update HISTORY.md 2017-05-18 19:01:12 +02:00
Ray
f1acd4a065 Update CHANGELOG 2017-05-18 19:00:18 +02:00
Ray
e01a1ba10c Support Gif recording 2017-05-18 18:57:11 +02:00
Ray
1a37f09b02 Update README.md 2017-05-18 00:22:48 +02:00
Ray
4a4fffe439 Updated to latest version 2017-05-18 00:13:58 +02:00
Ray
a083d4726f Update HISTORY.md 2017-05-17 17:56:45 +02:00
Ray
aec6c0350a Update HISTORY.md 2017-05-17 17:47:40 +02:00
Ray
9f50c6e611 Added gif file writter library
Setup for a new amazing feature! ;)
2017-05-17 16:01:55 +02:00
Ray
b4a68d2c87 Update HISTORY.md 2017-05-17 11:28:18 +02:00
Ray
636a2acc95 Update ROADMAP.md 2017-05-17 11:01:23 +02:00
Ray
ad174def77 Update LICENSE.md 2017-05-17 09:25:41 +02:00
Ray
2800b2a19a Update CHANGELOG 2017-05-17 09:09:23 +02:00
Ray
b6b01f5420 Merge pull request #287 from raysan5/develop
Integrate develop branch
2017-05-17 01:06:05 +02:00
Ray
1e2d3d93fe Some more patreons 2017-05-17 01:04:50 +02:00
Ray
bc981a0628 Added patreons to web 2017-05-17 01:04:21 +02:00
Ray
34ce1048d0 Update README.md 2017-05-17 00:58:27 +02:00
Ray
33aef15555 Updated architecture diagram 2017-05-17 00:54:14 +02:00
Ray
9819614276 Comments tweaks 2017-05-17 00:33:40 +02:00
Ray
0780cd4e6a Web review 2017-05-17 00:33:29 +02:00
Ray
a5bfd7db22 Some reviews for RPI 2017-05-16 15:23:01 +02:00
Ray
e563ebe240 Update README.md
Reviewed comments and added acknowledgements
2017-05-16 00:43:57 +02:00
Ray
f8a4498a24 Merge pull request #286 from raysan5/develop
Integrate develop branch
2017-05-16 00:20:17 +02:00
Ray
65e6a6db53 Improved shaders_postprocessing example 2017-05-16 00:14:14 +02:00
Ray
c9d6b7e356 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-05-15 22:48:13 +02:00
Ray
aba25e9ba3 Move shaders to examples 2017-05-15 22:48:04 +02:00
Ray
b3b828c8bb Update README.md 2017-05-15 18:55:18 +02:00
Ray
dd7b64a536 Simplify README
Move raylib history to another file
2017-05-15 18:36:38 +02:00
Ray
4ca229ed7f Renamed file 2017-05-15 18:26:53 +02:00
Ray
a8f142e736 Renamed file 2017-05-15 18:23:09 +02:00
Ray
6a48e7376b Review example 2017-05-15 18:20:27 +02:00
Ray
4a31ce4bd2 Reorganize code 2017-05-15 18:07:23 +02:00
Ray
87a3970222 Move android_native_app_glue to folder 2017-05-15 18:06:26 +02:00
Ray
5f09c71f98 Review comments for better organization 2017-05-15 11:30:09 +02:00
Ray
2a2bee8964 raylib v1.7 release 2017-05-14 18:34:55 +02:00
Ray
31b598cbc6 Review Android template libraries
Updated to latest version, not tested
2017-05-14 18:33:42 +02:00
Ray
fb0f2fd181 Moved Android header to external folder 2017-05-14 18:33:15 +02:00
Ray
01e65664dd Reviewed some comments... 2017-05-14 18:32:47 +02:00
Ray
32e5e20734 Update to latest OpenAL Soft version (1.18.0-dev)
Note that Android and Desktop versions of OpenAL Soft come from the same
sources, recompiled for every platform
2017-05-14 18:32:27 +02:00
Ray
026f9829e5 Review header comments 2017-05-14 18:30:51 +02:00
Ray
a63ad0fec4 Remove OculusSDK library
Just waiting for a better future alternative (multiplatform)... OpenXR ?
2017-05-14 18:30:21 +02:00
Ray
edb9e4159d Remove ndk-build based src building
Replaced by standaloane-toolchain based building, included in
src/Makefile
2017-05-14 18:29:05 +02:00
Ray
1ed3d3285f Merge pull request #285 from raysan5/develop
Integrate develop branch
2017-05-12 14:01:39 +02:00
raysan5
42ad00b7c2 Some test images for compressed texture formats 2017-05-11 23:14:15 +02:00
Ray
fd5c36fc32 Avoid math function duplicates 2017-05-11 17:22:25 +02:00
Ray
3d6c1f3f4f Remove useless files 2017-05-11 17:08:33 +02:00
Ray
518bdfc134 Some work on Android build 2017-05-11 16:45:49 +02:00
Ray
35fe34ba0f Added some useful functions 2017-05-11 16:24:40 +02:00
Ray
27bccdbd50 Review some path for image sharing 2017-05-10 19:40:49 +02:00
Ray
3ec2365103 Added Wave Collector web version 2017-05-10 19:40:26 +02:00
Ray
76062247f8 Corrected some issues
Now works in WEB!
2017-05-10 19:39:52 +02:00
Ray
93e2fd8ea1 Some tweaks 2017-05-10 19:37:48 +02:00
Ray
16842233c9 Review issue and added some comments 2017-05-10 19:34:57 +02:00
Ray
0880be638e Renamed RayHitInfo variables 2017-05-10 00:57:48 +02:00
Ray
7f6b16add4 HDR textures vertical flip 2017-05-09 22:32:21 +02:00
Ray
bac50fbba5 Review functions descriptions 2017-05-09 22:03:46 +02:00
Ray
321027a242 Added comments to create transparent framebuffer
Comments to create transparent framebuffer on RPI,
when activate you see though full screen window the console below!
2017-05-09 18:11:02 +02:00
Ray
0ca874c710 Merge pull request #282 from raysan5/develop
Integrate Develop branch
2017-05-09 09:35:58 +02:00
Ray
4c27412eff Corrected issue #281 2017-05-09 09:33:32 +02:00
Ray
f05d6dfc3c Some comment tweaks
Still some work left on camera...
2017-05-08 21:16:46 +02:00
Ray
8ccb558996 First person camera now works on web 2017-05-08 21:04:14 +02:00
Ray
fd1fe3ac14 Lock cursor on first person camera 2017-05-08 21:03:48 +02:00
Ray
35c6aff21f Corrected bug on HDR loading 2017-05-08 12:50:24 +02:00
Ray
50c887cb0a Support HDR R32G32B32 float textures loading 2017-05-08 12:31:47 +02:00
Ray
822c2ddad5 Some defines tweaks for consistency 2017-05-08 02:47:44 +02:00
Ray
83aba22e49 Improved hi-res timer on Win32 2017-05-08 02:37:37 +02:00
Ray
a522914183 Included required paths for web compilation 2017-05-08 01:33:34 +02:00
Ray
3861bc80f2 StopMusicStream() review 2017-05-08 00:55:47 +02:00
Ray
39732d04ec Comments review 2017-05-08 00:55:26 +02:00
Ray
0ebd8b0f6e Review Android compiling 2017-05-08 00:47:15 +02:00
Ray
3bdf367711 Support model.transform
Combine it with transform introduced as function parameters
2017-05-04 17:42:24 +02:00
Ray
70a7c65668 Return angles as degrees 2017-05-04 17:41:51 +02:00
Ray
18b31f6792 Added two new functions to raymath 2017-05-04 00:35:41 +02:00
Ray
9c66d961d0 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-05-03 14:17:25 +02:00
Ray
2d5c8e61b1 Some code tweaks 2017-05-03 14:16:53 +02:00
Ray
73774aadd6 Review makefiles 2017-05-03 14:16:42 +02:00
Ray
a64e909e55 Added games license 2017-05-03 14:16:11 +02:00
Ray
c4500901eb Added HTML5 games 2017-05-03 14:15:49 +02:00
Ray
33069cddc5 Merge pull request #275 from victorfisac/develop
Added function to set window minimum dimensions
2017-05-03 01:20:08 +02:00
victorfisac
e197665e1d Added function to set window minimum dimensions...
useful when using FLAG_WINDOW_RESIZABLE.
2017-05-02 15:04:32 +02:00
victorfisac
db0cfa935f Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-05-02 14:18:11 +02:00
Ray
d593bd0081 Some code tweaks 2017-04-30 13:03:31 +02:00
Ray
2d6213af60 Renamed deprecated function name 2017-04-28 00:30:23 +02:00
Ray
86f2d4b9f9 Commented pointer lock on web 2017-04-28 00:29:50 +02:00
Ray
66320582a3 Some work on example games 2017-04-28 00:29:23 +02:00
Ray
c785d84d30 Merge pull request #270 from raysan5/develop
Move compiled game to right folder
2017-04-24 00:23:26 +02:00
Ray
be40d97954 Move compiled game to right folder 2017-04-24 00:22:41 +02:00
Ray
71fe3c0b08 Merge pull request #269 from raysan5/develop
Integrate develop branch
2017-04-24 00:18:53 +02:00
raysan5
9a515ae9db Review examples list -IN PROGRESS- 2017-04-23 19:28:53 +02:00
raysan5
b4f4b179c2 Light my ritual web compilation 2017-04-23 19:28:35 +02:00
raysan5
0b869948c6 TraceLog() output tweak 2017-04-23 19:27:48 +02:00
raysan5
332f3b4f9d Set canvas background to black...
..to avoid blending issues with white background
2017-04-23 19:24:39 +02:00
raysan5
3c99093aed Rename variables for consistency 2017-04-23 12:30:36 +02:00
raysan5
f2656871e9 Review Makefiles default raylib path 2017-04-23 12:11:27 +02:00
raysan5
7bcae59477 Support XM modules by default 2017-04-23 12:06:05 +02:00
raysan5
3a1e6ab0b6 Review game code (something broken) 2017-04-23 12:05:47 +02:00
raysan5
9b072dc346 Review game examples Makefiles 2017-04-23 12:05:18 +02:00
raysan5
cfec2b40a4 Organize structs vs enums 2017-04-22 22:35:19 +02:00
raysan5
247da006ae Rename parameter 2017-04-22 22:35:04 +02:00
raysan5
b0f8ea27e3 Renamed function for lib consistency
LoadSpriteFontTTF() --> LoadSpriteFontEx()
2017-04-22 19:04:54 +02:00
Ray
5620e73914 Merge pull request #266 from Triangle345/patch-3
basic_game - update makefile
2017-04-21 23:04:02 +02:00
Eugene F
ec22577e5a basic_game - update makefile
Removed glew from basic_game makefile as glew is not part of the raylib package (no glew in mingw).
2017-04-21 16:20:40 -04:00
Ray
e38a7fcede Small tweak 2017-04-21 00:08:37 +02:00
Ray
e7f0d0eef1 Corrected issue with alloca.h on GCC 2017-04-21 00:08:24 +02:00
Ray
ecfe31bf1d Make TraceLog() public to the API
enum LogType could require some revision...
2017-04-21 00:08:00 +02:00
Ray
8d3750e36d Turn transparent pixels to black 2017-04-20 23:26:16 +02:00
Ray
1df7a8b4a6 Update some files 2017-04-20 18:09:30 +02:00
Ray
517a7e3466 Review makefiles 2017-04-20 00:57:03 +02:00
Ray
0ed82150f0 Merge pull request #263 from raysan5/develop
Added examples web images
2017-04-20 00:51:15 +02:00
Ray
61ce160023 Added examples web images
Added loader webs (previously ignored)
2017-04-20 00:49:39 +02:00
Ray
bc1bfe54d6 Merge pull request #262 from raysan5/develop
Integrate develop branch
2017-04-20 00:21:38 +02:00
Ray
35172430c6 Added SUPPORT_VR_SIMULATOR flag 2017-04-18 11:49:02 +02:00
Ray
a5c8ce2a34 Upload new game: Koala Seasons 2017-04-18 10:42:15 +02:00
Ray
99c226b344 Delete some old data...
- Removed raylib_demo (outdated)
- Removed some old examples
2017-04-18 10:30:37 +02:00
Ray
be4d530ebe Removed rBMF fonts 2017-04-18 10:15:24 +02:00
raysan5
4b8a0268ed Added physac examples to web
Some tweaks on original src files
2017-04-17 17:25:27 +02:00
raysan5
881f134f4d Review and recompile web examples 2017-04-17 16:42:01 +02:00
raysan5
3e082f1d62 Updated physac to latest version 2017-04-16 19:08:34 +02:00
raysan5
b4d28cc7a1 Working on examples...
- Removed rbmf font example
- Reviewed physac examples
2017-04-16 19:08:19 +02:00
raysan5
c67cffea38 Updated STB libs to latest version 2017-04-16 14:06:04 +02:00
victorfisac
8849a4c752 Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-04-16 14:03:39 +02:00
raysan5
f5894278b7 Added Vector2 math functions
Reviewed some Vector3 functions
Added auxiliary Clamp() function
2017-04-16 13:48:46 +02:00
raysan5
7e65c300b6 Make public TakeScreenshot() function 2017-04-16 13:47:49 +02:00
raysan5
9956344215 new example: shapes_lines_bezier 2017-04-14 15:37:50 +02:00
raysan5
843731e048 new example: text_input_box 2017-04-14 15:37:36 +02:00
raysan5
4315b82ea7 Replaced some images and updated examples 2017-04-14 13:58:39 +02:00
Ray
82c54449bf Merge pull request #260 from RDR8/develop-c99-cflags
Added _DEFAULT_SOURCE to CFLAGS for C99 compatibility
2017-04-13 11:16:10 +02:00
RDR8
774b120335 PLATFORM_WEB cleanup 2017-04-12 22:05:54 -05:00
RDR8
1bba1242f4 Added _DEFAULT_SOURCE to CFLAGS for C99 compatibility 2017-04-12 20:26:29 -05:00
raysan5
677c5cc9a8 Removed useless files 2017-04-10 15:30:36 +02:00
Ray
f7bebf9861 Working on web examples
Reorganizing folders
Review examples
Work on makefile and loader.html
2017-04-09 23:46:47 +02:00
Ray
8374460c39 Added glfw3 lib (for VS2015) 2017-04-08 23:32:30 +02:00
Ray
20d205cae5 Working on examples... 2017-04-08 23:31:58 +02:00
Ray
5fd83708cf Added web files to ignore 2017-04-08 11:19:11 +02:00
Ray
17b3f5e02e Support generic target compilation 2017-04-08 11:12:25 +02:00
Ray
d2d4b17633 Web: Support pointer lock 2017-04-08 00:16:03 +02:00
Ray
ca338b3318 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-04-07 00:51:26 +02:00
Ray
29067e19d9 Redesigned textures_rectangle example 2017-04-07 00:51:08 +02:00
Ray
74255b6eb2 Corrected project paths 2017-04-07 00:50:20 +02:00
Ray
795c6b465c Working on web examples 2017-04-07 00:49:49 +02:00
Ray
eb7212fe42 Merge pull request #258 from victorfisac/develop
Calculate tangents when loading a mesh
2017-04-06 20:45:32 +02:00
victorfisac
82577ededc Comment unused variables from tangent calculations 2017-04-06 15:34:04 +02:00
victorfisac
4b7ea25603 Remove testing binormals implementation 2017-04-06 15:33:20 +02:00
victorfisac
0c2a58cf96 Add tangents calculation when loading OBJ file 2017-04-06 15:31:48 +02:00
victorfisac
54f070a0f4 Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-04-06 15:28:04 +02:00
Ray
c47b04a2c6 Working on web examples 2017-04-05 00:29:39 +02:00
Ray
fdf8501e81 Improve vr support and simulator 2017-04-05 00:02:40 +02:00
Ray
99affa0caf Corrected issue when retrieving texture from GPU 2017-04-04 23:44:36 +02:00
Ray
407746193d Merge pull request #256 from raysan5/develop
Integrate develop branch
2017-04-04 12:17:08 +02:00
Ray
1f56e8e5d0 Minor code tweaks 2017-04-04 12:16:13 +02:00
Ray
dd4dd0e87d Reorganize examples folder 2017-04-04 01:54:49 +02:00
Ray
5a230659ef Working in random crash...
Related to UpdateMusicStream(), in stb_vorbis
2017-04-04 00:21:52 +02:00
Ray
c3b8a41f95 Remove function declaration 2017-04-03 23:10:49 +02:00
Ray
50bc77ed96 Improve web examples -IN PROGRESS- 2017-04-03 23:10:27 +02:00
victorfisac
256bc6e1dc Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-04-03 20:31:10 +02:00
Ray
e6ed85e993 Update web examples -WORK IN PROGRESS- 2017-04-01 00:51:31 +02:00
Ray
0a33fbf8bb Corrected TraceLog issue 2017-04-01 00:48:40 +02:00
Ray
9724443c5b Remove Lua lib from vs2015 2017-04-01 00:47:39 +02:00
victorfisac
0d06c946f2 Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-03-30 02:46:19 +02:00
Ray
954a24545f Merge pull request #251 from RDR8/4krishna
Restore inadvertant changes to Makefiles
2017-03-29 23:27:11 +02:00
RDR8
44de97ea16 Fine-tuning PLATFORM_WEB CFLAGS 2017-03-29 16:04:29 -05:00
RDR8
f65bd8e4a0 Edit examples/Makefile PLATFORM_WEB CFLAGS to match src/Makefile 2017-03-29 14:49:20 -05:00
RDR8
4889f240fe Restore inadvertant changes to Makefiles 2017-03-29 12:59:46 -05:00
Ray
080a79f0b0 Added IsFileExtension()
Replaced old GetExtension() function
Make IsFileExtension() public to the API
2017-03-29 00:35:42 +02:00
Ray
2f65975c5e Remove RBMF fileformat support 2017-03-29 00:02:40 +02:00
Ray
b5dd18a70c Review Sleep() usage, return to busy-wait-loop 2017-03-28 19:15:27 +02:00
Ray
5338bbf70d Merge pull request #250 from raysan5/develop
Integrate develop branch
2017-03-26 23:06:17 +02:00
Ray
90b36bd274 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-03-26 22:49:11 +02:00
Ray
b7a8a40e71 Work on configuration flags 2017-03-26 22:49:01 +02:00
Ray
160408f269 Merge pull request #249 from RDR8/games-linux
Fixed some games. Replaced font.size with font.baseSize. Uncommented linux libs.
2017-03-26 14:43:21 +02:00
RDR8
72b90bff0f Merge remote-tracking branch 'origin/develop' into games-linux 2017-03-25 21:13:17 -05:00
RDR8
efc4b2941b Missed a couple 2017-03-25 21:03:28 -05:00
RDR8
0c16af01e5 Replaced font.size with font.baseSize. Uncommented linux libs. Typo or two 2017-03-25 20:41:04 -05:00
Ray
5387b45431 Working on configuration flags 2017-03-25 12:01:01 +01:00
victorfisac
b2f0c7ca8b Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-03-24 15:37:58 +01:00
Ray
3f0c296422 Merge pull request #248 from RDR8/linux-c99
linux-c99
2017-03-24 10:43:34 +01:00
RDR8
ff44cb02e7 Always something 2017-03-24 03:42:10 -05:00
RDR8
9eaff6902f Sweep blank lines 2017-03-24 03:37:49 -05:00
RDR8
f1bb245999 Strip trailing spaces 2017-03-24 03:32:07 -05:00
RDR8
e23c120c8b Automate compiler flags selection. 2017-03-24 03:28:12 -05:00
RDR8
9875198a56 c99 fix, some linux housekeeping 2017-03-24 01:20:24 -05:00
Ray
6ba5217c28 Merge pull request #246 from RDR8/staging-linux-gitignore
staging-linux-gitignore
2017-03-22 14:10:28 +01:00
RDR8
314e1e0fd5 Merge remote-tracking branch 'upstream/develop' into staging-linux-gitignore 2017-03-21 11:19:34 -05:00
RDR8
c87006f85a Don't ignore release libraries. 2017-03-21 11:16:18 -05:00
Ray
004117a05c core: configuration flags 2017-03-21 13:22:59 +01:00
Ray
2ac7b684b5 text: configuration flags 2017-03-21 13:22:47 +01:00
Ray
974a6d4031 Corrected bug 2017-03-21 13:21:07 +01:00
RDR8
ae0b776eaf Merge remote-tracking branch 'upstream/develop' into staging-linux-gitignore 2017-03-20 22:48:43 -05:00
Ray
59652c75b4 Review some comments 2017-03-20 20:34:44 +01:00
RDR8
7b42492941 Merge branch 'staging-linux-gitignore' of https://github.com/RDR8/raylib into staging-linux-gitignore 2017-03-20 13:54:03 -05:00
RDR8
8278eebfac Ignore vim temporary files, .a and .so, games/ 2017-03-20 13:47:15 -05:00
RDR8
3f3ee5e37f Ignore additional vim temporary files, .a and .so files, games/ executables 2017-03-20 13:33:53 -05:00
Ray
fee5e8cfac Add files via upload 2017-03-19 18:40:41 +01:00
raysan5
46c2f2058f Added new patrons 2017-03-19 18:18:55 +01:00
raysan5
8f5ff64420 Working on file header comments... 2017-03-19 12:52:58 +01:00
raysan5
ca8c565617 Review contact information 2017-03-19 12:52:13 +01:00
raysan5
5d1f661661 Remove Oculus support from code
Moved to custom example, now raylib only supports simulated VR
rendering.
Oculus code was too device dependant... waiting for OpenXR.
2017-03-14 01:05:22 +01:00
raysan5
3813722f17 Added function: DrawLineBezier() 2017-03-14 00:22:53 +01:00
raysan5
63c65f8cc5 Updated game to raylib v1.7 2017-03-12 12:37:43 +01:00
Ray
2c0604aa29 Merge pull request #245 from raysan5/develop
Integrate develop branch
2017-03-12 11:40:41 +01:00
raysan5
023a08aeb9 Added some tools images 2017-03-12 11:39:00 +01:00
raysan5
7154b42f48 Corrected naming issue 2017-03-09 18:52:56 +01:00
Ray
7c888edba1 Corrected typo introduced in last commit 2017-03-09 16:25:15 +01:00
Ray
4ec65c0d25 Corrected issue with reserved words: near, far 2017-03-09 16:23:36 +01:00
Ray
81897e7771 Corrected bugs on RPI compilation 2017-03-09 13:13:13 +01:00
Ray
b898a161f7 Merge pull request #242 from raysan5/master
Integrate master changes into develop
2017-03-07 09:49:53 +01:00
Ray
6d1519c132 Merge pull request #241 from raysan5/develop
Integrate develop branch
2017-03-07 09:49:04 +01:00
-
cb29b1d2ac Removed unnecesary libs 2017-03-07 09:45:18 +01:00
Ray
6e683d57e8 Merge pull request #240 from victorfisac/develop
Updated Physac and examples with last changes
2017-03-07 08:45:53 +01:00
victorfisac
c964559bc9 Update physac source and examples with new changes 2017-03-06 22:57:33 +01:00
Ray
cb463a37ef Merge pull request #239 from victorfisac/develop
Fix bug in isGrounded state calculations
2017-03-06 16:24:03 +01:00
victorfisac
f88a943418 Fix bug in isGrounded state calculations 2017-03-06 09:58:28 +01:00
victorfisac
9261c3b8dc Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop 2017-03-06 09:40:04 +01:00
raysan5
b734802743 Revert test code... 2017-03-05 21:05:17 +01:00
raysan5
59038bae96 Added function: DrawLineEx()
Supports line thickness
2017-03-05 21:04:07 +01:00
Ray
c05701253e Merge pull request #238 from raysan5/develop
Integrate Develop branch
2017-03-05 19:17:34 +01:00
raysan5
aaf9c648d3 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-03-05 19:17:05 +01:00
raysan5
d1c9afd1d8 Work on timming functions...
It seems Sleep() behaves weird on my computer, disabled by default
returning to the busy wait loop... also re-implemented DrawFPS() to
avoid frame blitting...
2017-03-05 19:17:00 +01:00
Ray
47e3fbfc12 Update basic_game.c 2017-03-05 15:59:59 +01:00
Ray
b347c35ef4 Merge pull request #237 from raysan5/master
Integrate master change into develop
2017-03-05 15:50:36 +01:00
Ray
bb7b9adb37 Merge pull request #236 from raysan5/develop
Integrate Develop branch
2017-03-05 15:49:19 +01:00
Ray
b16f118452 Add files via upload 2017-03-05 15:48:32 +01:00
raysan5
203d1a154e Clear music buffers on stop 2017-03-05 10:55:58 +01:00
raysan5
9cfaa81a7e Added some flags and functions to manage window
- SetWindowPosition(int x, int y);
- SetWindowMonitor(int monitor);
2017-03-05 10:55:29 +01:00
Ray
9cda98b4e9 Merge pull request #234 from bugcaptor/fix-vs2015-build-audio_c
fix for audio.c(607): error C2036 in Visual Studio.
2017-03-03 09:17:13 +01:00
bugcaptor
de103ecc5e fix for audio.c(607): error C2036: 'void *': unknown size in Visual Studio 2015. 2017-03-02 10:07:09 +09:00
Ray
2ac956208d Update Makefile 2017-02-28 12:00:31 +01:00
Ray
c46989a1d9 Merge pull request #230 from OdnetninI/develop
Examples Linux Physics Fix
2017-02-23 17:59:13 +01:00
OdnetninI
bbdbc098dc Examples Linux Physics Fix
According to Man Pages, timespec with std=c99 needs "_POSIX_C_SOURCE 199309L". Due a some kind of bug, "#define _POSIX_C_SOURCE 199309L" doesn't work, so we must use "-D_POSIX_C_SOURCE=199309L" in compiler options.
2017-02-23 17:13:57 +01:00
Ray San
d8c19be047 Review .html typo 2017-02-23 16:45:18 +01:00
Ray
e54c8ecdf8 Merge pull request #229 from OdnetninI/develop
Fixed examples link
2017-02-23 16:38:58 +01:00
OdnetninI
34e791376d Fixed examples link
Last character 'l' was missing on examples link.
2017-02-23 16:32:19 +01:00
Ray
05cff44d0a Improved modules description -IN PROGRESS-
Working in modules configuration flags...
2017-02-16 00:50:02 +01:00
Ray
1c364cc507 Review rres loading to support multiple parts 2017-02-16 00:19:30 +01:00
Ray
177af272f0 Added function DrawRectanglePro() 2017-02-16 00:19:03 +01:00
raysan5
4cb3e4a240 Support resources divided in multiple parts
Every part is a resource itself, they are loaded in an array
2017-02-15 10:44:59 +01:00
raysan5
05f039f85f Corrected issue with OpenAL being 'keg only' on OSX
Also reviewed issue with stdbool when compiling with clang
2017-02-11 23:34:41 +01:00
raysan5
afcd748fdf Reviewed fread() usage around the code 2017-02-11 23:17:56 +01:00
Ray
b4988777ef [audio] Renamed variable 2017-02-09 22:19:48 +01:00
Ray
f8d94aeba5 Merge pull request #224 from raysan5/develop
Integrate develop branch
2017-02-09 18:25:16 +01:00
Ray San
42d5e3bd24 [web] Added new social networks
Replaced tabs by spaces
2017-02-09 18:13:23 +01:00
Ray San
836c1636a2 Remove lighting system from rlgl standalone header 2017-02-08 20:02:40 +01:00
Ray
9492901133 Merge pull request #223 from raysan5/develop
Integrate develop branch into master
2017-02-07 09:40:06 +01:00
Ray San
1f6eb1fc61 Moved raylib webpage to docs folder
raylib webpage has been completely reorganized and moved from gh-pages
(a pain to work with) to docs folder. Useless libs have been removed,
webs have been renamed, etc.

Now it would be easier (hopefully) to update webpage. :)
2017-02-06 18:48:56 +01:00
Ray
f2f05a734d Added audio function: SetMusicLoopCount()
Useful to set number of repeats for a music, needs to be tested...
2017-02-06 01:03:58 +01:00
Ray
ac6b4d3830 Added audio function: SetMasterVolume() 2017-02-06 00:44:54 +01:00
Ray
734776b923 Commented code for review 2017-02-06 00:44:21 +01:00
raysan5
7bf6a712cc Remove rlua from raylib main repo
Moved to own repo at https://github.com/raysan5/raylib-lua
2017-02-05 03:15:43 +01:00
raysan5
c4bd214cf0 Added function SetWindowIcon()
Only DESKTOP platforms (Windows, Linus, OSX)
2017-02-05 03:00:35 +01:00
raysan5
1a879ba08e Refactor SpriteFont struct
Now it uses CharInfo data, this way, it's better aligned with the future
RRES file format data layout for sprite font characters.
2017-02-05 02:59:39 +01:00
Ray
a08117155d Init memory for screenshot to zero 2017-02-01 00:28:28 +01:00
Ray
495108a2e9 Updated raylib version to 1.7
Preparing for next version... still some work left... :P
2017-01-29 23:08:19 +01:00
Ray
30bb24aa6e Updated Gestures enum 2017-01-29 22:29:54 +01:00
Ray
c85dfd4bc6 Remove unecessary spaces... 2017-01-28 23:02:30 +01:00
Ray
b681e8c277 Implemented Wait()
Now program is halted (OS signal call) for required amount of time every
frame, so CPU usage drops to zero, instead of using a busy wait loop.
2017-01-28 00:56:45 +01:00
Ray
37a64df7b9 Move lighting system out of raylib
Lighting is implemented as a raylib example now
2017-01-27 23:03:08 +01:00
Ray
7b5f61ddf7 Merge pull request #218 from gen2brain/develop
Integrate Android build into Makefile
2017-01-26 22:25:41 +01:00
Milan Nikolic
a1527f5620 Fix RPi build and add missing directories 2017-01-26 21:49:18 +01:00
Milan Nikolic
3c3a9318ff Integrate Android build into Makefile 2017-01-26 20:58:00 +01:00
Ray
d8edcafe5a Wait for events when window is minimized...
...instead of keep polling
2017-01-25 11:38:15 +01:00
Ray
ff7108389b Updated some code... for perfect transition 2017-01-25 00:44:04 +01:00
Ray San
8a549c3fbe Working in some bugs and screen transition
Detected a VERY weird code behaviour... :(
2017-01-24 12:14:15 +01:00
Ray
825eab37e2 Revert unneeded change 2017-01-24 00:32:16 +01:00
Ray
762d2580cd Some code improvements
Render wave in a render target
Implemented combo system
Removed big useless audio (fxWave)
2017-01-22 17:23:04 +01:00
Ray
f164ec80d6 Upload wave collector - GGJ17 game 2017-01-22 15:31:56 +01:00
Ray
7586031410 Support 32bit wav data 2017-01-19 13:18:04 +01:00
Ray
7cd24d2706 Updated stb external libraries 2017-01-18 23:27:41 +01:00
Ray San
3b120bd7d9 Some tweaks for consistency 2017-01-18 19:14:39 +01:00
Ray San
fc7d4cef18 Stop sound source before unloading 2017-01-18 17:25:25 +01:00
Ray San
46f95a730a Corrected bug on OGG sound loading 2017-01-18 17:04:20 +01:00
raysan5
6d6659205c Add support for 32-bit PCM sample data 2017-01-15 01:25:09 +01:00
raysan5
53457e4664 Work on rres file format -IN PROGRESS- 2017-01-15 01:11:38 +01:00
raysan5
e5a2def57f Code formatting 2017-01-15 01:10:34 +01:00
raysan5
61f6b0f707 Removed GetNextPOT(), review TraceLog() 2017-01-15 01:10:23 +01:00
raysan5
4a158d972d Added LoadText() function
Actually, renamed ReadTextFile() from rlgl and make it public
2017-01-15 01:09:15 +01:00
Ray
4ea8494f3e Merge pull request #216 from AudioMorphology/develop
modified:   core.c
2017-01-14 20:25:07 +01:00
AudioMorphology
07a2c00e84 modified: core.c 2017-01-14 16:18:06 +00:00
raysan5
1ca445a9b9 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-01-07 18:13:39 +01:00
raysan5
fbda9c4180 Support rRES data loading 2017-01-07 18:12:59 +01:00
Ray
9b334dcd25 Merge pull request #214 from AudioMorphology/develop
Added RPi Touchscreen device event reader
2017-01-05 23:07:43 +01:00
Richard R. Goodwin
21181f8167 added RPi touch interface 2017-01-05 21:36:40 +00:00
Richard R. Goodwin
d4f5c4e133 modified: src/core.c 2017-01-05 21:20:28 +00:00
raysan5
658c280669 Lattest PR review
Function names, code formatting...
2017-01-05 19:33:05 +01:00
Ray
0369bb4c8c Merge pull request #212 from joeld42/jbd_picking
Raycast Picking Utilities
2017-01-05 17:33:23 +01:00
Joel Davis
d5d391faaf Added RaycastMesh function and example test case 2017-01-02 21:56:25 -08:00
Ray
81388363fa Merge pull request #211 from joeld42/rlgl-updatemesh-fix
Fix vbo indices for rlglUpdateMesh
2017-01-02 13:23:11 +01:00
Joel Davis
037da8879a Added RaycastGround and ray picking example 2016-12-31 15:06:39 -08:00
Joel Davis
674ee2cf75 Fix vbo indexes for rlglUpdateMesh 2016-12-31 14:05:30 -08:00
raysan5
202f45415c rRES raylib resources custom file format support
First version of custom raylib resources file format -IN DEVELOPMENT-
2016-12-27 17:42:22 +01:00
raysan5
bf3a213e44 Some functions review and additions
- Improved ImageCopy() to support compressed formats
- Renaming file-formats header structs for consistency
- Review variables naming on ImageDither() for consistency
- Improved LoadImagePro() to make a copy of data
- Preliminary support of rRES file format on LoadImage()
2016-12-27 17:40:59 +01:00
raysan5
e7464d5fc3 Review some formatting and naming
- Renamed WritePNG() to SavePNG() for consistency with other file
loading functions
- Renamed WriteBitmap() to SaveBMP() for consistency with other file
loading functions
- Redesigned SaveBMP() to use stb_image_write
2016-12-27 17:37:35 +01:00
raysan5
3c91dc099d Added some comments to sample
Some work still required...
2016-12-26 11:46:07 +01:00
raysan5
5da815234c Improved FLAC audio support 2016-12-26 10:52:57 +01:00
raysan5
a27be5f2a9 Added support for gamepads on PLATFORM_WEB
Feature NOT TESTED yet...
2016-12-25 20:42:22 +01:00
raysan5
14cdd7fbff Added raw image file reading data check 2016-12-25 20:41:36 +01:00
raysan5
852f3d4fd0 Review comments and formatting 2016-12-25 02:01:13 +01:00
raysan5
6d6c542a1d Review some functions for consistency
Removed: LoadTextureEx()
Added: LoadImagePro()
2016-12-25 02:00:36 +01:00
raysan5
d8bf84f118 Added mesh loading functions 2016-12-25 01:59:23 +01:00
raysan5
5de597579f Complete review of audio module 2016-12-25 01:58:56 +01:00
Ray
4419ee9802 Merge pull request #210 from ficoos/fixes
Fixes
2016-12-22 11:47:59 +01:00
Saggi Mizrahi
aaea2eb9a6 Fix building audio_standalone example on linux
Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
2016-12-22 03:27:02 +02:00
Saggi Mizrahi
1aa775eca8 Fix physac.h building on linux
Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
2016-12-22 03:26:54 +02:00
Saggi Mizrahi
b2d4cd66a7 Fix warnings in lua binding
Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
2016-12-22 03:26:46 +02:00
Saggi Mizrahi
c394708c43 Change UpdateSound() to accept const void *
The function means to accept a const * so let's declare it.
Will allow passing const buffers in games.
Also constness is next to godliness!

Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
2016-12-22 03:25:42 +02:00
Saggi Mizrahi
5df10d824c Fix bad call to oculus API
Missing passing of &camera

Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
2016-12-22 03:25:28 +02:00
Ray
060d501cd1 Update to ignore Linux binaries (no extension) 2016-12-21 00:04:44 +01:00
Ray
4a9b77dd70 Corrected bug sound playing twice
Samples count was not properly calculated on WAV loading
2016-12-20 00:33:45 +01:00
Ray
814507906f Improving rRES custom format support -IN PROGRESS-
Start removing old rRES functions.
2016-12-17 19:05:40 +01:00
Ray
673ea62b27 Merge pull request #206 from joeld42/jbd_bugfix
Added SetupViewport so high-DPI fix applies to EndTextureMode
2016-12-15 22:42:31 +01:00
Joel Davis
06b8727d70 Moved viewport code into SetupViewport so high-DPI fix can be applied to EndTextureMode 2016-12-14 23:58:15 -08:00
Ray
d5c0f9d386 Replaced log2() function by equivalent
log2() is not available in some standard C library implementations
2016-12-09 10:15:44 +01:00
Ray
377dcb025f Corrected some warnings 2016-12-05 01:14:18 +01:00
Ray
ab9f5d5780 Corrected path slash separator 2016-11-26 11:12:31 +01:00
Ray
f5d792e551 Update Lua naming
Replaced LUA by Lua
2016-11-25 22:26:36 +01:00
Ray
d91ad4e2aa Update README.md 2016-11-25 01:47:30 +01:00
Ray
177c58d23a Update README.md
Added some missing contributors...
2016-11-25 01:46:51 +01:00
Ray
b9310f7d3a Updated background color 2016-11-24 22:41:26 +01:00
raysan5
46ce30a2eb Corrected bugs for OpenGL 1.1 backend 2016-11-24 19:02:34 +01:00
raysan5
44e21d84cd Remove useless file 2016-11-24 19:02:15 +01:00
755 changed files with 124749 additions and 48291 deletions

75
.gitignore vendored
View File

@@ -3,13 +3,8 @@
# Ignore VIM's backup generated files
*.swp
# Ignore Android generated files and folders
src_android/obj/
templates/android_project/bin/
templates/android_project/obj/
templates/android_project/libs/
local.properties
*.swo
*~
# Ignore thumbnails created by windows
Thumbs.db
@@ -40,6 +35,7 @@ Thumbs.db
*.sbr
*.sdf
obj/
[R]elease/
[Rr]elease.win32/
_ReSharper*/
[Tt]est[Rr]esult*
@@ -51,6 +47,28 @@ ipch/
*.exe
!tools/rREM/rrem.exe
# Ignore all examples files
examples/*
# Unignore all examples dirs
!examples/*/
# Unignore all examples files with extension
!examples/*.c
!examples/*.lua
!examples/*.png
# Unignore examples Makefile
!examples/Makefile
# Ignore all games files
games/*
# Unignore all games dirs
!games/*/
# Unignore all games files with extension
!games/*.c
!games/*.lua
!games/*.png
# Unignore games makefile
!games/Makefile
# Ignore files build by xcode
*.mode*v*
*.pbxuser
@@ -64,18 +82,10 @@ xcschememanagement.plist
._.*
xcuserdata/
DerivedData/
*.dll
src/libraylib.a
src/libraylib.bc
# oculus example
!examples/oculus_glfw_sample/
# external libraries DLLs
!src/external/glfw3/lib/win32/glfw3.dll
!src/external/openal_soft/lib/win32/OpenAL32.dll
!src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll
!src/external/pthread/lib/pthreadGC2.dll
# Visual Studio project
project/vs2015/*.db
@@ -88,3 +98,38 @@ project/vs2015/*.opendb
!project/vs2015/external/openal_soft/lib/win64/OpenAL32.dll
!project/vs2015/external/lua/lib/win32/lua53.dll
# Web examples
docs/examples/web/*.html
docs/examples/web/*/*.html
!docs/examples/web/loader.html
!docs/examples/web/core/loader.html
!docs/examples/web/shapes/loader.html
!docs/examples/web/text/loader.html
!docs/examples/web/textures/loader.html
!docs/examples/web/audio/loader.html
!docs/examples/web/physac/loader.html
!docs/examples/web/shaders/loader.html
!docs/examples/web/models/loader.html
# Meson build system
builddir/
# CMake stuff
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
build
!templates/android_project/Makefile
# Unignore These makefiles...
!examples/CMakeLists.txt
!games/CMakeLists.txt
# Ignore Android generated files and folders
templates/android_project/output

50
.travis.yml Normal file
View File

@@ -0,0 +1,50 @@
language: c
sudo: required
dist: trusty
git:
depth: 3
os:
- osx
- linux
env:
global:
- VERBOSE=1
matrix:
- CFLAGS=-m64
- CFLAGS=-m32
before_script:
- export CFLAGS="-std=gnu99 $CFLAGS"
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get install -y gcc-multilib
libopenal-dev
libxcursor-dev libxinerama-dev
mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev;
wget 'https://github.com/a3f/GLFW-3.2.1-Debian-binary-package/releases/download/v3.2.1/GLFW-3.2.1-Linux.deb' && sudo dpkg -i GLFW-3.2.1-Linux.deb;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew install glfw; fi
- "$CC --version"
script:
- mkdir build
- cd build
- cmake -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF ..
- make
# - make package
# - sudo make install
#
#deploy:
# provider: releases
# api_key:
# secure: XXX
# file_glob: true
# file: raylib-*.tar.gz
# skip_cleanup: true
# on:
# branch: master
# tags: true

196
CHANGELOG
View File

@@ -1,7 +1,193 @@
changelog
---------
Current Release: raylib 1.6.0 (20 November 2016)
Current Release: raylib 1.8.0 (Oct 2017)
-----------------------------------------------
Release: raylib 1.8.0 (Oct 2017)
-----------------------------------------------
NOTE:
In this release, multiple parts of the library have been reviewed (again) for consistency and simplification.
It exposes more than 30 new functions in comparison with previous version and it improves overall programming experience.
BIG CHANGES:
- New Image generation functions: Gradient, Checked, Noise, Cellular...
- New Mesh generation functions: Cube, Sphere, Cylinder, Torus, Knot...
- New Shaders and Materials systems to support PBR materials
- Custom Android APK build pipeline with simple Makefile
- Complete review of rlgl layer functionality
- Complete review of raymath functionality
detailed changes:
[rlgl] RENAMED: rlglLoadTexture() to rlLoadTexture()
[rlgl] RENAMED: rlglLoadRenderTexture() to rlLoadRenderTexture()
[rlgl] RENAMED: rlglUpdateTexture() to rlUpdateTexture()
[rlgl] RENAMED: rlglGenerateMipmaps() to rlGenerateMipmaps()
[rlgl] RENAMED: rlglReadScreenPixels() to rlReadScreenPixels()
[rlgl] RENAMED: rlglReadTexturePixels() to rlReadTexturePixels()
[rlgl] RENAMED: rlglLoadMesh() to rlLoadMesh()
[rlgl] RENAMED: rlglUpdateMesh() to rlUpdateMesh()
[rlgl] RENAMED: rlglDrawMesh() to rlDrawMesh()
[rlgl] RENAMED: rlglUnloadMesh() to rlUnloadMesh()
[rlgl] RENAMED: rlglUnproject() to rlUnproject()
[rlgl] RENAMED: LoadCompressedTexture() to LoadTextureCompressed()
[rlgl] RENAMED: GetDefaultTexture() to GetTextureDefault()
[rlgl] RENAMED: LoadDefaultShader() to LoadShaderDefault()
[rlgl] RENAMED: LoadDefaultShaderLocations() to SetShaderDefaultLocations()
[rlgl] RENAMED: UnloadDefaultShader() to UnLoadShaderDefault()
[rlgl] ADDED: rlGenMapCubemap(), Generate cubemap texture map from HDR texture
[rlgl] ADDED: rlGenMapIrradiance(), Generate irradiance texture map
[rlgl] ADDED: rlGenMapPrefilter(), Generate prefilter texture map
[rlgl] ADDED: rlGenMapBRDF(), Generate BRDF texture map
[rlgl] ADDED: GetVrDeviceInfo(), Get VR device information for some standard devices
[rlgl] REVIEWED: InitVrSimulator(), to accept device parameters as input
[core] ADDED: SetWindowTitle(), Set title for window (only PLATFORM_DESKTOP)
[core] ADDED: GetExtension(), Get file extension
[shapes] REMOVED: DrawRectangleGradient(), replaced by DrawRectangleGradientV() and DrawRectangleGradientH()
[shapes] ADDED: DrawRectangleGradientV(), Draw a vertical-gradient-filled rectangle
[shapes] ADDED: DrawRectangleGradientH(), Draw a horizontal-gradient-filled rectangle
[shapes] ADDED: DrawRectangleGradientEx(), Draw a gradient-filled rectangle with custom vertex colors
[shapes] ADDED: DrawRectangleT(), Draw rectangle using text character
[textures] ADDED: SaveImageAs(), Save image as PNG file
[textures] ADDED: GenImageGradientV(), Generate image: vertical gradient
[textures] ADDED: GenImageGradientH(), Generate image: horizontal gradient
[textures] ADDED: GenImageGradientRadial(), Generate image: radial gradient
[textures] ADDED: GenImageChecked(), Generate image: checked
[textures] ADDED: GenImageWhiteNoise(), Generate image: white noise
[textures] ADDED: GenImagePerlinNoise(), Generate image: perlin noise
[textures] ADDED: GenImageCellular(), Generate image: cellular algorithm. Bigger tileSize means bigger cells
[textures] ADDED: GenTextureCubemap(), Generate cubemap texture from HDR texture
[textures] ADDED: GenTextureIrradiance(), Generate irradiance texture using cubemap data
[textures] ADDED: GenTexturePrefilter(), Generate prefilter texture using cubemap data
[textures] ADDED: GenTextureBRDF(), Generate BRDF texture using cubemap data
[models] REMOVED: LoadMeshEx(), Mesh struct variables can be directly accessed
[models] REMOVED: UpdateMesh(), very ineficient
[models] REMOVED: LoadHeightmap(), use GenMeshHeightmap() and LoadModelFromMesh()
[models] REMOVED: LoadCubicmap(), use GenMeshCubicmap() and LoadModelFromMesh()
[models] RENAMED: LoadDefaultMaterial() to LoadMaterialDefault()
[models] ADDED: GenMeshPlane(), Generate plane mesh (with subdivisions)
[models] ADDED: GenMeshCube(), Generate cuboid mesh
[models] ADDED: GenMeshSphere(), Generate sphere mesh (standard sphere)
[models] ADDED: GenMeshHemiSphere(), Generate half-sphere mesh (no bottom cap)
[models] ADDED: GenMeshCylinder(), Generate cylinder mesh
[models] ADDED: GenMeshTorus(), Generate torus mesh
[models] ADDED: GenMeshKnot(), Generate trefoil knot mesh
[models] ADDED: GenMeshHeightmap(), Generate heightmap mesh from image data
[models] ADDED: GenMeshCubicmap(), Generate cubes-based map mesh from image data
[raymath] REVIEWED: full Matrix functionality to align with GLM in usage
[raymath] RENAMED: Vector3 functions for consistency: Vector*() renamed to Vector3*()
[build] Integrate Android APK building into examples Makefile
[build] Integrate Android APK building into templates Makefiles
[build] Improved Visual Studio 2015 project, folders, references...
[templates] Reviewed the full pack to support Android building
[examples] Reviewed full collection to adapt to raylib changes
[examples] [textures] ADDED: textures_image_generation
[examples] [models] ADDED: models_mesh_generation
[examples] [models] ADDED: models_material_pbr
[examples] [models] ADDED: models_skybox
[examples] [models] ADDED: models_yaw_pitch_roll
[examples] [others] REVIEWED: rlgl_standalone
[examples] [others] REVIEWED: audio_standalone
[github] Moved raylib webpage to own repo: github.com/raysan5/raylib.com
[games] Reviewed game: Koala Seasons
[*] Updated STB libraries to latest version
[*] Multiple bugs corrected (check github issues)
-----------------------------------------------
Release: raylib 1.7.0 (20 May 2017)
-----------------------------------------------
NOTE:
In this new raylib release, multiple parts of the library have been reviewed for consistency and simplification.
It exposes almost 300 functions, around 30 new functions in comparison with previous version and, again,
it sets a stepping stone towards raylib future.
BIG changes:
- More than 30 new functions added to the library, check list below.
- Support of configuration flags on every raylib module, to customize library build.
- Improved build system for all supported platforms with a unique Makefile to compile sources.
- Complete review of examples and sample games, added new sample material.
- Support automatic GIF recording of current window, just pressing Ctrl+F12
- Improved library consistency and organization in general.
other changes:
[core] Added function: SetWindowIcon(), to setup icon by code
[core] Added function: SetWindowMonitor(), to set current display monitor
[core] Added function: SetWindowMinSize(), to set minimum resize size
[core] Added function: TakeScreenshot(), made public to API (also launched internally with F12)
[core] Added function: GetDirectoryPath(), get directory for a given fileName (with path)
[core] Added function: GetWorkingDirectory(), get current working directory
[core] Added function: ChangeDirectory(), change working directory
[core] Added function: TraceLog(), made public to API
[core] Improved timming system to avoid busy wait loop on frame sync: Wait()
[core] Added support for gamepad on HTML5 platform
[core] Support mouse lock, useful for camera system
[core] Review functions description comments
[rlgl] Removed function: GetStandardShader(), removed internal standard shader
[rlgl] Removed function: CreateLight(), removed internal lighting system
[rlgl] Removed function: DestroyLight(), removed internal lighting system
[rlgl] Removed function: InitVrDevice(), removed VR device render, using simulator
[rlgl] Removed function: CloseVrDevice(), removed VR device render, using simulator
[rlgl] Removed function: IsVrDeviceReady(), removed VR device render, using simulator
[rlgl] Removed function: IsVrSimulator(), removed VR device render, using simulator
[rlgl] Added function: InitVrSimulator(), init VR simulator for selected device
[rlgl] Added function: CloseVrSimulator(), close VR simulator for current device
[rlgl] Added function: IsVrSimulatorReady(), detect if VR device is ready
[rlgl] Added function: BeginVrDrawing(), begin VR simulator stereo rendering
[rlgl] Added function: EndVrDrawing(), end VR simulator stereo rendering
[rlgl] Renamed function: ReadTextFile() to LoadText() and exposed to API
[rlgl] Removed internal lighting system and standard shader, moved to example
[rlgl] Removed Oculus Rift support, moved to oculus_rift example
[rlgl] Removed VR device support and replaced by VR simulator
[shapes] Added function: DrawLineEx(), draw line with QUADS, supports custom line thick
[shapes] Added function: DrawLineBezier(), draw a line using cubic-bezier curves in-out
[shapes] Added function: DrawRectanglePro(), draw a color-filled rectangle with pro parameters
[textures] Removed function: LoadImageFromRES(), redesigning custom RRES fileformat
[textures] Removed function: LoadTextureFromRES(), redesigning custom RRES fileformat
[textures] Removed function: LoadTextureEx(), use instead Image -> LoadImagePro(), LoadImageEx()
[textures] Added function: LoadImagePro()), load image from raw data with parameters
[textures] Review TraceLog() message when image file not found
[text] Renamed function: LoadSpriteFontTTF() to LoadSpriteFontEx(), for consistency
[text] Removed rBMF fileformat support, replaced by .png
[text] Refactor SpriteFont struct (better for rres custom fileformat)
[text] Renamed some variables for consistency
[models] Added function: LoadMesh(), load mesh from file
[models] Added function: LoadMeshEx(), load mesh from vertex data
[models] Added function: UnloadMesh(), unload mesh from memory (RAM and/or VRAM)
[models] Added function: GetCollisionRayMesh(), get collision info between ray and mesh
[models] Added function: GetCollisionRayTriangle(), get collision info between ray and triangle
[models] Added function: GetCollisionRayGround(), get collision info between ray and ground plane
[models] Renamed function: LoadModelEx() to LoadModelFromMesh()
[models] Removed function: DrawLight(), removed internal lighting system
[models] Renamed function: LoadModelEx() to LoadModelFromMesh() for consistency
[models] Removed function: LoadStandardMaterial(), removed internal standard shader
[models] Removed function: LoadModelFromRES(), redesigning custom RRES fileformat
[models] Renamed multiple variables for consistency
[audio] Added function: SetMasterVolume(), define listener volume
[audio] Added function: ResumeSound(), resume a paused sound
[audio] Added function: SetMusicLoopCount(), set number of repeats for a music
[audio] Added function: LoadWaveEx(), load wave from raw audio data
[audio] Added function: WaveCrop(), crop wave audio data
[audio] Added function: WaveFormat(), format audio data
[audio] Removed function: LoadSoundFromRES(), redesigning custom RRES fileformat
[audio] Added support for 32bit audio samples
[audio] Preliminary support for multichannel, limited to mono and stereo
[audio] Make sure buffers are ready for update: UpdateMusicStream()
[utils] Replaced function: GetExtension() by IsFileExtension() and made public to API
[utils] Unified function: TraceLog() between Android and other platforms
[utils] Removed internal function: GetNextPOT(), simplified implementation
[raymath] Added function: QuaternionToEuler(), to work with Euler angles
[raymath] Added function: QuaternionFromEuler(), to work with Euler angles
[raymath] Added multiple Vector2 math functions
[build] Integrate Android source building into Makefile
[example] Added example: shapes_lines_bezier
[example] Added example: text_input_box
[github] Moved gh-pages branch to master/docs
[github] Moved rlua.h and Lua examples to own repo: raylib-lua
[games] Reviewed full games collection
[games] New game added to collection: Koala Seasons
[*] Reviewed and improved examples collection (new assets)
[*] Reorganized library functions, structs, enums
[*] Updated STB libraries to latest version
-----------------------------------------------
Release: raylib 1.6.0 (20 November 2016)
@@ -11,11 +197,11 @@ NOTE:
It includes some interesting new features and is a stepping stone towards raylib future.
HUGE changes:
[rlua] LUA BINDING: Complete raylib LUA binding, ALL raylib functions ported to LUA plus the +60 code examples.
[rlua] Lua BINDING: Complete raylib Lua binding, ALL raylib functions ported to Lua plus the +60 code examples.
[audio] COMPLETE REDESIGN: Improved music support and also raw audio data processing and playing, +20 new functions added.
[physac] COMPLETE REWRITE: Improved performance, functionality and simplified usage, moved to own repository and added multiple examples!
Other changes:
other changes:
[core] Corrected issue on OSX with HighDPI display
[core] Added flag to allow resizable window
@@ -166,6 +352,7 @@ BIG changes:
[physac] NEW MODULE: Basic 2D physics support, use colliders and rigidbodies; apply forces to physic objects.
other changes:
[rlgl] Removed GLEW library dependency, now using GLAD
[rlgl] Implemented alternative to glGetTexImage() on OpenGL ES
[rlgl] Using depth data on batch drawing
@@ -204,7 +391,8 @@ BIG changes:
[gestures] NEW MODULE: Gestures system for Android and HTML5 platforms
[raygui] NEW MODULE: Set of IMGUI elements for tools development (experimental)
smaller changes:
other changes:
[rlgl] Added check for OpenGL supported extensions
[rlgl] Added function SetBlenMode() to select some predefined blending modes
[core] Added support for drop&drag of external files into running program

16
CMakeLists.txt Normal file
View File

@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.0)
# Config options
set(BUILD_EXAMPLES ON CACHE BOOL "Build the examples.")
set(BUILD_GAMES ON CACHE BOOL "Build the example games.")
add_subdirectory(src release)
if (${BUILD_EXAMPLES})
add_subdirectory(examples)
endif()
if (${BUILD_GAMES})
add_subdirectory(games)
endif()

35
CONTRIBUTORS.md Normal file
View File

@@ -0,0 +1,35 @@
I believe that time is the most valuable resource and the following people have invested part of their time
contributing (in some way or another) to make raylib project better. Huge thanks!
- [Zopokx](https://github.com/Zopokx) for testing the web.
- [Elendow](http://www.elendow.com) for testing and helping on web development.
- Victor Dual for implementing and testing 3D shapes functions.
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
- Kevin Gato for improving texture internal formats support and helping on raygui development.
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler).
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games.
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
- [Marcelo Paez](https://github.com/paezao) for his help on OSX to solve High DPI display issue. Thanks Marcelo!
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for his amazing contribution with raylib Lua module, I just work over his code to implement [rlua](https://github.com/raysan5/raylib/blob/master/src/rlua.h)
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for his improvements on OBJ object loading.
- [RDR8](https://github.com/RDR8) for helping with Linux build improvements
- [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system
- [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building
- [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c)
- [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support
- [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain
- [Michael Vetter](https://github.com/jubalh) for improvements on build system and adding meson support for Linux
- [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions and some fixes
- [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem
Please, if I forget someone in this list, excuse me and write me an email to remind me to add you!

View File

@@ -8,12 +8,12 @@ The following help is highly appreciated:
- C programming - Can you write / review / test / improve the code?
- Documentation / Tutorials / Example writters - Can you write some tutorial / example?
- Web Development - Can you help with the web? Can you setup a forum?
- Web Development - Can you help with the web? SEO, style, code writting: https://github.com/raysan5/raylib.com
- Porting to Linux, OSX, RaspberryPi, consoles... - Can you compile and test raylib on another systems?
- Testers of current features and multiple systems - Can you find some bug on raylib?
If you can not help on any of the above points but you still want to contribute in some way... please, consider helping
with a small [donation](http://www.raylib.com/helpme.htm) or contributing with [raylib patreon](https://www.patreon.com/raysan5). It will really motivate to continue improving this project (and pay some bills… or some coffee).
with a small [donation](http://www.raylib.com/helpme.html) or contributing with [raylib patreon](https://www.patreon.com/raysan5). It will really motivate to continue improving this project...
raylib philosophy
------------------
@@ -34,4 +34,4 @@ contact
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
* Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5)
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"

204
HISTORY.md Normal file
View File

@@ -0,0 +1,204 @@
<img src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
history
-------
I've developed videogames for some years and 4 years ago I started teaching videogames development
to young people with artistic profile, most of them had never written a single line of code.
I started with C language basis and, after searching for the most simple and easy-to-use library to teach
videogames programming, I found WinBGI; it was great and it worked very well with students, in just a
couple of weeks that people that had never written a single line of code were able to program (and understand)
a simple PONG and some of them even a BREAKOUT!
But WinBGI was not the clearer and most organized lib. There were a lot of things I found useless and
confusing and some function names were not clear enough for most of the students; not to mention points
like no transparencies support or no hardware acceleration.
So, I decided to create my own lib, hardware accelerated, clear function names, quite organized, well structured,
plain C coding and, the most important, primarily intended to LEARN videogames programming.
I've coded quite a lot in C# and XNA and I really love it (in fact, my students learn C# after C),
so, I decided to use C# language notation and XNA naming conventions. That way, students can jump from
raylib to XNA, MonoGame or similar libs extremely easily.
raylib started as a weekend project and after three months of hard work, raylib 1.0 was published on November 2013.
Enjoy it.
notes on raylib 1.1
-------------------
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a
complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style
immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes
a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the
support of DDS texture files (compressed and uncompressed) along with mipmaps support.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
notes on raylib 1.2
-------------------
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a
complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the user.
On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input
system has been written from scratch.
A new display initialization system has been created to support multiple resolutions, adding black bars if required;
user only defines desired screen size and it gets properly displayed.
Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
notes on raylib 1.3
-------------------
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality,
improves tremendously textures module and also provides some new modules (camera system, gestures system, IMGUI).
Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be
attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included
in this release, check raylib/shaders folder.
Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
A brand new [camera](https://github.com/raysan5/raylib/blob/develop/src/camera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person).
Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_first_person.c).
New [gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.h) module simplifies gestures detection on Android and HTML5 programs.
[raygui](https://github.com/raysan5/raylib/blob/develop/src/raygui.h), the new IMGUI (Immediate Mode GUI) module offers a set of functions to create simple user interfaces,
primary intended for tools development. It's still in experimental state but already fully functional.
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
notes on raylib 1.4
-------------------
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version,
lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/develop/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image.
Now a basic image processing can be done before converting the image to texture for usage.
SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library).
Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
New [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) physics module for basic 2D physics support. Still in development but already functional.
Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
[raymath](https://github.com/raysan5/raylib/blob/develop/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
[gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse.
This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`).
Gamepad support has also been added (experimental).
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported).
A simple [easings](https://github.com/raysan5/raylib/blob/develop/src/easings.h) module has also been added for values animation.
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn
how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
Lots of code changes and lots of hours of hard work have concluded in this amazing new raylib 1.4.
notes on raylib 1.5
-------------------
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/develop/examples/core_oculus_rift.c).
New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/develop/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/develop/examples/core_2d_camera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/develop/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/develop/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/develop/CHANGELOG) file for a more detailed list of changes.
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/develop/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/develop/examples/audio_standalone.c) raylib modules as standalone libraries.
Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5.
notes on raylib 1.6
-------------------
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/develop/src/audio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/develop/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
[Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
notes on raylib 1.7
-------------------
On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timming improvements, public log system, rres file format support, automatic GIF recording...
And here it is another version of **raylib, a simple and easy-to-use library to learn videogames programming**. Enjoy it.
notes on raylib 1.8
-------------------
October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are:
[Procedural image generation](https://github.com/raysan5/raylib/blob/develop/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses.
[Parametric mesh generation](https://github.com/raysan5/raylib/blob/develop/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing.
PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/develop/examples/models/models_material_pbr.c) is also provided for reference.
Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/develop/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
[rlgl](https://github.com/raysan5/raylib/blob/develop/src/rlgl.c) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/develop/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions.
[raymath](https://github.com/raysan5/raylib/blob/develop/src/rlgl.c) library has been also reviewed to align with other advance math libraries like [GLM](https://github.com/g-truc/glm). Matrix math has been improved and simplified, some new Quaternion functions have been added and Vector3 functions have been renamed all around the library for consistency with new Vector2 functionality.
Additionally, as always, examples and templates have been reviewed to work with new version (some new examples have been added), all external libraries have been updated to latest stable version and latest Notepad++ and MinGW have been configured to work with new raylib. For a full list of changes, just check [CHANGELOG](CHANGELOG).
New installer provided, web updated, examples re-builded, documentation reviewed... **new raylib 1.8 published**. Enjoy coding games.

View File

@@ -27,7 +27,7 @@ applications, and to alter it and redistribute it freely, subject to the followi
fonts
------
All rBMF fonts provided with raylib are free to use (freeware) and have been designed by the following people:
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/develop/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
* Alpha Beta - Brian Kent (AEnigma)
* Setback - Brian Kent (AEnigma)
@@ -38,344 +38,12 @@ All rBMF fonts provided with raylib are free to use (freeware) and have been des
* PixelPlay - Aleksander Shevchuk
* PixAntiqua - Gerhard Großmann
2d art
------
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
3d models
---------
dwarf 3d model used in examples is created by David Moreno and licensed as Creative Commons Attribution-NonCommercial 3.0
Full license provided below:
Creative Commons Legal Code
Attribution-NonCommercial 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and
other pre-existing works, such as a translation, adaptation,
derivative work, arrangement of music or other alterations of a
literary or artistic work, or phonogram or performance and includes
cinematographic adaptations or any other form in which the Work may be
recast, transformed, or adapted including in any form recognizably
derived from the original, except that a work that constitutes a
Collection will not be considered an Adaptation for the purpose of
this License. For the avoidance of doubt, where the Work is a musical
work, performance or phonogram, the synchronization of the Work in
timed-relation with a moving image ("synching") will be considered an
Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as
encyclopedias and anthologies, or performances, phonograms or
broadcasts, or other works or subject matter other than works listed
in Section 1(f) below, which, by reason of the selection and
arrangement of their contents, constitute intellectual creations, in
which the Work is included in its entirety in unmodified form along
with one or more other contributions, each constituting separate and
independent works in themselves, which together are assembled into a
collective whole. A work that constitutes a Collection will not be
considered an Adaptation (as defined above) for the purposes of this
License.
c. "Distribute" means to make available to the public the original and
copies of the Work or Adaptation, as appropriate, through sale or
other transfer of ownership.
d. "Licensor" means the individual, individuals, entity or entities that
offer(s) the Work under the terms of this License.
e. "Original Author" means, in the case of a literary or artistic work,
the individual, individuals, entity or entities who created the Work
or if no individual or entity can be identified, the publisher; and in
addition (i) in the case of a performance the actors, singers,
musicians, dancers, and other persons who act, sing, deliver, declaim,
play in, interpret or otherwise perform literary or artistic works or
expressions of folklore; (ii) in the case of a phonogram the producer
being the person or legal entity who first fixes the sounds of a
performance or other sounds; and, (iii) in the case of broadcasts, the
organization that transmits the broadcast.
f. "Work" means the literary and/or artistic work offered under the terms
of this License including without limitation any production in the
literary, scientific and artistic domain, whatever may be the mode or
form of its expression including digital form, such as a book,
pamphlet and other writing; a lecture, address, sermon or other work
of the same nature; a dramatic or dramatico-musical work; a
choreographic work or entertainment in dumb show; a musical
composition with or without words; a cinematographic work to which are
assimilated works expressed by a process analogous to cinematography;
a work of drawing, painting, architecture, sculpture, engraving or
lithography; a photographic work to which are assimilated works
expressed by a process analogous to photography; a work of applied
art; an illustration, map, plan, sketch or three-dimensional work
relative to geography, topography, architecture or science; a
performance; a broadcast; a phonogram; a compilation of data to the
extent it is protected as a copyrightable work; or a work performed by
a variety or circus performer to the extent it is not otherwise
considered a literary or artistic work.
g. "You" means an individual or entity exercising rights under this
License who has not previously violated the terms of this License with
respect to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
violation.
h. "Publicly Perform" means to perform public recitations of the Work and
to communicate to the public those public recitations, by any means or
process, including by wire or wireless means or public digital
performances; to make available to the public Works in such a way that
members of the public may access these Works from a place and at a
place individually chosen by them; to perform the Work to the public
by any means or process and the communication to the public of the
performances of the Work, including by public digital performance; to
broadcast and rebroadcast the Work by any means including signs,
sounds or images.
i. "Reproduce" means to make copies of the Work by any means including
without limitation by sound or visual recordings and the right of
fixation and reproducing fixations of the Work, including storage of a
protected performance or phonogram in digital form or other electronic
medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more
Collections, and to Reproduce the Work as incorporated in the
Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation,
including any translation in any medium, takes reasonable steps to
clearly label, demarcate or otherwise identify that changes were made
to the original Work. For example, a translation could be marked "The
original work was translated from English to Spanish," or a
modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated
in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights in
other media and formats. Subject to Section 8(f), all rights not expressly
granted by Licensor are hereby reserved, including but not limited to the
rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the terms
of this License. You must include a copy of, or the Uniform Resource
Identifier (URI) for, this License with every copy of the Work You
Distribute or Publicly Perform. You may not offer or impose any terms
on the Work that restrict the terms of this License or the ability of
the recipient of the Work to exercise the rights granted to that
recipient under the terms of the License. You may not sublicense the
Work. You must keep intact all notices that refer to this License and
to the disclaimer of warranties with every copy of the Work You
Distribute or Publicly Perform. When You Distribute or Publicly
Perform the Work, You may not impose any effective technological
measures on the Work that restrict the ability of a recipient of the
Work from You to exercise the rights granted to that recipient under
the terms of the License. This Section 4(a) applies to the Work as
incorporated in a Collection, but this does not require the Collection
apart from the Work itself to be made subject to the terms of this
License. If You create a Collection, upon notice from any Licensor You
must, to the extent practicable, remove from the Collection any credit
as required by Section 4(c), as requested. If You create an
Adaptation, upon notice from any Licensor You must, to the extent
practicable, remove from the Adaptation any credit as required by
Section 4(c), as requested.
b. You may not exercise any of the rights granted to You in Section 3
above in any manner that is primarily intended for or directed toward
commercial advantage or private monetary compensation. The exchange of
the Work for other copyrighted works by means of digital file-sharing
or otherwise shall not be considered to be intended for or directed
toward commercial advantage or private monetary compensation, provided
there is no payment of any monetary compensation in connection with
the exchange of copyrighted works.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
Collections, You must, unless a request has been made pursuant to
Section 4(a), keep intact all copyright notices for the Work and
provide, reasonable to the medium or means You are utilizing: (i) the
name of the Original Author (or pseudonym, if applicable) if supplied,
and/or if the Original Author and/or Licensor designate another party
or parties (e.g., a sponsor institute, publishing entity, journal) for
attribution ("Attribution Parties") in Licensor's copyright notice,
terms of service or by other reasonable means, the name of such party
or parties; (ii) the title of the Work if supplied; (iii) to the
extent reasonably practicable, the URI, if any, that Licensor
specifies to be associated with the Work, unless such URI does not
refer to the copyright notice or licensing information for the Work;
and, (iv) consistent with Section 3(b), in the case of an Adaptation,
a credit identifying the use of the Work in the Adaptation (e.g.,
"French translation of the Work by Original Author," or "Screenplay
based on original Work by Original Author"). The credit required by
this Section 4(c) may be implemented in any reasonable manner;
provided, however, that in the case of a Adaptation or Collection, at
a minimum such credit will appear, if a credit for all contributing
authors of the Adaptation or Collection appears, then as part of these
credits and in a manner at least as prominent as the credits for the
other contributing authors. For the avoidance of doubt, You may only
use the credit required by this Section for the purpose of attribution
in the manner set out above and, by exercising Your rights under this
License, You may not implicitly or explicitly assert or imply any
connection with, sponsorship or endorsement by the Original Author,
Licensor and/or Attribution Parties, as appropriate, of You or Your
use of the Work, without the separate, express prior written
permission of the Original Author, Licensor and/or Attribution
Parties.
d. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme cannot be waived, the Licensor
reserves the exclusive right to collect such royalties for any
exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme can be waived, the Licensor reserves
the exclusive right to collect such royalties for any exercise by
You of the rights granted under this License if Your exercise of
such rights is for a purpose or use which is otherwise than
noncommercial as permitted under Section 4(b) and otherwise waives
the right to collect royalties through any statutory or compulsory
licensing scheme; and,
iii. Voluntary License Schemes. The Licensor reserves the right to
collect royalties, whether individually or, in the event that the
Licensor is a member of a collecting society that administers
voluntary licensing schemes, via that society, from any exercise
by You of the rights granted under this License that is for a
purpose or use which is otherwise than noncommercial as permitted
under Section 4(c).
e. Except as otherwise agreed in writing by the Licensor or as may be
otherwise permitted by applicable law, if You Reproduce, Distribute or
Publicly Perform the Work either by itself or as part of any
Adaptations or Collections, You must not distort, mutilate, modify or
take other derogatory action in relation to the Work which would be
prejudicial to the Original Author's honor or reputation. Licensor
agrees that in those jurisdictions (e.g. Japan), in which any exercise
of the right granted in Section 3(b) of this License (the right to
make Adaptations) would be deemed to be a distortion, mutilation,
modification or other derogatory action prejudicial to the Original
Author's honor and reputation, the Licensor will waive or not assert,
as appropriate, this Section, to the fullest extent permitted by the
applicable national law, to enable You to reasonably exercise Your
right under Section 3(b) of this License (right to make Adaptations)
but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Adaptations or Collections
from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is
perpetual (for the duration of the applicable copyright in the Work).
Notwithstanding the above, Licensor reserves the right to release the
Work under different license terms or to stop distributing the Work at
any time; provided, however that any such election will not serve to
withdraw this License (or any other license that has been, or is
required to be, granted under the terms of this License), and this
License will continue in full force and effect unless terminated as
stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection,
the Licensor offers to the recipient a license to the Work on the same
terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
offers to the recipient a license to the original Work on the same
terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
the minimum extent necessary to make such provision valid and
enforceable.
d. No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in writing
and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with
respect to the Work licensed here. There are no understandings,
agreements or representations with respect to the Work not specified
here. Licensor shall not be bound by any additional provisions that
may appear in any communication from You. This License may not be
modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this
License were drafted utilizing the terminology of the Berne Convention
for the Protection of Literary and Artistic Works (as amended on
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
and the Universal Copyright Convention (as revised on July 24, 1971).
These rights and subject matter take effect in the relevant
jurisdiction in which the License terms are sought to be enforced
according to the corresponding provisions of the implementation of
those treaty provisions in the applicable national law. If the
standard suite of rights granted under applicable copyright law
includes additional rights not granted under this License, such
additional rights are deemed to be included in the License; this
License is not intended to restrict the license of any rights under
applicable law.
Creative Commons Notice
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, Creative Commons does not authorize
the use by either party of the trademark "Creative Commons" or any
related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in
compliance with Creative Commons' then-current trademark usage
guidelines, as may be published on its website or otherwise made
available upon request from time to time. For the avoidance of doubt,
this trademark restriction does not form part of the License.
Creative Commons may be contacted at https://creativecommons.org/.
[dwarf 3d model and textures](https://github.com/raysan5/raylib/tree/develop/examples/models/resources/model) have been created by David Moreno and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)

257
README.md
View File

@@ -1,239 +1,56 @@
<img src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
about
-----
raylib is a simple and easy-to-use library to learn videogames programming.
**raylib is a simple and easy-to-use library to learn videogames programming.**
raylib is highly inspired by Borland BGI graphics lib and by XNA framework.
raylib could be useful for prototyping, tools development, graphic applications, embedded systems and education.
NOTE for ADVENTURERS: raylib is a programming library to learn videogames programming;
no fancy interface, no visual helpers, no auto-debugging... just coding in the most
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.htm)
history
-------
I've developed videogames for some years and 4 years ago I started teaching videogames development
to young people with artistic profile, most of them had never written a single line of code.
I started with C language basis and, after searching for the most simple and easy-to-use library to teach
videogames programming, I found WinBGI; it was great and it worked very well with students, in just a
couple of weeks that people that had never written a single line of code were able to program (and understand)
a simple PONG and some of them even a BREAKOUT!
But WinBGI was not the clearer and most organized lib. There were a lot of things I found useless and
confusing and some function names were not clear enough for most of the students; not to mention points
like no transparencies support or no hardware acceleration.
So, I decided to create my own lib, hardware accelerated, clear function names, quite organized, well structured,
plain C coding and, the most important, primarily intended to LEARN videogames programming.
I've coded quite a lot in C# and XNA and I really love it (in fact, my students learn C# after C),
so, I decided to use C# language notation and XNA naming conventions. That way, students can jump from
raylib to XNA, MonoGame or similar libs extremely easily.
raylib started as a weekend project and after three months of hard work, raylib 1.0 was published on November 2013.
Enjoy it.
notes on raylib 1.1
-------------------
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a
complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style
immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
[rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes
a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the
support of DDS texture files (compressed and uncompressed) along with mipmaps support.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
notes on raylib 1.2
-------------------
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a
complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the user.
On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input
system has been written from scratch.
A new display initialization system has been created to support multiple resolutions, adding black bars if required;
user only defines desired screen size and it gets properly displayed.
Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
notes on raylib 1.3
-------------------
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality,
improves tremendously textures module and also provides some new modules (camera system, gestures system, IMGUI).
Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be
attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included
in this release, check raylib/shaders folder.
Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
A brand new [camera](https://github.com/raysan5/raylib/blob/develop/src/camera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person).
Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/develop/examples/core_3d_camera_first_person.c).
New [gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.h) module simplifies gestures detection on Android and HTML5 programs.
[raygui](https://github.com/raysan5/raylib/blob/develop/src/raygui.h), the new IMGUI (Immediate Mode GUI) module offers a set of functions to create simple user interfaces,
primary intended for tools development. It's still in experimental state but already fully functional.
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
notes on raylib 1.4
-------------------
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version,
lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/develop/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image.
Now a basic image processing can be done before converting the image to texture for usage.
SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library).
Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
New [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) physics module for basic 2D physics support. Still in development but already functional.
Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
[raymath](https://github.com/raysan5/raylib/blob/develop/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
[gestures](https://github.com/raysan5/raylib/blob/develop/src/gestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse.
This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`).
Gamepad support has also been added (experimental).
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported).
A simple [easings](https://github.com/raysan5/raylib/blob/develop/src/easings.h) module has also been added for values animation.
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn
how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
Lots of code changes and lots of hours of hard work have concluded in this amazing new raylib 1.4.
notes on raylib 1.5
-------------------
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/develop/examples/core_oculus_rift.c).
New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/develop/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/develop/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/develop/examples/core_2d_camera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/develop/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/develop/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/develop/CHANGELOG) file for a more detailed list of changes.
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/develop/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/develop/examples/audio_standalone.c) raylib modules as standalone libraries.
Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5.
notes on raylib 1.6
-------------------
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
Complete raylib LUA binding. All raylib functions plus the +60 code examples have been ported to LUA, now LUA users can enjoy coding videogames in LUA while using all the internal power of raylib. This addition also open the doors to LUA scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to LUA scripts while keep using raylib functionality.
Completely redesigned audio module. Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. FLAC file format support has also been added. In the same line, OpenAL Soft backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
Physac module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by @victorfisac, multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured Visual Studio C++ 2015 solution with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
[![Build Status](https://travis-ci.org/raysan5/raylib.svg?branch=develop)](https://travis-ci.org/raysan5/raylib)
features
--------
* Written in plain C code (C99)
* Uses PascalCase/camelCase notation
* Written in plain C code (C99) in PascalCase/camelCase notation
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2)
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
* Powerful fonts module with multiple SpriteFonts formats support (XNA bitmap fonts, AngelCode fonts, TTF)
* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF)
* Outstanding texture formats support, including compressed formats (DXT, ETC, PVRT, ASTC)
* Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps
* Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support
* Basic 3d support for Geometrics, Models, Billboards, Heightmaps and Cubicmaps
* Flexible Materials system, supporting classic maps and PBR maps
* Shaders support, including Model shaders and Postprocessing shaders
* Powerful math module for Vector and Matrix operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.c)
* Audio loading and playing with streaming support and mixing channels (WAV, OGG, FLAC, XM, MOD)
* Powerful math module for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
* Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
* Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5**
* VR stereo rendering support with configurable HMD device parameters
* Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi**, **HTML5** and **Oculus Rift CV1**
* Custom color palette for fancy visuals on raywhite background
* Minimal external dependencies (GLFW3, OpenGL, OpenAL)
* Complete binding to LUA
* Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go))
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option by far I found for
multiplatform (Windows, Linux, Mac) window/context and input management (clean, focused, great license, well documented, modern, ...).
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for
multiplatform (Windows, Linux, Mac) window/context and input management (clean, focused, great license, well documented, modern, maintained, ...).
raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/audio.c) module, [OpenAL Soft](http://kcat.strangesoft.net/openal.html) audio library, in multiple flavours,
to accomodate to Android, Raspberry Pi and HTML5.
On Android, raylib uses `native_app_glue module` (provided by Android NDK) and native Android libraries to manage window/context, inputs and activity cycle.
*On Android, `native_app_glue module` (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.*
On Raspberry Pi, raylib uses Videocore API and EGL for window/context management and raw inputs reading.
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
On Oculus Rift CV1, raylib uses Oculus PC SDK libraries but only the core C library ([LibOVR](https://github.com/raysan5/raylib/tree/develop/src/external/OculusSDK/LibOVR)); runtime library (LibOVRRT32_1.dll) must be linked at compilation time.
building
--------
raylib is licensed under a zlib/libpng license. View [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE.md).
tools requirements
------------------
For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
raylib has been developed using exclusively two tools:
* Notepad++ (text editor) - [http://notepad-plus-plus.org/](http://notepad-plus-plus.org/)
* MinGW (GCC compiler) - [http://www.mingw.org/](http://www.mingw.org/)
Those are the tools I recommend to develop with raylib, in fact, those are the tools my students use.
I believe those are the best tools to train spartan-programmers.
Someone could argue about debugging. raylib is a library intended for learning and I think C it's a clear enough language
to allow writing small-mid size programs with a printf-based debugging. All raylib examples have also been written this way.
Since raylib v1.1, you can download a Windows Installer package for easy installation and configuration. Check [raylib Webpage](http://www.raylib.com/)
building source (generate libraylib.a)
--------------------------------------
Check raylib wiki page: [Compile for...](https://github.com/raysan5/raylib/wiki)
building examples
-----------------
Check raylib wiki page: [Compile for...](https://github.com/raysan5/raylib/wiki)
Those are the tools recommended to develop with raylib, in fact, those are the tools my students use.
contact
-------
@@ -247,32 +64,12 @@ contact
If you are using raylib and you enjoy it, please, [let me know][raysan5].
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.htm)
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.html)
acknowledgements
---------------
license
-------
I believe that time is the most valuable resource and the following people have invested part of their time
contributing (in some way or another) to make raylib project better. Huge thanks!
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE.md) for further details.
- [Zopokx](https://github.com/Zopokx) for testing the web.
- [Elendow](http://www.elendow.com) for testing and helping on web development.
- Victor Dual for implementing and testing 3D shapes functions.
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
- Kevin Gato for improving texture internal formats support and helping on raygui development.
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
- Sergio Martinez for helping on raygui development and tools development (raygui_styler).
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing materials and lighting systems... among multiple other improvements and multiple tools and games.
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
- Marcelo Paez (paezao) for his help on OSX to solve High DPI display issue. Thanks Marcelo!
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"

View File

@@ -1,48 +1,53 @@
roadmap
-------
Current version of raylib is quite complete and functional but there is still a lot of things to add and improve.
Here it is a wish list of features I would like to add and functions to improve.
Current version of raylib is complete and functional but there is still a lot of room for improvement.
Here it is a wish-list with features and ideas to improve the library.
Note raylib source code has multiple TODO points with pending things to review and improve. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
Note that [raylib source code](https://github.com/raysan5/raylib/tree/develop/src) has some *TODO* marks around code with pending things to review and improve. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
raylib 1.x
**raylib 1.x**
- [ ] Basic GPU stats sytem (memory, draws, time...)
- [ ] Improved custom file-format (.rres) and packaging tool
- [ ] Touch-based camera controls for Android
- [ ] Quaternions-based camera system
Basic GPU stats sytem (memory, draws, time...)
Improved custom file-format (.rres) and packaging tool
Procedural image generation functions (spot, gradient, noise...)
Procedural mesh generation functions (cube, cone, sphere...)
Touch-based camera controls for Android
Gamepad support on HTML5
**raylib 1.8**
- [x] Improved Materials system with PBR support
- [x] Procedural image generation functions (spot, gradient, noise...)
- [x] Procedural mesh generation functions (cube, sphere...)
- [x] Custom Android APK build pipeline (default Makefile)
raylib 1.6
**raylib 1.7**
- [x] Support configuration flags
- [x] Improved build system for Android
- [x] Gamepad support on HTML5
[DONE] LUA scripting support (raylib lua wrapper)
[DONE] Redesigned audio module
**raylib 1.6**
- [x] Lua scripting support (raylib Lua wrapper)
- [x] Redesigned audio module
- [x] Support FLAC file format
raylib 1.5
**raylib 1.5**
- [x] Support Oculus Rift CV1 and VR stereo rendering (simulator)
- [x] Redesign Shaders/Textures system -> New Materials system
- [x] Support lighting: Omni, Directional and Spot lights
- [x] Redesign physics module (physac)
- [x] Chiptunes audio modules support
[DONE] Support Oculus Rift CV1 and VR stereo rendering (simulator)
[DONE] Redesign Shaders/Textures system -> New Materials system
[DONE] Support lighting: Omni, Directional and Spot lights
[DONE] Redesign physics module (physac)
[DONE] Chiptunes audio modules support
raylib 1.4
[DONE] TTF fonts support (using stb_truetype)
[DONE] Raycast system for 3D picking (including collisions detection)
[DONE] Floyd-Steinberg dithering on 16bit image format conversion
[DONE] Basic image manipulation functions (crop, resize, draw...)
[DONE] Storage load/save data functionality
[DONE] Add Physics module (physac)
[DONE] Remove GLEW dependency -> Replaced by GLAD
[DONE] Redesign Raspberry PI inputs system
[DONE] Redesign gestures module to be multiplatform
[DONE] Module raymath as header-only and functions inline
[DONE] Add Easings module (easings.h)
**raylib 1.4**
- [x] TTF fonts support (using stb_truetype)
- [x] Raycast system for 3D picking (including collisions detection)
- [x] Floyd-Steinberg dithering on 16bit image format conversion
- [x] Basic image manipulation functions (crop, resize, draw...)
- [x] Storage load/save data functionality
- [x] Add Physics module (physac)
- [x] Remove GLEW dependency -> Replaced by GLAD
- [x] Redesign Raspberry PI inputs system
- [x] Redesign gestures module to be multiplatform
- [x] Module raymath as header-only and functions inline
- [x] Add Easings module (easings.h)
Any feature missing? Do you have a request? [Let me know!][raysan5]
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
[isssues]: https://github.com/raysan5/raylib/issues
[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

39
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1,39 @@
# Setup the project and settings
project(examples)
include("../utils.cmake")
# Make sure raylib has been built
# TODO `build` directory should maybe be something else...
# TODO place somewhere else?
include_directories("../build/release")
# Get the sources together
set(example_dirs audio core models others physac shaders text texutures)
set(example_sources)
set(example_resources)
foreach(example_dir ${example_dirs})
# Get the .c files
file(GLOB sources ${example_dir}/*.c)
list(APPEND example_sources ${sources})
# Any any resources
file(GLOB resources ${example_dir}/resources/*)
list(APPEND example_resources ${resources})
endforeach()
# Do each example
foreach(example_source ${example_sources})
# Create the basename for the example
get_filename_component(example_name ${example_source} NAME)
string(REPLACE ".c" "" example_name ${example_name})
# Setup the example
add_executable(${example_name} ${example_source})
# Link the libraries
link_libraries_to_executable(${example_name})
endforeach()
# Copy all of the resource files to the destination
file(COPY ${example_resources} DESTINATION "resources/")

View File

@@ -1,10 +1,8 @@
#**************************************************************************************************
#
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
#
# NOTE: By default examples are compiled using raylib static library and OpenAL Soft shared library
#
# Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
@@ -23,22 +21,36 @@
#
#**************************************************************************************************
# define raylib platform to compile for
# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB
.PHONY: all clean
# Define required raylib variables
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
PLATFORM ?= PLATFORM_DESKTOP
RAYLIB_PATH ?= ..
PROJECT_NAME ?= raylib_example
# define NO to use OpenAL Soft as static library (shared by default)
SHARED_OPENAL ?= YES
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib
endif
# determine PLATFORM_OS in case PLATFORM_DESKTOP selected
# Library type used for raylib and OpenAL Soft: STATIC (.a) or SHARED (.so/.dll)
# NOTE: Libraries should be provided in the selected form
RAYLIB_LIBTYPE ?= STATIC
OPENAL_LIBTYPE ?= STATIC
# On PLATFORM_WEB force OpenAL Soft shared library
ifeq ($(PLATFORM),PLATFORM_WEB)
OPENAL_LIBTYPE = SHARED
endif
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
PLATFORM_OS=WINDOWS
LIBPATH=win32
else
UNAMEOS:=$(shell uname)
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
LIBPATH=linux
@@ -51,485 +63,275 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
endif
# define compiler: gcc for C program, define as g++ for C++
ifeq ($(PLATFORM),PLATFORM_WEB)
# define emscripten compiler
CC = emcc
else
ifeq ($(PLATFORM_OS),OSX)
# define llvm compiler for mac
CC = clang
else
# define default gcc compiler
CC = gcc
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI cross-compiler
RPI_CROSS_COMPILE ?= NO
endif
# define compiler flags:
# -O2 defines optimization level
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH = C:/emsdk
EMSCRIPTEN_VERSION = 1.37.21
CLANG_VERSION=e1.37.21_64bit
PYTHON_VERSION=2.7.5.3_64bit
NODE_VERSION=4.1.1_64bit
export PATH=$(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
endif
# Define raylib release directory for compiled library
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
endif
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
endif
ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
endif
# Define default C compiler: gcc
CC = gcc
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX)
# OSX default compiler
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES)
# RPI cross-compiler
CC = armv6j-hardfloat-linux-gnueabi-gcc
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# HTML5 emscripten compiler
CC = emcc
endif
# Define default make program: Mingw32-make
MAKE = mingw32-make
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
MAKE = make
endif
endif
# Define compiler flags:
# -O1 defines optimization level
# -Og enable debugging
# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -std=c99 use standard C from 1999 revision
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline
else
CFLAGS = -O2 -s -Wall -std=c99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources
#-s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
#-s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
endif
# -std=c99 defines C language mode (standard C from 1999 revision)
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
# -fgnu89-inline declaring inline functions support (GCC optimized)
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces
#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes
# define raylib release directory for compiled library
# Additional flags for compiler (if desired)
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
RAYLIB_PATH = ../release/win32/mingw32
endif
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_PATH = ../release/linux
endif
ifeq ($(PLATFORM_OS),OSX)
RAYLIB_PATH = ../release/osx
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
RAYLIB_PATH = ../release/html5
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH = ../release/rpi
endif
# define any directories containing required header files
INCLUDES = -I. -I../src -I../src/external -I$(RAYLIB_PATH)
ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDES += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# add standard directories for GNU/Linux
ifeq ($(PLATFORM_OS),LINUX)
INCLUDES += -I/usr/local/include/raylib/
else ifeq ($(PLATFORM_OS),WINDOWS)
# external libraries headers
# GLFW3
INCLUDES += -I../src/external/glfw3/include
# OpenAL Soft
INCLUDES += -I../src/external/openal_soft/include
endif
endif
# define library paths containing required libs
LFLAGS = -L. -L../src -L$(RAYLIB_PATH)
ifeq ($(PLATFORM),PLATFORM_RPI)
LFLAGS += -L/opt/vc/lib
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# add standard directories for GNU/Linux
ifeq ($(PLATFORM_OS),WINDOWS)
# external libraries to link with
# GLFW3
LFLAGS += -L../src/external/glfw3/lib/$(LIBPATH)
# OpenAL Soft
LFLAGS += -L../src/external/openal_soft/lib/$(LIBPATH)
endif
endif
# define any libraries to link into executable
# if you want to link libraries (libname.so or libname.a), use the -lname
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
# libraries for Debian GNU/Linux desktop compiling
# requires the following packages:
# libglfw3-dev libopenal-dev libegl1-mesa-dev
LIBS = -lraylib -lglfw3 -lGL -lopenal -lm -lpthread -ldl
# on XWindow could require also below libraries, just uncomment
#LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
else
ifeq ($(PLATFORM_OS),OSX)
# libraries for OS X 10.9 desktop compiling
# requires the following packages:
# libglfw3-dev libopenal-dev libegl1-mesa-dev
LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa
else
# libraries for Windows desktop compiling
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
LIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
# if static OpenAL Soft required, define the corresponding libs
ifeq ($(SHARED_OPENAL),NO)
LIBS += -lopenal32 -lwinmm
CFLAGS += -Wl,-allow-multiple-definition
else
LIBS += -lopenal32dll
endif
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# libraries for Raspberry Pi compiling
# NOTE: OpenAL Soft library should be installed (libopenal1 package)
LIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# just adjust the correct path to libraylib.bc
LIBS = ../release/html5/libraylib.bc
endif
# define additional parameters and flags for windows
ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window
WINFLAGS = ../src/resources -Wl,--subsystem,windows
CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows
endif
ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -no-pie -D_DEFAULT_SOURCE
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS += -std=gnu99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# -O2 # if used, also set --memory-init-file 0
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
# -s USE_PTHREADS=1 # multithreading support
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling -s TOTAL_MEMORY=16777216 --preload-file resources
endif
# Define include paths for required headers
# NOTE: Several external required libraries (stb and others)
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI requried libraries
INCLUDE_PATHS += -I/opt/vc/include
INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
endif
# Define library paths containing required libs
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -L/opt/vc/lib
endif
# Define any libraries required on linking
# if you want to link libraries (libname.so or libname.a), use the -lname
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compiling
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
LDLIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
# Define required flags and libs for OpenAL Soft STATIC/SHARED usage
# NOTE: ALLIBS flag only required for raylib Win32 SHARED library building
ifeq ($(OPENAL_LIBTYPE),STATIC)
LDLIBS += -lopenal32 -lwinmm
CFLAGS += -DAL_LIBTYPE_STATIC -Wl,-allow-multiple-definition
else
LDLIBS += -lopenal32dll
endif
# Required for physac examples
LDLIBS += -static -lpthread
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libglfw3-dev libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -lglfw3 -lGL -lopenal -lm -lpthread -ldl
# On XWindow requires also below libraries
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for OSX 10.9 desktop compiling
# NOTE: Required packages: libglfw3-dev libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -lglfw -framework OpenGL -framework OpenAL -framework Cocoa
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling
# NOTE: Required packages: libopenal1
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE)/libraylib.bc
endif
# Define output extension to generate a .html file using provided shell
ifeq ($(PLATFORM),PLATFORM_WEB)
EXT = .html
WEB_SHELL = --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
endif
# define all object files required
# Define all object files required
EXAMPLES = \
core_basic_window \
core_input_keys \
core_input_mouse \
core_mouse_wheel \
core_input_gamepad \
core_random_values \
core_color_select \
core_drop_files \
core_storage_values \
core_gestures_detection \
core_3d_mode \
core_3d_picking \
core_3d_camera_free \
core_3d_camera_first_person \
core_2d_camera \
core_world_screen \
core_oculus_rift \
shapes_logo_raylib \
shapes_basic_shapes \
shapes_colors_palette \
shapes_logo_raylib_anim \
textures_logo_raylib \
textures_image_loading \
textures_rectangle \
textures_srcrec_dstrec \
textures_to_image \
textures_raw_data \
textures_formats_loading \
textures_particles_trail_blending \
textures_image_processing \
textures_image_drawing \
text_sprite_fonts \
text_bmfont_ttf \
text_rbmf_fonts \
text_format_text \
text_font_select \
text_writing_anim \
text_ttf_loading \
text_bmfont_unordered \
models_geometric_shapes \
models_box_collisions \
models_billboard \
models_obj_loading \
models_heightmap \
models_cubicmap \
shaders_model_shader \
shaders_shapes_textures \
shaders_custom_uniform \
shaders_postprocessing \
shaders_standard_lighting \
audio_sound_loading \
audio_music_stream \
audio_module_playing \
audio_raw_stream \
physics_demo \
physics_friction \
physics_movement \
physics_restitution \
physics_shatter \
core/core_basic_window \
core/core_input_keys \
core/core_input_mouse \
core/core_mouse_wheel \
core/core_input_gamepad \
core/core_random_values \
core/core_color_select \
core/core_drop_files \
core/core_storage_values \
core/core_gestures_detection \
core/core_3d_mode \
core/core_3d_picking \
core/core_3d_camera_free \
core/core_3d_camera_first_person \
core/core_2d_camera \
core/core_world_screen \
core/core_vr_simulator \
shapes/shapes_logo_raylib \
shapes/shapes_basic_shapes \
shapes/shapes_colors_palette \
shapes/shapes_logo_raylib_anim \
shapes/shapes_lines_bezier \
textures/textures_logo_raylib \
textures/textures_image_loading \
textures/textures_rectangle \
textures/textures_srcrec_dstrec \
textures/textures_to_image \
textures/textures_raw_data \
textures/textures_particles_blending \
textures/textures_image_processing \
textures/textures_image_drawing \
textures/textures_image_generation \
text/text_sprite_fonts \
text/text_bmfont_ttf \
text/text_raylib_fonts \
text/text_format_text \
text/text_writing_anim \
text/text_ttf_loading \
text/text_bmfont_unordered \
text/text_input_box \
models/models_geometric_shapes \
models/models_box_collisions \
models/models_billboard \
models/models_obj_loading \
models/models_heightmap \
models/models_cubicmap \
models/models_mesh_picking \
models/models_mesh_generation \
models/models_yaw_pitch_roll \
models/models_material_pbr \
models/models_skybox \
shaders/shaders_model_shader \
shaders/shaders_shapes_textures \
shaders/shaders_custom_uniform \
shaders/shaders_postprocessing \
audio/audio_sound_loading \
audio/audio_music_stream \
audio/audio_module_playing \
audio/audio_raw_stream \
physac/physics_demo \
physac/physics_friction \
physac/physics_movement \
physac/physics_restitution \
physac/physics_shatter \
fix_dylib \
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
# typing 'make' will invoke the default target entry called 'all',
# in this case, the 'default' target entry is raylib
all: examples
# Default target entry
all: $(EXAMPLES)
# compile all examples
examples: $(EXAMPLES)
# compile [core] example - basic window
core_basic_window: core_basic_window.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - keyboard input
core_input_keys: core_input_keys.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - mouse input
core_input_mouse: core_input_mouse.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - mouse wheel
core_mouse_wheel: core_mouse_wheel.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - gamepad input
core_input_gamepad: core_input_gamepad.c
ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# Generic compilation pattern
# NOTE: Examples must be ready for Android compilation!
%: %.c
ifeq ($(PLATFORM),PLATFORM_ANDROID)
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
else
@echo core_input_gamepad: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
endif
# compile [core] example - generate random values
core_random_values: core_random_values.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - color selection (collision detection)
core_color_select: core_color_select.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - drop files
core_drop_files: core_drop_files.c
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
else
@echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
endif
# compile [core] example - storage values
core_storage_values: core_storage_values.c
ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
else
@echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
endif
# compile [core] example - gestures detection
core_gestures_detection: core_gestures_detection.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - 3d mode
core_3d_mode: core_3d_mode.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - 3d picking
core_3d_picking: core_3d_picking.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - 3d camera free
core_3d_camera_free: core_3d_camera_free.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - 3d camera first person
core_3d_camera_first_person: core_3d_camera_first_person.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - 2d camera
core_2d_camera: core_2d_camera.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - world screen
core_world_screen: core_world_screen.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [core] example - oculus rift
core_oculus_rift: core_oculus_rift.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shapes] example - raylib logo (with basic shapes)
shapes_logo_raylib: shapes_logo_raylib.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shapes] example - basic shapes usage (rectangle, circle, ...)
shapes_basic_shapes: shapes_basic_shapes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shapes] example - raylib color palette
shapes_colors_palette: shapes_colors_palette.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shapes] example - raylib logo animation
shapes_logo_raylib_anim: shapes_logo_raylib_anim.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - raylib logo texture loading
textures_logo_raylib: textures_logo_raylib.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - image loading and conversion to texture
textures_image_loading: textures_image_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture rectangle drawing
textures_rectangle: textures_rectangle.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture source and destination rectangles
textures_srcrec_dstrec: textures_srcrec_dstrec.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture to image
textures_to_image: textures_to_image.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture raw data
textures_raw_data: textures_raw_data.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture formats loading
textures_formats_loading: textures_formats_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture particles trail blending
textures_particles_trail_blending: textures_particles_trail_blending.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture image processing
textures_image_processing: textures_image_processing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [textures] example - texture image drawing
textures_image_drawing: textures_image_drawing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - sprite fonts loading
text_sprite_fonts: text_sprite_fonts.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - bmfonts and ttf loading
text_bmfont_ttf: text_bmfont_ttf.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - raylib bitmap fonts (rBMF)
text_rbmf_fonts: text_rbmf_fonts.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - text formatting
text_format_text: text_format_text.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - font selection program
text_font_select: text_font_select.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - text writing animation
text_writing_anim: text_writing_anim.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - text ttf loading
text_ttf_loading: text_ttf_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [text] example - text bmfont unordered
text_bmfont_unordered: text_bmfont_unordered.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - basic geometric 3d shapes
models_geometric_shapes: models_geometric_shapes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - box collisions
models_box_collisions: models_box_collisions.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - basic window
models_planes: models_planes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - billboard usage
models_billboard: models_billboard.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - OBJ model loading
models_obj_loading: models_obj_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - heightmap loading
models_heightmap: models_heightmap.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [models] example - cubesmap loading
models_cubicmap: models_cubicmap.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shaders] example - model shader
shaders_model_shader: shaders_model_shader.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shaders] example - shapes texture shader
shaders_shapes_textures: shaders_shapes_textures.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shaders] example - custom uniform in shader
shaders_custom_uniform: shaders_custom_uniform.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shaders] example - postprocessing shader
shaders_postprocessing: shaders_postprocessing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [shaders] example - standard lighting
shaders_standard_lighting: shaders_standard_lighting.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [audio] example - sound loading and playing (WAV and OGG)
audio_sound_loading: audio_sound_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [audio] example - music stream playing (OGG)
audio_music_stream: audio_music_stream.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [audio] example - module playing (XM)
audio_module_playing: audio_module_playing.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [audio] example - raw audio streaming
audio_raw_stream: audio_raw_stream.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics demo
physics_demo: physics_demo.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics friction
physics_friction: physics_friction.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics movement
physics_movement: physics_movement.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics restitution
physics_restitution: physics_restitution.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics shatter
physics_shatter: physics_shatter.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
# fix dylib install path name for each executable (MAC)
fix_dylib:
ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -print0 | xargs -t -0 -R 1 -I file install_name_tool -change libglfw.3.0.dylib ../external/glfw3/lib/osx/libglfw.3.0.dylib file
endif
# clean everything
# Clean everything
clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
del *.o *.exe /s
endif
ifeq ($(PLATFORM_OS),LINUX)
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f
endif
ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -delete
rm -f *.o
else
ifeq ($(PLATFORM_OS),LINUX)
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f
else
del *.o *.exe
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
@@ -541,7 +343,3 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
endif
@echo Cleaning done
# instead of defining every module one by one, we can define a pattern
# this pattern below will automatically compile every module defined on $(OBJS)
#%.exe : %.c
# $(CC) -o $@ $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM)

View File

@@ -52,7 +52,7 @@ int main()
circles[i].color = colors[GetRandomValue(0, 13)];
}
Music xm = LoadMusicStream("resources/audio/mini1111.xm");
Music xm = LoadMusicStream("resources/mini1111.xm");
PlayMusicStream(xm);
@@ -86,7 +86,7 @@ int main()
}
// Get timePlayed scaled to bar dimensions
timePlayed = (GetMusicTimePlayed(xm)/GetMusicTimeLength(xm)*(screenWidth - 40))*2;
timePlayed = GetMusicTimePlayed(xm)/GetMusicTimeLength(xm)*(screenWidth - 40);
// Color circles animation
for (int i = MAX_CIRCLES - 1; (i >= 0) && !pause; i--)
@@ -112,7 +112,7 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(WHITE);
ClearBackground(RAYWHITE);
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -24,7 +24,7 @@ int main()
InitAudioDevice(); // Initialize audio device
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
Music music = LoadMusicStream("resources/guitar_noodling.ogg");
PlayMusicStream(music);
@@ -58,7 +58,7 @@ int main()
}
// Get timePlayed scaled to bar dimensions (400 pixels)
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*100*4;
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*400;
//----------------------------------------------------------------------------------
// Draw

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -16,7 +16,8 @@
#include <stdlib.h> // Required for: malloc(), free()
#include <math.h> // Required for: sinf()
#define MAX_SAMPLES 20000
#define MAX_SAMPLES 22050
#define MAX_SAMPLES_PER_UPDATE 4096
int main()
{
@@ -29,21 +30,20 @@ int main()
InitAudioDevice(); // Initialize audio device
// Init raw audio stream (sample rate: 22050, sample size: 32bit-float, channels: 1-mono)
AudioStream stream = InitAudioStream(22050, 32, 1);
// Init raw audio stream (sample rate: 22050, sample size: 16bit-short, channels: 1-mono)
AudioStream stream = InitAudioStream(22050, 16, 1);
// Fill audio stream with some samples (sine wave)
float *data = (float *)malloc(sizeof(float)*MAX_SAMPLES);
// Generate samples data from sine wave
short *data = (short *)malloc(sizeof(short)*MAX_SAMPLES);
// TODO: Review data generation, it seems data is discontinued for loop,
// for that reason, there is a clip everytime audio stream is looped...
for (int i = 0; i < MAX_SAMPLES; i++)
{
data[i] = sinf(((2*PI*(float)i)/2)*DEG2RAD);
data[i] = (short)(sinf(((2*PI*(float)i)/2)*DEG2RAD)*32000);
}
// NOTE: The generated MAX_SAMPLES do not fit to close a perfect loop
// for that reason, there is a clip everytime audio stream is looped
PlayAudioStream(stream);
PlayAudioStream(stream); // Start processing stream buffer (no data loaded currently)
int totalSamples = MAX_SAMPLES;
int samplesLeft = totalSamples;
@@ -60,10 +60,13 @@ int main()
//----------------------------------------------------------------------------------
// Refill audio stream if required
// NOTE: Every update we check if stream data has been already consumed and we update
// buffer with new data from the generated samples, we upload data at a rate (MAX_SAMPLES_PER_UPDATE),
// but notice that at some point we update < MAX_SAMPLES_PER_UPDATE data...
if (IsAudioBufferProcessed(stream))
{
int numSamples = 0;
if (samplesLeft >= 4096) numSamples = 4096;
if (samplesLeft >= MAX_SAMPLES_PER_UPDATE) numSamples = MAX_SAMPLES_PER_UPDATE;
else numSamples = samplesLeft;
UpdateAudioStream(stream, data + (totalSamples - samplesLeft), numSamples);
@@ -83,11 +86,11 @@ int main()
DrawText("SINE WAVE SHOULD BE PLAYING!", 240, 140, 20, LIGHTGRAY);
// NOTE: Draw a part of the sine wave (only screen width)
// NOTE: Draw a part of the sine wave (only screen width, proportional values)
for (int i = 0; i < GetScreenWidth(); i++)
{
position.x = i;
position.y = 250 + 50*data[i];
position.y = 250 + 50*data[i]/32000;
DrawPixelV(position, RED);
}

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -24,8 +24,8 @@ int main()
InitAudioDevice(); // Initialize audio device
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/tanatana.ogg"); // Load OGG audio file
SetTargetFPS(60);
//--------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -1,101 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [audio] example - Module playing (streaming)
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
MAX_CIRCLES = 64
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)")
InitAudioDevice() -- Initialize audio device
local colors = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE }
-- Creates ome circles for visual effect
local circles = {}
for i = MAX_CIRCLES, 1, -1 do
circles[i] = {}
circles[i].alpha = 0.0
circles[i].radius = GetRandomValue(10, 40)
circles[i].position = Vector2(0, 0)
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius)
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius)
circles[i].speed = GetRandomValue(1, 100)/20000.0
circles[i].color = colors[GetRandomValue(1, 14)]
end
local xm = LoadMusicStream("resources/audio/mini1111.xm")
PlayMusicStream(xm)
local timePlayed = 0.0
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
for i = MAX_CIRCLES, 1, -1 do
circles[i].alpha = circles[i].alpha + circles[i].speed
circles[i].radius = circles[i].radius + circles[i].speed*10.0
if (circles[i].alpha > 1.0) then circles[i].speed = circles[i].speed*-1 end
if (circles[i].alpha <= 0.0) then
circles[i].alpha = 0.0
circles[i].radius = GetRandomValue(10, 40)
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius)
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius)
circles[i].color = colors[GetRandomValue(1, 14)]
circles[i].speed = GetRandomValue(1, 100)/20000.0
end
end
-- Get timePlayed scaled to bar dimensions
timePlayed = (GetMusicTimePlayed(xm)/GetMusicTimeLength(xm)*(screenWidth - 40))*2
UpdateMusicStream(xm) -- Update music buffer with new stream data
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
for i = MAX_CIRCLES, 1, -1 do
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha))
end
-- Draw time bar
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY)
DrawRectangle(20, screenHeight - 20 - 12, timePlayed//1, 12, MAROON)
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, WHITE)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
UnloadMusicStream(xm) -- Unload music stream buffers from RAM
CloseAudioDevice() -- Close audio device (music streaming is automatically stopped)
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,66 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [audio] example - Music playing (streaming)
--
-- NOTE: This example requires OpenAL Soft library installed
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [audio] example - music playing (streaming)")
InitAudioDevice() -- Initialize audio device
local music = LoadMusicStream("resources/audio/guitar_noodling.ogg")
PlayMusicStream(music)
local framesCounter = 0
local timePlayed = 0.0
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
framesCounter = framesCounter + 1
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*100*4 -- We scale by 4 to fit 400 pixels
UpdateMusicStream(music) -- Update music buffer with new stream data
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("MUSIC SHOULD BE PLAYING!", 255, 200, 20, LIGHTGRAY)
DrawRectangle(200, 250, 400, 12, LIGHTGRAY)
DrawRectangle(200, 250, timePlayed//1, 12, MAROON)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
UnloadMusicStream(music) -- Unload music stream buffers from RAM
CloseAudioDevice() -- Close audio device (music streaming is automatically stopped)
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,97 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [audio] example - Raw audio streaming
--
-- NOTE: This example requires OpenAL Soft library installed
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
MAX_SAMPLES = 20000
DEG2RAD = math.pi/180.0
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [audio] example - raw audio streaming")
InitAudioDevice() -- Initialize audio device
-- Init raw audio stream (sample rate: 22050, sample size: 32bit-float, channels: 1-mono)
local stream = InitAudioStream(22050, 32, 1)
-- Fill audio stream with some samples (sine wave)
local data = {}
for i = 1, MAX_SAMPLES do
data[i] = math.sin(((2*math.pi*i)/2)*DEG2RAD)
end
-- NOTE: The generated MAX_SAMPLES do not fit to close a perfect loop
-- for that reason, there is a clip everytime audio stream is looped
PlayAudioStream(stream)
local totalSamples = MAX_SAMPLES
local samplesLeft = totalSamples
local position = Vector2(0, 0)
SetTargetFPS(30) -- Set our game to run at 30 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
-- Refill audio stream if required
if (IsAudioBufferProcessed(stream)) then
local numSamples = 0
if (samplesLeft >= 4096) then numSamples = 4096
else numSamples = samplesLeft end
UpdateAudioStream(stream, data + (totalSamples - samplesLeft), numSamples)
samplesLeft = samplesLeft - numSamples
-- Reset samples feeding (loop audio)
if (samplesLeft <= 0) then samplesLeft = totalSamples end
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("SINE WAVE SHOULD BE PLAYING!", 240, 140, 20, LIGHTGRAY)
-- NOTE: Draw a part of the sine wave (only screen width)
for i = 1, GetScreenWidth() do
position.x = (i - 1)
position.y = 250 + 50*data[i]
DrawPixelV(position, RED)
end
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseAudioStream(stream) -- Close raw audio stream and delete buffers from RAM
CloseAudioDevice() -- Close audio device (music streaming is automatically stopped)
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,59 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [audio] example - Sound loading and playing
--
-- NOTE: This example requires OpenAL Soft library installed
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [audio] example - sound loading and playing")
InitAudioDevice() -- Initialize audio device
local fxWav = LoadSound("resources/audio/weird.wav") -- Load WAV audio file
local fxOgg = LoadSound("resources/audio/tanatana.ogg") -- Load OGG audio file
SetTargetFPS(60)
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
if (IsKeyPressed(KEY.SPACE)) then PlaySound(fxWav) end -- Play WAV sound
if (IsKeyPressed(KEY.ENTER)) then PlaySound(fxOgg) end -- Play OGG sound
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, LIGHTGRAY)
DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, LIGHTGRAY)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
UnloadSound(fxWav) -- Unload sound data
UnloadSound(fxOgg) -- Unload sound data
CloseAudioDevice() -- Close audio device
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -48,7 +48,6 @@ int main()
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
// NOTE: This function is NOT WORKING properly!
ray = GetMouseRay(GetMousePosition(), camera);
// Check collision between ray and box

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -15,7 +15,7 @@
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -4,8 +4,8 @@
*
* NOTE: This example requires a Gamepad connected to the system
* raylib is configured to work with the following gamepads:
* Xbox 360 Controller (Xbox 360, Xbox One)
* PLAYSTATION(R)3 Controller
* - Xbox 360 Controller (Xbox 360, Xbox One)
* - PLAYSTATION(R)3 Controller
* Check raylib.h for buttons configuration
*
* This example has been created using raylib 1.6 (www.raylib.com)

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,14 +1,11 @@
/*******************************************************************************************
*
* raylib [core] example - Oculus Rift CV1
* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters)
*
* Compile example using:
* gcc -o $(NAME_PART).exe $(FILE_NAME) -L. -L..\src\external\OculusSDK\LibOVR -lLibOVRRT32_1 -lraylib -lglfw3 -lopengl32 -lgdi32 -std=c99
*
* This example has been created using raylib 1.5 (www.raylib.com)
* This example has been created using raylib 1.7 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2016 Ramon Santamaria (@raysan5)
* Copyright (c) 2017 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -23,10 +20,10 @@ int main()
// NOTE: screenWidth/screenHeight should match VR device aspect ratio
InitWindow(screenWidth, screenHeight, "raylib [core] example - oculus rift");
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
// NOTE: If device is not available, it fallbacks to default device (simulator)
InitVrDevice(HMD_OCULUS_RIFT_CV1); // Init VR device (Oculus Rift CV1)
// Init VR simulator (Oculus Rift CV1 parameters)
InitVrSimulator(GetVrDeviceInfo(HMD_OCULUS_RIFT_CV1));
// Define the camera to look into our 3d world
Camera camera;
@@ -47,8 +44,7 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
if (IsVrSimulator()) UpdateCamera(&camera); // Update camera (simulator mode)
else if (IsVrDeviceReady()) UpdateVrTracking(&camera); // Update camera with device tracking data
UpdateCamera(&camera); // Update camera (simulator mode)
if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode
//----------------------------------------------------------------------------------
@@ -59,6 +55,8 @@ int main()
ClearBackground(RAYWHITE);
BeginVrDrawing();
Begin3dMode(camera);
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
@@ -68,6 +66,8 @@ int main()
End3dMode();
EndVrDrawing();
DrawFPS(10, 10);
EndDrawing();
@@ -76,7 +76,7 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
CloseVrDevice(); // Close VR device
CloseVrSimulator(); // Close VR simulator
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 173 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,130 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - 2d camera
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
MAX_BUILDINGS = 100
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 2d camera")
local player = Rectangle(400, 280, 40, 40)
local buildings = {}
local buildColors = {}
local spacing = 0;
for i = 1, MAX_BUILDINGS do
buildings[i] = Rectangle(0, 0, 0, 0)
buildings[i].width = GetRandomValue(50, 200)
buildings[i].height = GetRandomValue(100, 800)
buildings[i].y = screenHeight - 130 - buildings[i].height
buildings[i].x = -6000 + spacing
spacing = spacing + buildings[i].width
buildColors[i] = Color(GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255)
end
local camera = Camera2D(Vector2(0, 0), Vector2(0, 0), 0.0, 1.0)
camera.target = Vector2(player.x + 20, player.y + 20)
camera.offset = Vector2(0, 0)
camera.rotation = 0.0
camera.zoom = 1.0
SetTargetFPS(60)
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
if (IsKeyDown(KEY.RIGHT)) then
player.x = player.x + 2 -- Player movement
camera.offset.x = camera.offset.x - 2 -- Camera displacement with player movement
elseif (IsKeyDown(KEY.LEFT)) then
player.x = player.x - 2 -- Player movement
camera.offset.x = camera.offset.x + 2 -- Camera displacement with player movement
end
-- Camera target follows player
camera.target = Vector2(player.x + 20, player.y + 20)
-- Camera rotation controls
if (IsKeyDown(KEY.A)) then camera.rotation = camera.rotation - 1
elseif (IsKeyDown(KEY.S)) then camera.rotation = camera.rotation + 1
end
-- Limit camera rotation to 80 degrees (-40 to 40)
if (camera.rotation > 40) then camera.rotation = 40
elseif (camera.rotation < -40) then camera.rotation = -40
end
-- Camera zoom controls
camera.zoom = camera.zoom + (GetMouseWheelMove()*0.05)
if (camera.zoom > 3.0) then camera.zoom = 3.0
elseif (camera.zoom < 0.1) then camera.zoom = 0.1
end
-- Camera reset (zoom and rotation)
if (IsKeyPressed(KEY.R)) then
camera.zoom = 1.0
camera.rotation = 0.0
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin2dMode(camera)
DrawRectangle(-6000, 320, 13000, 8000, DARKGRAY)
for i = 1, MAX_BUILDINGS, 1 do DrawRectangleRec(buildings[i], buildColors[i]) end
DrawRectangleRec(player, RED)
DrawRectangle(camera.target.x, -500, 1, screenHeight*4, GREEN)
DrawRectangle(-500, camera.target.y, screenWidth*4, 1, GREEN)
End2dMode()
DrawText("SCREEN AREA", 640, 10, 20, RED)
DrawRectangle(0, 0, screenWidth, 5, RED)
DrawRectangle(0, 5, 5, screenHeight - 10, RED)
DrawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, RED)
DrawRectangle(0, screenHeight - 5, screenWidth, 5, RED)
DrawRectangle( 10, 10, 250, 113, Fade(SKYBLUE, 0.5))
DrawRectangleLines( 10, 10, 250, 113, BLUE)
DrawText("Free 2d camera controls:", 20, 20, 10, BLACK)
DrawText("- Right/Left to move Offset", 40, 40, 10, DARKGRAY)
DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, DARKGRAY)
DrawText("- A / S to Rotate", 40, 80, 10, DARKGRAY)
DrawText("- R to reset Zoom and Rotation", 40, 100, 10, DARKGRAY)
EndDrawing();
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,84 +0,0 @@
--------------------------------------------------------------------------------------------
--
-- raylib [core] example - 3d camera first person
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
--------------------------------------------------------------------------------------------
MAX_COLUMNS = 20
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera first person")
-- Define the camera to look into our 3d world (position, target, up vector)
local camera = Camera(Vector3(4.0, 2.0, 4.0), Vector3(0.0, 1.8, 0.0), Vector3(0.0, 1.0, 0.0), 60.0)
-- Generates some random columns
local heights = {}
local positions = {}
local colors = {}
for i = 1, MAX_COLUMNS do
heights[i] = GetRandomValue(1, 12)
positions[i] = Vector3(GetRandomValue(-15, 15), heights[i]/2, GetRandomValue(-15, 15))
colors[i] = Color(GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255)
end
local playerPosition = Vector3(4.0, 2.0, 4.0) -- Define player position
SetCameraMode(camera, CameraMode.FIRST_PERSON) -- Set a first person camera mode
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
camera = UpdateCamera(camera) -- Update camera
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera)
DrawPlane(Vector3(0.0, 0.0, 0.0), Vector2(32.0, 32.0), LIGHTGRAY) -- Draw ground
DrawCube(Vector3(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, BLUE) -- Draw a blue wall
DrawCube(Vector3(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, LIME) -- Draw a green wall
DrawCube(Vector3(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, GOLD) -- Draw a yellow wall
-- Draw some cubes around
for i = 1, MAX_COLUMNS do
DrawCube(positions[i], 2.0, heights[i], 2.0, colors[i])
DrawCubeWires(positions[i], 2.0, heights[i], 2.0, MAROON)
end
End3dMode()
DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5))
DrawRectangleLines( 10, 10, 220, 70, BLUE)
DrawText("First person camera default controls:", 20, 20, 10, BLACK)
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY)
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,72 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Initialize 3d camera free
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
--------------------------------------------------------------------------------------------
-- Initialization
----------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera free")
-- Define the camera to look into our 3d world
local camera = {}
camera.position = Vector3(10.0, 10.0, 10.0) -- Camera position
camera.target = Vector3(0.0, 0.0, 0.0) -- Camera looking at point
camera.up = Vector3(0.0, 1.0, 0.0) -- Camera up vector (rotation towards target)
camera.fovy = 45.0 -- Camera field-of-view Y
local cubePosition = Vector3(0.0, 0.0, 0.0)
SetCameraMode(camera, CameraMode.FREE) -- Set a free camera mode
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
camera = UpdateCamera(camera) -- Update camera
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera)
DrawCube(cubePosition, 2.0, 2.0, 2.0, RED)
DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, MAROON)
DrawGrid(10, 1.0)
End3dMode()
DrawRectangle( 10, 10, 320, 133, Fade(SKYBLUE, 0.5))
DrawRectangleLines( 10, 10, 320, 133, BLUE)
DrawText("Free camera default controls:", 20, 20, 10, BLACK)
DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY)
DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, DARKGRAY)
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, DARKGRAY)
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, DARKGRAY)
DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, DARKGRAY)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,64 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Initialize 3d mode
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d mode")
-- Define the camera to look into our 3d world
local camera = {}
camera.position = Vector3(0.0, 10.0, 10.0) -- Camera position
camera.target = Vector3(0.0, 0.0, 0.0) -- Camera looking at point
camera.up = Vector3(0.0, 1.0, 0.0) -- Camera up vector (rotation towards target)
camera.fovy = 45.0 -- Camera field-of-view Y
local cubePosition = Vector3(0.0, 0.0, 0.0)
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
-- TODO: Update your variables here
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera) -- ERROR: Lua Error: attempt to index a number value (?)
DrawCube(cubePosition, 2.0, 2.0, 2.0, RED)
DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, MAROON)
DrawGrid(10, 1.0)
End3dMode()
DrawText("Welcome to the third dimension!", 10, 40, 20, DARKGRAY)
DrawFPS(10, 10)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,96 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Picking in 3d mode
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d picking")
-- Define the camera to look into our 3d world
local camera = {}
camera.position = Vector3(0.0, 10.0, 10.0) -- Camera position
camera.target = Vector3(0.0, 0.0, 0.0) -- Camera looking at point
camera.up = Vector3(0.0, 1.0, 0.0) -- Camera up vector (rotation towards target)
camera.fovy = 45.0 -- Camera field-of-view Y
local cubePosition = Vector3(0.0, 1.0, 0.0)
local cubeSize = Vector3(2.0, 2.0, 2.0)
local ray = Ray(Vector3(0, 0, 0), Vector3(0, 0, 0)) -- Picking line ray
local collision = false
SetCameraMode(camera, CameraMode.FREE) -- Set a free camera mode
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
camera = UpdateCamera(camera) -- Update camera
if (IsMouseButtonPressed(MOUSE.LEFT_BUTTON)) then
-- NOTE: This function is NOT WORKING properly!
ray = GetMouseRay(GetMousePosition(), camera)
-- Check collision between ray and box
collision = CheckCollisionRayBox(ray,
BoundingBox(Vector3(cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2),
Vector3(cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2)))
--print("collision check:", collision)
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera)
if (collision) then
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RED)
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, MAROON)
DrawCubeWires(cubePosition, cubeSize.x + 0.2, cubeSize.y + 0.2, cubeSize.z + 0.2, GREEN)
else
DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, GRAY)
DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, DARKGRAY)
end
DrawRay(ray, MAROON)
DrawGrid(10, 1.0)
End3dMode()
DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY)
if (collision) then
DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30))/2, screenHeight*0.1, 30, GREEN)
end
DrawFPS(10, 10)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,44 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Basic window
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
SetTargetFPS(60) -- Set target frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
-- TODO: Update your variables here
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,82 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Color selection by mouse (collision detection)
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
NUM_RECTANGLES = 21
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - color selection (collision detection)")
local colors = { DARKGRAY, MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, DARKBROWN,
GRAY, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK, YELLOW,
GREEN, SKYBLUE, PURPLE, BEIGE }
local colorsRecs = {} -- Rectangles array
local selected = {}
-- Fills colorsRecs data (for every rectangle)
for i = 1, NUM_RECTANGLES do
colorsRecs[i] = Rectangle(0, 0, 0, 0)
colorsRecs[i].x = 20 + 100*((i-1)%7) + 10*((i-1)%7)
colorsRecs[i].y = 60 + 100*((i-1)//7) + 10*((i-1)//7) -- Using floor division: //
colorsRecs[i].width = 100
colorsRecs[i].height = 100
selected[i] = false
end
local mousePoint = Vector2(0, 0)
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
mousePoint = GetMousePosition()
for i = 1, NUM_RECTANGLES do -- Iterate along all the rectangles
if (CheckCollisionPointRec(mousePoint, colorsRecs[i])) then
colors[i].a = 120
if (IsMouseButtonPressed(MOUSE.LEFT_BUTTON)) then selected[i] = not selected[i] end
else colors[i].a = 255 end
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
for i = 1, NUM_RECTANGLES do -- Draw all rectangles
DrawRectangleRec(colorsRecs[i], colors[i])
-- Draw four rectangles around selected rectangle
if (selected[i]) then
DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 100, 10, RAYWHITE) -- Square top rectangle
DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 10, 100, RAYWHITE) -- Square left rectangle
DrawRectangle(colorsRecs[i].x + 90, colorsRecs[i].y, 10, 100, RAYWHITE) -- Square right rectangle
DrawRectangle(colorsRecs[i].x, colorsRecs[i].y + 90, 100, 10, RAYWHITE) -- Square bottom rectangle
end
end
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,66 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Windows drop files
--
-- This example only works on platforms that support drag & drop (Windows, Linux, OSX)
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - drop files")
local count = 0
local droppedFiles = {}
SetTargetFPS(60)
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
if (IsFileDropped()) then
droppedFiles = GetDroppedFiles()
count = #droppedFiles
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
if (count == 0) then DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY)
else
DrawText("Dropped files:", 100, 40, 20, DARKGRAY)
for i = 0, count-1 do
if (i%2 == 0) then DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5))
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3)) end
DrawText(droppedFiles[i+1], 120, 100 + 40*i, 10, GRAY)
end
DrawText("Drop new files...", 100, 110 + 40*count, 20, DARKGRAY)
end
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
ClearDroppedFiles() -- Clear internal buffers
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,102 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Gestures Detection
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
MAX_GESTURE_STRINGS = 20
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - gestures detection")
local touchPosition = Vector2(0, 0)
local touchArea = Rectangle(220, 10, screenWidth - 230, screenHeight - 20)
local gesturesCount = 0
local gestureStrings = {}
for i = 1, MAX_GESTURE_STRINGS do gestureStrings[i] = "" end
local currentGesture = Gestures.NONE
local lastGesture = Gestures.NONE
--SetGesturesEnabled(0b0000000000001001) -- Enable only some gestures to be detected
SetTargetFPS(60)
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
lastGesture = currentGesture
currentGesture = GetGestureDetected()
touchPosition = GetTouchPosition(0)
if (CheckCollisionPointRec(touchPosition, touchArea) and (currentGesture ~= Gestures.NONE)) then
if (currentGesture ~= lastGesture) then
-- Store gesture string
if (currentGesture == Gestures.TAP) then gestureStrings[gesturesCount] = "GESTURE TAP"
elseif (currentGesture == Gestures.DOUBLETAP) then gestureStrings[gesturesCount] = "GESTURE DOUBLETAP"
elseif (currentGesture == Gestures.HOLD) then gestureStrings[gesturesCount] = "GESTURE HOLD"
elseif (currentGesture == Gestures.DRAG) then gestureStrings[gesturesCount] = "GESTURE DRAG"
elseif (currentGesture == Gestures.SWIPE_RIGHT) then gestureStrings[gesturesCount] = "GESTURE SWIPE RIGHT"
elseif (currentGesture == Gestures.SWIPE_LEFT) then gestureStrings[gesturesCount] = "GESTURE SWIPE LEFT"
elseif (currentGesture == Gestures.SWIPE_UP) then gestureStrings[gesturesCount] = "GESTURE SWIPE UP"
elseif (currentGesture == Gestures.SWIPE_DOWN) then gestureStrings[gesturesCount] = "GESTURE SWIPE DOWN"
elseif (currentGesture == Gestures.PINCH_IN) then gestureStrings[gesturesCount] = "GESTURE PINCH IN"
elseif (currentGesture == Gestures.PINCH_OUT) then gestureStrings[gesturesCount] = "GESTURE PINCH OUT"
end
gesturesCount = gesturesCount + 1
-- Reset gestures strings
if (gesturesCount >= MAX_GESTURE_STRINGS) then
for i = 1, MAX_GESTURE_STRINGS do gestureStrings[i] = "\0" end
gesturesCount = 0
end
end
end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawRectangleRec(touchArea, GRAY)
DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, RAYWHITE)
DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, Fade(GRAY, 0.5))
for i = 1, gesturesCount do
if ((i - 1)%2 == 0) then DrawRectangle(10, 30 + 20*(i - 1), 200, 20, Fade(LIGHTGRAY, 0.5))
else DrawRectangle(10, 30 + 20*(i - 1), 200, 20, Fade(LIGHTGRAY, 0.3)) end
if (i < gesturesCount) then DrawText(gestureStrings[i], 35, 36 + 20*(i - 1), 10, DARKGRAY)
else DrawText(gestureStrings[i], 35, 36 + 20*(i - 1), 10, MAROON) end
end
DrawRectangleLines(10, 29, 200, screenHeight - 50, GRAY)
DrawText("DETECTED GESTURES", 50, 15, 10, GRAY)
if (currentGesture ~= GESTURE_NONE) then DrawCircleV(touchPosition, 30, MAROON) end
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,163 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Gamepad input
--
-- NOTE: This example requires a Gamepad connected to the system
-- raylib is configured to work with Xbox 360 gamepad, check raylib.h for buttons configuration
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input")
local texPs3Pad = LoadTexture("resources/ps3.png")
local texXboxPad = LoadTexture("resources/xbox.png")
SetTargetFPS(60) -- Set target frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
-- ...
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
if (IsGamepadAvailable(GAMEPAD.PLAYER1)) then
DrawText(string.format("GP1: %s", GetGamepadName(GAMEPAD.PLAYER1)), 10, 10, 10, BLACK)
if (IsGamepadName(GAMEPAD.PLAYER1, "Xbox 360 Controller")) then
DrawTexture(texXboxPad, 0, 0, DARKGRAY)
-- Draw buttons: xbox home
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_HOME)) then DrawCircle(394, 89, 19, RED) end
-- Draw buttons: basic
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_START)) then DrawCircle(436, 150, 9, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_SELECT)) then DrawCircle(352, 150, 9, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_X)) then DrawCircle(501, 151, 15, BLUE) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_A)) then DrawCircle(536, 187, 15, LIME) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_B)) then DrawCircle(572, 151, 15, MAROON) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_Y)) then DrawCircle(536, 115, 15, GOLD) end
-- Draw buttons: d-pad
DrawRectangle(317, 202, 19, 71, BLACK)
DrawRectangle(293, 228, 69, 19, BLACK)
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_UP)) then DrawRectangle(317, 202, 19, 26, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_DOWN)) then DrawRectangle(317, 202 + 45, 19, 26, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_LEFT)) then DrawRectangle(292, 228, 25, 19, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_RIGHT)) then DrawRectangle(292 + 44, 228, 26, 19, RED) end
-- Draw buttons: left-right back
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_LB)) then DrawCircle(259, 61, 20, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.XBOX_BUTTON_RB)) then DrawCircle(536, 61, 20, RED) end
-- Draw axis: left joystick
DrawCircle(259, 152, 39, BLACK)
DrawCircle(259, 152, 34, LIGHTGRAY)
DrawCircle(259 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_LEFT_X)*20),
152 - (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_LEFT_Y)*20), 25, BLACK)
-- Draw axis: right joystick
DrawCircle(461, 237, 38, BLACK)
DrawCircle(461, 237, 33, LIGHTGRAY)
DrawCircle(461 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_RIGHT_X)*20),
237 - (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_RIGHT_Y)*20), 25, BLACK)
-- Draw axis: left-right triggers
DrawRectangle(170, 30, 15, 70, GRAY)
DrawRectangle(604, 30, 15, 70, GRAY)
DrawRectangle(170, 30, 15, (((1.0 + GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_LT))/2.0)*70), RED)
DrawRectangle(604, 30, 15, (((1.0 + GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_RT))/2.0)*70), RED)
--DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_LT)), 10, 40, 10, BLACK)
--DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_RT)), 10, 60, 10, BLACK)
elseif (IsGamepadName(GAMEPAD.PLAYER1, "PLAYSTATION(R)3 Controller")) then
DrawTexture(texPs3Pad, 0, 0, DARKGRAY)
-- Draw buttons: ps
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_PS)) then DrawCircle(396, 222, 13, RED) end
-- Draw buttons: basic
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_SELECT)) then DrawRectangle(328, 170, 32, 13, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_START)) then DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_TRIANGLE)) then DrawCircle(557, 144, 13, LIME) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_CIRCLE)) then DrawCircle(586, 173, 13, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_CROSS)) then DrawCircle(557, 203, 13, VIOLET) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_SQUARE)) then DrawCircle(527, 173, 13, PINK) end
-- Draw buttons: d-pad
DrawRectangle(225, 132, 24, 84, BLACK)
DrawRectangle(195, 161, 84, 25, BLACK)
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_UP)) then DrawRectangle(225, 132, 24, 29, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_DOWN)) then DrawRectangle(225, 132 + 54, 24, 30, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_LEFT)) then DrawRectangle(195, 161, 30, 25, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_RIGHT)) then DrawRectangle(195 + 54, 161, 30, 25, RED) end
-- Draw buttons: left-right back buttons
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_L1)) then DrawCircle(239, 82, 20, RED) end
if (IsGamepadButtonDown(GAMEPAD.PLAYER1, GAMEPAD.PS3_BUTTON_R1)) then DrawCircle(557, 82, 20, RED) end
-- Draw axis: left joystick
DrawCircle(319, 255, 35, BLACK)
DrawCircle(319, 255, 31, LIGHTGRAY)
DrawCircle(319 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_LEFT_X)*20),
255 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_LEFT_Y)*20), 25, BLACK)
-- Draw axis: right joystick
DrawCircle(475, 255, 35, BLACK)
DrawCircle(475, 255, 31, LIGHTGRAY)
DrawCircle(475 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_RIGHT_X)*20),
255 + (GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_RIGHT_Y)*20), 25, BLACK)
-- Draw axis: left-right triggers
DrawRectangle(169, 48, 15, 70, GRAY)
DrawRectangle(611, 48, 15, 70, GRAY)
DrawRectangle(169, 48, 15, (((1.0 - GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_L2))/2.0)*70), RED)
DrawRectangle(611, 48, 15, (((1.0 - GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.PS3_AXIS_R2))/2.0)*70), RED)
else
DrawText("- GENERIC GAMEPAD -", 280, 180, 20, GRAY)
-- TODO: Draw generic gamepad
end
DrawText(string.format("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD.PLAYER1)), 10, 50, 10, MAROON)
for i = 1, GetGamepadAxisCount(GAMEPAD.PLAYER1) do -- Iterate along all the rectangles
DrawText(string.format("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD.PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY)
end
if (GetGamepadButtonPressed() ~= -1) then DrawText(string.format("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED)
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY) end
else
DrawText("GP1: NOT DETECTED", 10, 10, 10, GRAY)
DrawTexture(texXboxPad, 0, 0, LIGHTGRAY)
end
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
UnloadTexture(texPs3Pad) -- Unload gamepad texture
UnloadTexture(texXboxPad) -- Unload gamepad texture
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,51 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Keyboard input
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
local ballPosition = Vector2(screenWidth/2, screenHeight/2)
SetTargetFPS(60) -- Set target frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
if (IsKeyDown(KEY.RIGHT)) then ballPosition.x = ballPosition.x + 0.8 end
if (IsKeyDown(KEY.LEFT)) then ballPosition.x = ballPosition.x - 0.8 end
if (IsKeyDown(KEY.UP)) then ballPosition.y = ballPosition.y - 0.8 end
if (IsKeyDown(KEY.DOWN)) then ballPosition.y = ballPosition.y + 0.8 end
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("move the ball with arrow keys", 10, 10, 20, DARKGRAY)
DrawCircleV(ballPosition, 50, MAROON)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,54 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Mouse input
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - mouse input")
local ballPosition = Vector2(-100.0, -100.0)
local ballColor = DARKBLUE
SetTargetFPS(60) -- Set target frames-per-second
-----------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
------------------------------------------------------------------------------------
ballPosition = GetMousePosition()
if (IsMouseButtonPressed(MOUSE.LEFT_BUTTON)) then ballColor = MAROON
elseif (IsMouseButtonPressed(MOUSE.MIDDLE_BUTTON)) then ballColor = LIME
elseif (IsMouseButtonPressed(MOUSE.RIGHT_BUTTON)) then ballColor = DARKBLUE
end
------------------------------------------------------------------------------------
-- Draw
------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawCircleV(ballPosition, 40, ballColor)
DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY)
EndDrawing()
------------------------------------------------------------------------------------
end
-- De-Initialization
----------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
----------------------------------------------------------------------------------------

View File

@@ -1,50 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] examples - Mouse wheel
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - mouse wheel")
local boxPositionY = screenHeight/2 - 40
local scrollSpeed = 4 -- Scrolling speed in pixels
SetTargetFPS(60) -- Set target frames-per-second
----------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
------------------------------------------------------------------------------------
boxPositionY = boxPositionY - (GetMouseWheelMove()*scrollSpeed)
------------------------------------------------------------------------------------
-- Draw
------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON)
DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY)
DrawText(string.format("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY)
EndDrawing()
------------------------------------------------------------------------------------
end
-- De-Initialization
----------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
----------------------------------------------------------------------------------------

View File

@@ -1,73 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Oculus Rift CV1
--
-- NOTE: Example requires linkage with LibOVR
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 1080
local screenHeight = 600
-- NOTE: screenWidth/screenHeight should match VR device aspect ratio
InitWindow(screenWidth, screenHeight, "raylib [core] example - oculus rift")
-- NOTE: If device is not available, it fallbacks to default device (simulator)
InitVrDevice(VrDevice.OCULUS_RIFT_CV1) -- Init VR device (Oculus Rift CV1)
-- Define the camera to look into our 3d world
local camera = {}
camera.position = Vector3(5.0, 5.0, 5.0) -- Camera position
camera.target = Vector3(0.0, 0.0, 0.0) -- Camera looking at point
camera.up = Vector3(0.0, 1.0, 0.0) -- Camera up vector (rotation towards target)
camera.fovy = 60.0 -- Camera field-of-view Y
local cubePosition = Vector3(0.0, 0.0, 0.0)
SetTargetFPS(90) -- Set our game to run at 90 frames-per-second
----------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
------------------------------------------------------------------------------------
UpdateVrTracking()
if (IsKeyPressed(KEY.SPACE)) then ToggleVrMode() end
------------------------------------------------------------------------------------
-- Draw
------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera)
DrawCube(cubePosition, 2.0, 2.0, 2.0, RED)
DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, MAROON)
DrawGrid(10, 1.0)
End3dMode()
DrawFPS(10, 10)
EndDrawing()
------------------------------------------------------------------------------------
end
-- De-Initialization
----------------------------------------------------------------------------------------
CloseVrDevice() -- Close VR device
CloseWindow() -- Close window and OpenGL context
----------------------------------------------------------------------------------------

View File

@@ -1,56 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Generate random values
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - generate random values")
local framesCounter = 0 -- Variable used to count frames
local randValue = GetRandomValue(-8, 5) -- Get a random integer number between -8 and 5 (both included)
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
----------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
------------------------------------------------------------------------------------
framesCounter = framesCounter + 1
-- Every two seconds (120 frames) a new random value is generated
if (((framesCounter/120)%2) == 1) then
randValue = GetRandomValue(-8, 5)
framesCounter = 0
end
------------------------------------------------------------------------------------
-- Draw
------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, MAROON)
DrawText(string.format("%i", randValue), 360, 180, 80, LIGHTGRAY)
EndDrawing()
------------------------------------------------------------------------------------
end
-- De-Initialization
----------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
----------------------------------------------------------------------------------------

View File

@@ -1,74 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - Storage save/load values
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- NOTE: Storage positions must start with 0, directly related to file memory layout
STORAGE_SCORE = 0
STORAGE_HISCORE = 1
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values")
local score = 0
local hiscore = 0
local framesCounter = 0
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
if (IsKeyPressed(KEY.R)) then
score = GetRandomValue(1000, 2000)
hiscore = GetRandomValue(2000, 4000)
end
if (IsKeyPressed(KEY.ENTER)) then
StorageSaveValue(STORAGE_SCORE, score)
StorageSaveValue(STORAGE_HISCORE, hiscore)
elseif (IsKeyPressed(KEY.SPACE)) then
-- NOTE: If requested position could not be found, value 0 is returned
score = StorageLoadValue(STORAGE_SCORE)
hiscore = StorageLoadValue(STORAGE_HISCORE)
end
framesCounter = framesCounter + 1
---------------------------------------------------------------------------------------
-- Draw
---------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText(string.format("SCORE: %i", score), 280, 130, 40, MAROON)
DrawText(string.format("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK)
DrawText(string.format("frames: %i", framesCounter), 10, 10, 20, LIME)
DrawText("Press R to generate random numbers", 220, 40, 20, LIGHTGRAY)
DrawText("Press ENTER to SAVE values", 250, 310, 20, LIGHTGRAY)
DrawText("Press SPACE to LOAD values", 252, 350, 20, LIGHTGRAY)
EndDrawing()
---------------------------------------------------------------------------------------
end
-- De-Initialization
-------------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
-------------------------------------------------------------------------------------------

View File

@@ -1,66 +0,0 @@
-------------------------------------------------------------------------------------------
--
-- raylib [core] example - World to screen
--
-- This example has been created using raylib 1.6 (www.raylib.com)
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
--
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
--
-------------------------------------------------------------------------------------------
-- Initialization
-------------------------------------------------------------------------------------------
local screenWidth = 800
local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera free")
-- Define the camera to look into our 3d world
local camera = Camera(Vector3(0.0, 10.0, 10.0), Vector3(0.0, 0.0, 0.0), Vector3(0.0, 1.0, 0.0), 45.0)
local cubePosition = Vector3(0.0, 0.0, 0.0)
local cubeScreenPosition = Vector2(0, 0)
SetCameraMode(camera, CameraMode.FREE) -- Set a free camera mode
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
----------------------------------------------------------------------------------------
-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
------------------------------------------------------------------------------------
camera = UpdateCamera(camera) -- Update camera
-- Calculate cube screen space position (with a little offset to be in top)
cubeScreenPosition = GetWorldToScreen(Vector3(cubePosition.x, cubePosition.y + 2.5, cubePosition.z), camera)
------------------------------------------------------------------------------------
-- Draw
------------------------------------------------------------------------------------
BeginDrawing()
ClearBackground(RAYWHITE)
Begin3dMode(camera)
DrawCube(cubePosition, 2.0, 2.0, 2.0, RED)
DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, MAROON)
DrawGrid(10, 1.0)
End3dMode()
DrawText("Enemy: 100 / 100", cubeScreenPosition.x//1 - MeasureText("Enemy: 100 / 100", 20)//2, cubeScreenPosition.y//1, 20, BLACK)
DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20))//2, 25, 20, GRAY)
EndDrawing()
------------------------------------------------------------------------------------
end
-- De-Initialization
----------------------------------------------------------------------------------------
CloseWindow() -- Close window and OpenGL context
----------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -2,7 +2,7 @@
*
* raylib [models] example - Cubicmap loading and drawing
*
* This example has been created using raylib 1.3 (www.raylib.com)
* This example has been created using raylib 1.8 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
@@ -25,11 +25,13 @@ int main()
Image image = LoadImage("resources/cubicmap.png"); // Load cubicmap image (RAM)
Texture2D cubicmap = LoadTextureFromImage(image); // Convert image to texture to display (VRAM)
Model map = LoadCubicmap(image); // Load cubicmap model (generate model from image)
Mesh mesh = GenMeshCubicmap(image, (Vector3){ 1.0f, 1.0f, 1.0f });
Model model = LoadModelFromMesh(mesh);
// NOTE: By default each cube is mapped to one part of texture atlas
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture
map.material.texDiffuse = texture; // Set map diffuse texture
model.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture
Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position
@@ -56,7 +58,7 @@ int main()
Begin3dMode(camera);
DrawModel(map, mapPosition, 1.0f, WHITE);
DrawModel(model, mapPosition, 1.0f, WHITE);
End3dMode();
@@ -76,7 +78,7 @@ int main()
//--------------------------------------------------------------------------------------
UnloadTexture(cubicmap); // Unload cubicmap texture
UnloadTexture(texture); // Unload map texture
UnloadModel(map); // Unload map model
UnloadModel(model); // Unload map model
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 403 KiB

After

Width:  |  Height:  |  Size: 403 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -2,7 +2,7 @@
*
* raylib [models] example - Heightmap loading and drawing
*
* This example has been created using raylib 1.3 (www.raylib.com)
* This example has been created using raylib 1.8 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
@@ -25,9 +25,12 @@ int main()
Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
Model map = LoadHeightmap(image, (Vector3){ 16, 8, 16 }); // Load heightmap model with defined size
map.material.texDiffuse = texture; // Set map diffuse texture
Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Set model position (depends on model scaling!)
Mesh mesh = GenMeshHeightmap(image, (Vector3){ 16, 8, 16 }); // Generate heightmap mesh (RAM and VRAM)
Model model = LoadModelFromMesh(mesh); // Load model from generated mesh
model.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture
Vector3 mapPosition = { -8.0f, 0.0f, -8.0f }; // Define model position
UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
@@ -52,8 +55,7 @@ int main()
Begin3dMode(camera);
// NOTE: Model is scaled to 1/4 of its original size (128x128 units)
DrawModel(map, mapPosition, 1.0f, RED);
DrawModel(model, mapPosition, 1.0f, RED);
DrawGrid(20, 1.0f);
@@ -71,7 +73,7 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(texture); // Unload texture
UnloadModel(map); // Unload model
UnloadModel(model); // Unload model
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Some files were not shown because too many files have changed in this diff Show More