246 Commits

Author SHA1 Message Date
Ray
b908a4078a Merge pull request #460 from raysan5/develop
Integrate develop branch
2018-02-04 13:47:42 +01:00
raysan5
5437458469 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2018-02-04 13:46:45 +01:00
raysan5
3a11cc5e31 Incremeted version to align with CMake 2018-02-04 13:44:41 +01:00
Ray
327aec9da4 Merge pull request #459 from a3f/develop
Bump version to 1.9.4
2018-02-04 13:44:20 +01:00
Ahmad Fatoum
19f280f4b7 Bump version to 1.9.4 2018-02-04 13:36:08 +01:00
Ahmad Fatoum
184df917be Travis CI: Don't use external GLFW
While nice to test, this would mean that the tagged release will depend
on GLFW as well… Therefore disable it for now.
2018-02-04 13:35:18 +01:00
Ray
d50e291e86 Merge pull request #458 from raysan5/develop
Integrate develop branch into master
2018-02-04 12:51:24 +01:00
raysan5
6dc2f979cc Updated raylib version
Note that this version is under development and could be buggy on some
platforms...
2018-02-04 12:33:46 +01:00
raysan5
c32ed921a2 Security check in case window initialization fails 2018-02-04 12:31:16 +01:00
raysan5
8f287e72d2 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2018-02-04 12:26:33 +01:00
raysan5
70e0070a85 Reviewed window initialization
In case graphic device could not be created it returns false instead of
failing with an error tracelog (and consequently closing the program).
Window initialization success could be checked with new function
IsWindowReady()
2018-02-04 12:26:28 +01:00
Ahmad Fatoum
cb66c89dfa CMake: Rename WITH_SYSTEM_GLFW to USE_EXTERNAL_GLFW
for consistency with Makefile. Requested by @raysan5 in #453.
2018-02-04 12:10:23 +01:00
Ray
e2861fa71f Merge pull request #456 from a3f/develop
Return false from InitWindow if glfwInit or glfwCreateWindow fails -TO REVIEW AS DISCUSSED-
2018-02-04 11:55:18 +01:00
Ahmad Fatoum
26c9176a14 Return false from InitWindow if glfwInit or glfwCreateWindow fails
You can't do much with raylib if glfwInit or glfwCreateWindow fails,
currently it just exits by means of TraceLog(LOG_ERROR.
User code, however, might want to fall back to a text-only UI
or display a warning if raylib can't be used.
2018-02-03 14:53:58 +01:00
Ahmad Fatoum
44cd4faf83 exit(3), don't crash, when glfwCreateWindow fails
glfwSetWindowPos was called on a NULL window, triggering an assert
inside GLFW. Check for failure and exit cleanly by means of
TraceLog(LOG_ERROR instead.
2018-02-03 14:46:26 +01:00
Ahmad Fatoum
2b2b1f91ee CMake: Fix typo in GLFW detection
Let it be noted I utterly dislike their syntax.
2018-02-03 13:30:59 +01:00
Ray
5bb23c6c06 Update README.md 2018-02-03 11:33:05 +01:00
Ray
7918c0bf71 Removed external dependencies 2018-02-03 11:31:54 +01:00
Ahmad Fatoum
7f5fa4d49c CMake: Add tristate option for using system GLFW (#455)
-DWITH_SYSTEM_GLFW=ON: Link against system glfw and fail otherwise
-DWITH_SYSTEM_GLFW=OFF: Use embedded rglfw.c
-DWITH_SYSTEM_GLFW=IF_POSSIBLE: Probe for system glfw but fallback to
                                rglfw if unavailable

Also change Linux 64-bit CI build to install system glfw and use it,
so this doesn't bitrot.

Addresses #453.
2018-02-03 10:17:51 +01:00
Ahmad Fatoum
007ae1b7b3 CMake: Fix typo in MACOS_FATLIB 2018-02-03 09:38:57 +01:00
Ray San
d1ef6869a9 Added function DrawRectangleLinesEx() 2018-02-02 11:01:38 +01:00
Ray
58346414f7 Corrected typo 2018-01-31 15:32:40 +01:00
Ray
44c95af463 Added missing keys definitions 2018-01-31 14:08:08 +01:00
Ray
227880977e Do not ignore Makefiles! 2018-01-29 14:01:06 +01:00
Ray
eb508bf75f Upload GGJ18 game: transmission mission
Game developed in the GGJ18, it has some bugs and ending screen is
incomplete... I'll try to keep working a bit more on it.
2018-01-29 13:46:04 +01:00
Ray
1ce8c80de9 Corrected several issues... 2018-01-28 16:52:18 +01:00
Ahmad Fatoum
f955b2255d GLFW: Fix build error on Linux < v2.6.39
Cherry-pick from upstream glfw/glfw#1196
Found in CPANtesters test of Alien::raylib:
http://www.cpantesters.org/cpan/report/d956d128-0339-11e8-b0d1-b6c4abd39192
2018-01-27 14:53:04 +01:00
Ahmad Fatoum
2090ad8119 CMake: Add missing 0 to minimum version
Removed by mistake.
2018-01-27 02:00:40 +01:00
Ahmad Fatoum
7f7aac643a CMake: Search dependencies and build pkg-config's Libs.private with it 2018-01-27 01:57:21 +01:00
Ahmad Fatoum
1093766669 CMake: remove OpenAL dependency 2018-01-27 01:05:17 +01:00
Ahmad Fatoum
d5bbcbc15f Travis CI: Don't set CFLAGS=-m64 for macOS build 2018-01-27 01:05:17 +01:00
Ahmad Fatoum
1ab3c058f5 Drop libglew-dev as prereq for Travis build
Noted by @eserte in athreef/Alien-raylib#2. Thanks!
2018-01-26 22:14:05 +01:00
Ray
1d5fbef93d Clear fbo for drawing
Just in case ClearBackground() is not used after BeginTextureMode(), it clears fbo to color defined by previous ClearBackground()
2018-01-26 11:49:00 +01:00
Ray
779719f5dc Merge pull request #440 from a3f/develop
Make function calls without prior declaration an error
2018-01-26 01:17:19 +01:00
Ahmad Fatoum
520f317a75 #include header for time() on Windows 2018-01-25 23:12:03 +01:00
Ahmad Fatoum
03ee03e2a6 #include header for glInsertEventMarkerEXT on macOS 2018-01-25 23:00:07 +01:00
Ahmad Fatoum
8be93762d9 Make function calls without prior declaration an error
which is the default behavior on C99 and up.
2018-01-25 22:34:29 +01:00
Ray
c2ec88f930 Support DEBUG library building 2018-01-25 10:07:51 +01:00
Ray
2dcaddc81c Review mipmaps generation issue
When changing image format, mipmaps are lost and regenerated from
scratch
2018-01-23 13:23:34 +01:00
Ray
04af83ff99 Improved pixel formats support
Review rlLoadTexture() function to make it simpler, now OpenGL texture
glInternalFormat, glFormat and glType are retrieved with new function
GetGlFormats()
2018-01-22 00:20:42 +01:00
Ray
cbef78ea18 Review VS2017 projects configurations 2018-01-22 00:17:07 +01:00
Ray
e604fe1ace Added VS2017 UWP project
Reviewed VS2015 UWP project
2018-01-19 13:07:32 +01:00
Ray
8e0a277f7c Reviewed UWP branch integration 2018-01-19 12:02:15 +01:00
Ray
6f73008007 Merge pull request #434 from raysan5/testing_uwp
Integration of UWP support
2018-01-19 11:43:21 +01:00
Ray
750323da53 Merge branch 'develop' into testing_uwp 2018-01-19 11:41:51 +01:00
Ray
5931bd501c Merge pull request #433 from a3f/develop
GCC/Clang: Treat void pointer arithmetic as error
2018-01-18 13:35:09 +01:00
Ahmad Fatoum
30ef3f3122 GCC/Clang: Treat void pointer arithmetic as error
As an extension, GNU C treats sizeof(void) as 1. MSVC doesn't.
Make it an error on GCC/Clang to avoid accidental MSVC breakage.
2018-01-18 13:22:41 +01:00
Ahmad Fatoum
a2edc9d641 MSVC: Fix void pointer arithmetic error
GNU C allows it as a compiler extension, but MSVC doesn't.
2018-01-18 13:20:13 +01:00
Ray
ce9f191f1b Added function: ImageMipmaps() 2018-01-18 00:23:45 +01:00
kai
bdb61306ac CMake: build shape and texture examples (#432) 2018-01-17 20:14:14 +01:00
Ray
727cb1819b Reviewed VS2015 projects
- Support OpenGL 1.1 if selected macro
- Corrected MSVC compiler issues with (void *) data
- Removed raylib.dll project
- Created DEBUG_DLL and RELEASE_DLL configurations
2018-01-17 14:21:23 +01:00
Ray
c8e97df233 Reviewed function GenImagePerlinNoise()
Added support for noise image offset
2018-01-17 00:43:30 +01:00
Ray
dd3b3dbadb Redesigned rlLoadTexture()
- Added support for mipmap levels loading
- Removed internal function LoadTextureCompressed(), not required any
more...
2018-01-16 00:00:05 +01:00
-
61679a4bbc Review releases, removed external dependencies
Not required any more!
2018-01-15 13:59:51 +01:00
-
230e78a23e Code tweak while using OpenAL backend 2018-01-15 13:54:25 +01:00
-
f2a675ae53 Reviewed Makefiles...
- Renamed VERSION to RAYLIB_VERSION
- Renamed API_VERSION to RAYLIB_API_VERSION
- Renamed RAYLIB_RELEASE to RAYLIB_RELEASE_PATH
- Support Web Assembly compilation on PLATFORM_WEB
2018-01-15 13:54:06 +01:00
-
493a67e6d5 Support canvas scaling with window 2018-01-15 12:53:14 +01:00
-
ddf6c65d00 Review Makefiles and templates 2018-01-15 12:52:58 +01:00
Ray
f818ec0e05 Merge pull request #428 from SamNChiet/testing_uwp
Add mouse input and revert keyboard to callback model
2018-01-13 11:00:56 +01:00
Sam C
1f70a8984a Add mouse input and revert keyboard to callback model
Mouse input is implemented, with all bells-and-whistles. This includes
cursor locking and scroll wheel support.

Keyboard input is reverted to a callback model to better reflect the
existing architecture in "core.c"
2018-01-12 20:56:35 -08:00
Ray
278d8575bd Added new function: ImageAlphaCrop() 2018-01-11 10:22:32 +01:00
Ray
c37d2d448d Corrected issue with matrices
Matrix stack system should be reviewed but, in the meantime,
currentMatrix should be reseted in order of 3d to work
2018-01-08 01:03:04 +01:00
Ray
fcb0cae605 Use busy wait loop
If not using busy wait loop, linkage with WINMM in Windows platform is
required
2018-01-07 23:55:23 +01:00
Ray
4dcc02ff1e Launch draw call if buffer limits reached
Note that this solution is a temporal patch, not properly tested and
prone to fail, specially if matrix are pushed into the stack...
2018-01-07 23:54:11 +01:00
raysan5
e4be917d1b Added new image functions
- Added: ImageAlphaClear()
- Added: ImageAlphaPremultiply()
- Reorganized some functions
2018-01-07 00:51:26 +01:00
raysan5
b97134c3e1 Review float pixel format textures support 2018-01-06 18:17:38 +01:00
raysan5
7caa3201d5 Improved pixel formats support
- Renamed enum TextureFormat to PixelFormat for consistency
- Added support for pixel format UNCOMPRESSED_R32
- Using GetPixelDataSize() where required
2018-01-06 13:43:48 +01:00
raysan5
1f0f8c33fa Added function declaration 2018-01-06 02:51:28 +01:00
raysan5
7fa2861160 Added function: GetPixelDataSize()
Just found I need that function...
2018-01-06 02:50:20 +01:00
raysan5
0e48396369 Corrected issue with new functionality
Using default font texture as base white texture for rectangles reduces
draw calls considerably, actually, raygui can be drawn with a single
pass!
2018-01-06 02:44:47 +01:00
raysan5
b760f16f9b Reviewed framebuffers cleaning
Issues when dealing with FBOs
2018-01-06 02:43:38 +01:00
raysan5
1a82e1ab26 Added function GetFileName()
Review comments
2018-01-02 02:26:05 +01:00
raysan5
e1baae0249 Removed function DrawRectangleT()
Functionality integrated in DrawRectangle() and selectable with config
flag USE_DEFAULT_FONT_TEXTURE
2018-01-01 16:54:32 +01:00
raysan5
e69424c86f Reviewed text input 2017-12-31 23:50:22 +01:00
Ray
f51dcd8bfa Merge pull request #427 from SamNChiet/testing_uwp
Add Keyboard Input
2017-12-29 09:54:34 +01:00
Sam C
ff984d13db Revert accidental inclusion of binary+build files
This removes the binary files I accidentally tacked onto the "Add keyboard input" commit
2017-12-28 21:05:30 -08:00
Sam C
9941a6f4aa Replace keyboard callbacks with polling 2017-12-28 13:00:03 -08:00
Sam C
c801830bcc Add keyboard input 2017-12-28 10:44:03 -08:00
raysan5
e7cf03b1e4 Minor tweaks 2017-12-28 19:27:02 +01:00
raysan5
7965f983ba Support Wayland display on Linux desktop 2017-12-28 18:14:39 +01:00
raysan5
b19e155b34 Support UNCOMPRESSED_R32G32B32A32 texture format 2017-12-28 17:58:37 +01:00
raysan5
c93bca8c27 Review Makefile config flags
Support external GLFW usage
Renamed some flags for consistency
2017-12-28 17:58:09 +01:00
raysan5
0bd06eec51 Renamed function to SetTraceLog()
I think is clearer this way...
2017-12-24 16:49:54 +01:00
raysan5
e517d8fd16 Added function SetTraceLogTypes()
Trace log messages could be configured with this function to select wich
ones are shown
2017-12-24 16:47:33 +01:00
raysan5
e574428343 Some formatting tweaks 2017-12-24 16:12:52 +01:00
raysan5
f44dbf21cf Review physac timming system 2017-12-24 15:59:03 +01:00
Ray
0bb90d21c6 Merge pull request #424 from Martinfx/develop
Added next BSD OS
2017-12-23 18:57:26 +01:00
raysan5
b5a1282c6b Updated VS2015 projects
Removed GLFW3 and OpenAL Soft dependencies
2017-12-23 18:52:35 +01:00
Martinfx
dae426d9c6 Fixed path for FreeBSD 2017-12-23 18:29:44 +01:00
Martinfx
9b7a24331d Added next bsd os 2017-12-23 18:12:19 +01:00
Ray San
00c34a035c Updated copyright year 2017-12-20 12:37:08 +01:00
Ray San
27c274bc3c Corrected issue with SaveImageAs()
That function depends on SavePNG() and forces platform check on textures
module, that behaviour should be changed, platform definition should be
only required on core module...
2017-12-20 12:36:47 +01:00
Ray San
e8bb53ed35 Corrected issue on OpenGL ES compilation 2017-12-20 12:35:12 +01:00
Ray San
61afd07bd7 Force OpenAL backend on some platforms
OpenAL audio backend is being forced on HTML5 and OSX
2017-12-20 12:34:18 +01:00
Ray San
1320044e94 Review code formatting 2017-12-20 11:37:43 +01:00
Ray
b63ffcfa0f Some code tweaks
Audio module requires a complete formatting review....
2017-12-20 00:34:31 +01:00
Ray San
5290390494 Expose GetTime() function to users
Monotonic time since InitWindow() could be retrieved with this function.
2017-12-19 14:06:54 +01:00
Ray
a7de5bf6d9 Merge pull request #423 from RDR8/patch-1
Update CONTRIBUTING.md
2017-12-19 09:37:43 +01:00
RDR8
22e72cb0a1 Update CONTRIBUTING.md 2017-12-19 02:27:12 -06:00
RDR8
8d5484bbe0 Fix some typos in CONTRIBUTING.md (#422) 2017-12-19 09:19:43 +01:00
Ahmad Fatoum
647d8b2d53 Remove Alien::raylib from bindings list
* `Alien::raylib` downloads raylib, builds it and installs it in the Perl module path (Basically abusing CPAN as package manager)
* `Graphics::Raylib::XS` depends on `Alien::raylib` and reexports all C symbols as XS symbols usable in Perl
* `Graphics::Raylib` depends on `Graphics::Raylib::XS` and is the actual Perl wrapper with a Perlish API, which users should be using
2017-12-18 15:35:10 +01:00
Ray San
f3f3e7cf6d Removed contributors file
Contributors added to contributing file
2017-12-18 12:23:29 +01:00
Ray
bd4aa2459f Create CONTRIBUTING.md 2017-12-18 12:06:58 +01:00
Ray
bc6ae93a48 Added some comments on GetTime()
Reviewing GetTime() functionality
2017-12-18 00:06:57 +01:00
Ray San
b155333178 Support audio module skip on compiling
Some programs like tools could not require audio support
2017-12-15 17:02:29 +01:00
Ray San
e17a9a8216 Updated mini_al to latest version 2017-12-15 17:01:50 +01:00
Ray San
53ad53d051 Manually review previous PR 2017-12-15 13:44:31 +01:00
Ray
bcdde6c65a Merge pull request #420 from questor/develop
Develop
2017-12-15 13:28:33 +01:00
Ray
35d54dd7e4 Merge pull request #421 from a3f/develop
Build shared libs, games and examples on CI
2017-12-14 13:47:25 +01:00
Ahmad Fatoum
263e81b5c9 Build shared libs, games and examples on CI
Now with external OpenAL and GLFW dependencies removed,
we don't have to worry about installing them in CI.
Shared libraries are now always built along with static libs.
Games and examples are built everwhere except for Visual Studio,
because Physac needs pthreads, which VS doesn't provide.
2017-12-14 13:26:10 +01:00
user
2affac820e make raylib not clash with windows-header 2017-12-14 11:52:45 +01:00
user
217917530b fix for eventmarker missed in first cl 2017-12-14 11:51:17 +01:00
user
48d0c93ace make GetTime available to user of library 2017-12-14 11:50:35 +01:00
user
b872de951b fix for GetMatrixModelview (former cl) 2017-12-14 11:49:31 +01:00
user
d51f382ef8 optimized matrixrotate function by removing identity matrix 2017-12-14 11:48:33 +01:00
user
b5395b22cc make raymath compiling with msvc in c++ mode 2017-12-14 11:47:52 +01:00
user
07b522c113 make matrix stack work closer to old opengl implementation 2017-12-14 11:46:38 +01:00
user
a7f2fedbfb compilefix for function declaration (win only) 2017-12-14 11:45:47 +01:00
user
0e18b14605 added debug-event-markers for opengl so that you're able to set markers for renderdoc or other gpu debuggers what your program is currently doing 2017-12-14 11:44:48 +01:00
user
963551ee6e added possibility to get modelview matrix from rlgl to be able to send it to shaders 2017-12-14 11:43:06 +01:00
user
69c8fa409a fixed function declaration differ from implementation 2017-12-14 11:42:06 +01:00
user
54587d7fdb proper if-clauses for disabling functionality in text.c 2017-12-14 11:41:31 +01:00
user
08fc886afd added proper define checks for png-save if it's disabled 2017-12-14 11:40:08 +01:00
Ray
2388cbc3cd Corrected crash on shader loading
If shader file could not be found on loading it crashed, instead added
fallback to default shader!
2017-12-13 20:10:13 +01:00
Ray
a6f9cc5629 Remove rres support
Let the user choose if using rres external library
2017-12-11 11:55:02 +01:00
Ray
3e1d6859db Merge pull request #417 from a3f/develop
Add library versioning to Make/CMake build systems
2017-12-11 11:40:46 +01:00
Ahmad Fatoum
4a7840b752 Remove Meson build system
Less maintenance overhead that way,
given that make/CMake now also do library versioning.
2017-12-11 11:15:14 +01:00
Ahmad Fatoum
d24b89bb0e Add library versioning to Make/CMake build systems
See #401 for the discussion.
Also bumps version number to 1.9.2 without the -dev,
because neither ELF nor MachO like such a suffix.
The -dev suffix will have to be restricted to the git tags.
2017-12-11 10:25:06 +01:00
Ahmad Fatoum
de78fa69bc Fix CI builds after mini_al changes 2017-12-10 21:35:38 +01:00
Ahmad Fatoum
203b2f65d1 Fix typo in preprocessor macro 2017-12-10 21:11:04 +01:00
raysan5
5ae2c0d15b Added Wayland support
Updated to latest GLFW library and working on Wayland support, still
looking how to implement it on raylib because it just exposes
PLATFORM_DESKTOP and defaults to X11 windowing system on Linux...
2017-12-09 19:05:42 +01:00
Ray San
3b5a26099e Removed OpenAL Soft dependency on building
OpenAL Soft backend is still available in audio module, I'm thinking if
exposing it for building in some way or just left it there for advance
users to switch to it manually in case of necessity...
2017-12-05 14:01:35 +01:00
Ray San
33eec31575 Updated external libraries dependencies
Added dr_wav for a future use
2017-12-05 13:23:04 +01:00
Ray San
acbfba9250 Updated library features and dependencies 2017-12-05 13:22:26 +01:00
Ray
9d0ee6c2f6 Merge pull request #413 from mackron/dr/mini_al
mini_al integration
2017-12-05 11:23:16 +01:00
David Reid
104391f82b Update mini_al. 2017-12-05 18:49:00 +10:00
Ray
54d0acc3b6 Change version number for develop
Updated raylib version to 1.9-dev for development pourposes.

Next raylib version is planned to implement a big amount of changes, so
the version bump.
2017-12-05 00:05:05 +01:00
Ray San
0cd327ccb2 Moved QuaternionNlerp() function 2017-12-04 11:03:45 +01:00
David Reid
82f88e5df9 Potential fixes for Raspberry Pi. 2017-12-03 11:20:02 +10:00
Ray San
25a232a6f3 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-11-30 16:59:13 +01:00
Ray San
9a7524661f Removed GLFW3 linking and added rglfw 2017-11-30 16:59:09 +01:00
Ray
14b81c20c1 Merge pull request #410 from SamNChiet/testing_uwp
Add UWP gamepad input polling
2017-11-30 09:26:42 +01:00
Sam C
9dbd30c44b Add UWP gamepad input polling
Add a basic UWP gampead poll function with zero changes to code outside of App.cpp
2017-11-29 20:43:41 -08:00
Martinfx
825d15b069 Fixed broken include for AppVeyor 2017-11-29 17:06:40 +01:00
Ray
55396ae2b8 Merge pull request #407 from Martinfx/develop
Added support compilation with cmake for FreeBSD
2017-11-29 14:54:29 +01:00
Martinfx
69a1c19735 Fixed use ${LIBS_PRIVATE} for FreeBSD 2017-11-29 13:17:02 +01:00
Martinfx
2f471414c2 Added compile with cmake for FreeBSD 2017-11-29 00:05:39 +01:00
Martinfx
2cf37708c0 Added glfw support for FreeBSD 2017-11-29 00:04:29 +01:00
Ray San
c9722161d1 Support GetCurrentTime() on macOS 2017-11-27 12:46:40 +01:00
Ahmad Fatoum
ca921e5a53 CMake: Explicitly ask for C99 support
Otherwise using a compiler that defaults to -std=c89 or -std=gnu89 will
fail. Example:
http://www.cpantesters.org/cpan/report/abb85066-d283-11e7-9926-b2f4efb9c382

Apparently, -m32 Travis CI build was broken: -m32 was overridden by
-std=gnu99.  This fixes that.
2017-11-27 02:10:56 +01:00
Ray
7099e4ea4d Merge pull request #400 from a3f/develop
Note that raylib can now be installed via Homebrew
2017-11-26 11:24:35 +01:00
Ahmad Fatoum
a78a1504a8 Note that raylib can be installed via Homebrew
[ci skip]
2017-11-26 10:54:35 +01:00
Ahmad Fatoum
f991a075e1 Build examples and games on Travis CI
They were disabled because they failed to build,
but this patch set fixes the build on Linux and macOS.

This doesn't apply to the AppVeyor build on Windows yet;
it currently fails at linking with OpenAL.
2017-11-25 21:45:31 +01:00
raysan5
853cc6f4c9 Added authorization token 2017-11-25 19:40:05 +01:00
Ahmad Fatoum
d54ea107f7 [CI] Push Github artifacts only on tag
Forgot that one the first time round, which created some unnecssary
releases.
2017-11-24 23:03:02 +01:00
Ahmad Fatoum
13fa61f7d9 CI: Only push binaries for develop branch builds
... for now.
Syntax was confusing Travis CI, AppVeyor is reporting 401,
so lets see if this change at least fixes Travis.

If this doesn't work, it might be that @raysan5's token is required.
2017-11-24 22:53:07 +01:00
Ray
8337787ced Merge pull request #396 from a3f/develop
Setup CMake package target and CI auto-deploy tags
2017-11-24 22:33:08 +01:00
Ahmad Fatoum
49c5a433df Setup CMake package target and CI auto-deploy tags
cmake --build . --target package # or make package if make is used

can now be used to create binary packages for raylib.

AppVeyor and Travis CI are configured to push the artifacts
that result from building git tags to the related Github releases page.
2017-11-24 21:24:35 +01:00
Ray
10dc276423 Merge pull request #395 from a3f/develop
Generate and install pkg-config pc file and allow static/shared builds in one go
2017-11-24 18:49:49 +01:00
Ahmad Fatoum
44376c04fa Generate and install pkg-config pc file
After installation, compiling new programs is possible with
    $ cc game.c `pkg-config --static --libs --cflags raylib`
or
    $ cc game.c `pkg-config --libs --cflags raylib`
depending on configuration

Also adds following configuration options:
- WITH_PIC "Compile static library as position-independent code"
- STATIC_RAYLIB "Build raylib as a static library"
- MACOS_FATLIB  "Build fat library for both i386 and x86_64 on macOS"
2017-11-24 17:15:33 +01:00
David Reid
a0d9913c7c Potential fixes for audio on RPI and Emscripten builds. 2017-11-24 22:13:33 +10:00
David Reid
5463e14886 Audio: Fix a bug with AudioStreams.
This bug is a result of the buffer of an AudioStream being smaller than
that of a period of the backend playback device. In this situation,
AudioStream's would have pauses between buffer updates because the
backend is not able to re-fill the AudioStream buffer's quick enough
due to it's periods being longer than the AudioStream buffer.
2017-11-24 21:54:00 +10:00
Ray
589cec0dd5 Update README.md 2017-11-24 12:40:08 +01:00
Ray
f9d9ff7e48 Update README.md 2017-11-23 10:14:53 +01:00
Ray
83029225d6 Update README.md 2017-11-23 10:13:40 +01:00
Ray
08200f8f40 Merge pull request #393 from a3f/develop
Add AppVeyor CI for automatic Windows Builds
2017-11-23 09:59:36 +01:00
Ahmad Fatoum
17c91bad6f Disable CRT "secure" warnings
Suppresses 88 of the 213 warnings reported when compiling with
MSVC 2015 on AppVeyor.
2017-11-23 07:56:02 +01:00
Ahmad Fatoum
1e1b20c889 Add AppVeyor CI for automatic Windows Builds
We already have automatic Linux and macOS build via Travis CI.
This adds the same for Windows x86 and x86_64 with both
Microsoft Visual Studio 2015 as well as MinGW-w64.
2017-11-23 00:47:58 +01:00
Ray
96e0f0e35e Merge pull request #392 from a3f/develop
Fix macOS build of new rglfw.c approach
2017-11-22 23:16:52 +01:00
Ahmad Fatoum
b2acff66de Fix macOS build of new rglfw.c approach
There have been two problems:

* GLFW itself was compiled with the definitions for compiling
_against_ GLFW (fixed by removing requirement for external glfw)

* rglfw.c was being compiled as C code, although it includes
Objective C files.

This _might_ break the Windows build, needs to be checked.

Fixes #391, but as noted I'd prefer though a separate source directory
and build script for GLFW.
2017-11-22 23:11:41 +01:00
Ahmad Fatoum
899e1fbd94 Avoid duplicate definition of feature macro
Feature macros need to be defined before #including any headers,
preferably through the build system, but this is good enough.

Fixes a compile error on my fork's Travis CI.
2017-11-22 22:58:18 +01:00
Ray
f70a0a996c Review file issue 2017-11-22 19:51:38 +01:00
Ray San
9ec8c0f1d6 Updated OSX compilation with clang 2017-11-22 17:30:09 +01:00
Ray San
1be826fb16 Removed useless file 2017-11-22 17:30:09 +01:00
Ray
25ceec9b8f Corrected default textures locations
By default, we look for texture1 for LOC_MAP_SPECULAR and texture2 for
LOC_MAP_NORMAL
2017-11-22 14:56:45 +01:00
David Reid
8b3694a34d Fix a crash in audio mixing code. 2017-11-22 18:36:48 +10:00
Ray
6624672bfa Merge pull request #389 from Martinfx/master
Added  clean to Makefile for FreeBSD
2017-11-21 23:26:01 +01:00
Martinfx
398d793dbb Added FreeBSD clean for Makefile 2017-11-21 19:30:52 +01:00
David Reid
c71b01c8ac Update mini_al with fixes for OpenSL and SDL backends. 2017-11-21 06:35:38 +10:00
David Reid
14b889be41 Update mini_al with a potential fix for HTML5. 2017-11-20 21:47:07 +10:00
David Reid
3238cba47c Log the name of the playback device. 2017-11-19 19:38:23 +10:00
David Reid
49e945f958 Update mini_al with fixes and improvements for Emscripten. 2017-11-19 12:15:01 +10:00
David Reid
84ef860443 Update mini_al with experimental support for SDL/Emscripten. 2017-11-18 22:30:20 +10:00
David Reid
f9144ac5b0 Rename a variable for consistency. 2017-11-18 12:15:48 +10:00
David Reid
3be83dac7e Update mini_al. 2017-11-18 11:51:51 +10:00
David Reid
b9bb80d004 Add some logging and update mini_al. 2017-11-18 10:27:44 +10:00
David Reid
60d7215b2a mini_al: Unify the buffer system for Sounds and AudioStreams. 2017-11-18 08:42:14 +10:00
Ray San
6d317c7afe Remove glfw3 dependency
Full sources already included and compiled with raylib (rglfw)
2017-11-17 18:43:39 +01:00
Ray San
e2e4b8df28 Remove unneeded glfw dependencies
Only required by examples
2017-11-17 18:42:39 +01:00
Ray San
a6877c82c6 Added alternative license to rgif.h library
Just in case of legal conflict with public domain software, added MIT
alternative license.
2017-11-17 18:30:19 +01:00
David Reid
261b00e9e8 Update mini_al. 2017-11-17 21:12:05 +10:00
Ray San
a6416f82a7 Reviewed file comments 2017-11-16 17:59:35 +01:00
David Reid
96be62e88b Update mini_al.h 2017-11-16 21:49:45 +10:00
David Reid
e03afbf2fa Add support for pitch shifting.
This commit should bring the mini_al backend up to feature parity with
the OpenAL backend.
2017-11-15 22:04:23 +10:00
David Reid
322d868841 Fix minor errors with the OpenAL backend. 2017-11-14 21:44:57 +10:00
David Reid
88d2810fa3 Bug fixes for Music with mini_al. 2017-11-14 21:15:50 +10:00
Ray
68024f1b0b Added desktop platform check...
...to define proper values
2017-11-13 21:37:00 +01:00
David Reid
3a96a66fdf Bring up to date with changes to mini_al. 2017-11-13 21:46:29 +10:00
Ray San
9c65caea8c Added GLFW sources to raylib
Compiling GLFW library with raylib avoids external dependencies, this
way we solve version problems in some platforms
2017-11-13 12:09:41 +01:00
Ray San
6105ff9959 Added VS2015 UWP solution 2017-11-13 08:44:17 +01:00
David Reid
e52f4282d6 Update comments. 2017-11-12 22:57:31 +10:00
David Reid
ac4c911ad7 Work on porting Music to mini_al. 2017-11-12 21:55:24 +10:00
David Reid
68bf6c9701 Initial work on porting AudioStream to use mini_al. 2017-11-12 20:59:16 +10:00
raysan5
24b12e5e23 Remove PLATFORM_ checks from raylib header
Now header is truly multiplatform...

Actually still a small pending check on XBOX gamepad controls that
hopefully will be removed with next GLFW 3.3
2017-11-12 11:45:35 +01:00
raysan5
02dd4d32b5 Allow custom distortion shader - IN PROGRESS - 2017-11-12 11:00:28 +01:00
raysan5
09228752ce Review default shaders usage on loading 2017-11-12 10:33:44 +01:00
David Reid
b0852002b8 Rename SoundInternal to SoundData for consistency with MusicData. 2017-11-12 14:54:37 +10:00
David Reid
75433a670e Initial work on adding support for mini_al. 2017-11-12 14:17:05 +10:00
Ray San
b6b58991e6 Working on UWP support
Support Universal Windows Platform (UWP):
- Windows 10 App
- Windows Phone
- Xbox One
2017-11-10 12:37:53 +01:00
Ray
e12182f59b Merge pull request #384 from nounoursheureux/develop
Store the default shaders
2017-11-10 12:10:49 +01:00
Wilhem Barbier
7ef604fbf5 Store the default shaders 2017-11-09 20:47:22 +01:00
Ray San
0eb222bda1 Issue with libraries renamed on Raspbian Stretch
libEGL and libGLESv2 have been renamed on latest Raspbian Stretch
version (also included on latest Jessie upgrade).

It seems to be done to avoid conflicts between official Mesa libs and
Broadcomm provided ones.
2017-11-07 13:02:15 +01:00
Ray
99d3803d16 Added VS2017 raylib project 2017-11-06 23:56:03 +01:00
Ray San
37986b26cb Corrected issue with text drawing on image 2017-11-06 14:13:50 +01:00
Ray San
2f024dbfef Corrected possible issue on FBO creation
USE_DEPTH_RENDERBUFFER on OpenGL 2.1
2017-11-06 13:58:11 +01:00
Ray San
4fe8e05a7f Review GLSL 120 shaders
Not tested, could have errors
2017-11-06 13:49:33 +01:00
Ray San
81518ccd13 Corrected issue with shader locations init
On RPI, after latest drivers update, models were not rendered properly
cause of that...
2017-11-06 13:41:13 +01:00
Ray
2eceecb7b7 Merge pull request #382 from nounoursheureux/develop
Have SetShaderValue(i) take a const pointer
2017-11-05 22:47:55 +01:00
Wilhem Barbier
879c2f484b SetShaderValue take const pointer 2017-11-05 21:57:29 +01:00
Ray
085779707f Uploaded shaders for GLSL 120 2017-11-05 17:13:17 +01:00
Ray
24657ca789 Review textures to be POT
Could correct possible issues on OpenGL 1.1
2017-11-05 17:06:50 +01:00
Ray
5f65380732 Merge branch 'develop' of https://github.com/raysan5/raylib into develop 2017-11-05 09:58:31 +01:00
Ray
aa6a1b4283 Corrected issue with missing defines 2017-11-05 09:58:25 +01:00
raysan5
36ae9c8c3a Compile DLL avoiding extra dependencies
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin>dumpbin.exe
D:\GitHub\raylib\release\libs\win32\msvc\raylib.dll /DEPENDENTS

Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file D:\GitHub\raylib\release\libs\win32\msvc\raylib.dll

File Type: DLL

Image has the following dependencies:

KERNEL32.dll
glfw3.dll
OpenAL32.dll

Summary

4000 .data
1000 .gfids
23000 .rdata
5000 .reloc
1000 .rsrc
68000 .text
1000 _RDATA
2017-11-04 18:36:15 +01:00
Ray
d43af4918b Improve textures support for OpenGL 2.1 2017-11-04 16:57:46 +01:00
Ray
9e0105a1a3 Corrected function name 2017-11-04 16:57:20 +01:00
Ray San
c570f7ca63 Rebuild dynamic libs for MSVC (VS2015)
Added support for raylib DLL building on MSVC
2017-11-03 17:32:13 +01:00
Ray San
244007a99b Review Fade() functionality 2017-11-03 12:41:03 +01:00
Ray San
3c3d56bb4a Renamed data types to standard names 2017-11-03 12:40:46 +01:00
Ray San
3d755d617a Some code tweaks... 2017-11-02 20:08:52 +01:00
Ray San
415e7e972c Review some issues, view description
- Review RPI compilation (core_drop_files not supported)
- Review ImageFormat(), some issues
- GetTextureData() reviewed for RPI
2017-10-30 13:51:46 +01:00
Ray San
f460b3842e Added new example: text drawing on image 2017-10-30 09:37:16 +01:00
Ray
743cc6add6 Review new build platform: FreeBSD
Corrected issue with RPI_CROSS_COMPILE
2017-10-30 00:14:13 +01:00
raysan5
ecf797cc7d Updated VS2015 project include and link paths 2017-10-29 14:33:35 +01:00
Ray
52cd0395b4 Merge pull request #373 from Martinfx/master
Added support FreeBSD
2017-10-28 22:22:04 +02:00
Martinfx
f897169160 Removed comment 2017-10-28 18:53:32 +02:00
Martinfx
47c7f3624f Added support FreeBSD for example 2017-10-28 18:41:29 +02:00
Martinfx
b3110c14fe Added support FreeBSD 2017-10-28 17:30:02 +02:00
Ray San
ab01cd45bc Review rlReadTexturePixels()
Improve second option to retrieve texture data from fbo...

Still requires some testing...
2017-10-25 12:46:26 +02:00
Ray San
31c8c86d8e Comment tweak...
...while reviewing GetTextureData() functionality on OpenGL ES 2.0
2017-10-25 12:33:44 +02:00
Ray
9b24554698 Added youtube channel link
Hopefully new videos comming soon...
2017-10-25 11:37:19 +02:00
Ray
539a9ca50e Corrected ImageTextEx()
- Added new function: GenImageColor()

ImageDraw() should be reviewed... specially alpha blending...
2017-10-25 01:24:17 +02:00
Ray
cbe0dcedfe Corrected issue with ttf font y-offset 2017-10-25 00:30:58 +02:00
Ray
61b0ab5332 Corrected some issues on game
Now it works! :)
2017-10-24 00:27:25 +02:00
Ray
9668f546d3 Example shader correction 2017-10-23 22:41:06 +02:00
raysan5
bd2e3b2a90 Removed file 2017-10-23 00:21:20 +02:00
314 changed files with 66838 additions and 21659 deletions

25
.gitignore vendored
View File

@@ -83,20 +83,20 @@ xcschememanagement.plist
xcuserdata/
DerivedData/
# external libraries DLLs
!src/external/glfw3/lib/win32/glfw3.dll
!src/external/openal_soft/lib/win32/OpenAL32.dll
# Visual Studio project
project/vs2015/*.db
project/vs2015/*.opendb
project/vs2015.UWP/packages
project/vs2015.UWP/*.db
!project/vs2015/raylib.sln
!project/vs2015/raylib/*.vcxproj
!project/vs2015/examples/*.vcxproj
!project/vs2015/external/glfw3/lib/win32/glfw3.dll
!project/vs2015/external/openal_soft/lib/win32/OpenAL32.dll
!project/vs2015/external/openal_soft/lib/win64/OpenAL32.dll
!project/vs2015/external/lua/lib/win32/lua53.dll
!project/vs2017/raylib.sln
!project/vs2017/raylib/*.vcxproj
!project/vs2017/examples/*.vcxproj
!project/vs2015.UWP/raylib/*.vcxproj
!project/vs2015.UWP/*.sln
!project/vs2015.UWP/raylib.App.UWP/*.vcxproj
# Web examples
docs/examples/web/*.html
@@ -111,15 +111,11 @@ docs/examples/web/*/*.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
@@ -133,3 +129,8 @@ build
# Ignore Android generated files and folders
templates/android_project/output
# Ignore GNU global tags
GPATH
GRTAGS
GTAGS

View File

@@ -1,50 +1,62 @@
language: c
sudo: required
dist: trusty
git:
depth: 3
os:
- osx
- linux
# TODO we could use a 32 bit Docker container for running true 32-bit tests
# services: - docker
env:
global:
- VERBOSE=1
matrix:
- CFLAGS=-m64
- CFLAGS=-m32
matrix:
include:
- os: linux
env: ARCH=i386
sudo: required
- os: linux
env: ARCH=amd64
sudo: required
- os: osx
env: ARCH=universal
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;
libasound2-dev:$ARCH
libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
libx11-dev:$ARCH libxrandr-dev:$ARCH libxi-dev:$ARCH
libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
if [ "$ARCH" == "i386" ]; then export CFLAGS="-m32"; fi;
if [ "$ARCH" == "amd64" ]; then export CFLAGS="-m64"; fi;
if [ "$GLFW" == "SYSTEM" ]; then
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3_3.2.1-1_amd64.deb';
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3-dev_3.2.1-1_amd64.deb';
sudo dpkg -i libglfw3_3.2.1-1_amd64.deb libglfw3-dev_3.2.1-1_amd64.deb;
fi;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export RAYLIB_PACKAGE_SUFFIX="-macOS";
if [ "$GLFW" == "SYSTEM" ]; then brew update; brew install glfw; fi;
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
- cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE ..
- make VERBOSE=1
- make package
deploy:
provider: releases
api_key:
secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA=
file_glob: true
file: raylib-*.tar.gz
skip_cleanup: true
on:
repo: raysan5/raylib
branch: develop
tags: true

19
CMakeLists.txt Normal file → Executable file
View File

@@ -4,6 +4,25 @@ cmake_minimum_required(VERSION 3.0)
set(BUILD_EXAMPLES ON CACHE BOOL "Build the examples.")
set(BUILD_GAMES ON CACHE BOOL "Build the example games.")
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
endif()
else()
set (CMAKE_C_STANDARD 99)
endif()
include(CheckCCompilerFlag)
foreach(option -Werror=pointer-arith;-Werror=implicit-function-declaration)
CHECK_C_COMPILER_FLAG("${option}" COMPILER_HAS_THOSE_TOGGLES)
set(outcome "Failed")
if(COMPILER_HAS_THOSE_TOGGLES)
set(CMAKE_C_FLAGS "${option} ${CMAKE_C_FLAGS}")
set(outcome "works")
endif()
message(STATUS "Testing if ${option} can be used -- ${outcome}")
endforeach()
add_subdirectory(src release)
if (${BUILD_EXAMPLES})

142
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,142 @@
## Contributing to raylib
Hello contributors! Welcome to raylib!
This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules.
Use your best judgement, and feel free to propose changes to this document in a pull-request.
### raylib philosophy
- raylib is a tool to LEARN videogames programming, every single function in raylib should be a tutorial on itself.
- raylib is SIMPLE and EASY-TO-USE, I tried to keep it compact with a small set of functions, if a function is too complex or is not clearly useful, better not to include it.
- raylib is open source and free; educators and institutions can use this tool to TEACH videogames programming completely by free.
- raylib is collaborative; contribution of tutorials / code-examples / bugs-solving / code-comments are highly appreciated.
- raylib's license (and its external libs respective licenses) allow using it for commercial products.
### Some interesting reads to start with
- [raylib history](HISTORY.md)
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
- [raylib license](LICENSE.md)
- [raylib roadmap](ROADMAP.md)
[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit.
Feel free to review it if required, just take care not to break anything.
### raylib C coding conventions
Despite being written in C, raylib does not follow the standard Hungarian notation for C,
it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions),
more common on C# language. All code formatting decisions have been carefully taken
to make it easier for students to read, write and understand code.
Source code is extensively commented for that purpose, raylib primary learning method is:
> learn by reading code and examples
### Using raylib develop branch
raylib [master branch](https://github.com/raysan5/raylib) contains the latest raylib release but all
the future work is always done on [develop branch](https://github.com/raysan5/raylib/tree/develop),
it's far ahead of master and I try to keep it always stable with latest library changes.
Please, if issuing a bug or sending a pull-request, verify that you're using develop branch.
Note that while using develop branch predefined Notepad++ building scripts could not work, in that case,
use provided [Makefile](https://github.com/raysan5/raylib/blob/develop/src/Makefile) or [CMake](https://github.com/raysan5/raylib/blob/develop/src/CMakeLists.txt) building systems.
For detailed information on building raylib and examples, please check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
### Opening new Issues
To open new issue for raylib (bug, enhancement, discussion...), just try to follow these rules:
- Make sure the issue has not already been reported before by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a
title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior.
- If applies, attach some screenshot of the issue and a .zip file with the code sample and required resources.
- On issue description, add a brackets tag about the raylib module that relates to this issue.
If don't know the module, just report the issue, I will review it.
- You can check other issues to see how is being done!
### Sending a Pull-Request
To send a pull-request, first of all, make sure you're sending it to [develop branch](https://github.com/raysan5/raylib/tree/develop). Here are some other rules:
- Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
- Don't send big pull-requests (lots of changelists), they are difficult to review. It's better to send small pull-request, one at a time.
- Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry
if you cannot test all the platforms.
### raylib bindings
Some people ported raylib to other languages in form of bindings or wrappers to the library, here is a list with the ones I'm aware of:
- [raylib C/C++ version (default)](https://github.com/raysan5/raylib)
- [raylib Lua binding](https://github.com/raysan5/raylib-lua)
- [raylib Go binding](https://github.com/gen2brain/raylib-go)
- [raylib Nim binding](https://gitlab.com/define-private-public/raylib-Nim)
- [raylib Crystal binding](https://gitlab.com/Zatherz/cray)
- [raylib Perl wrapper](https://metacpan.org/pod/Graphics::Raylib)
- raylib Pascal binding with custom IDE (closed-source)
Usually, raylib bindings follow the convention: `raylib-{language}`
Let me know if you're writing a new binding for raylib, I will list it here and I usually
provide the icon/logo for that new language binding.
### Contact information
If you have any doubt, don't hesitate to [contact me](mailto:ray@raylib.com)!.
You can write me a direct mail but you can also contact me on the following networks:
- [raylib forum](http://forum.raylib.com/) - A good place for discussions or to ask for help.
- [raylib gitter](https://gitter.im/raylib) - A direct communication channel for project discussions.
- [raylib twitter](https://twitter.com/raysan5) - My personal twitter account, I usually post about raylib, you can send me PMs.
- [raylib web](http://www.raylib.com/) - On top-right corner there is a bunch of networks where you can find me.
Thank you very much for your time! :)
----
Here is a list of raylib contributors, these people have invested part of their time
contributing (in some way or another) to make the raylib project better. Huge thanks to all of them!
- [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
- [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS
- [Wilhem Barbier](https://github.com/nounoursheureux) for supporting default shaders on shader loading, if shader not provided
- [Ahmad Fatoum](https://github.com/a3f) for implementing continuus integration support for raylib (Travis and AppVeyor) and greatly improving build system.
- [SamNChiet](https://github.com/SamNChiet) for his work on UWP inputs implementation.
- [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing mini_al audio library.
- [Kai](https://github.com/questor) for multiple code reviews and improvements.
Please, if I forget someone in this list, excuse me and write me an email to remind me to add you!

View File

@@ -1,35 +0,0 @@
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

@@ -11,23 +11,27 @@ no fancy interface, no visual helpers, no auto-debugging... just coding in the m
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)
[![https://ci.appveyor.com/api/projects/status/github/raysan5/raylib?svg=true](https://ci.appveyor.com/api/projects/status/github/raysan5/raylib?svg=true)](https://ci.appveyor.com/project/raysan5/raylib)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/raylib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE.md)
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow)](https://twitter.com/raysan5)
features
--------
* Written in plain C code (C99) in PascalCase/camelCase notation
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2)
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
* 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 Geometrics, Models, Billboards, Heightmaps and Cubicmaps
* Powerful fonts module with SpriteFonts support (XNA fonts, AngelCode fonts, TTF)
* Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
* Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
* Flexible Materials system, supporting classic maps and PBR maps
* Shaders support, including Model shaders and Postprocessing shaders
* 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
* Minimal external dependencies (GLFW3, OpenGL, OpenAL)
* Multiple platforms support: Windows, Linux, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5.
* VR stereo rendering with configurable HMD device parameters
* NO external dependencies, all required libraries included with raylib
* 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 I found for
@@ -40,10 +44,14 @@ to accomodate to Android, Raspberry Pi and HTML5.
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
building
--------
build and installation
----------------------
For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
Binary releases for Windows, Linux and macOS are available at the [Github Releases](https://github.com/raysan5/raylib/releases) page. Raylib is also available via following package managers:
* Homebrew: `brew install raylib`
To build raylib yourself, check out the [raylib Wiki](https://github.com/raysan5/raylib/wiki) for detailed instructions.
raylib has been developed using exclusively two tools:
@@ -61,6 +69,7 @@ contact
* Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
* Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5)
* YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/channel/UC8WIBkhYb5sBNqXO1mZ7WSQ)
If you are using raylib and you enjoy it, please, [let me know][raysan5].

65
appveyor.yml Normal file
View File

@@ -0,0 +1,65 @@
#os: Visual Studio 2015
clone_depth: 5
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
init:
- cmake -E remove c:\programdata\chocolatey\bin\cpack.exe
- set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=%
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32
- if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
- if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH%
- set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER%
- set VERBOSE=1
environment:
matrix:
- compiler: mingw
bits: 32
examples: ON
- compiler: mingw
bits: 64
examples: ON
- compiler: msvc15
bits: 32
examples: OFF
- compiler: msvc15
bits: 64
examples: OFF
before_build:
- if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles"
- if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015"
- if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64"
- mkdir build
- cd build
build_script:
- cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% ..
- cmake --build . --target install
after_build:
- cmake --build . --target package
before_test:
test_script:
artifacts:
- path: 'build\*.zip'
deploy:
- provider: GitHub
auth_token:
secure: OxKnnT3tlkPl9365cOO84rDWU4UkHIYJc0D3r3Tv7rB3HaR2BBhlhCnl7g3nuOJy
artifact: /.*\.zip/
draft: false
prerelease: false
force_update: true
on:
branch: develop
appveyor_repo_tag: true # deploy on tag push only

View File

@@ -7,9 +7,20 @@ include("../utils.cmake")
# TODO `build` directory should maybe be something else...
# TODO place somewhere else?
include_directories("../build/release")
include_directories("../src/external")
include_directories("../src/external/glfw/include")
# Get the sources together
set(example_dirs audio core models others physac shaders text texutures)
set(example_dirs audio core models others shaders shapes text textures)
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=199309L)
include(CheckSymbolExists)
check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC)
check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC)
set(CMAKE_REQUIRED_DEFINITIONS)
if(HAVE_QPC OR HAVE_CLOCK_MONOTONIC)
set(example_dirs ${example_dirs} physac)
endif()
set(example_sources)
set(example_resources)
foreach(example_dir ${example_dirs})
@@ -22,6 +33,14 @@ foreach(example_dir ${example_dirs})
list(APPEND example_resources ${resources})
endforeach()
include(CheckIncludeFiles)
check_include_files(OVR_CAPI_GL.h HAVE_OCULUS_CAPI)
if(NOT HAVE_OCULUS_CAPI)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/oculus_rift.c)
endif()
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c)
# Do each example
foreach(example_source ${example_sources})
# Create the basename for the example

View File

@@ -2,7 +2,7 @@
#
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
#
# Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2018 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.
@@ -29,76 +29,87 @@ PLATFORM ?= PLATFORM_DESKTOP
RAYLIB_PATH ?= ..
PROJECT_NAME ?= raylib_example
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib
endif
# Library type used for raylib and OpenAL Soft: STATIC (.a) or SHARED (.so/.dll)
# NOTE: Libraries should be provided in the selected form
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
OPENAL_LIBTYPE ?= STATIC
# On PLATFORM_WEB force OpenAL Soft shared library
ifeq ($(PLATFORM),PLATFORM_WEB)
OPENAL_LIBTYPE = SHARED
endif
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# Use Wayland display server protocol on Linux desktop
# by default it uses X11 windowing system
USE_WAYLAND_DISPLAY ?= FALSE
# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile)
# 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
# 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)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
LIBPATH=linux
else
endif
ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX
LIBPATH=osx
endif
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI cross-compiler
RPI_CROSS_COMPILE ?= NO
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH = C:/emsdk
EMSCRIPTEN_VERSION = 1.37.21
CLANG_VERSION=e1.37.21_64bit
EMSCRIPTEN_VERSION = 1.37.28
CLANG_VERSION=e1.37.28_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
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
# Define raylib release directory for compiled library
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
endif
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
endif
ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif
ifeq ($(PLATFORM_OS),FREEBSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
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
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
endif
# Define default C compiler: gcc
# NOTE: define g++ compiler if using C++
CC = gcc
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
@@ -106,11 +117,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler
CC = clang
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# FreeBSD default compiler
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES)
# RPI cross-compiler
CC = armv6j-hardfloat-linux-gnueabi-gcc
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
@@ -129,7 +145,7 @@ endif
# Define compiler flags:
# -O1 defines optimization level
# -Og enable debugging
# -g enable debugging
# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -std=c99 defines C language mode (standard C from 1999 revision)
@@ -160,7 +176,13 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# -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
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
# --preload-file resources # specify a resources folder for data compilation
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
# Define a custom shell .html and output extension
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
EXT = .html
endif
# Define include paths for required headers
@@ -176,7 +198,14 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
endif
# Define library paths containing required libs
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD)
INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -L/opt/vc/lib
@@ -186,50 +215,53 @@ endif
# 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
# Libraries for Windows desktop compilation
LDLIBS = -lraylib -lopengl32 -lgdi32
# 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
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
# On X11 requires also below libraries
LDLIBS += -lX11
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
# On Wayland windowing system, additional libraries requires
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
endif
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for OSX 10.9 desktop compiling
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# Libraries for FreeBSD desktop compiling
# NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm
# 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
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
# NOTE: It could require additional packages installed: libglfw3-dev
LDLIBS += -lglfw
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
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
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
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
endif
# Define all object files required
@@ -266,6 +298,7 @@ EXAMPLES = \
textures/textures_image_processing \
textures/textures_image_drawing \
textures/textures_image_generation \
textures/textures_image_text \
text/text_sprite_fonts \
text/text_bmfont_ttf \
text/text_raylib_fonts \
@@ -282,9 +315,9 @@ EXAMPLES = \
models/models_cubicmap \
models/models_mesh_picking \
models/models_mesh_generation \
models/models_yaw_pitch_roll \
models/models_material_pbr \
models/models_skybox \
models/models_yaw_pitch_roll \
shaders/shaders_model_shader \
shaders/shaders_shapes_textures \
shaders/shaders_custom_uniform \
@@ -298,7 +331,7 @@ EXAMPLES = \
physac/physics_movement \
physac/physics_restitution \
physac/physics_shatter \
fix_dylib \
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))

View File

@@ -119,17 +119,17 @@ int main()
BeginBlendMode(BLEND_ALPHA);
DrawTexturePro(texBackground, (Rectangle){0,0,texBackground.width, texBackground.height},
DrawTexturePro(texBackground, (Rectangle){ 0, 0, texBackground.width, texBackground.height },
(Rectangle){ centerX, centerY, texBackground.width*scaleFactor, texBackground.height*scaleFactor},
(Vector2){texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor}, roll, WHITE);
(Vector2){ texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE);
DrawTexturePro(texPitch, (Rectangle){ 0, 0, texPitch.width, texPitch.height },
(Rectangle){ centerX, centerY, texPitch.width*scaleFactor, texPitch.height*scaleFactor },
(Vector2){ texPitch.width/2*scaleFactor, texPitch.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE);
DrawTexturePro(texPlane, (Rectangle){0,0,texPlane.width, texPlane.height },
DrawTexturePro(texPlane, (Rectangle){ 0, 0, texPlane.width, texPlane.height },
(Rectangle){ centerX, centerY, texPlane.width*scaleFactor, texPlane.height*scaleFactor },
(Vector2){texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, WHITE);
(Vector2){ texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, WHITE);
EndBlendMode();
@@ -144,9 +144,9 @@ int main()
End3dMode();
// Draw 2D GUI stuff
DrawAngleGauge(texAngleGauge, 80, 80, roll, "roll", RED);
DrawAngleGauge(texAngleGauge, 190, 80, pitch, "pitch", GREEN);
DrawAngleGauge(texAngleGauge, 300, 80, yaw, "yaw", SKYBLUE);
DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RED);
DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", GREEN);
DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", SKYBLUE);
DrawRectangle(30, 360, 260, 70, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(30, 360, 260, 70, Fade(DARKBLUE, 0.5f));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -26,14 +26,11 @@
********************************************************************************************/
#include <stdio.h>
#include "audio.h"
#if defined(_WIN32)
#include <conio.h> // Windows only, no stardard library
#endif
#include "audio.h"
#if defined(__linux__)
#else
#include <stdio.h>
#include <termios.h>
#include <unistd.h>

View File

@@ -10,7 +10,7 @@ varying vec2 fragTexCoord;
varying vec4 fragColor;
varying vec3 fragNormal;
uniform mat4 mvpMatrix;
uniform mat4 mvp;
void main()
{
@@ -19,5 +19,5 @@ void main()
fragColor = vertexColor;
fragNormal = vertexNormal;
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
gl_Position = mvp*vec4(vertexPosition, 1.0);
}

View File

@@ -10,7 +10,7 @@ out vec2 fragTexCoord;
out vec4 fragColor;
out vec3 fragNormal;
uniform mat4 mvpMatrix;
uniform mat4 mvp;
void main()
{
@@ -19,5 +19,5 @@ void main()
fragColor = vertexColor;
fragNormal = vertexNormal;
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
gl_Position = mvp*vec4(vertexPosition, 1.0);
}

View File

@@ -0,0 +1,22 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
uniform vec2 resolution = vec2(800, 450);
void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord);
// NOTE: Implement here your fragment shader code
gl_FragColor = texelColor*colDiffuse;
}

View File

@@ -0,0 +1,26 @@
#version 120
// Input vertex attributes
attribute vec3 vertexPosition;
attribute vec2 vertexTexCoord;
attribute vec3 vertexNormal;
attribute vec4 vertexColor;
// Input uniform values
uniform mat4 mvp;
// Output vertex attributes (to fragment shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// NOTE: Add here your custom variables
void main()
{
// Send vertex attributes to fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
// Calculate final vertex position
gl_Position = mvp*vec4(vertexPosition, 1.0);
}

View File

@@ -0,0 +1,37 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
const vec2 size = vec2(800, 450); // render size
const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance
const float quality = 2.5; // lower = smaller glow, better quality
void main()
{
vec4 sum = vec4(0);
vec2 sizeFactor = vec2(1)/size*quality;
// Texel color fetching from texture sampler
vec4 source = texture2D(texture0, fragTexCoord);
const int range = 2; // should be = (samples - 1)/2;
for (int x = -range; x <= range; x++)
{
for (int y = -range; y <= range; y++)
{
sum += texture2D(texture0, fragTexCoord + vec2(x, y)*sizeFactor);
}
}
// Calculate final fragment color
gl_FragColor = ((sum/(samples*samples)) + source)*colDiffuse;
}

View File

@@ -0,0 +1,32 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
const float renderHeight = 450.0;
vec3 offset = vec3(0.0, 1.3846153846, 3.2307692308);
vec3 weight = vec3(0.2270270270, 0.3162162162, 0.0702702703);
void main()
{
// Texel color fetching from texture sampler
vec3 tc = texture2D(texture0, fragTexCoord).rgb*weight.x;
tc += texture2D(texture0, fragTexCoord + vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
tc += texture2D(texture0, fragTexCoord - vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
tc += texture2D(texture0, fragTexCoord + vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
tc += texture2D(texture0, fragTexCoord - vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
gl_FragColor = vec4(tc, 1.0);
}

View File

@@ -0,0 +1,45 @@
# version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
float hatchOffsetY = 5.0;
float lumThreshold01 = 0.9;
float lumThreshold02 = 0.7;
float lumThreshold03 = 0.5;
float lumThreshold04 = 0.3;
void main()
{
vec3 tc = vec3(1.0, 1.0, 1.0);
float lum = length(texture2D(texture0, fragTexCoord).rgb);
if (lum < lumThreshold01)
{
if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
if (lum < lumThreshold02)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
if (lum < lumThreshold03)
{
if (mod(gl_FragCoord .x + gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
if (lum < lumThreshold04)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
gl_FragColor = vec4(tc, 1.0);
}

View File

@@ -0,0 +1,55 @@
# version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
const float renderHeight = 450.0;
float stitchingSize = 6.0;
int invert = 0;
vec4 PostFX(sampler2D tex, vec2 uv)
{
vec4 c = vec4(0.0);
float size = stitchingSize;
vec2 cPos = uv * vec2(renderWidth, renderHeight);
vec2 tlPos = floor(cPos / vec2(size, size));
tlPos *= size;
int remX = int(mod(cPos.x, size));
int remY = int(mod(cPos.y, size));
if (remX == 0 && remY == 0) tlPos = cPos;
vec2 blPos = tlPos;
blPos.y += (size - 1.0);
if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y)))))
{
if (invert == 1) c = vec4(0.2, 0.15, 0.05, 1.0);
else c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
}
else
{
if (invert == 1) c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
else c = vec4(0.0, 0.0, 0.0, 1.0);
}
return c;
}
void main()
{
vec3 tc = PostFX(texture0, fragTexCoord).rgb;
gl_FragColor = vec4(tc, 1.0);
}

View File

@@ -0,0 +1,52 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
// Input uniform values
uniform sampler2D texture0;
// NOTE: Default parameters for Oculus Rift DK2 device
const vec2 LeftLensCenter = vec2(0.2863248, 0.5);
const vec2 RightLensCenter = vec2(0.7136753, 0.5);
const vec2 LeftScreenCenter = vec2(0.25, 0.5);
const vec2 RightScreenCenter = vec2(0.75, 0.5);
const vec2 Scale = vec2(0.25, 0.45);
const vec2 ScaleIn = vec2(4.0, 2.5);
const vec4 HmdWarpParam = vec4(1.0, 0.22, 0.24, 0.0);
const vec4 ChromaAbParam = vec4(0.996, -0.004, 1.014, 0.0);
void main()
{
// The following two variables need to be set per eye
vec2 LensCenter = fragTexCoord.x < 0.5 ? LeftLensCenter : RightLensCenter;
vec2 ScreenCenter = fragTexCoord.x < 0.5 ? LeftScreenCenter : RightScreenCenter;
// Scales input texture coordinates for distortion: vec2 HmdWarp(vec2 fragTexCoord, vec2 LensCenter)
vec2 theta = (fragTexCoord - LensCenter)*ScaleIn; // Scales to [-1, 1]
float rSq = theta.x*theta.x + theta.y*theta.y;
vec2 theta1 = theta*(HmdWarpParam.x + HmdWarpParam.y*rSq + HmdWarpParam.z*rSq*rSq + HmdWarpParam.w*rSq*rSq*rSq);
//vec2 tc = LensCenter + Scale*theta1;
// Detect whether blue texture coordinates are out of range since these will scaled out the furthest
vec2 thetaBlue = theta1*(ChromaAbParam.z + ChromaAbParam.w*rSq);
vec2 tcBlue = LensCenter + Scale*thetaBlue;
if (any(bvec2(clamp(tcBlue, ScreenCenter - vec2(0.25, 0.5), ScreenCenter + vec2(0.25, 0.5)) - tcBlue))) gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
else
{
// Do blue texture lookup
float blue = texture2D(texture0, tcBlue).b;
// Do green lookup (no scaling)
vec2 tcGreen = LensCenter + Scale*theta1;
float green = texture2D(texture0, tcGreen).g;
// Do red scale and lookup
vec2 thetaRed = theta1*(ChromaAbParam.x + ChromaAbParam.y*rSq);
vec2 tcRed = LensCenter + Scale*thetaRed;
float red = texture2D(texture0, tcRed).r;
gl_FragColor = vec4(red, green, blue, 1.0);
}
}

View File

@@ -0,0 +1,35 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
void main()
{
vec4 color = texture2D(texture0, fragTexCoord);
color += texture2D(texture0, fragTexCoord + 0.001);
color += texture2D(texture0, fragTexCoord + 0.003);
color += texture2D(texture0, fragTexCoord + 0.005);
color += texture2D(texture0, fragTexCoord + 0.007);
color += texture2D(texture0, fragTexCoord + 0.009);
color += texture2D(texture0, fragTexCoord + 0.011);
color += texture2D(texture0, fragTexCoord - 0.001);
color += texture2D(texture0, fragTexCoord - 0.003);
color += texture2D(texture0, fragTexCoord - 0.005);
color += texture2D(texture0, fragTexCoord - 0.007);
color += texture2D(texture0, fragTexCoord - 0.009);
color += texture2D(texture0, fragTexCoord - 0.011);
color.rgb = vec3((color.r + color.g + color.b)/3.0);
color = color/9.5;
gl_FragColor = color;
}

View File

@@ -0,0 +1,41 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
const float PI = 3.1415926535;
void main()
{
float aperture = 178.0;
float apertureHalf = 0.5 * aperture * (PI / 180.0);
float maxFactor = sin(apertureHalf);
vec2 uv = vec2(0.0);
vec2 xy = 2.0 * fragTexCoord.xy - 1.0;
float d = length(xy);
if (d < (2.0 - maxFactor))
{
d = length(xy * maxFactor);
float z = sqrt(1.0 - d * d);
float r = atan(d, z) / PI;
float phi = atan(xy.y, xy.x);
uv.x = r * cos(phi) + 0.5;
uv.y = r * sin(phi) + 0.5;
}
else
{
uv = fragTexCoord.xy;
}
gl_FragColor = texture2D(texture0, uv);
}

View File

@@ -0,0 +1,23 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord)*colDiffuse*fragColor;
// Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
// Calculate final fragment color
gl_FragColor = vec4(gray, gray, gray, texelColor.a);
}

View File

@@ -0,0 +1,30 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
const float renderHeight = 450.0;
float pixelWidth = 5.0;
float pixelHeight = 5.0;
void main()
{
float dx = pixelWidth*(1.0/renderWidth);
float dy = pixelHeight*(1.0/renderHeight);
vec2 coord = vec2(dx*floor(fragTexCoord.x/dx), dy*floor(fragTexCoord.y/dy));
vec3 tc = texture2D(texture0, coord).rgb;
gl_FragColor = vec4(tc, 1.0);
}

View File

@@ -0,0 +1,27 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
float gamma = 0.6;
float numColors = 8.0;
void main()
{
vec3 color = texture2D(texture0, fragTexCoord.xy).rgb;
color = pow(color, vec3(gamma, gamma, gamma));
color = color*numColors;
color = floor(color);
color = color/numColors;
color = pow(color, vec3(1.0/gamma));
gl_FragColor = vec4(color, 1.0);
}

View File

@@ -0,0 +1,29 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
void main()
{
vec3 color = texture2D(texture0, fragTexCoord).rgb;
vec3 colors[3];
colors[0] = vec3(0.0, 0.0, 1.0);
colors[1] = vec3(1.0, 1.0, 0.0);
colors[2] = vec3(1.0, 0.0, 0.0);
float lum = (color.r + color.g + color.b)/3.0;
vec3 tc = vec3(0.0, 0.0, 0.0);
if (lum < 0.5) tc = mix(colors[0], colors[1], lum/0.5);
else tc = mix(colors[1], colors[2], (lum - 0.5)/0.5);
gl_FragColor = vec4(tc, 1.0);
}

View File

@@ -0,0 +1,42 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
float offset = 0.0;
float frequency = 450.0/3.0;
uniform float time;
void main()
{
/*
// Scanlines method 1
float tval = 0; //time
vec2 uv = 0.5 + (fragTexCoord - 0.5)*(0.9 + 0.01*sin(0.5*tval));
vec4 color = texture2D(texture0, fragTexCoord);
color = clamp(color*0.5 + 0.5*color*color*1.2, 0.0, 1.0);
color *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0 - uv.x)*(1.0 - uv.y);
color *= vec4(0.8, 1.0, 0.7, 1);
color *= 0.9 + 0.1*sin(10.0*tval + uv.y*1000.0);
color *= 0.97 + 0.03*sin(110.0*tval);
fragColor = color;
*/
// Scanlines method 2
float globalPos = (fragTexCoord.y + offset) * frequency;
float wavePos = cos((fract(globalPos) - 0.5)*3.14);
vec4 color = texture2D(texture0, fragTexCoord);
gl_FragColor = mix(vec4(0.0, 0.3, 0.0, 0.0), color, wavePos);
}

View File

@@ -0,0 +1,38 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
vec2 resolution = vec2(800.0, 450.0);
void main()
{
float x = 1.0/resolution.x;
float y = 1.0/resolution.y;
vec4 horizEdge = vec4(0.0);
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
vec4 vertEdge = vec4(0.0);
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0;
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb));
gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a);
}

View File

@@ -0,0 +1,44 @@
#version 120
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
// NOTE: Render size values should be passed from code
const float renderWidth = 800;
const float renderHeight = 450;
float radius = 250.0;
float angle = 0.8;
uniform vec2 center;
void main()
{
vec2 texSize = vec2(renderWidth, renderHeight);
vec2 tc = fragTexCoord*texSize;
tc -= center;
float dist = length(tc);
if (dist < radius)
{
float percent = (radius - dist)/radius;
float theta = percent*percent*angle*8.0;
float s = sin(theta);
float c = cos(theta);
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
}
tc += center;
vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;;
gl_FragColor = vec4(color.rgb, 1.0);;
}

View File

@@ -20,10 +20,8 @@
#if defined(PLATFORM_DESKTOP)
#define GLSL_VERSION 330
#define DEFAULT_VERTEX_SHADER "resources/shaders/glsl330/base.vs"
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
#define GLSL_VERSION 100
#define DEFAULT_VERTEX_SHADER "resources/shaders/glsl100/base.vs"
#endif
#define MAX_POSTPRO_SHADERS 12
@@ -85,18 +83,19 @@ int main()
// NOTE 2: We load the correct shader depending on GLSL version
Shader shaders[MAX_POSTPRO_SHADERS];
shaders[FX_GRAYSCALE] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
shaders[FX_POSTERIZATION] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
shaders[FX_DREAM_VISION] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/dream_vision.fs", GLSL_VERSION));
shaders[FX_PIXELIZER] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/pixelizer.fs", GLSL_VERSION));
shaders[FX_CROSS_HATCHING] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/cross_hatching.fs", GLSL_VERSION));
shaders[FX_CROSS_STITCHING] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/cross_stitching.fs", GLSL_VERSION));
shaders[FX_PREDATOR_VIEW] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
shaders[FX_SCANLINES] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
shaders[FX_FISHEYE] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
shaders[FX_SOBEL] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
shaders[FX_BLOOM] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
shaders[FX_BLUR] = LoadShader(DEFAULT_VERTEX_SHADER, FormatText("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
shaders[FX_GRAYSCALE] = LoadShader(0, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
shaders[FX_POSTERIZATION] = LoadShader(0, FormatText("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
shaders[FX_DREAM_VISION] = LoadShader(0, FormatText("resources/shaders/glsl%i/dream_vision.fs", GLSL_VERSION));
shaders[FX_PIXELIZER] = LoadShader(0, FormatText("resources/shaders/glsl%i/pixelizer.fs", GLSL_VERSION));
shaders[FX_CROSS_HATCHING] = LoadShader(0, FormatText("resources/shaders/glsl%i/cross_hatching.fs", GLSL_VERSION));
shaders[FX_CROSS_STITCHING] = LoadShader(0, FormatText("resources/shaders/glsl%i/cross_stitching.fs", GLSL_VERSION));
shaders[FX_PREDATOR_VIEW] = LoadShader(0, FormatText("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
shaders[FX_SCANLINES] = LoadShader(0, FormatText("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
shaders[FX_FISHEYE] = LoadShader(0, FormatText("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
shaders[FX_SOBEL] = LoadShader(0, FormatText("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
shaders[FX_BLOOM] = LoadShader(0, FormatText("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
shaders[FX_BLUR] = LoadShader(0, FormatText("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
int currentShader = FX_GRAYSCALE;

View File

@@ -52,7 +52,7 @@ int main()
letterCount++;
}
if (key == KEY_BACKSPACE)
if (IsKeyPressed(KEY_BACKSPACE))
{
letterCount--;
name[letterCount] = '\0';

View File

@@ -32,7 +32,7 @@ int main()
GenTextureMipmaps(&font.texture);
float fontSize = font.baseSize;
Vector2 fontPosition = { 40, screenHeight/2 + 50 };
Vector2 fontPosition = { 40, screenHeight/2 - 50 };
Vector2 textSize;
SetTextureFilter(font.texture, FILTER_POINT);

Binary file not shown.

View File

@@ -24,10 +24,10 @@ int main()
Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RED, BLUE);
Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RED, BLUE);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.f, WHITE, BLACK);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 8.f);
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
Texture2D textures[NUM_TEXTURES];

View File

@@ -0,0 +1,83 @@
/*******************************************************************************************
*
* raylib [texture] example - Image text drawing using TTF generated spritefont
*
* 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) 2017 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main()
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing");
// TTF SpriteFont loading with custom generation parameters
SpriteFont font = LoadSpriteFontEx("resources/KAISG.ttf", 64, 0, 0);
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
// Draw over image using custom font
ImageDrawTextEx(&parrots, (Vector2){ 20, 20 }, font, "[Parrots font drawing]", font.baseSize, 0, WHITE);
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
Vector2 position = { screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 20 };
bool showFont = false;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyDown(KEY_SPACE)) showFont = true;
else showFont = false;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
if (!showFont)
{
// Draw texture with text already drawn inside
DrawTextureV(texture, position, WHITE);
// Draw text directly using sprite font
DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20,
position.y + 20 + 280 }, font.baseSize, 0, WHITE);
}
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK);
DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(texture); // Texture unloading
UnloadSpriteFont(font); // Unload custom spritefont
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

View File

@@ -151,7 +151,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# -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
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling -s ALLOW_MEMORY_GROWTH=1 --preload-file resources
endif
# Define include paths for required headers
@@ -218,7 +218,7 @@ endif
ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains raylib icon for windows .exe
# -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows
LDLIBS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows
endif
# Define output extension to generate a .html file using provided shell
@@ -253,7 +253,7 @@ all:
# Project target defined by PROJECT_NAME
$(PROJECT_NAME): $(OBJS)
$(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
$(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) $(WEB_SHELL)
# Compile source files
# NOTE: This pattern will compile every module defined on $(OBJS)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 KiB

After

Width:  |  Height:  |  Size: 994 KiB

View File

@@ -6,7 +6,7 @@ attribute vec2 vertexTexCoord;
attribute vec4 vertexColor;
// Input uniform values
uniform mat4 mvpMatrix;
uniform mat4 mvp;
// Output vertex attributes (to fragment shader)
varying vec2 fragTexCoord;
@@ -21,5 +21,5 @@ void main()
fragColor = vertexColor;
// Calculate final vertex position
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
gl_Position = mvp*vec4(vertexPosition, 1.0);
}

View File

@@ -858,8 +858,8 @@ void DrawTitleScreen(void)
DrawTexturePro(atlas02, gameplay_background, (Rectangle){0, 0, gameplay_background.width*2, gameplay_background.height*2}, (Vector2){0, 0}, 0, color02);
// Draw parallax
//DrawParallaxBack();
//DrawParallaxMiddle();
DrawParallaxBack();
DrawParallaxMiddle();
for (int i = 0; i < MAX_particle; i++)
{
@@ -984,8 +984,6 @@ void DrawTitleScreen(void)
if (musicActive)DrawTexturePro(atlas01, title_speaker_on, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_on.width, title_speaker_on.height}, (Vector2){0,0}, 0, WHITE);
else DrawTexturePro(atlas01, title_speaker_off, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_off.width, title_speaker_off.height}, (Vector2){0,0}, 0, WHITE);
*/
DrawParallaxFront();
}
// Title Screen Unload logic
@@ -1004,9 +1002,6 @@ static void DrawParallaxFront(void)
{
Rectangle ground01 = gameplay_back_ground01;
DrawTexturePro(atlas02, gameplay_back_tree01_layer01, (Rectangle){0, 0, gameplay_back_tree01_layer01.width*2, gameplay_back_tree01_layer01.height*2}, (Vector2){0,0}, 0, WHITE);
/*
//DrawTexturePro(atlas02, gameplay_back_tree01_layer03, (Rectangle){0, 21, gameplay_back_tree01_layer03.width*2, gameplay_back_tree01_layer03.height*2}, (Vector2){0,0}, 0, color02);
DrawTexturePro(atlas02, gameplay_back_tree01_layer01, (Rectangle){(int)parallaxFrontOffset, 60, gameplay_back_tree01_layer01.width*2, gameplay_back_tree01_layer01.height*2}, (Vector2){0,0}, 0, color02);
DrawTexturePro(atlas02, gameplay_back_tree02_layer01, (Rectangle){(int)parallaxFrontOffset + 140, 60, gameplay_back_tree02_layer01.width*2, gameplay_back_tree02_layer01.height*2}, (Vector2){0,0}, 0, color02);
@@ -1018,7 +1013,6 @@ static void DrawParallaxFront(void)
DrawTexturePro(atlas02, gameplay_back_tree08_layer01, (Rectangle){(int)parallaxFrontOffset + 140*7, 60, gameplay_back_tree08_layer01.width*2, gameplay_back_tree08_layer01.height*2}, (Vector2){0,0}, 0, color02);
DrawTexturePro(atlas02, gameplay_back_ground01, (Rectangle){0, 559, ground01.width*2, ground01.height*2}, (Vector2){0,0}, 0, color01);
DrawTexturePro(atlas02, (Rectangle){ground01.x, ground01.y + ground01.height, ground01.width, -ground01.height}, (Rectangle){0, -33, ground01.width*2, ground01.height*2}, (Vector2){0,0}, 0, color01);
*/
}
static void DrawParallaxMiddle(void)

324
games/transmission/Makefile Normal file
View File

@@ -0,0 +1,324 @@
#**************************************************************************************************
#
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
#
# Copyright (c) 2013-2018 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.
#
# Permission is granted to anyone to use this software for any purpose, including commercial
# applications, and to alter it and redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not claim that you
# wrote the original software. If you use this software in a product, an acknowledgment
# in the product documentation would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be misrepresented
# as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#
#**************************************************************************************************
.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 = C:\GitHub\raylib
PROJECT_NAME ?= transmission
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib
endif
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# Use Wayland display server protocol on Linux desktop
# by default it uses X11 windowing system
USE_WAYLAND_DISPLAY ?= FALSE
# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile)
# 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
else
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
endif
ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH = C:/emsdk
EMSCRIPTEN_VERSION = 1.37.28
CLANG_VERSION=e1.37.28_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
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
# Define raylib release directory for compiled library
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
endif
ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
endif
ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif
ifeq ($(PLATFORM_OS),FREEBSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
endif
# Define default C compiler: gcc
# NOTE: define g++ compiler if using C++
CC = gcc
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX)
# OSX default compiler
CC = clang
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# FreeBSD default compiler
CC = clang
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-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
# -g enable debugging
# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -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
# Additional flags for compiler (if desired)
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window
CFLAGS += -Wl,--subsystem,windows
WINRES = $(RAYLIB_PATH)/src/resources
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
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
# --preload-file resources # specify a resources folder for data compilation
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources -s TOTAL_MEMORY=67108864
# Define a custom shell .html and output extension
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
EXT = .html
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_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD)
INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif
endif
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 compilation
LDLIBS = -lraylib -lopengl32 -lgdi32
# Required for physac examples
#LDLIBS += -static -lpthread
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
# On X11 requires also below libraries
LDLIBS += -lX11
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
# On Wayland windowing system, additional libraries requires
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
endif
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for OSX 10.9 desktop compiling
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif
ifeq ($(PLATFORM_OS),FREEBSD)
# Libraries for FreeBSD desktop compiling
# NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm
# On XWindow requires also below libraries
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
endif
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
# NOTE: It could require additional packages installed: libglfw3-dev
LDLIBS += -lglfw
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Libraries for web (HTML5) compiling
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
endif
# Define all source files required
PROJECT_SOURCE_FILES ?= transmission.c \
screens/screen_logo.c \
screens/screen_title.c \
screens/screen_mission.c \
screens/screen_gameplay.c \
screens/screen_ending.c
# Define all object files from source files
OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES))
# For Android platform we call a custom Makefile.Android
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKEFILE_PARAMS = -f Makefile.Android
export PROJECT_NAME
export PROJECT_SOURCE_FILES
else
MAKEFILE_PARAMS = $(PROJECT_NAME)
endif
# Default target entry
# NOTE: We call this Makefile target or Makefile.Android target
all:
$(MAKE) $(MAKEFILE_PARAMS)
# Project target defined by PROJECT_NAME
$(PROJECT_NAME): $(OBJS)
$(CC) -o $(PROJECT_NAME)$(EXT) $(WINRES) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
# Compile source files
# NOTE: This pattern will compile every module defined on $(OBJS)
%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
# 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
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
find . -type f -executable -delete
rm -f *.o
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
del *.o *.html *.js
endif
@echo Cleaning done

View File

@@ -0,0 +1,289 @@
#**************************************************************************************************
#
# raylib makefile for Android project (APK building)
#
# Copyright (c) 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.
#
# Permission is granted to anyone to use this software for any purpose, including commercial
# applications, and to alter it and redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not claim that you
# wrote the original software. If you use this software in a product, an acknowledgment
# in the product documentation would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be misrepresented
# as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#
#**************************************************************************************************
# Define required raylib variables
PLATFORM ?= PLATFORM_ANDROID
RAYLIB_PATH = C:\GitHub\raylib
# Required path variables
# NOTE: JAVA_HOME must be set to JDK
ANDROID_HOME = C:/android-sdk
ANDROID_NDK = C:/android-ndk
ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16
ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/26.0.2
ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
JAVA_HOME = C:/PROGRA~1/Java/jdk1.8.0_144
# Android project configuration variables
PROJECT_NAME ?= raylib_game
PROJECT_LIBRARY_NAME ?= main
PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME)
PROJECT_RESOURCES_PATH ?= resources
PROJECT_SOURCE_FILES ?= raylib_game.c
# Some source files are placed in directories, when compiling to some
# output directory other than source, that directory must pre-exist.
# Here we get a list of required folders that need to be created on
# code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors.
PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES)))
# Android app configuration variables
APP_LABEL_NAME ?= rGame
APP_COMPANY_NAME ?= raylib
APP_PRODUCT_NAME ?= rgame
APP_VERSION_CODE ?= 1
APP_VERSION_NAME ?= 1.0
APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\logo36x36.png
APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\logo48x48.png
APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\logo72x72.png
APP_SCREEN_ORIENTATION ?= landscape
APP_KEYSTORE_PASS ?= raylib
# Library type used for raylib and OpenAL Soft: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
OPENAL_LIBTYPE ?= STATIC
RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\armeabi-v7a
OPENAL_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\armeabi-v7a
# Shared libs must be added to APK if required
# NOTE: Generated NativeLoader.java automatically load those libraries
ifeq ($(RAYLIB_LIBTYPE),SHARED)
PROJECT_SHARED_LIBS = lib/armeabi-v7a/libraylib.so
endif
ifeq ($(OPENAL_LIBTYPE),SHARED)
PROJECT_SHARED_LIBS += lib/armeabi-v7a/libopenal.so
endif
# Compiler and archiver
# NOTE: GCC is being deprectated in Android NDK r16
CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc
AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar
# Compiler flags for arquitecture
CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
# Compilation functions attributes options
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC
# Compiler options for the linker
CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes
# Preprocessor macro definitions
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=16
# Paths containing required header files
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue
# Linker options
LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a
LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
# Force linking of library module to define symbol
LDFLAGS += -u ANativeActivity_onCreate
# Library paths containing required libs
LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/armeabi-v7a
# Define any libraries to link into executable
# if you want to link libraries (libname.so or libname.a), use the -lname
LDLIBS = -lraylib -lnative_app_glue -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm -ldl
# Generate target objects list from PROJECT_SOURCE_FILES
OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES))
# Android APK building process... some steps required...
# NOTE: typing 'make' will invoke the default target entry called 'all',
all: create_temp_project_dirs \
copy_project_required_libs \
copy_project_resources \
generate_loader_script \
generate_android_manifest \
generate_apk_keystore \
config_project_package \
compile_native_app_glue \
compile_project_code \
compile_project_class \
compile_project_class_dex \
create_project_apk_package \
sign_project_apk_package \
zipalign_project_apk_package
# Create required temp directories for APK building
create_temp_project_dirs:
if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH)
if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj
if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src
if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com
if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)
if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME)
if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib
if not exist $(PROJECT_BUILD_PATH)\lib\armeabi-v7a mkdir $(PROJECT_BUILD_PATH)\lib\armeabi-v7a
if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin
if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res
if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi
if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi
if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi
if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values
if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets
if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH)
if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens
$(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir)))
define create_dir
if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1)
endef
# Copy required shared libs for integration into APK
# NOTE: If using shared libs they are loaded by generated NativeLoader.java
copy_project_required_libs:
ifeq ($(RAYLIB_LIBTYPE),SHARED)
copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libraylib.so
endif
ifeq ($(OPENAL_LIBTYPE),SHARED)
copy /Y $(OPENAL_LIB_PATH)\libopenal.so $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libopenal.so
endif
ifeq ($(RAYLIB_LIBTYPE),STATIC)
copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libraylib.a
endif
ifeq ($(OPENAL_LIBTYPE),STATIC)
copy /Y $(OPENAL_LIB_PATH)\libopenal.a $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libopenal.a
endif
# Copy project required resources: strings.xml, icon.png, assets
# NOTE: Required strings.xml is generated and game resources are copied to assets folder
# TODO: Review xcopy usage, it can not be found in some systems!
copy_project_resources:
copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y
copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y
copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/res/values/strings.xml
@echo ^<resources^>^<string name="app_name"^>$(APP_LABEL_NAME)^</string^>^</resources^> >> $(PROJECT_BUILD_PATH)/res/values/strings.xml
if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F
# Generate NativeLoader.java to load required shared libraries
# NOTE: Probably not the bet way to generate this file... but it works.
generate_loader_script:
@echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
ifeq ($(OPENAL_LIBTYPE),SHARED)
@echo System.loadLibrary("openal"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
endif
ifeq ($(RAYLIB_LIBTYPE),SHARED)
@echo System.loadLibrary("raylib"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
endif
@echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
# Generate AndroidManifest.xml with all the required options
# NOTE: Probably not the bet way to generate this file... but it works.
generate_android_manifest:
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<manifest xmlns:android="http://schemas.android.com/apk/res/android" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<uses-sdk android:minSdkVersion="16" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<uses-feature android:glEsVersion="0x00020000" android:required="true" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<application android:allowBackup="false" android:label="@string/app_name" android:icon="@drawable/icon" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<activity android:name="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME).NativeLoader" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo android:configChanges="orientation|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo android:clearTaskOnLaunch="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<meta-data android:name="android.app.lib_name" android:value="$(PROJECT_LIBRARY_NAME)" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<intent-filter^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<action android:name="android.intent.action.MAIN" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^<category android:name="android.intent.category.LAUNCHER" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</intent-filter^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</activity^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</application^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
@echo ^</manifest^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
# Generate storekey for APK signing: $(PROJECT_NAME).keystore
# NOTE: Configure here your Distinguished Names (-dname) if required!
generate_apk_keystore:
if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA
# Config project package and resource using AndroidManifest.xml and res/values/strings.xml
# NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java
config_project_package:
$(ANDROID_BUILD_TOOLS)/aapt package -f -m -S $(PROJECT_BUILD_PATH)/res -J $(PROJECT_BUILD_PATH)/src -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -I $(ANDROID_HOME)/platforms/android-16/android.jar
# Compile native_app_glue code as static library: obj/libnative_app_glue.a
compile_native_app_glue:
$(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
$(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o
# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so
compile_project_code: $(OBJS)
$(CC) -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS)
# Compile all .c files required into object (.o) files
# NOTE: Those files will be linked into a shared library
$(PROJECT_BUILD_PATH)/obj/%.o:%.c
$(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot
# Compile project .java code into .class (Java bytecode)
compile_project_class:
$(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-16/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
# Compile .class files into Dalvik executable bytecode (.dex)
# NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT)
compile_project_class_dex:
$(ANDROID_BUILD_TOOLS)/dx --verbose --dex --output=$(PROJECT_BUILD_PATH)/bin/classes.dex $(PROJECT_BUILD_PATH)/obj
# Create Android APK package: bin/$(PROJECT_NAME).unsigned.apk
# NOTE: Requires compiled classes.dex and lib$(PROJECT_LIBRARY_NAME).so
# NOTE: Use -A resources to define additional directory in which to find raw asset files
create_project_apk_package:
$(ANDROID_BUILD_TOOLS)/aapt package -f -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -S $(PROJECT_BUILD_PATH)/res -A $(PROJECT_BUILD_PATH)/assets -I $(ANDROID_HOME)/platforms/android-16/android.jar -F $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_BUILD_PATH)/bin
cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS)
# Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk
sign_project_apk_package:
$(JAVA_HOME)/bin/jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key
# Create zip-aligned APK package: $(PROJECT_NAME).apk
zipalign_project_apk_package:
$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_NAME).apk
# Install $(PROJECT_NAME).apk to default emulator/device
# NOTE: Use -e (emulator) or -d (device) parameters if required
install:
$(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk
# Monitorize output log coming from device, only raylib tag
logcat:
$(ANDROID_PLATFORM_TOOLS)/adb logcat -c
$(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S
# Install and monitorize $(PROJECT_NAME).apk to default emulator/device
deploy:
$(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk
$(ANDROID_PLATFORM_TOOLS)/adb logcat -c
$(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S
#$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W
# Clean everything
clean:
del $(PROJECT_BUILD_PATH)\* /f /s /q
rmdir $(PROJECT_BUILD_PATH) /s /q
@echo Cleaning done

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,65 @@
# Total missions
# NOTE: Missions follow the order of this file
t 4
# -----------------------------------------------------------------
# Briefing of the mission
b Se ha visto al Presidente en actitud cariñosa con una persona que no es la Primera Dama. Una situación comprometida que definirá el curso de la historia... Especialmente en campaña electoral y siendo del partido conservador... ¡El pueblo debe saber!
#
# Mission keyword
k oviparo
#
# Message to be coded
# NOTE: Sensible words must be noted using @
m El @presidente es visto en un @hotel acompañado de su @amante .
#
# Solution to mission
# NOTE: Provide the correct solution nums, according to above words
# WARNING: Always provide 8 values, use -1 for not used ones
# Coding Words: POLLO = 0, CONEJO, HUEVO, NIDO, AIRE, ARMARIO, AGUJERO, PLATANO, PASTEL, MERCADO, RATON, MELON
s 0 3 2 -1 -1 -1 -1 -1
# -----------------------------------------------------------------
# Briefing of the mission
b Se ha visto un ovni sobrevolando la ciudad, al parecer se prevee un ataque alienígena inminente que definirá el curso de la historia... ¡El pueblo debe saber!
#
# Mission keyword
k roedor
#
# Message to be coded
# NOTE: Sensible words must be noted using @
m Un @ovni ha sido detectado en el @cielo del @pais . Preparaos para el ataque de un @alien .
#
# NOTE: Provide the correct solution nums, according to above words
# WARNING: Always provide 8 values, use -1 for not used ones
# Coding Words: POLLO = 0, CONEJO, HUEVO, NIDO, AIRE, ARMARIO, AGUJERO, PLATANO, PASTEL, MERCADO, RATON, MELON
s 1 6 5 10 -1 -1 -1 -1
# -----------------------------------------------------------------
# Briefing of the mission
b Se ha filtrado una inminente subida del precio de un producto básico para todo el mundo: el ajo. Le evolución de su precio de mercado definirá el curso de la historia... ¡El pueblo debe saber!
#
# Mission keyword
k comida
#
# Message to be coded
# NOTE: Sensible words must be noted using @
m Sube el @precio del @ajo. ¡Un @desastre inminente!
#
# NOTE: Provide the correct solution nums, according to above words
# WARNING: Always provide 8 values, use -1 for not used ones
# Coding Words: POLLO = 0, CONEJO, HUEVO, NIDO, AIRE, ARMARIO, AGUJERO, PLATANO, PASTEL, MERCADO, RATON, MELON
s 9 7 2 -1 -1 -1 -1 -1
# -----------------------------------------------------------------
# Briefing of the mission
b Se ha visto a un famoso presentador de TV deshaciéndose del cuerpo de un rival de otra cadena. Una pérdida que definirá el curso de la historia... Especialmente cuando su programa podría no continuar... ¡El pueblo debe saber!
#
# Mission keyword
k postre
#
# Message to be coded
# NOTE: Sensible words must be noted using @
m Un @presentador se deshace del @cuerpo de su rival. ¡Peligra el @programa del Prime Time!
#
# NOTE: Provide the correct solution nums, according to above words
# WARNING: Always provide 8 values, use -1 for not used ones
# Coding Words: POLLO = 0, CONEJO, HUEVO, NIDO, AIRE, ARMARIO, AGUJERO, PLATANO, PASTEL, MERCADO, RATON, MELON
s 7 11 8 -1 -1 -1 -1 -1
# -----------------------------------------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -0,0 +1,212 @@
/**********************************************************************************************
*
* raylib - Advance Game template
*
* Ending Screen Functions Definitions (Init, Update, Draw, Unload)
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#include "raylib.h"
#include "screens.h"
#include <string.h>
#include <stdlib.h>
#define MAX_TITLE_CHAR 128
#define MAX_SUBTITLE_CHAR 256
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
static char *codingWords[MAX_CODING_WORDS] = {
"pollo\0",
"conejo\0",
"huevo\0",
"nido\0",
"aire\0",
"armario\0",
"agujero\0",
"platano\0",
"pastel\0",
"mercado\0",
"raton\0",
"melon\0",
};
// Ending screen global variables
static int framesCounter;
static int finishScreen;
static Texture2D texBackground;
static Texture2D texNewspaper;
static Texture2D texVignette;
static Sound fxNews;
static float rotation = 0.1f;
static float scale = 0.05f;
static int state = 0;
static Mission *missions = NULL;
static bool showResults = false;
//----------------------------------------------------------------------------------
// Ending Screen Functions Definition
//----------------------------------------------------------------------------------
// Ending Screen Initialization logic
void InitEndingScreen(void)
{
framesCounter = 0;
finishScreen = 0;
rotation = 0.1f;
scale = 0.05f;
state = 0;
texBackground = LoadTexture("resources/textures/ending_background.png");
texVignette = LoadTexture("resources/textures/message_vignette.png");
fxNews = LoadSound("resources/audio/fx_batman.ogg");
// TODO: Check game results!
missions = LoadMissions("resources/missions.txt");
int wordsCount = missions[currentMission].wordsCount;
TraceLog(LOG_WARNING, "Words count %i", wordsCount);
char title[MAX_TITLE_CHAR] = "\0";
//char subtitle[MAX_SUBTITLE_CHAR] = "\0";
char *ptrTitle = title;
int len = 0;
for (int i = 0; i < wordsCount; i++)
{
if (messageWords[i].id == missions[currentMission].sols[i])
{
len = strlen(messageWords[i].text);
strncpy(ptrTitle, messageWords[i].text, len);
ptrTitle += len;
// title[len] = ' ';
// len++;
// ptrTitle++;
}
else
{
TraceLog(LOG_WARNING, "Coding word: %s", codingWords[messageWords[i].id]);
len = strlen(codingWords[messageWords[i].id]);
TraceLog(LOG_WARNING, "Lenght: %i", len);
strncpy(ptrTitle, codingWords[messageWords[i].id], len);
ptrTitle += len;
// title[len] = ' ';
// len++;
// ptrTitle++;
}
}
ptrTitle = '\0';
//TraceLog(LOG_WARNING, "Titular: %s", title);
// Generate newspaper with title and subtitle
Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png");
SpriteFont fontNews = LoadSpriteFontEx("resources/fonts/Lora-Bold.ttf", 82, 250, 0);
ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, "FRACASO EN LA GGJ18!", fontNews.baseSize, 0, DARKGRAY);
// TODO: Draw subtitle message
//ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 210 }, fontNews, "SUBE LA ESCALERA!", fontNews.baseSize, 0, DARKGRAY);
texNewspaper = LoadTextureFromImage(imNewspaper);
UnloadSpriteFont(fontNews);
UnloadImage(imNewspaper);
}
// Ending Screen Update logic
void UpdateEndingScreen(void)
{
framesCounter++;
if (framesCounter == 10) PlaySound(fxNews);
if (state == 0)
{
rotation += 18.0f;
scale += 0.0096f;
if (scale >= 1.0f)
{
scale = 1.0f;
state = 1;
}
}
if ((state == 1) && (IsKeyPressed(KEY_ENTER) || IsButtonPressed()))
{
currentMission++;
if (currentMission >= totalMissions) finishScreen = 2;
else finishScreen = 1;
}
if (IsKeyPressed(KEY_SPACE)) showResults = !showResults;
}
// Ending Screen Draw logic
void DrawEndingScreen(void)
{
DrawTexture(texBackground, 0, 0, WHITE);
DrawTexturePro(texNewspaper, (Rectangle){ 0, 0, texNewspaper.width, texNewspaper.height },
(Rectangle){ GetScreenWidth()/2, GetScreenHeight()/2, texNewspaper.width*scale, texNewspaper.height*scale },
(Vector2){ (float)texNewspaper.width*scale/2, (float)texNewspaper.height*scale/2 }, rotation, WHITE);
DrawTextureEx(texVignette, (Vector2){ 0, 0 }, 0.0f, 2.0f, WHITE);
if (showResults)
{
for (int i = 0; i < missions[currentMission].wordsCount; i++)
{
if (messageWords[i].id == missions[currentMission].sols[i]) DrawText(messageWords[i].text, 10, 10 + 30*i, 20, GREEN);
else DrawText(codingWords[messageWords[i].id], 10, 10 + 30*i, 20, RED);
}
}
if (state == 1) DrawButton("continuar");
}
// Ending Screen Unload logic
void UnloadEndingScreen(void)
{
UnloadTexture(texBackground);
UnloadTexture(texNewspaper);
UnloadTexture(texVignette);
UnloadSound(fxNews);
free(missions);
}
// Ending Screen should finish?
int FinishEndingScreen(void)
{
return finishScreen;
}

View File

@@ -0,0 +1,423 @@
/**********************************************************************************************
*
* raylib - Advance Game template
*
* Gameplay Screen Functions Definitions (Init, Update, Draw, Unload)
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#include "raylib.h"
#include "screens.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
//#define MAX_CODING_WORDS 12
//#define MAX_MISSION_WORDS 8
#define MAX_LINE_CHAR 30
/*
// NOTE: Coding words are generic and the same words
// are used for all missions,
typedef enum CodingWords {
POLLO = 0,
CONEJO,
HUEVO,
NIDO,
AIRE,
ARMARIO,
AGUJERO,
COSA,
WORD,
} CodingWords;
*/
static char *codingWords[MAX_CODING_WORDS] = {
"pollo\0",
"conejo\0",
"huevo\0",
"nido\0",
"aire\0",
"armario\0",
"agujero\0",
"platano\0",
"pastel\0",
"mercado\0",
"raton\0",
"melon\0"
};
// Words to be coded or coding words
/*typedef struct Word {
int id;
Rectangle rec;
Rectangle iniRec;
bool hover;
bool picked;
char text[32]; // text
} Word;*/
/*
// Mission information
typedef struct Mission {
int id;
char brief[512]; // Mission briefing
char key[32]; // Mission keyword
char msg[256]; // Message to be coded
int wordsCount; // Number of words to coded
int sols[8]; // Solution code, depends on wordsCount
} Mission;
*/
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
// Gameplay screen global variables
static int framesCounter;
static int finishScreen;
static Texture2D texBackground;
static SpriteFont fontMessage;
static Texture2D texWordsAtlas;
static Texture2D texVignette;
static Sound fxGrab;
static Sound fxPlace;
static Sound fxLeave;
static Music musSpy;
static Word words[MAX_CODING_WORDS] = { 0 };
// Hay que hacerlo global, para poder consultar el resultado desde la endingscreen
//static Word messageWords[MAX_MISSION_WORDS] = { 0 };
static Mission *missions = NULL;
static bool canSend = false;
Vector2 msgOffset = { 430, 300 };
//----------------------------------------------------------------------------------
// Gameplay Screen Functions Definition
//----------------------------------------------------------------------------------
// Gameplay Screen Initialization logic
void InitGameplayScreen(void)
{
framesCounter = 0;
finishScreen = 0;
fontMessage = LoadSpriteFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0);
texBackground = LoadTexture("resources/textures/message_background.png");
texVignette = LoadTexture("resources/textures/message_vignette.png");
fxGrab = LoadSound("resources/audio/fx_grab.ogg");
fxPlace = LoadSound("resources/audio/fx_place.ogg");
fxLeave = LoadSound("resources/audio/fx_leave.ogg");
musSpy = LoadMusicStream("resources/audio/s_p_y.xm");
PlayMusicStream(musSpy);
#if defined(PLATFORM_WEB)
#define WORD_ATLAS_FROM_FILE
#endif
#if defined(WORD_ATLAS_FROM_FILE)
texWordsAtlas = LoadTexture("resources/textures/mission_words.png");
#else
// Generate coding words atlas directly from text
Image imWordsBase = LoadImage("resources/textures/words_base.png");
Image imWords = GenImageColor(imWordsBase.width, imWordsBase.height*MAX_CODING_WORDS, WHITE);
for (int i = 0; i < MAX_CODING_WORDS; i++)
{
ImageDraw(&imWords, imWordsBase,
(Rectangle){ 0, 0, imWordsBase.width, imWordsBase.height },
(Rectangle){ 0, imWordsBase.height*i, imWordsBase.width, imWordsBase.height });
ImageDrawTextEx(&imWords,(Vector2){ imWordsBase.width/2 - MeasureTextEx(fontMessage, codingWords[i],
fontMessage.baseSize, 0).x/2, imWordsBase.height*i }, fontMessage, codingWords[i],
fontMessage.baseSize, 0, BLACK);
}
texWordsAtlas = LoadTextureFromImage(imWords);
UnloadImage(imWordsBase);
UnloadImage(imWords);
#endif
// Initialize missions
// WARNING: Some problem with imWords image generation (memory leak?) could cause
// that loading missions before/after generation breaks game, on web is the other way round... :(
missions = LoadMissions("resources/missions.txt");
TraceLog(LOG_WARNING, "Words count %i", missions[currentMission].wordsCount);
// Initialize coding words
for (int i = 0; i < MAX_CODING_WORDS; i++)
{
words[i].id = -1; // Not placed anywhere
words[i].rec.x = 110 + 940*(i/(MAX_CODING_WORDS/2));
words[i].rec.y = 200 + 60*(i%(MAX_CODING_WORDS/2));
words[i].rec.width = 140; // texWordsAtlas.width/MAX_MISSIONS
words[i].rec.height = 35; // texWordsAtlas.height/MAX_MISSION_WORDS
words[i].iniRec = words[i].rec;
words[i].hover = false; // Mouse hover detected
words[i].picked = false; // Mouse picked
//words[i].text = ''; //codingWords[i]; // Fill text if required...
}
// Analize missions[currentMission].msg string for words!
int msgLen = strlen(missions[currentMission].msg);
// Add '/' each MAX_LINE_CHAR chars
int currentLine = 1;
int i = currentLine * MAX_LINE_CHAR;
while (i < msgLen - 1)
{
if (missions[currentMission].msg[i] == ' ')
{
missions[currentMission].msg[i] = '/';
currentLine++;
i = currentLine*MAX_LINE_CHAR;
}
else i++;
}
int currentWord = 0;
int offsetX = 0;
int offsetY = 0;
bool foundWord = false;
int wordInitPosX = 0;
int wordInitPosY = 0;
// TODO: messageWords should be reseted every mission
//memcpy(messageWords, 0, sizeof(Word)*MAX_MISSION_WORDS);
for (int i = 0; i < msgLen; i++)
{
char c = missions[currentMission].msg[i];
if (foundWord && (c == ' ' || c == '.'))
{
foundWord = false;
messageWords[currentWord - 1].rec.width = (int)MeasureTextEx(fontMessage, SubText(missions[currentMission].msg, wordInitPosX, (i - wordInitPosX)), 30, 0).x;
messageWords[currentWord - 1].rec.height = fontMessage.baseSize;
//TODO: Guardar en message
strncpy(messageWords[currentWord - 1].text, SubText(missions[currentMission].msg, wordInitPosX, (i - wordInitPosX)), i - wordInitPosX);
}
if (c == '@') // One word to change
{
foundWord = true;
missions[currentMission].msg[i] = ' ';
offsetX = (int)MeasureTextEx(fontMessage, SubText(missions[currentMission].msg, wordInitPosY, (i + 1) - wordInitPosY), 30, 0).x;
messageWords[currentWord].rec.x = offsetX;
messageWords[currentWord].rec.y = offsetY;
wordInitPosX = i + 1;
currentWord++;
}
else if (c == '/')
{
missions[currentMission].msg[i] = '\n';
wordInitPosY = i;
offsetY += (fontMessage.baseSize + fontMessage.baseSize/2); // raylib internal increment on line break...
}
}
for (int i = 0; i < missions[currentMission].wordsCount; i++)
{
messageWords[i].id = -1; // Not required for message words, id is the array position
// Recalculate words rectangles considering text offset on screen
messageWords[i].rec.x += msgOffset.x;
messageWords[i].rec.y += msgOffset.y;
// Recalculate words rectangle considering new width height
messageWords[i].rec.x -= (texWordsAtlas.width - messageWords[i].rec.width)/2;
messageWords[i].rec.y -= ((texWordsAtlas.height / MAX_CODING_WORDS) - messageWords[i].rec.height)/2;
//Recalculate width height
messageWords[i].rec.width = texWordsAtlas.width;
messageWords[i].rec.height = texWordsAtlas.height / MAX_CODING_WORDS;
messageWords[i].hover = false; // Mouse hover detected
messageWords[i].picked = false; // Mouse picked
}
}
// Gameplay Screen Update logic
void UpdateGameplayScreen(void)
{
UpdateMusicStream(musSpy);
for (int i = 0; i < MAX_CODING_WORDS; i++)
{
if (CheckCollisionPointRec(GetMousePosition(), words[i].rec))
{
words[i].hover = true;
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
words[i].picked = true;
PlaySound(fxGrab);
}
}
else words[i].hover = false;
if (words[i].picked)
{
for (int j = 0; j < missions[currentMission].wordsCount; j++)
{
if (CheckCollisionPointRec(GetMousePosition(), messageWords[j].rec)) messageWords[j].hover = true;
else messageWords[j].hover = false;
}
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON))
{
words[i].picked = false;
for (int j = 0; j < missions[currentMission].wordsCount; j++)
{
messageWords[j].hover = false;
if (CheckCollisionPointRec(GetMousePosition(), messageWords[j].rec))
{
PlaySound(fxPlace);
words[i].rec.x = messageWords[j].rec.x;
words[i].rec.y = messageWords[j].rec.y;
if (messageWords[j].id != -1)
{
int id = messageWords[j].id;
words[id].rec = words[id].iniRec;
}
messageWords[j].id = i;
for (int k = 0; k < missions[currentMission].wordsCount; k++)
{
if (j != k && messageWords[j].id == messageWords[k].id)
{
messageWords[k].id = -1;
break;
}
}
break;
}
else
{
PlaySound(fxLeave);
words[i].rec = words[i].iniRec;
if (i == messageWords[j].id) messageWords[j].id = -1;
}
}
}
}
// TODO: Move word picked with mouse
if (words[i].picked)
{
words[i].rec.x = GetMouseX() - words[i].rec.width/2;
words[i].rec.y = GetMouseY() - words[i].rec.height/2;
// TODO: Check if label is placed in some mission word position
//if (CheckCollisionRecs(words[i].rec))
}
else
{
//if (words[i].id != -1)
}
}
canSend = true;
for(int j = 0; j < missions[currentMission].wordsCount; j++)
{
if(messageWords[j].id == -1)
{
canSend = false;
break;
}
}
if (canSend && (IsKeyPressed(KEY_ENTER) || IsButtonPressed()))
{
finishScreen = true;
}
}
// Gameplay Screen Draw logic
void DrawGameplayScreen(void)
{
DrawTexture(texBackground, 0, 0, WHITE);
DrawTextEx(fontMessage, missions[currentMission].msg, msgOffset, fontMessage.baseSize, 0, BLACK);
for (int i = 0; i < missions[currentMission].wordsCount; i++)
{
Rectangle recLines = messageWords[i].rec;
DrawRectangleLines(recLines.x, recLines.y, recLines.width, recLines.height, Fade(RED, 0.35f));
if(messageWords[i].hover) DrawRectangleRec(messageWords[i].rec, Fade(RED, 0.30f));
DrawText(FormatText("%i", messageWords[i].id), i*25, 0, 30, RED);
}
for (int i = 0; i < MAX_CODING_WORDS; i++)
{
if (words[i].picked) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, MAROON);
else if (words[i].hover) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, RED);
else DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, WHITE);
}
DrawTexturePro(texVignette, (Rectangle){0,0,texVignette.width, texVignette.height}, (Rectangle){0,0,GetScreenWidth(), GetScreenHeight()}, (Vector2){0,0}, 0, WHITE);
if (canSend) DrawButton("enviar");
}
// Gameplay Screen Unload logic
void UnloadGameplayScreen(void)
{
UnloadTexture(texBackground);
UnloadTexture(texVignette);
UnloadTexture(texWordsAtlas);
UnloadSound(fxGrab);
UnloadSound(fxLeave);
UnloadSound(fxPlace);
UnloadMusicStream(musSpy);
free(missions);
}
// Gameplay Screen should finish?
int FinishGameplayScreen(void)
{
return finishScreen;
}

View File

@@ -0,0 +1,102 @@
/**********************************************************************************************
*
* raylib - Advance Game template
*
* Logo Screen Functions Definitions (Init, Update, Draw, Unload)
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#include "raylib.h"
#include "screens.h"
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
// Logo screen global variables
static int framesCounter;
static int finishScreen;
static Texture2D logoCW;
static float fadeValue;
static int showLogoFrames;
static bool fadeOut;
//----------------------------------------------------------------------------------
// Logo Screen Functions Definition
//----------------------------------------------------------------------------------
// Logo Screen Initialization logic
void InitLogoScreen(void)
{
framesCounter = 0;
finishScreen = 0;
logoCW = LoadTexture("resources/textures/cw_logo.png");
showLogoFrames = 60;
fadeValue = 0;
fadeOut = false;
}
// Logo Screen Update logic
void UpdateLogoScreen(void)
{
if(!fadeOut)
{
fadeValue += 0.02f;
if(fadeValue > 1.01f)
{
fadeValue = 1.0f;
framesCounter++;
if(framesCounter % showLogoFrames == 0)
{
fadeOut = true;
finishScreen = true;
}
}
}
if(IsKeyPressed(KEY_ENTER))
{
finishScreen = true;
}
}
// Logo Screen Draw logic
void DrawLogoScreen(void)
{
DrawTexture(logoCW, GetScreenWidth()/2 - logoCW.width/2, GetScreenHeight()/2 - logoCW.height/2, Fade(WHITE, fadeValue));
}
// Logo Screen Unload logic
void UnloadLogoScreen(void)
{
UnloadTexture(logoCW);
}
// Logo Screen should finish?
int FinishLogoScreen(void)
{
return finishScreen;
}

View File

@@ -0,0 +1,293 @@
/**********************************************************************************************
*
* raylib - transmission mission
*
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#include "raylib.h"
#include "screens.h"
#include <string.h>
#include <stdlib.h>
#define MISSION_MAX_LENGTH 256
#define KEYWORD_MAX_LENGTH 32
#define MAX_LINE_CHAR 75
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
// Mission screen global variables
static int framesCounter;
static int finishScreen;
static Texture2D texBackground;
static Texture2D texBackline; //mission_backline
static Rectangle sourceRecBackLine;
static Rectangle destRecBackLine;
static float fadeBackLine;
static Vector2 numberPosition;
static Color numberColor;
//static char textMission[MISSION_MAX_LENGTH];
static Vector2 missionPosition;
static int missionSize;
static Color missionColor;
static int missionLenght;
static bool missionMaxLength;
static int missionSpeed;
//static char textKeyword[KEYWORD_MAX_LENGTH];
static Vector2 keywordPosition;
static Color keywordColor;
static int showMissionWaitFrames;
static int showNumberWaitFrames;
static int showKeywordWaitFrames;
static bool startWritting;
static bool writeMission;
static bool writeNumber;
static bool writeKeyword;
static bool writeEnd;
static bool writtingMission;
static int blinkFrames;
static bool blinkKeyWord = true;
static bool showButton = false;
static Mission *missions = NULL;
static Sound fxTransmit;
static Music musMission;
//----------------------------------------------------------------------------------
// Mission Screen Functions Definition
//----------------------------------------------------------------------------------
static void WriteMissionText();
static void EndWritting();
static void BlinkKeyword();
// Mission Screen Initialization logic
void InitMissionScreen(void)
{
framesCounter = 0;
finishScreen = 0;
fadeButton = 0.80f;
texBackground = LoadTexture("resources/textures/mission_background.png");
texBackline = LoadTexture("resources/textures/mission_backline.png");
sourceRecBackLine = (Rectangle){0,0,GetScreenWidth(), texBackline.height};
destRecBackLine = (Rectangle){0,0,sourceRecBackLine.width, sourceRecBackLine.height};
fadeBackLine = 0;
fxTransmit = LoadSound("resources/audio/fx_message.ogg");
musMission = LoadMusicStream("resources/audio/music_mission.ogg");
PlayMusicStream(musMission);
// Initialize missions
missions = LoadMissions("resources/missions.txt");
missionMaxLength = strlen(missions[currentMission].brief);
// Insert line breaks every MAX_LINE_CHAR
int currentLine = 1;
int i = currentLine * MAX_LINE_CHAR;
while (i < missionMaxLength)
{
if (missions[currentMission].brief[i] == ' ')
{
missions[currentMission].brief[i] = '\n';
currentLine++;
i = currentLine*MAX_LINE_CHAR;
}
else i++;
}
missionSize = 30;
missionLenght = 0;
missionSpeed = 1;
numberColor = RAYWHITE;
missionColor = LIGHTGRAY;
keywordColor = (Color){198, 49, 60, 255}; //RED
numberPosition = (Vector2){150, 185};
missionPosition = (Vector2){numberPosition.x, numberPosition.y + 60};
keywordPosition = (Vector2){missionPosition.x, missionPosition.y + MeasureTextEx(fontMission, missions[currentMission].brief, missionSize, 0).y + 60};
startWritting = false;
writeNumber = false;
writeMission = false;
writeKeyword = false;
writeEnd = false;
writtingMission = false;
showNumberWaitFrames = 30;
showMissionWaitFrames = 60;
showKeywordWaitFrames = 60;
blinkKeyWord = true;
blinkFrames = 15;
PlaySound(fxTransmit);
}
// Mission Screen Update logic
void UpdateMissionScreen(void)
{
UpdateMusicStream(musMission);
if (!writeEnd) WriteMissionText();
else BlinkKeyword();
if (showButton)
{
if (IsKeyPressed(KEY_ENTER) || IsButtonPressed())
{
if (!writeEnd) EndWritting();
else
{
finishScreen = true;
showButton = false;
}
}
}
}
// Mission Screen Draw logic
void DrawMissionScreen(void)
{
// TODO: Draw MISSION screen here!
DrawTexture(texBackground, 0,0, WHITE);
DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine));
if (writeNumber) DrawTextEx(fontMission, FormatText("Filtración #%02i ", currentMission + 1), numberPosition, missionSize + 10, 0, numberColor);
DrawTextEx(fontMission, SubText(missions[currentMission].brief, 0, missionLenght), missionPosition, missionSize, 0, missionColor);
if (writeKeyword && blinkKeyWord) DrawTextEx(fontMission, FormatText("Keyword: %s", missions[currentMission].key), keywordPosition, missionSize + 10, 0, keywordColor);
if (showButton)
{
if (!writeEnd) DrawButton("saltar");
else DrawButton("codificar");
}
}
// Mission Screen Unload logic
void UnloadMissionScreen(void)
{
// TODO: Unload MISSION screen variables here!
UnloadTexture(texBackground);
UnloadTexture(texBackline);
UnloadSound(fxTransmit);
UnloadMusicStream(musMission);
free(missions);
}
// Mission Screen should finish?
int FinishMissionScreen(void)
{
return finishScreen;
}
static void WriteMissionText()
{
if(!startWritting)
{
framesCounter++;
if(framesCounter % 60 == 0)
{
framesCounter = 0;
startWritting = true;
}
}
else if(!writeNumber)
{
framesCounter++;
fadeBackLine += 0.020f;
if(framesCounter % showNumberWaitFrames == 0)
{
framesCounter = 0;
writeNumber = true;
showButton = true;
}
}
else if(!writeMission)
{
framesCounter ++;
if(framesCounter % showMissionWaitFrames == 0)
{
framesCounter = 0;
writeMission = true;
writtingMission = true;
}
}
else if(writeMission && writtingMission)
{
framesCounter++;
if(framesCounter % missionSpeed == 0)
{
framesCounter = 0;
missionLenght++;
if(missionLenght == missionMaxLength)
{
writtingMission = false;
}
}
}
else if(!writeKeyword)
{
framesCounter++;
if(framesCounter % showKeywordWaitFrames == 0)
{
framesCounter = 0;
writeKeyword = true;
writeEnd = true;
}
}
}
static void EndWritting()
{
writeEnd = true;
writeKeyword = true;
writeNumber = true;
missionLenght = missionMaxLength;
}
static void BlinkKeyword()
{
framesCounter++;
if(framesCounter % blinkFrames == 0)
{
framesCounter = 0;
blinkKeyWord = !blinkKeyWord;
}
}

View File

@@ -0,0 +1,168 @@
/**********************************************************************************************
*
* raylib - transmission mission
*
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#include "raylib.h"
#include "screens.h"
#include <string.h>
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
// Title screen global variables
static int framesCounter;
static int finishScreen;
static Texture2D texBackground;
static SpriteFont fontTitle;
static Sound fxTyping;
static float titleSize;
static Vector2 transmissionPosition;
static Vector2 missionPositon;
static const char textTitle[20] = "transmissionmission";
static Color titleColor;
static int speedText;
static int transmissionLenght;
static int missionLenght;
static int transmissionMaxLenght;
static int missionMaxLenght;
static bool writeTransmission;
static bool writeMission;
static bool writeEnd;
//----------------------------------------------------------------------------------
// Title Screen Functions Definition
//----------------------------------------------------------------------------------
static void MissionScreen();
// Title Screen Initialization logic
void InitTitleScreen(void)
{
// TODO: Initialize TITLE screen variables here!
framesCounter = 0;
finishScreen = 0;
texBackground = LoadTexture("resources/textures/title_background.png");
fxTyping = LoadSound("resources/audio/fx_typing.ogg");
fontTitle = LoadSpriteFontEx("resources/fonts/fontTitle.ttf", 96, 0, 0);
titleSize = 44;
transmissionPosition = (Vector2){519, 221};
missionPositon = (Vector2){580, 261};
titleColor = BLACK;
speedText = 15;
missionLenght = 0;
transmissionLenght = 0;
missionMaxLenght = 7;
transmissionMaxLenght = 12;
writeTransmission = true;
writeMission = false;
writeEnd = false;
currentMission = 0;
}
// Title Screen Update logic
void UpdateTitleScreen(void)
{
if (!writeEnd)
{
framesCounter ++;
if (framesCounter%speedText == 0)
{
framesCounter = 0;
if (writeTransmission)
{
transmissionLenght++;
if (transmissionLenght == transmissionMaxLenght)
{
writeTransmission = false;
writeMission = true;
}
}
else if (writeMission)
{
missionLenght++;
if (missionLenght == missionMaxLenght)
{
writeMission = false;
writeEnd = true;
}
}
PlaySound(fxTyping);
}
}
if(IsButtonPressed())
{
MissionScreen();
}
else if (IsKeyPressed(KEY_ENTER)) MissionScreen();
}
// Title Screen Draw logic
void DrawTitleScreen(void)
{
DrawTexture(texBackground, 0,0, WHITE);
DrawTextEx(fontTitle, SubText(textTitle, 0, transmissionLenght), transmissionPosition, titleSize, 0, titleColor);
DrawTextEx(fontTitle, SubText(textTitle, 12, missionLenght), missionPositon, titleSize, 0, titleColor);
DrawButton("start");
}
// Title Screen Unload logic
void UnloadTitleScreen(void)
{
UnloadTexture(texBackground);
UnloadSound(fxTyping);
UnloadSpriteFont(fontTitle);
}
// Title Screen should finish?
int FinishTitleScreen(void)
{
return finishScreen;
}
static void MissionScreen()
{
transmissionLenght = transmissionMaxLenght;
missionLenght = missionMaxLenght;
writeEnd = true;
//finishScreen = 1; // OPTIONS
finishScreen = true; // GAMEPLAY
//PlaySound(fxCoin);
}

View File

@@ -0,0 +1,143 @@
/**********************************************************************************************
*
* raylib - transmission mission
*
* Screens Functions Declarations (Init, Update, Draw, Unload)
*
* Copyright (c) 2014-2018 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.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#ifndef SCREENS_H
#define SCREENS_H
#define MAX_CODING_WORDS 12
#define MAX_MISSION_WORDS 8
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
typedef enum GameScreen { LOGO = 0, TITLE, MISSION, GAMEPLAY, ENDING } GameScreen;
// Words to be coded or coding words
typedef struct Word {
int id;
Rectangle rec;
Rectangle iniRec;
bool hover;
bool picked;
char text[32]; // text
} Word;
// Mission information
typedef struct Mission {
int id;
char brief[512]; // Mission briefing
char key[32]; // Mission keyword
char msg[256]; // Message to be coded
int wordsCount; // Number of words to coded
int sols[10]; // Solution code, depends on wordsCount
} Mission;
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
GameScreen currentScreen;
Music music;
Sound fxButton;
//Mission *missions;
// UI BUTTON
Rectangle recButton;
float fadeButton;
Color colorButton;
Texture2D texButton;
Vector2 textPositionButton;
int fontSizeButton;
Color textColorButton;
int currentMission;
int totalMissions;
SpriteFont fontMission;
Word messageWords[MAX_MISSION_WORDS];
#ifdef __cplusplus
extern "C" { // Prevents name mangling of functions
#endif
//----------------------------------------------------------------------------------
// Transmission Functions Declaration
//----------------------------------------------------------------------------------
bool IsButtonPressed();
void DrawButton(const char *text);
Mission *LoadMissions(const char *fileName);
//----------------------------------------------------------------------------------
// Logo Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitLogoScreen(void);
void UpdateLogoScreen(void);
void DrawLogoScreen(void);
void UnloadLogoScreen(void);
int FinishLogoScreen(void);
//----------------------------------------------------------------------------------
// Title Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitTitleScreen(void);
void UpdateTitleScreen(void);
void DrawTitleScreen(void);
void UnloadTitleScreen(void);
int FinishTitleScreen(void);
//----------------------------------------------------------------------------------
// Mission Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitMissionScreen(void);
void UpdateMissionScreen(void);
void DrawMissionScreen(void);
void UnloadMissionScreen(void);
int FinishMissionScreen(void);
//----------------------------------------------------------------------------------
// Gameplay Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitGameplayScreen(void);
void UpdateGameplayScreen(void);
void DrawGameplayScreen(void);
void UnloadGameplayScreen(void);
int FinishGameplayScreen(void);
//----------------------------------------------------------------------------------
// Ending Screen Functions Declaration
//----------------------------------------------------------------------------------
void InitEndingScreen(void);
void UpdateEndingScreen(void);
void DrawEndingScreen(void);
void UnloadEndingScreen(void);
int FinishEndingScreen(void);
#ifdef __cplusplus
}
#endif
#endif // SCREENS_H

View File

@@ -0,0 +1,465 @@
/*******************************************************************************************
*
* raylib - transmission mission
*
* Code and transmit the right message
*
* This game has been created using raylib (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014-2018 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "screens/screens.h" // NOTE: Defines global variable: currentScreen
#include <stdlib.h>
#include <stdio.h>
#if defined(PLATFORM_ANDROID)
#include "android_native_app_glue.h"
#endif
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h>
#endif
//----------------------------------------------------------------------------------
// Global Variables Definition (local to this module)
//----------------------------------------------------------------------------------
const int screenWidth = 1280;
const int screenHeight = 720;
// Required variables to manage screen transitions (fade-in, fade-out)
static float transAlpha = 0.0f;
static bool onTransition = false;
static bool transFadeOut = false;
static int transFromScreen = -1;
static int transToScreen = -1;
// NOTE: Some global variables that require to be visible for all screens,
// are defined in screens.h (i.e. currentScreen)
//----------------------------------------------------------------------------------
// Local Functions Declaration
//----------------------------------------------------------------------------------
static void ChangeToScreen(int screen); // No transition effect
static void TransitionToScreen(int screen);
static void UpdateTransition(void);
static void DrawTransition(void);
static void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
// Main entry point
//----------------------------------------------------------------------------------
#if defined(PLATFORM_ANDROID)
void android_main(struct android_app *app)
#else
int main(void)
#endif
{
// Initialization
//---------------------------------------------------------
#if defined(PLATFORM_ANDROID)
InitWindow(screenWidth, screenHeight, app);
#else
SetConfigFlags(FLAG_SHOW_LOGO); // | FLAG_FULLSCREEN_MODE);
InitWindow(screenWidth, screenHeight, "raylib game - transmission mission");
#endif
// Global data loading (assets that must be available in all screens, i.e. fonts)
InitAudioDevice();
music = LoadMusicStream("resources/audio/music_title.ogg");
fxButton = LoadSound("resources/audio/fx_newspaper.ogg");
SetMusicVolume(music, 1.0f);
PlayMusicStream(music);
fontMission = LoadSpriteFontEx("resources/fonts/traveling_typewriter.ttf", 64, 250, 0);
texButton = LoadTexture("resources/textures/title_ribbon.png");
// UI BUTTON
recButton.width = texButton.width;
recButton.height = texButton.height;
recButton.x = screenWidth - recButton.width;
recButton.y = screenHeight - recButton.height - 50;
fadeButton = 0.8f;
colorButton = RED;
textPositionButton = (Vector2){recButton.x + recButton.width/2, recButton.y + recButton.height/2};
fontSizeButton = 30;
textColorButton = WHITE;
currentMission = 0;
totalMissions = 4;
// Setup and Init first screen
currentScreen = LOGO;
InitLogoScreen();
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
UpdateDrawFrame();
}
#endif
// De-Initialization
//--------------------------------------------------------------------------------------
// Unload current screen data before closing
switch (currentScreen)
{
case LOGO: UnloadLogoScreen(); break;
case TITLE: UnloadTitleScreen(); break;
case MISSION: UnloadMissionScreen(); break;
case GAMEPLAY: UnloadGameplayScreen(); break;
case ENDING: UnloadEndingScreen(); break;
default: break;
}
// Unload all global loaded data (i.e. fonts) here!
UnloadMusicStream(music);
UnloadSound(fxButton);
UnloadSpriteFont(fontMission);
UnloadTexture(texButton);
CloseAudioDevice(); // Close audio context
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
#if !defined(PLATFORM_ANDROID)
return 0;
#endif
}
//----------------------------------------------------------------------------------
// Module specific Functions Definition
//----------------------------------------------------------------------------------
// Change to next screen, no transition
static void ChangeToScreen(int screen)
{
// Unload current screen
switch (currentScreen)
{
case LOGO: UnloadLogoScreen(); break;
case TITLE: UnloadTitleScreen(); break;
case MISSION: UnloadMissionScreen(); break;
case GAMEPLAY: UnloadGameplayScreen(); break;
case ENDING: UnloadEndingScreen(); break;
default: break;
}
// Init next screen
switch (screen)
{
case LOGO: InitLogoScreen(); break;
case TITLE: InitTitleScreen(); break;
case MISSION: InitMissionScreen(); break;
case GAMEPLAY: InitGameplayScreen(); break;
case ENDING: InitEndingScreen(); break;
default: break;
}
currentScreen = screen;
}
// Define transition to next screen
static void TransitionToScreen(int screen)
{
onTransition = true;
transFadeOut = false;
transFromScreen = currentScreen;
transToScreen = screen;
transAlpha = 0.0f;
}
// Update transition effect
static void UpdateTransition(void)
{
if (!transFadeOut)
{
transAlpha += 0.02f;
// NOTE: Due to float internal representation, condition jumps on 1.0f instead of 1.05f
// For that reason we compare against 1.01f, to avoid last frame loading stop
if (transAlpha > 1.01f)
{
transAlpha = 1.0f;
// Unload current screen
switch (transFromScreen)
{
case LOGO: UnloadLogoScreen(); break;
case TITLE: UnloadTitleScreen(); break;
case MISSION: UnloadMissionScreen(); break;
case GAMEPLAY: UnloadGameplayScreen(); break;
case ENDING: UnloadEndingScreen(); break;
default: break;
}
// Load next screen
switch (transToScreen)
{
case LOGO: InitLogoScreen(); break;
case TITLE: InitTitleScreen(); break;
case MISSION: InitMissionScreen(); break;
case GAMEPLAY: InitGameplayScreen(); break;
case ENDING: InitEndingScreen(); break;
default: break;
}
currentScreen = transToScreen;
// Activate fade out effect to next loaded screen
transFadeOut = true;
}
}
else // Transition fade out logic
{
transAlpha -= 0.02f;
if (transAlpha < -0.01f)
{
transAlpha = 0.0f;
transFadeOut = false;
onTransition = false;
transFromScreen = -1;
transToScreen = -1;
}
}
}
// Draw transition effect (full-screen rectangle)
static void DrawTransition(void)
{
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha));
}
// Update and draw game frame
static void UpdateDrawFrame(void)
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // NOTE: Music keeps playing between screens
if (!onTransition)
{
switch(currentScreen)
{
case LOGO:
{
UpdateLogoScreen();
if (FinishLogoScreen()) TransitionToScreen(TITLE);
} break;
case TITLE:
{
UpdateTitleScreen();
if (FinishTitleScreen())
{
StopMusicStream(music);
TransitionToScreen(MISSION);
}
} break;
case MISSION:
{
UpdateMissionScreen();
if (FinishMissionScreen())
{
StopMusicStream(music);
TransitionToScreen(GAMEPLAY);
}
} break;
case GAMEPLAY:
{
UpdateGameplayScreen();
if (FinishGameplayScreen() == 1) TransitionToScreen(ENDING);
//else if (FinishGameplayScreen() == 2) TransitionToScreen(TITLE);
} break;
case ENDING:
{
UpdateEndingScreen();
if (FinishEndingScreen() == 1) // Continue to next mission
{
TransitionToScreen(MISSION);
}
else if (FinishEndingScreen() == 2) // Replay current mission
{
PlayMusicStream(music);
TransitionToScreen(TITLE);
}
} break;
default: break;
}
}
else UpdateTransition(); // Update transition (fade-in, fade-out)
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
switch(currentScreen)
{
case LOGO: DrawLogoScreen(); break;
case TITLE: DrawTitleScreen(); break;
case MISSION: DrawMissionScreen(); break;
case GAMEPLAY: DrawGameplayScreen(); break;
case ENDING: DrawEndingScreen(); break;
default: break;
}
// Draw full screen rectangle in front of everything
if (onTransition) DrawTransition();
//DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// Load missions from text file
Mission *LoadMissions(const char *fileName)
{
Mission *missions = NULL;
char buffer[512];
int missionsCount = 0;
FILE *misFile = fopen(fileName, "rt");
if (misFile == NULL) printf("[%s] Missions file could not be opened\n", fileName);
else
{
// First pass to get total missions count
while (!feof(misFile))
{
fgets(buffer, 512, misFile);
switch (buffer[0])
{
case 't': sscanf(buffer, "t %i", &missionsCount); break;
default: break;
}
}
if (missionsCount > 0) missions = (Mission *)malloc(missionsCount*sizeof(Mission));
else return NULL;
rewind(misFile); // Return to the beginning of the file, to read again
int missionNum = 0;
while (!feof(misFile))
{
fgets(buffer, 512, misFile);
if (missionNum < missionsCount)
{
switch (buffer[0])
{
case 'b':
{
// New mission brief starts!
missions[missionNum].id = missionNum;
sscanf(buffer, "b %[^\n]s", missions[missionNum].brief);
} break;
case 'k': sscanf(buffer, "k %[^\n]s", missions[missionNum].key); break;
case 'm':
{
// NOTE: Message is loaded as is, needs to be processed!
sscanf(buffer, "m %[^\n]s", missions[missionNum].msg);
} break;
case 's':
{
sscanf(buffer, "s %i %i %i %i %i %i %i %i",
&missions[missionNum].sols[0],
&missions[missionNum].sols[1],
&missions[missionNum].sols[2],
&missions[missionNum].sols[3],
&missions[missionNum].sols[4],
&missions[missionNum].sols[5],
&missions[missionNum].sols[6],
&missions[missionNum].sols[7]);
missions[missionNum].wordsCount = 0;
for (int i = 0; i < 8; i++)
{
if (missions[missionNum].sols[i] > -1)
{
missions[missionNum].wordsCount++;
}
}
TraceLog(LOG_WARNING, "Mission %i - Words count %i", missionNum, missions[missionNum].wordsCount);
missionNum++;
} break;
default: break;
}
}
}
if (missionsCount != missionNum) TraceLog(LOG_WARNING, "Missions count and loaded missions don't match!");
}
fclose(misFile);
if (missions != NULL)
{
TraceLog(LOG_INFO, "Missions loaded: %i", missionsCount);
TraceLog(LOG_INFO, "Missions loaded successfully!");
}
return missions;
}
bool IsButtonPressed()
{
if (CheckCollisionPointRec(GetMousePosition(), recButton))
{
fadeButton = 1.0f;
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) || IsGestureDetected(GESTURE_TAP))
{
PlaySound(fxButton);
return true;
}
}
else fadeButton = 0.80f;
return false;
}
void DrawButton(const char *text)
{
//DrawRectangleRec(recButton, Fade(colorButton, fadeButton));
DrawTexturePro(texButton, (Rectangle){0,0,texButton.width, texButton.height}, recButton, (Vector2){0,0},0, Fade(WHITE, fadeButton));
Vector2 measure = MeasureTextEx(fontMission, text, fontSizeButton, 0);
Vector2 textPos = {textPositionButton.x - measure.x/2 + 10, textPositionButton.y - measure.y/2 - 10};
DrawTextEx(fontMission, text, textPos , fontSizeButton, 0, textColorButton);
}

View File

@@ -63,7 +63,7 @@ static void UpdateDrawFrame(void); // Update and Draw one frame
#if defined(PLATFORM_ANDROID)
void android_main(struct android_app *app)
#else
int main(void)
int main(int argc, char *argv[])
#endif
{
// Initialization

View File

@@ -1,15 +0,0 @@
project('raylib', 'c', version: '1.8.0',
license: 'zlib',
meson_version: '>= 0.39.1',
default_options : 'c_std=gnu99')
cc = meson.get_compiler('c')
glfw_dep = dependency('glfw3', version : '>=3.2')
gl_dep = dependency('gl')
openal_dep = dependency('openal')
x11_dep = dependency('x11')
m_dep = cc.find_library('m', required : false)
subdir('src')

View File

@@ -0,0 +1,558 @@
#include "pch.h"
#include "app.h"
#include "raylib.h"
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;
using namespace Windows::Devices::Input;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Gaming::Input;
using namespace Windows::Graphics::Display;
using namespace Microsoft::WRL;
using namespace Platform;
using namespace raylibUWP;
/*
To-do list
- Cache reference to our CoreWindow?
- Implement gestures
*/
/* INPUT CODE */
// Stand-ins for "core.c" variables
#define MAX_GAMEPADS 4 // Max number of gamepads supported
#define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad)
#define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad)
static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready
static float gamepadAxisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state
static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state
static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state
static char previousKeyState[512] = { 0 }; // Contains previous frame keyboard state
static char currentKeyState[512] = { 0 }; // Contains current frame keyboard state
//...
static char previousMouseState[3] = { 0 }; // Registers previous mouse button state
static char currentMouseState[3] = { 0 }; // Registers current mouse button state
static int previousMouseWheelY = 0; // Registers previous mouse wheel variation
static int currentMouseWheelY = 0; // Registers current mouse wheel variation
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
static bool cursorHidden = false; // Track if cursor is hidden
static Vector2 mousePosition;
static Vector2 mouseDelta; // NOTE: Added to keep track of mouse movement while the cursor is locked - no equivalent in "core.c"
static bool toggleCursorLock;
CoreCursor ^regularCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); // The "visible arrow" cursor type
// Helper to process key events
void ProcessKeyEvent(Windows::System::VirtualKey key, int action)
{
using Windows::System::VirtualKey;
switch (key)
{
case VirtualKey::Space: currentKeyState[KEY_SPACE] = action; break;
case VirtualKey::Escape: currentKeyState[KEY_ESCAPE] = action; break;
case VirtualKey::Enter: currentKeyState[KEY_ENTER] = action; break;
case VirtualKey::Delete: currentKeyState[KEY_BACKSPACE] = action; break;
case VirtualKey::Right: currentKeyState[KEY_RIGHT] = action; break;
case VirtualKey::Left: currentKeyState[KEY_LEFT] = action; break;
case VirtualKey::Down: currentKeyState[KEY_DOWN] = action; break;
case VirtualKey::Up: currentKeyState[KEY_UP] = action; break;
case VirtualKey::F1: currentKeyState[KEY_F1] = action; break;
case VirtualKey::F2: currentKeyState[KEY_F2] = action; break;
case VirtualKey::F3: currentKeyState[KEY_F4] = action; break;
case VirtualKey::F4: currentKeyState[KEY_F5] = action; break;
case VirtualKey::F5: currentKeyState[KEY_F6] = action; break;
case VirtualKey::F6: currentKeyState[KEY_F7] = action; break;
case VirtualKey::F7: currentKeyState[KEY_F8] = action; break;
case VirtualKey::F8: currentKeyState[KEY_F9] = action; break;
case VirtualKey::F9: currentKeyState[KEY_F10] = action; break;
case VirtualKey::F10: currentKeyState[KEY_F11] = action; break;
case VirtualKey::F11: currentKeyState[KEY_F12] = action; break;
case VirtualKey::LeftShift: currentKeyState[KEY_LEFT_SHIFT] = action; break;
case VirtualKey::LeftControl: currentKeyState[KEY_LEFT_CONTROL] = action; break;
case VirtualKey::LeftMenu: currentKeyState[KEY_LEFT_ALT] = action; break; // NOTE: Potential UWP bug with Alt key: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9bebfb0a-7637-400e-8bda-e55620091407/unexpected-behavior-in-windowscoreuicorephysicalkeystatusismenukeydown
case VirtualKey::RightShift: currentKeyState[KEY_RIGHT_SHIFT] = action; break;
case VirtualKey::RightControl: currentKeyState[KEY_RIGHT_CONTROL] = action; break;
case VirtualKey::RightMenu: currentKeyState[KEY_RIGHT_ALT] = action; break;
case VirtualKey::Number0: currentKeyState[KEY_ZERO] = action; break;
case VirtualKey::Number1: currentKeyState[KEY_ONE] = action; break;
case VirtualKey::Number2: currentKeyState[KEY_TWO] = action; break;
case VirtualKey::Number3: currentKeyState[KEY_THREE] = action; break;
case VirtualKey::Number4: currentKeyState[KEY_FOUR] = action; break;
case VirtualKey::Number5: currentKeyState[KEY_FIVE] = action; break;
case VirtualKey::Number6: currentKeyState[KEY_SIX] = action; break;
case VirtualKey::Number7: currentKeyState[KEY_SEVEN] = action; break;
case VirtualKey::Number8: currentKeyState[KEY_EIGHT] = action; break;
case VirtualKey::Number9: currentKeyState[KEY_NINE] = action; break;
case VirtualKey::A: currentKeyState[KEY_A] = action; break;
case VirtualKey::B: currentKeyState[KEY_B] = action; break;
case VirtualKey::C: currentKeyState[KEY_C] = action; break;
case VirtualKey::D: currentKeyState[KEY_D] = action; break;
case VirtualKey::E: currentKeyState[KEY_E] = action; break;
case VirtualKey::F: currentKeyState[KEY_F] = action; break;
case VirtualKey::G: currentKeyState[KEY_G] = action; break;
case VirtualKey::H: currentKeyState[KEY_H] = action; break;
case VirtualKey::I: currentKeyState[KEY_I] = action; break;
case VirtualKey::J: currentKeyState[KEY_J] = action; break;
case VirtualKey::K: currentKeyState[KEY_K] = action; break;
case VirtualKey::L: currentKeyState[KEY_L] = action; break;
case VirtualKey::M: currentKeyState[KEY_M] = action; break;
case VirtualKey::N: currentKeyState[KEY_N] = action; break;
case VirtualKey::O: currentKeyState[KEY_O] = action; break;
case VirtualKey::P: currentKeyState[KEY_P] = action; break;
case VirtualKey::Q: currentKeyState[KEY_Q] = action; break;
case VirtualKey::R: currentKeyState[KEY_R] = action; break;
case VirtualKey::S: currentKeyState[KEY_S] = action; break;
case VirtualKey::T: currentKeyState[KEY_T] = action; break;
case VirtualKey::U: currentKeyState[KEY_U] = action; break;
case VirtualKey::V: currentKeyState[KEY_V] = action; break;
case VirtualKey::W: currentKeyState[KEY_W] = action; break;
case VirtualKey::X: currentKeyState[KEY_X] = action; break;
case VirtualKey::Y: currentKeyState[KEY_Y] = action; break;
case VirtualKey::Z: currentKeyState[KEY_Z] = action; break;
}
}
/* CALLBACKS */
void App::PointerPressed(CoreWindow^ window, PointerEventArgs^ args)
{
if (args->CurrentPoint->Properties->IsLeftButtonPressed)
{
currentMouseState[MOUSE_LEFT_BUTTON] = 1;
}
if (args->CurrentPoint->Properties->IsRightButtonPressed)
{
currentMouseState[MOUSE_RIGHT_BUTTON] = 1;
}
if (args->CurrentPoint->Properties->IsMiddleButtonPressed)
{
currentMouseState[MOUSE_MIDDLE_BUTTON] = 1;
}
}
void App::PointerReleased(CoreWindow ^window, PointerEventArgs^ args)
{
if (!(args->CurrentPoint->Properties->IsLeftButtonPressed))
{
currentMouseState[MOUSE_LEFT_BUTTON] = 0;
}
if (!(args->CurrentPoint->Properties->IsRightButtonPressed))
{
currentMouseState[MOUSE_RIGHT_BUTTON] = 0;
}
if (!(args->CurrentPoint->Properties->IsMiddleButtonPressed))
{
currentMouseState[MOUSE_MIDDLE_BUTTON] = 0;
}
}
void App::PointerWheelChanged(CoreWindow ^window, PointerEventArgs^ args)
{
// TODO: Scale the MouseWheelDelta to match GLFW's mouse wheel sensitivity.
currentMouseWheelY += args->CurrentPoint->Properties->MouseWheelDelta;
}
void App::MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args)
{
mouseDelta.x += args->MouseDelta.X;
mouseDelta.y += args->MouseDelta.Y;
}
void App::OnKeyDown(CoreWindow ^ sender, KeyEventArgs ^ args)
{
ProcessKeyEvent(args->VirtualKey, 1);
}
void App::OnKeyUp(CoreWindow ^ sender, KeyEventArgs ^ args)
{
ProcessKeyEvent(args->VirtualKey, 0);
}
/* REIMPLEMENTED FROM CORE.C */
// Get one key state
static bool GetKeyStatus(int key)
{
return currentKeyState[key];
}
// Show mouse cursor
void UWPShowCursor()
{
CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor;
cursorHidden = false;
}
// Hides mouse cursor
void UWPHideCursor()
{
CoreWindow::GetForCurrentThread()->PointerCursor = nullptr;
cursorHidden = true;
}
// Set mouse position XY
void UWPSetMousePosition(Vector2 position)
{
CoreWindow ^window = CoreWindow::GetForCurrentThread();
Point mousePosScreen = Point(position.x + window->Bounds.X, position.y + window->Bounds.Y);
window->PointerPosition = mousePosScreen;
mousePosition = position;
}
// Enables cursor (unlock cursor)
void UWPEnableCursor()
{
UWPShowCursor();
UWPSetMousePosition(mousePosition); // The mouse is hidden in the center of the screen - move it to where it should appear
toggleCursorLock = false;
}
// Disables cursor (lock cursor)
void UWPDisableCursor()
{
UWPHideCursor();
toggleCursorLock = true;
}
// Get one mouse button state
static bool UWPGetMouseButtonStatus(int button)
{
return currentMouseState[button];
}
// Poll (store) all input events
void UWP_PollInput()
{
// Register previous keyboard state
for (int k = 0; k < 512; k++) previousKeyState[k] = currentKeyState[k];
// Process Mouse
{
// Register previous mouse states
for (int i = 0; i < 3; i++) previousMouseState[i] = currentMouseState[i];
previousMouseWheelY = currentMouseWheelY;
currentMouseWheelY = 0;
CoreWindow ^window = CoreWindow::GetForCurrentThread();
if (toggleCursorLock)
{
// Track cursor movement delta, recenter it on the client
mousePosition.x += mouseDelta.x;
mousePosition.y += mouseDelta.y;
// Why we're not using UWPSetMousePosition here...
// UWPSetMousePosition changes the "mousePosition" variable to match where the cursor actually is.
// Our cursor is locked to the middle of screen, and we don't want that reflected in "mousePosition"
Vector2 centerClient = { (float)(GetScreenWidth() / 2), (float)(GetScreenHeight() / 2) };
window->PointerPosition = Point(centerClient.x + window->Bounds.X, centerClient.y + window->Bounds.Y);
}
else
{
// Record the cursor's position relative to the client
mousePosition.x = window->PointerPosition.X - window->Bounds.X;
mousePosition.y = window->PointerPosition.Y - window->Bounds.Y;
}
mouseDelta = { 0 ,0 };
}
// Process Gamepads
{
// Check if gamepads are ready
for (int i = 0; i < MAX_GAMEPADS; i++)
{
// HACK: UWP keeps a contiguous list of gamepads. For the interest of time I'm just doing a 1:1 mapping of
// connected gamepads with their spot in the list, but this has serious robustness problems
// e.g. player 1, 2, and 3 are playing a game - if player2 disconnects, p3's controller would now be mapped to p2's character since p3 is now second in the list.
gamepadReady[i] = (i < Gamepad::Gamepads->Size);
}
// Get current gamepad state
for (int i = 0; i < MAX_GAMEPADS; i++)
{
if (gamepadReady[i])
{
// Register previous gamepad states
for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k];
// Get current gamepad state
auto gamepad = Gamepad::Gamepads->GetAt(i);
GamepadReading reading = gamepad->GetCurrentReading();
// NOTE: Maybe it would be wiser to redefine the gamepad button mappings in "raylib.h" for the UWP platform instead of remapping them manually
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_A] = ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_B] = ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_X] = ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_Y] = ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LB] = ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RB] = ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_SELECT] = ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View); // Changed for XB1 Controller
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_START] = ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu); // Changed for XB1 Controller
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_UP] = ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RIGHT] = ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_DOWN] = ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadDown);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LEFT] = ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadLeft);
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_HOME] = false; // Home button not supported by UWP
// Get current axis state
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_X] = reading.LeftThumbstickX;
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_Y] = reading.LeftThumbstickY;
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_X] = reading.RightThumbstickX;
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_Y] = reading.RightThumbstickY;
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LT] = reading.LeftTrigger;
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RT] = reading.RightTrigger;
}
}
}
}
// The following functions were ripped from core.c and have *no additional work done on them*
// Detect if a key has been pressed once
bool UWPIsKeyPressed(int key)
{
bool pressed = false;
if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 1))
pressed = true;
else pressed = false;
return pressed;
}
// Detect if a key is being pressed (key held down)
bool UWPIsKeyDown(int key)
{
if (GetKeyStatus(key) == 1) return true;
else return false;
}
// Detect if a key has been released once
bool UWPIsKeyReleased(int key)
{
bool released = false;
if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true;
else released = false;
return released;
}
// Detect if a key is NOT being pressed (key not held down)
bool UWPIsKeyUp(int key)
{
if (GetKeyStatus(key) == 0) return true;
else return false;
}
/* OTHER CODE */
// Helper to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
inline float ConvertDipsToPixels(float dips, float dpi)
{
static const float dipsPerInch = 96.0f;
return floor(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
}
// Implementation of the IFrameworkViewSource interface, necessary to run our app.
ref class SimpleApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
{
public:
virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView()
{
return ref new App();
}
};
// The main function creates an IFrameworkViewSource for our app, and runs the app.
[Platform::MTAThread]
int main(Platform::Array<Platform::String^>^)
{
auto simpleApplicationSource = ref new SimpleApplicationSource();
CoreApplication::Run(simpleApplicationSource);
return 0;
}
App::App() :
mWindowClosed(false),
mWindowVisible(true)
{
}
// The first method called when the IFrameworkView is being created.
void App::Initialize(CoreApplicationView^ applicationView)
{
// Register event handlers for app lifecycle. This example includes Activated, so that we
// can make the CoreWindow active and start rendering on the window.
applicationView->Activated += ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
// Logic for other event handlers could go here.
// Information about the Suspending and Resuming event handlers can be found here:
// http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh994930.aspx
CoreApplication::Resuming += ref new EventHandler<Platform::Object^>(this, &App::OnResuming);
}
// Called when the CoreWindow object is created (or re-created).
void App::SetWindow(CoreWindow^ window)
{
window->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
window->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerPressed);
window->PointerReleased += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerReleased);
window->PointerWheelChanged += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerWheelChanged);
window->KeyDown += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &App::OnKeyDown);
window->KeyUp += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &App::OnKeyUp);
Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler<MouseDevice^, MouseEventArgs^>(this, &App::MouseMoved);
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
currentDisplayInformation->DpiChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
currentDisplayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
// The CoreWindow has been created, so EGL can be initialized.
InitWindow(800, 450, (EGLNativeWindowType)window);
}
// Initializes scene resources
void App::Load(Platform::String^ entryPoint)
{
// InitWindow() --> rlglInit()
}
static int posX = 100;
static int posY = 100;
static int time = 0;
// This method is called after the window becomes active.
void App::Run()
{
while (!mWindowClosed)
{
if (mWindowVisible)
{
// Draw
BeginDrawing();
ClearBackground(RAYWHITE);
posX += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_X] * 5;
posY += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_Y] * -5;
DrawRectangle(posX, posY, 400, 100, RED);
DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
DrawCircle(mousePosition.x, mousePosition.y, 40, BLUE);
if(UWPIsKeyDown(KEY_S))
{
DrawCircle(100, 100, 100, BLUE);
}
if(UWPIsKeyPressed(KEY_A))
{
posX -= 50;
UWPEnableCursor();
}
if (UWPIsKeyPressed(KEY_D))
{
posX += 50;
UWPDisableCursor();
}
if(currentKeyState[KEY_LEFT_ALT])
DrawRectangle(250, 250, 20, 20, BLACK);
if (currentKeyState[KEY_BACKSPACE])
DrawRectangle(280, 250, 20, 20, BLACK);
if (currentMouseState[MOUSE_LEFT_BUTTON])
DrawRectangle(280, 250, 20, 20, BLACK);
static int pos = 0;
pos -= currentMouseWheelY;
DrawRectangle(280, pos + 50, 20, 20, BLACK);
DrawRectangle(250, 280 + (time++ % 60), 10, 10, PURPLE);
EndDrawing();
UWP_PollInput();
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
}
else
{
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
}
}
CloseWindow();
}
// Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
// class is torn down while the app is in the foreground.
void App::Uninitialize()
{
// CloseWindow();
}
// Application lifecycle event handler.
void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
{
// Run() won't start until the CoreWindow is activated.
CoreWindow::GetForCurrentThread()->Activate();
}
void App::OnResuming(Object^ sender, Object^ args)
{
// Restore any data or state that was unloaded on suspend. By default, data
// and state are persisted when resuming from suspend. Note that this event
// does not occur if the app was previously terminated.
}
void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
{
// TODO: Update window and render area size
//m_deviceResources->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height));
//m_main->UpdateForWindowSizeChange();
}
// Window event handlers.
void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
{
mWindowVisible = args->Visible;
// raylib core has the variable windowMinimized to register state,
// it should be modifyed by this event...
}
void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{
mWindowClosed = true;
// raylib core has the variable windowShouldClose to register state,
// it should be modifyed by this event...
}
void App::OnDpiChanged(DisplayInformation^ sender, Object^ args)
{
//m_deviceResources->SetDpi(sender->LogicalDpi);
//m_main->UpdateForWindowSizeChange();
}
void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
{
//m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
//m_main->UpdateForWindowSizeChange();
}

