Merge pull request #458 from raysan5/develop
Integrate develop branch into master
25
.gitignore
vendored
|
@ -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
|
||||
|
|
74
.travis.yml
|
@ -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 GLFW=SYSTEM
|
||||
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
|
@ -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
|
@ -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!
|
|
@ -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!
|
31
README.md
|
@ -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)
|
||||
|
||||
[](https://travis-ci.org/raysan5/raylib)
|
||||
[](https://ci.appveyor.com/project/raysan5/raylib)
|
||||
[](https://gitter.im/raylib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](LICENSE.md)
|
||||
[](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
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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 XWindow requires also below libraries
|
||||
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||
# 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: libglfw3-dev libopenal-dev libegl1-mesa-dev
|
||||
LDLIBS = -lraylib -lglfw -framework OpenGL -framework OpenAL -framework Cocoa
|
||||
# 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: 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))
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.7 KiB |
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
22
examples/shaders/resources/shaders/glsl120/base.fs
Normal 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;
|
||||
}
|
26
examples/shaders/resources/shaders/glsl120/base.vs
Normal 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);
|
||||
}
|
37
examples/shaders/resources/shaders/glsl120/bloom.fs
Normal 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;
|
||||
}
|
32
examples/shaders/resources/shaders/glsl120/blur.fs
Normal 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);
|
||||
}
|
45
examples/shaders/resources/shaders/glsl120/cross_hatching.fs
Normal 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);
|
||||
}
|
|
@ -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);
|
||||
}
|
52
examples/shaders/resources/shaders/glsl120/distortion.fs
Normal 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);
|
||||
}
|
||||
}
|
35
examples/shaders/resources/shaders/glsl120/dream_vision.fs
Normal 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;
|
||||
}
|
41
examples/shaders/resources/shaders/glsl120/fisheye.fs
Normal 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);
|
||||
}
|
23
examples/shaders/resources/shaders/glsl120/grayscale.fs
Normal 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);
|
||||
}
|
30
examples/shaders/resources/shaders/glsl120/pixelizer.fs
Normal 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);
|
||||
}
|
27
examples/shaders/resources/shaders/glsl120/posterization.fs
Normal 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);
|
||||
}
|
29
examples/shaders/resources/shaders/glsl120/predator.fs
Normal 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);
|
||||
}
|
42
examples/shaders/resources/shaders/glsl120/scanlines.fs
Normal 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);
|
||||
}
|
38
examples/shaders/resources/shaders/glsl120/sobel.fs
Normal 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);
|
||||
}
|
44
examples/shaders/resources/shaders/glsl120/swirl.fs
Normal 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);;
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
@ -177,4 +176,4 @@ int main()
|
|||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ int main()
|
|||
letterCount++;
|
||||
}
|
||||
|
||||
if (key == KEY_BACKSPACE)
|
||||
if (IsKeyPressed(KEY_BACKSPACE))
|
||||
{
|
||||
letterCount--;
|
||||
name[letterCount] = '\0';
|
||||
|
|
|
@ -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);
|
||||
|
|
BIN
examples/textures/resources/KAISG.ttf
Normal 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];
|
||||
|
|
83
examples/textures/textures_image_text.c
Normal 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;
|
||||
}
|
BIN
examples/textures/textures_image_text.png
Normal file
After Width: | Height: | Size: 543 KiB |
|
@ -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)
|
||||
|
|
Before Width: | Height: | Size: 899 KiB After Width: | Height: | Size: 994 KiB |
|
@ -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);
|
||||
}
|
|
@ -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
|
||||
|
@ -1003,10 +1001,7 @@ int FinishTitleScreen(void)
|
|||
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
|
@ -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
|
||||
|
289
games/transmission/Makefile.Android
Normal 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
|
BIN
games/transmission/resources/audio/fx_batman.ogg
Normal file
BIN
games/transmission/resources/audio/fx_button.ogg
Normal file
BIN
games/transmission/resources/audio/fx_grab.ogg
Normal file
BIN
games/transmission/resources/audio/fx_leave.ogg
Normal file
BIN
games/transmission/resources/audio/fx_message.ogg
Normal file
BIN
games/transmission/resources/audio/fx_newspaper.ogg
Normal file
BIN
games/transmission/resources/audio/fx_place.ogg
Normal file
BIN
games/transmission/resources/audio/fx_typing.ogg
Normal file
BIN
games/transmission/resources/audio/music_mission.ogg
Normal file
BIN
games/transmission/resources/audio/music_title.ogg
Normal file
BIN
games/transmission/resources/audio/s_p_y.xm
Normal file
BIN
games/transmission/resources/audio/spy_versus_spy.xm
Normal file
BIN
games/transmission/resources/fonts/Lora-Bold.ttf
Normal file
BIN
games/transmission/resources/fonts/Lora-BoldItalic.ttf
Normal file
BIN
games/transmission/resources/fonts/fontTitle.ttf
Normal file
BIN
games/transmission/resources/fonts/traveling_typewriter.ttf
Normal file
65
games/transmission/resources/missions.txt
Normal 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
|
||||
# -----------------------------------------------------------------
|
BIN
games/transmission/resources/textures/cw_logo.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
games/transmission/resources/textures/ending_background.png
Normal file
After Width: | Height: | Size: 241 KiB |
BIN
games/transmission/resources/textures/ending_newspaper.png
Normal file
After Width: | Height: | Size: 756 KiB |
BIN
games/transmission/resources/textures/message_background.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
games/transmission/resources/textures/message_vignette.png
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
games/transmission/resources/textures/mission_background.png
Normal file
After Width: | Height: | Size: 796 KiB |
BIN
games/transmission/resources/textures/mission_backline.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
games/transmission/resources/textures/mission_words.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
games/transmission/resources/textures/title_background.png
Normal file
After Width: | Height: | Size: 1,009 KiB |
BIN
games/transmission/resources/textures/title_ribbon.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
games/transmission/resources/textures/words_base.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
212
games/transmission/screens/screen_ending.c
Normal 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;
|
||||
}
|
423
games/transmission/screens/screen_gameplay.c
Normal 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;
|
||||
}
|
102
games/transmission/screens/screen_logo.c
Normal 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;
|
||||
}
|
293
games/transmission/screens/screen_mission.c
Normal 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;
|
||||
}
|
||||
}
|
168
games/transmission/screens/screen_title.c
Normal 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);
|
||||
}
|
143
games/transmission/screens/screens.h
Normal 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
|
465
games/transmission/transmission.c
Normal 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);
|
||||
}
|
|
@ -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
|
||||
|
@ -315,4 +315,4 @@ static void UpdateDrawFrame(void)
|
|||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
|
15
meson.build
|
@ -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')
|
||||
|
558
project/vs2015.UWP/raylib.App.UWP/App.cpp
Normal 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();
|
||||
}
|
49
project/vs2015.UWP/raylib.App.UWP/App.h
Normal 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;
|
||||
};
|
||||
}
|
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png
Normal file
After Width: | Height: | Size: 801 B |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png
Normal file
After Width: | Height: | Size: 329 B |
After Width: | Height: | Size: 2.1 KiB |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png
Normal file
After Width: | Height: | Size: 429 B |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
26
project/vs2015.UWP/raylib.App.UWP/Package.appxmanifest
Normal 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>
|
4
project/vs2015.UWP/raylib.App.UWP/packages.config
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ANGLE.WindowsStore" version="2.1.13" targetFramework="native" />
|
||||
</packages>
|
1
project/vs2015.UWP/raylib.App.UWP/pch.cpp
Normal file
|
@ -0,0 +1 @@
|
|||
#include "pch.h"
|
16
project/vs2015.UWP/raylib.App.UWP/pch.h
Normal 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>
|
42
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.filters
Normal 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>
|
4
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.user
Normal 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>
|
145
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj
Normal 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>
|
50
project/vs2015.UWP/raylib.UWP.sln
Normal 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
|
186
project/vs2015.UWP/raylib/raylib.vcxproj
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|