View File

@@ -0,0 +1,49 @@
#pragma once
#include <string>
#include "pch.h"
namespace raylibUWP
{
ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
{
public:
App();
// IFrameworkView Methods.
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
virtual void Load(Platform::String^ entryPoint);
virtual void Run();
virtual void Uninitialize();
protected:
// Application lifecycle event handlers.
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
// Window event handlers.
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
// DisplayInformation event handlers.
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
// Input event handlers
void PointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void PointerReleased(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args);
void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args);
void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
private:
bool mWindowClosed;
bool mWindowVisible;
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="b842558c-c034-4e4b-9457-a286f26e83cc" Publisher="CN=Alumno" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="56d2ca94-c361-4e9f-9a33-bacd751552fa" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>raylibUWP</DisplayName>
<PublisherDisplayName>Alumno</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="raylibUWP.App">
<uap:VisualElements DisplayName="raylibUWP" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="raylib UWP game" BackgroundColor="#464646">
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ANGLE.WindowsStore" version="2.1.13" targetFramework="native" />
</packages>

View File

@@ -0,0 +1 @@
#include "pch.h"

View File

@@ -0,0 +1,16 @@
#pragma once
#include <memory>
#include <wrl.h>
// OpenGL ES includes
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
// EGL includes
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <EGL/eglplatform.h>
// ANGLE include for Windows Store
#include <angle_windowsstore.h>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="App.cpp" />
<ClCompile Include="pch.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\SmallLogo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\WideLogo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Logo.scale-100.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<None Include="UWP_OpenGLES2_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="$(angle-BinPath)\libEGL.dll" />
<None Include="$(angle-BinPath)\libGLESv2.dll" />
</ItemGroup>
<ItemGroup>
<Filter Include="Assets">
<UniqueIdentifier>{d16954bb-de54-472b-ac10-ecab10d3fdc8}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{b842558c-c034-4e4b-9457-a286f26e83cc}</ProjectGuid>
<RootNamespace>raylibUWP</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<ProjectName>raylib.App.UWP</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>raylib.App.UWP.TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<IncludePath>C:\Users\Sam\Documents\GitHub\raylib\release\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\raylib\Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
<Link>
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\arm;$(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<Link>
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)raylib\Debug;%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\x64\Debug;C:\Users\Alumno\Downloads\angle\UWP_OpenGLES2\raylib;%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Default</CompileAs>
<OmitDefaultLibName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</OmitDefaultLibName>
</ClCompile>
<Link>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Image Include="Assets\Logo.scale-100.png" />
<Image Include="Assets\SmallLogo.scale-100.png" />
<Image Include="Assets\StoreLogo.scale-100.png" />
<Image Include="Assets\SplashScreen.scale-100.png" />
<Image Include="Assets\WideLogo.scale-100.png" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="App.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="packages.config" />
<None Include="raylib.App.UWP.TemporaryKey.pfx" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets" Condition="Exists('..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets'))" />
</Target>
</Project>

View File

@@ -0,0 +1,50 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.App.UWP", "raylib.App.UWP\raylib.App.UWP.vcxproj", "{B842558C-C034-4E4B-9457-A286F26E83CC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.ActiveCfg = Debug|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Build.0 = Debug|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Deploy.0 = Debug|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.ActiveCfg = Debug|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Build.0 = Debug|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Deploy.0 = Debug|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.ActiveCfg = Debug|Win32
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Build.0 = Debug|Win32
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Deploy.0 = Debug|Win32
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.ActiveCfg = Release|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Build.0 = Release|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Deploy.0 = Release|ARM
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.ActiveCfg = Release|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Build.0 = Release|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Deploy.0 = Release|x64
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.ActiveCfg = Release|Win32
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Build.0 = Release|Win32
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Deploy.0 = Release|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|ARM.ActiveCfg = Debug|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|x64
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|ARM.ActiveCfg = Release|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E89D61AC-55DE-4482-AFD4-DF7242EBC859}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>raylib</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
<Lib>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\include\ANGLE</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
<Lib>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\include\ANGLE;$(SolutionDir)..\..\release\include</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\audio.c" />
<ClCompile Include="..\..\..\src\core.c" />
<ClCompile Include="..\..\..\src\external\stb_vorbis.c" />
<ClCompile Include="..\..\..\src\models.c" />
<ClCompile Include="..\..\..\src\rlgl.c" />
<ClCompile Include="..\..\..\src\shapes.c" />
<ClCompile Include="..\..\..\src\text.c" />
<ClCompile Include="..\..\..\src\textures.c" />
<ClCompile Include="..\..\..\src\utils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\camera.h" />
<ClInclude Include="..\..\..\src\external\glad.h" />
<ClInclude Include="..\..\..\src\external\jar_mod.h" />
<ClInclude Include="..\..\..\src\external\jar_xm.h" />
<ClInclude Include="..\..\..\src\external\stb_image.h" />
<ClInclude Include="..\..\..\src\external\stb_image_resize.h" />
<ClInclude Include="..\..\..\src\external\stb_image_write.h" />
<ClInclude Include="..\..\..\src\external\stb_rect_pack.h" />
<ClInclude Include="..\..\..\src\external\stb_truetype.h" />
<ClInclude Include="..\..\..\src\external\stb_vorbis.h" />
<ClInclude Include="..\..\..\src\gestures.h" />
<ClInclude Include="..\..\..\src\raylib.h" />
<ClInclude Include="..\..\..\src\raymath.h" />
<ClInclude Include="..\..\..\src\rlgl.h" />
<ClInclude Include="..\..\..\src\shader_distortion.h" />
<ClInclude Include="..\..\..\src\shader_standard.h" />
<ClInclude Include="..\..\..\src\utils.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug_DLL|Win32">
<Configuration>Debug_DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_DLL|Win32">
<Configuration>Release_DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,12 @@
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -31,6 +45,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@@ -39,20 +60,36 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
@@ -61,13 +98,30 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)external\glfw3\lib\win32;$(SolutionDir)external\openal_soft\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -79,7 +133,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
@@ -88,8 +142,30 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)external\glfw3\lib\win32;$(SolutionDir)external\openal_soft\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug_DLL|Win32">
<Configuration>Debug_DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_DLL|Win32">
<Configuration>Release_DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,12 @@
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -31,6 +45,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@@ -39,20 +60,36 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(ProjectDir)$(ProjectName)\$(Configuration)</OutDir>
<IntDir>$(ProjectDir)$(ProjectName)\$(Configuration)\temp</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
@@ -60,14 +97,31 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)external\glfw3\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -80,15 +134,36 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)external\glfw3\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

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