diff options
| author | DarkElvenAngel <jb_rotavele@yahoo.com> | 2019-06-10 16:12:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-10 16:12:06 -0400 |
| commit | d7f4be071579e6f00974c0940f021272f22fbc54 (patch) | |
| tree | 6ee389e6617c494d272e9bc82415fbc3618e7a28 /projects | |
| parent | 8a21830b77eaa76ffe0c31df5f96aecd6bd2eecc (diff) | |
| parent | baf7d7d19ad8d6bfbfc201169e4ed4f49a9576a6 (diff) | |
| download | raylib-d7f4be071579e6f00974c0940f021272f22fbc54.tar.gz raylib-d7f4be071579e6f00974c0940f021272f22fbc54.zip | |
Merge pull request #1 from raysan5/master
Update
Diffstat (limited to 'projects')
64 files changed, 3786 insertions, 1100 deletions
diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile new file mode 100644 index 00000000..a00f4fab --- /dev/null +++ b/projects/4coder/Makefile @@ -0,0 +1,400 @@ +#************************************************************************************************** +# +# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 +# +# Copyright (c) 2013-2019 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 +PROJECT_NAME ?= game +RAYLIB_VERSION ?= 2.5.0 +RAYLIB_API_VERSION ?= 2 +RAYLIB_PATH ?= ..\.. + +# Define default options + +# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + +# Locations of your newly installed library and associated headers. See ../src/Makefile +# On Linux, if you have installed raylib but cannot compile the examples, check that +# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations. +# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED. +# To enable compile-time linking to a special version of libraylib.so, change these variables here. +# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below. +# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime, +# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH. +# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. +DESTDIR ?= /usr/local +RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib +# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. +RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include + +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) +RAYLIB_LIBTYPE ?= STATIC + +# Build mode for project: DEBUG or RELEASE +BUILD_MODE ?= RELEASE + +# Use external GLFW library instead of rglfw module +# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3 +USE_EXTERNAL_GLFW ?= FALSE + +# Use Wayland display server protocol on Linux desktop +# by default it uses X11 windowing system +USE_WAYLAND_DISPLAY ?= FALSE + +# 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=BSD + endif + ifeq ($(UNAMEOS),OpenBSD) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),NetBSD) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),DragonFly) + PLATFORM_OS=BSD + 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 + +# RAYLIB_PATH adjustment for different platforms. +# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? +# Required for ldconfig or other tools that do not perform path expansion. +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),LINUX) + RAYLIB_PREFIX ?= .. + RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) + endif +endif +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki. +# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. +ifeq ($(PLATFORM),PLATFORM_RPI) + RAYLIB_PATH ?= /home/pi/raylib +endif + +ifeq ($(PLATFORM),PLATFORM_WEB) + # Emscripten required variables + EMSDK_PATH ?= C:/emsdk + EMSCRIPTEN_VERSION ?= 1.38.31 + CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit + PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 + NODE_VERSION = 8.9.1_64bit + export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) + EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) +endif + +# Define raylib release directory for compiled library. +# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src + +# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries +# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH +# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux +# without formal installation from ../src/Makefile. It aids portability and is useful if you have +# multiple versions of raylib, have raylib installed to a non-standard location, or want to +# bundle libraylib.so with your game. Change it to your liking. +# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, +# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH, +# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) +# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute. +# To see which libraries a built example is linking to, ldd core/core_basic_window; +# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing. +EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH) + +# 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),BSD) + # FreeBSD, OpenBSD, NetBSD, DragonFly 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 + # WARNING: To compile to HTML5, code must be redesigned + # to use emscripten.h and emscripten_set_main_loop() + 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 include debug information on compilation +# -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) +# -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 -Wno-missing-braces + +ifeq ($(BUILD_MODE),DEBUG) + CFLAGS += -g +endif + +# Additional flags for compiler (if desired) +#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + # resource file contains windows executable icon and properties + # -Wl,--subsystem,windows hides the console window + CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows + endif + ifeq ($(PLATFORM_OS),LINUX) + ifeq ($(RAYLIB_LIBTYPE),STATIC) + CFLAGS += -D_DEFAULT_SOURCE + endif + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Explicitly enable runtime link to libraylib.so + CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) + endif + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + CFLAGS += -std=gnu99 +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + # -Os # size optimization + # -O2 # optimization level 2, if used, also set --memory-init-file 0 + # -s USE_GLFW=3 # Use glfw3 library (context/input management) + # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + # -s USE_PTHREADS=1 # multithreading support + # -s WASM=0 # disable Web Assembly, emitted by default + # -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow) + # -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter + # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # --profiling # include information for code profiling + # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) + # --preload-file resources # specify a resources folder for data compilation + CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources + ifeq ($(BUILD_MODE), DEBUG) + CFLAGS += -s ASSERTIONS=1 --profiling + endif + + # Define a custom shell .html and output extension + CFLAGS += --shell-file $(RAYLIB_PATH)\src\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)/src -I$(RAYLIB_PATH)/src/external + +# Define additional directories containing required header files +ifeq ($(PLATFORM),PLATFORM_RPI) + # RPI required 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 +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + # Consider -L$(RAYLIB_H_INSTALL_PATH) + INCLUDE_PATHS += -I/usr/local/include + endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include + INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external + endif +endif + +# Define library paths containing required libs. +LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src + +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + # Consider -L$(RAYLIB_INSTALL_PATH) + LDFLAGS += -L. -Lsrc -L/usr/local/lib + endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs + LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) + 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 + # NOTE: WinMM library required to set high-res timer resolution + LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm + # 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 + # Explicit link to libc + ifeq ($(RAYLIB_LIBTYPE),SHARED) + LDLIBS += -lc + 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),BSD) + # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly 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 a recursive wildcard function +rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) + +# Define all source files required +SRC_DIR = src +OBJ_DIR = obj + +# Define all object files from source files +SRC = $(call rwildcard, *.c, *.h) +#OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) +OBJS = main.c + +# For Android platform we call a custom Makefile.Android +ifeq ($(PLATFORM),PLATFORM_ANDROID) + MAKEFILE_PARAMS = -f Makefile.Android + export PROJECT_NAME + export SRC_DIR +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) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + +# Compile source files +# NOTE: This pattern will compile every module defined on $(OBJS) +#%.o: %.c +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.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 -fv + 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 -fv *.o +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + del *.o *.html *.js +endif + @echo Cleaning done + diff --git a/projects/4coder/Makefile.Android b/projects/4coder/Makefile.Android new file mode 100644 index 00000000..29d437b1 --- /dev/null +++ b/projects/4coder/Makefile.Android @@ -0,0 +1,300 @@ +#************************************************************************************************** +# +# 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 ?= ..\.. + +# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version +ANDROID_ARCH ?= ARM +ANDROID_API_VERSION = 21 +ifeq ($(ANDROID_ARCH),ARM) + ANDROID_ARCH_NAME = armeabi-v7a +endif +ifeq ($(ANDROID_ARCH),ARM64) + ANDROID_ARCH_NAME = arm64-v8a +endif + +# Required path variables +# NOTE: JAVA_HOME must be set to JDK +JAVA_HOME ?= C:/JavaJDK +ANDROID_HOME = C:/android-sdk +ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) +ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 +ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools + +# 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\raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_SCREEN_ORIENTATION ?= landscape +APP_KEYSTORE_PASS ?= raylib + +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) +RAYLIB_LIBTYPE ?= STATIC + +# Library path for libraylib.a/libraylib.so +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src + +# 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/$(ANDROID_ARCH_NAME)/libraylib.so +endif + +# Compiler and archiver +# NOTE: GCC is being deprecated in Android NDK r16 +ifeq ($(ANDROID_ARCH),ARM) + CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang + AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar +endif +ifeq ($(ANDROID_ARCH),ARM64) + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang + AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar +endif + +# Compiler flags for arquitecture +ifeq ($(ANDROID_ARCH),ARM) + CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 +endif +ifeq ($(ANDROID_ARCH),ARM64) + CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769 +endif +# 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__=$(ANDROID_API_VERSION) + +# Paths containing required header files +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -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/$(ANDROID_ARCH_NAME) -L$(ANDROID_TOOLCHAIN)\sysroot\usr\lib + +# Define any libraries to link into executable +# if you want to link libraries (libname.so or libname.a), use the -lname +LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -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_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\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) + 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\$(ANDROID_ARCH_NAME)\libraylib.so +endif +ifeq ($(RAYLIB_LIBTYPE),STATIC) + copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.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 ($(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="$(ANDROID_API_VERSION)" /^> >> $(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-$(ANDROID_API_VERSION)/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/$(ANDROID_ARCH_NAME)/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-$(ANDROID_API_VERSION)/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-$(ANDROID_API_VERSION)/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/$(ANDROID_ARCH_NAME)/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 --abi $(ANDROID_ARCH_NAME) -rds $(PROJECT_NAME).apk + +# Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64) +check_device_abi: + $(ANDROID_PLATFORM_TOOLS)/adb shell getprop ro.product.cpu.abi + +# 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 diff --git a/projects/4coder/main.c b/projects/4coder/main.c new file mode 100644 index 00000000..e7918422 --- /dev/null +++ b/projects/4coder/main.c @@ -0,0 +1,39 @@ +#include <math.h> +#include "raylib.h" + +int main() { + int screenWidth = 800; + int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib"); + + Camera cam; + cam.position = (Vector3){ 0.f, 10.f, 8.f }; + cam.target = (Vector3){ 0.f, 0.f, 0.f }; + cam.up = (Vector3){ 0.f, 1.f, 0.f }; + cam.fovy = 60.f; + cam.type = CAMERA_PERSPECTIVE; + + Vector3 cubePos = { 0.f, 0.f, 0.f }; + + SetTargetFPS(60); + + while (!WindowShouldClose()) { + cam.position.x = sin(GetTime()) * 10.f; + cam.position.z = cos(GetTime()) * 10.f; + + BeginDrawing(); + ClearBackground(RAYWHITE); + BeginMode3D(cam); + DrawCube(cubePos, 2.f, 2.f, 2.f, RED); + DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON); + DrawGrid(10, 1.f); + EndMode3D(); + DrawText("This is a raylib example", 10, 40, 20, DARKGRAY); + DrawFPS(10, 10); + EndDrawing(); + } + + CloseWindow(); + return 0; +}
\ No newline at end of file diff --git a/projects/4coder/project.4coder b/projects/4coder/project.4coder new file mode 100644 index 00000000..e466bb4f --- /dev/null +++ b/projects/4coder/project.4coder @@ -0,0 +1,54 @@ +version(1); + +project_name = "raylib-example"; + +patterns = { +"*.cpp", +"*.c", +"*.h", +"*.bat", +"*.sh", +"*.4coder", +"Makefile", +}; + +blacklist_patterns = { +".*", +}; + +load_paths = { + { { {".", .relative = true, .recursive = true, } }, .os = "win" }, + { { {".", .relative = true, .recursive = true, } }, .os = "linux" }, + { { {".", .relative = true, .recursive = true, } }, .os = "mac" }, +}; + +command_list = { + { .name = "clean", + .out = "*clean*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, + .cmd = { + {"mingw32-make clean", .os = "win"}, + {"make clean", .os = "linux"}, + {"make clean", .os = "mac"}, + }, + }, + { .name = "build", + .out = "*compile*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, + .cmd = { + {"mingw32-make", .os = "win"}, + {"make", .os = "linux"}, + {"make", .os = "mac"}, + }, + }, + { .name = "run", + .out = "*run*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, + .cmd = { + {"./game.exe", .os = "win"}, + {"./game", .os = "linux"}, + {"./game", .os = "mac"}, + }, + }, +}; + +fkey_command[3] = "clean"; +fkey_command[4] = "build"; +fkey_command[5] = "run"; diff --git a/projects/CodeBlocks/core_basic_window.cbp b/projects/CodeBlocks/core_basic_window.cbp index 10390e25..c4b22a9e 100644 --- a/projects/CodeBlocks/core_basic_window.cbp +++ b/projects/CodeBlocks/core_basic_window.cbp @@ -13,11 +13,11 @@ <Option compiler="gcc" /> <Compiler> <Add option="-g" /> - <Add directory="../../raylib/raylib/release/include" /> + <Add directory="../../src" /> </Compiler> <Linker> <Add option="-lraylib -lopengl32 -lgdi32 -lwinmm" /> - <Add library="../../../../raylib/raylib/release/libs/win32/mingw32/libraylib.a" /> + <Add library="../../src/libraylib.a" /> </Linker> </Target> <Target title="Release"> @@ -27,12 +27,12 @@ <Option compiler="gcc" /> <Compiler> <Add option="-O2" /> - <Add directory="../../../../raylib/raylib/release/include" /> + <Add directory="../../src" /> </Compiler> <Linker> <Add option="-s" /> - <Add option="-lraylib -lopengl32 -lgdi32" /> - <Add library="../../../../raylib/raylib/release/libs/win32/mingw32/libraylib.a" /> + <Add option="-lraylib -lopengl32 -lgdi32 -lwinmm" /> + <Add library="../../src/libraylib.a" /> </Linker> </Target> </Build> diff --git a/projects/Geany/raylib.c.tags b/projects/Geany/raylib.c.tags new file mode 100644 index 00000000..33864ca0 --- /dev/null +++ b/projects/Geany/raylib.c.tags @@ -0,0 +1,452 @@ +# format=pipe +InitWindow|void|(int width, int height, const char *title);| +WindowShouldClose|bool|(void);| +CloseWindow|void|(void);| +IsWindowReady|bool|(void);| +IsWindowMinimized|bool|(void);| +IsWindowResized|bool|(void);| +IsWindowHidden|bool|(void);| +ToggleFullscreen|void|(void);| +UnhideWindow|void|(void);| +HideWindow|void|(void);| +SetWindowIcon|void|(Image image);| +SetWindowTitle|void|(const char *title);| +SetWindowPosition|void|(int x, int y);| +SetWindowMonitor|void|(int monitor);| +SetWindowMinSize|void|(int width, int height);| +SetWindowSize|void|(int width, int height);| +GetWindowHandle|void *|(void);| +GetScreenWidth|int|(void);| +GetScreenHeight|int|(void);| +GetMonitorCount|int|(void);| +GetMonitorWidth|int|(int monitor);| +GetMonitorHeight|int|(int monitor);| +GetMonitorPhysicalWidth|int|(int monitor);| +GetMonitorPhysicalHeight|int|(int monitor);| +GetMonitorName|const char *|(int monitor);| +GetClipboardText|const char *|(void);| +SetClipboardText|void|(const char *text);| +ShowCursor|void|(void);| +HideCursor|void|(void);| +IsCursorHidden|bool|(void);| +EnableCursor|void|(void);| +DisableCursor|void|(void);| +ClearBackground|void|(Color color);| +BeginDrawing|void|(void);| +EndDrawing|void|(void);| +BeginMode2D|void|(Camera2D camera);| +EndMode2D|void|(void);| +BeginMode3D|void|(Camera3D camera);| +EndMode3D|void|(void);| +BeginTextureMode|void|(RenderTexture2D target);| +EndTextureMode|void|(void);| +GetMouseRay|Ray|(Vector2 mousePosition, Camera camera);| +GetWorldToScreen|Vector2|(Vector3 position, Camera camera);| +GetCameraMatrix|Matrix|(Camera camera);| +SetTargetFPS|void|(int fps);| +GetFPS|int|(void);| +GetFrameTime|float|(void);| +GetTime|double|(void);| +ColorToInt|int|(Color color);| +ColorNormalize|Vector4|(Color color);| +ColorToHSV|Vector3|(Color color);| +ColorFromHSV|Color|(Vector3 hsv);| +GetColor|Color|(int hexValue);| +Fade|Color|(Color color, float alpha);| +SetConfigFlags|void|(unsigned char flags);| +SetTraceLogLevel|void|(int logType);| +SetTraceLogExit|void|(int logType);| +SetTraceLogCallback|void|(TraceLogCallback callback);| +TraceLog|void|(int logType, const char *text, ...);| +TakeScreenshot|void|(const char *fileName);| +GetRandomValue|int|(int min, int max);| +FileExists|bool|(const char *fileName);| +IsFileExtension|bool|(const char *fileName, const char *ext);| +GetExtension|const char *|(const char *fileName);| +GetFileName|const char *|(const char *filePath);| +GetFileNameWithoutExt|const char *|(const char *filePath);| +GetDirectoryPath|const char *|(const char *fileName);| +GetWorkingDirectory|const char *|(void);| +GetDirectoryFiles|char **|(const char *dirPath, int *count);| +ClearDirectoryFiles|void|(void);| +ChangeDirectory|bool|(const char *dir);| +IsFileDropped|bool|(void);| +GetDroppedFiles|char **|(int *count);| +ClearDroppedFiles|void|(void);| +GetFileModTime|long|(const char *fileName);| +StorageSaveValue|void|(int position, int value);| +StorageLoadValue|int|(int position);| +OpenURL|void|(const char *url);| +IsKeyPressed|bool|(int key);| +IsKeyDown|bool|(int key);| +IsKeyReleased|bool|(int key);| +IsKeyUp|bool|(int key);| +GetKeyPressed|int|(void);| +SetExitKey|void|(int key);| +IsGamepadAvailable|bool|(int gamepad);| +IsGamepadName|bool|(int gamepad, const char *name);| +GetGamepadName|const char *|(int gamepad);| +IsGamepadButtonPressed|bool|(int gamepad, int button);| +IsGamepadButtonDown|bool|(int gamepad, int button);| +IsGamepadButtonReleased|bool|(int gamepad, int button);| +IsGamepadButtonUp|bool|(int gamepad, int button);| +GetGamepadButtonPressed|int|(void);| +GetGamepadAxisCount|int|(int gamepad);| +GetGamepadAxisMovement|float|(int gamepad, int axis);| +IsMouseButtonPressed|bool|(int button);| +IsMouseButtonDown|bool|(int button);| +IsMouseButtonReleased|bool|(int button);| +IsMouseButtonUp|bool|(int button);| +GetMouseX|int|(void);| +GetMouseY|int|(void);| +GetMousePosition|Vector2|(void);| +SetMousePosition|void|(int x, int y);| +SetMouseOffset|void|(int offsetX, int offsetY);| +SetMouseScale|void|(float scaleX, float scaleY);| +GetMouseWheelMove|int|(void);| +GetTouchX|int|(void);| +GetTouchY|int|(void);| +GetTouchPosition|Vector2|(int index);| +SetGesturesEnabled|void|(unsigned int gestureFlags);| +IsGestureDetected|bool|(int gesture);| +GetGestureDetected|int|(void);| +GetTouchPointsCount|int|(void);| +GetGestureHoldDuration|float|(void);| +GetGestureDragVector|Vector2|(void);| +GetGestureDragAngle|float|(void);| +GetGesturePinchVector|Vector2|(void);| +GetGesturePinchAngle|float|(void);| +SetCameraMode|void|(Camera camera, int mode);| +UpdateCamera|void|(Camera *camera);| +SetCameraPanControl|void|(int panKey);| +SetCameraAltControl|void|(int altKey);| +SetCameraSmoothZoomControl|void|(int szKey);| +SetCameraMoveControls|void|(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);| +DrawPixel|void|(int posX, int posY, Color color);| +DrawPixelV|void|(Vector2 position, Color color);| +DrawLine|void|(int startPosX, int startPosY, int endPosX, int endPosY, Color color);| +DrawLineV|void|(Vector2 startPos, Vector2 endPos, Color color);| +DrawLineEx|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| +DrawLineBezier|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| +DrawCircle|void|(int centerX, int centerY, float radius, Color color);| +DrawCircleSector|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);| +DrawCircleSectorLines|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline +DrawCircleGradient|void|(int centerX, int centerY, float radius, Color color1, Color color2);| +DrawCircleV|void|(Vector2 center, float radius, Color color);| +DrawCircleLines|void|(int centerX, int centerY, float radius, Color color);| +DrawRing|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);| +DrawRingLines|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);| +DrawRectangle|void|(int posX, int posY, int width, int height, Color color);| +DrawRectangleV|void|(Vector2 position, Vector2 size, Color color);| +DrawRectangleRec|void|(Rectangle rec, Color color);| +DrawRectanglePro|void|(Rectangle rec, Vector2 origin, float rotation, Color color);| +DrawRectangleGradientV|void|(int posX, int posY, int width, int height, Color color1, Color color2);| +DrawRectangleGradientH|void|(int posX, int posY, int width, int height, Color color1, Color color2);| +DrawRectangleGradientEx|void|(Rectangle rec, Color col1, Color col2, Color col3, Color col4);| +DrawRectangleLines|void|(int posX, int posY, int width, int height, Color color);| +DrawRectangleLinesEx|void|(Rectangle rec, int lineThick, Color color);| +DrawRectangleRounded|void|(Rectangle rec, float roundness, int segments, Color color);| +DrawRectangleRoundedLines|void|(Rectangle rec, float roundness, int segments, int lineThick, Color color);| +DrawTriangle|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| +DrawTriangleLines|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| +DrawPoly|void|(Vector2 center, int sides, float radius, float rotation, Color color);| +DrawPolyEx|void|(Vector2 *points, int numPoints, Color color);| +DrawPolyExLines|void|(Vector2 *points, int numPoints, Color color);| +SetShapesTexture|void|(Texture2D texture, Rectangle source);| +CheckCollisionRecs|bool|(Rectangle rec1, Rectangle rec2);| +CheckCollisionCircles|bool|(Vector2 center1, float radius1, Vector2 center2, float radius2);| +CheckCollisionCircleRec|bool|(Vector2 center, float radius, Rectangle rec);| +GetCollisionRec|Rectangle|(Rectangle rec1, Rectangle rec2);| +CheckCollisionPointRec|bool|(Vector2 point, Rectangle rec);| +CheckCollisionPointCircle|bool|(Vector2 point, Vector2 center, float radius);| +CheckCollisionPointTriangle|bool|(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);| +LoadImage|Image|(const char *fileName);| +LoadImageEx|Image|(Color *pixels, int width, int height);| +LoadImagePro|Image|(void *data, int width, int height, int format);| +LoadImageRaw|Image|(const char *fileName, int width, int height, int format, int headerSize);| +ExportImage|void|(Image image, const char *fileName);| +ExportImageAsCode|void|(Image image, const char *fileName);| +LoadTexture|Texture2D|(const char *fileName);| +LoadTextureFromImage|Texture2D|(Image image);| +LoadTextureCubemap|TextureCubemap|(Image image, int layoutType);| +LoadRenderTexture|RenderTexture2D|(int width, int height);| +UnloadImage|void|(Image image);| +UnloadTexture|void|(Texture2D texture);| +UnloadRenderTexture|void|(RenderTexture2D target);| +GetImageData|Color *|(Image image);| +GetImageDataNormalized|Vector4 *|(Image image);| +GetPixelDataSize|int|(int width, int height, int format);| +GetTextureData|Image|(Texture2D texture);| +GetScreenData|Image|(void);| +UpdateTexture|void|(Texture2D texture, const void *pixels);| +ImageCopy|Image|(Image image);| +ImageToPOT|void|(Image *image, Color fillColor);| +ImageFormat|void|(Image *image, int newFormat);| +ImageAlphaMask|void|(Image *image, Image alphaMask);| +ImageAlphaClear|void|(Image *image, Color color, float threshold); +ImageAlphaCrop|void|(Image *image, float threshold);| +ImageAlphaPremultiply|void|(Image *image);| +ImageCrop|void|(Image *image, Rectangle crop);| +ImageResize|void|(Image *image, int newWidth, int newHeight);| +ImageResizeNN|void|(Image *image, int newWidth,int newHeight);|void| +ImageResizeCanvas|void|(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);| +ImageMipmaps|void|(Image *image);| +ImageDither|void|(Image *image, int rBpp, int gBpp, int bBpp, int aBpp);| +ImageExtractPalette|Color *|(Image image, int maxPaletteSize, int *extractCount);| +ImageText|Image|(const char *text, int fontSize, Color color);| +ImageTextEx|Image|(Font font, const char *text, float fontSize, float spacing, Color tint);| +ImageDraw|void|(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);| +ImageDrawRectangle|void|(Image *dst, Rectangle rec, Color color);| +ImageDrawRectangleLines|void|(Image *dst, Rectangle rec, int thick, Color color);| +ImageDrawText|void|(Image *dst, Vector2 position, const char *text, int fontSize, Color color);| +ImageDrawTextEx|void|(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color);| +ImageFlipVertical|void|(Image *image);| +ImageFlipHorizontal|void|(Image *image);| +ImageRotateCW|void|(Image *image);| +ImageRotateCCW|void|(Image *image);| +ImageColorTint|void|(Image *image, Color color);| +ImageColorInvert|void|(Image *image);| +ImageColorGrayscale|void|(Image *image);| +ImageColorContrast|void|(Image *image, float contrast);| +ImageColorBrightness|void|(Image *image, int brightness);| +ImageColorReplace|void|(Image *image, Color color, Color replace);| +GenImageColor|Image|(int width, int height, Color color);| +GenImageGradientV|Image|(int width, int height, Color top, Color bottom);| +GenImageGradientH|Image|(int width, int height, Color left, Color right);| +GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);| +GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);| +GenImageWhiteNoise|Image|(int width, int height, float factor);| +GenImagePerlinNoise|Image|(int width, int height, int offsetX, int offsetY, float scale);| +GenImageCellular|Image|(int width, int height, int tileSize);| +GenTextureMipmaps|void|(Texture2D *texture);| +SetTextureFilter|void|(Texture2D texture, int filterMode);| +SetTextureWrap|void|(Texture2D texture, int wrapMode);| +DrawTexture|void|(Texture2D texture, int posX, int posY, Color tint);| +DrawTextureV|void|(Texture2D texture, Vector2 position, Color tint);| +DrawTextureEx|void|(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);| +DrawTextureRec|void|(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);| +DrawTextureQuad|void|(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);| +DrawTexturePro|void|(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);| +DrawTextureNPatch|void|(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);| +GetFontDefault|Font|(void);| +LoadFont|Font|(const char *fileName);| +LoadFontEx|Font|(const char *fileName, int fontSize, int *fontChars, int charsCount);| +LoadFontFromImage|Font|(Image image, Color key, int firstChar);| +LoadFontData|CharInfo *|(const char *fileName, int fontSize, int *fontChars, int charsCount, int type);| +GenImageFontAtlas|Image|(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod);| +UnloadFont|void|(Font font);| +DrawFPS|void|(int posX, int posY);| +DrawText|void|(const char *text, int posX, int posY, int fontSize, Color color);| +DrawTextEx|void|(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint);| +DrawTextRec|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint);| +DrawTextRecEx|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack);| +MeasureText|int|(const char *text, int fontSize);| +MeasureTextEx|Vector2|(Font font, const char *text, float fontSize, float spacing);| +GetGlyphIndex|int|(Font font, int character);| +TextIsEqual|bool|(const char *text1, const char *text2);| +TextLength|unsigned int|(const char *text);| +TextFormat|const char *|(const char *text, ...);| +TextSubtext|const char *|(const char *text, int position, int length);| +TextReplace|const char *|(char *text, const char *replace, const char *by);| +TextInsert|const char *|(const char *text, const char *insert, int position);| +TextJoin|const char *|(const char **textList, int count, const char *delimiter);| +TextSplit|const char **|(const char *text, char delimiter, int *count);| +TextAppend|void|(char *text, const char *append, int *position);| +TextFindIndex|int|(const char *text, const char *find);| +TextToUpper|const char *|(const char *text);| +TextToLower|const char *|(const char *text);| +TextToPascal|const char *|(const char *text);| +TextToInteger|int|(const char *text);| +DrawLine3D|void|(Vector3 startPos, Vector3 endPos, Color color);| +DrawCircle3D|void|(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);| +DrawCube|void|(Vector3 position, float width, float height, float length, Color color);| +DrawCubeV|void|(Vector3 position, Vector3 size, Color color);| +DrawCubeWires|void|(Vector3 position, float width, float height, float length, Color color);| +DrawCubeWiresV|void|(Vector3 position, Vector3 size, Color color);| +DrawCubeTexture|void|(Texture2D texture, Vector3 position, float width, float height, float length, Color color);| +DrawSphere|void|(Vector3 centerPos, float radius, Color color);| +DrawSphereEx|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);| +DrawSphereWires|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);| +DrawCylinder|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);| +DrawCylinderWires|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);| +DrawPlane|void|(Vector3 centerPos, Vector2 size, Color color);| +DrawRay|void|(Ray ray, Color color);| +DrawGrid|void|(int slices, float spacing);| +DrawGizmo|void|(Vector3 position);| +LoadModel|Model|(const char *fileName);| +LoadModelFromMesh|Model|(Mesh mesh);| +UnloadModel|void|(Model model);| +LoadMeshes|Mesh *|(const char *fileName, int *meshCount);| +ExportMesh|void|(Mesh mesh, const char *fileName);| +UnloadMesh|void|(Mesh *mesh);| +LoadMaterials|Material *|(const char *fileName, int *materialCount);| +LoadMaterialDefault|Material|(void);| +UnloadMaterial|void|(Material material);| +SetMaterialTexture|void|(Material *material, int mapType, Texture2D texture);| +SetModelMeshMaterial|void|(Model *model, int meshId, int materialId);| +LoadModelAnimations|ModelAnimation *|(const char *fileName, int *animsCount);| +UpdateModelAnimation|void|(Model model, ModelAnimation anim, int frame);| +UnloadModelAnimation|void|(ModelAnimation anim);| +IsModelAnimationValid|bool|(Model model, ModelAnimation anim);| +GenMeshPoly|Mesh|(int sides, float radius);| +GenMeshPlane|Mesh|(float width, float length, int resX, int resZ);| +GenMeshCube|Mesh|(float width, float height, float length);| +GenMeshSphere|Mesh|(float radius, int rings, int slices);| +GenMeshHemiSphere|Mesh|(float radius, int rings, int slices);| +GenMeshCylinder|Mesh|(float radius, float height, int slices);| +GenMeshTorus|Mesh|(float radius, float size, int radSeg, int sides);| +GenMeshKnot|Mesh|(float radius, float size, int radSeg, int sides);| +GenMeshHeightmap|Mesh|(Image heightmap, Vector3 size);| +GenMeshCubicmap|Mesh|(Image cubicmap, Vector3 cubeSize);| +MeshBoundingBox|BoundingBox|(Mesh mesh);| +MeshTangents|void|(Mesh *mesh);| +MeshBinormals|void|(Mesh *mesh);| +DrawModel|void|(Model model, Vector3 position, float scale, Color tint);| +DrawModelEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);| +DrawModelWires|void|(Model model, Vector3 position, float scale, Color tint);| +DrawModelWiresEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);| +DrawBoundingBox|void|(BoundingBox box, Color color);| +DrawBillboard|void|(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);| +DrawBillboardRec|void|(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);| +CheckCollisionSpheres|bool|(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);| +CheckCollisionBoxes|bool|(BoundingBox box1, BoundingBox box2);| +CheckCollisionBoxSphere|bool|(BoundingBox box, Vector3 centerSphere, float radiusSphere);| +CheckCollisionRaySphere|bool|(Ray ray, Vector3 spherePosition, float sphereRadius);| +CheckCollisionRaySphereEx|bool|(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);| +CheckCollisionRayBox|bool|(Ray ray, BoundingBox box);| +GetCollisionRayModel|RayHitInfo|(Ray ray, Model *model);| +GetCollisionRayTriangle|RayHitInfo|(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);| +GetCollisionRayGround|RayHitInfo|(Ray ray, float groundHeight);| +LoadText|char *|(const char *fileName);| +LoadShader|Shader|(const char *vsFileName, const char *fsFileName);| +LoadShaderCode|Shader|(char *vsCode, char *fsCode);| +UnloadShader|void|(Shader shader);| +GetShaderDefault|Shader|(void);| +GetTextureDefault|Texture2D|(void);| +GetShaderLocation|int|(Shader shader, const char *uniformName);| +SetShaderValue|void|(Shader shader, int uniformLoc, const void *value, int uniformType);| +SetShaderValueV|void|(Shader shader, int uniformLoc, const void *value, int uniformType, int count);| +SetShaderValueMatrix|void|(Shader shader, int uniformLoc, Matrix mat);| +SetShaderValueTexture|void|(Shader shader, int uniformLoc, Texture2D texture);| +SetMatrixProjection|void|(Matrix proj);| +SetMatrixModelview|void|(Matrix view);| +GetMatrixModelview|Matrix|();| +BeginShaderMode|void|(Shader shader);| +EndShaderMode|void|(void);| +BeginBlendMode|void|(int mode);| +EndBlendMode|void|(void);| +BeginScissorMode|void|(int x, int y, int width, int height);| +EndScissorMode|void|(void);| +InitVrSimulator|void|(void);| +CloseVrSimulator|void|(void);| +UpdateVrTracking|void|(Camera *camera);| +SetVrConfiguration|void|(VrDeviceInfo info, Shader distortion);| +IsVrSimulatorReady|bool|(void);| +ToggleVrMode|void|(void);| +BeginVrDrawing|void|(void);| +EndVrDrawing|void|(void);| +InitAudioDevice|void|(void);| +CloseAudioDevice|void|(void);| +IsAudioDeviceReady|bool|(void);| +SetMasterVolume|void|(float volume);| +LoadWave|Wave|(const char *fileName);| +LoadWaveEx|Wave|(void *data, int sampleCount, int sampleRate, int sampleSize, int channels);| +LoadSound|Sound|(const char *fileName);| +LoadSoundFromWave|Sound|(Wave wave);| +UpdateSound|void|(Sound sound, const void *data, int samplesCount);| +UnloadWave|void|(Wave wave);| +UnloadSound|void|(Sound sound);| +ExportWave|void|(Wave wave, const char *fileName);| +ExportWaveAsCode|void|(Wave wave, const char *fileName);| +PlaySound|void|(Sound sound);| +PauseSound|void|(Sound sound);| +ResumeSound|void|(Sound sound);| +StopSound|void|(Sound sound);| +IsSoundPlaying|bool|(Sound sound);| +SetSoundVolume|void|(Sound sound, float volume);| +SetSoundPitch|void|(Sound sound, float pitch);| +WaveFormat|void|(Wave *wave, int sampleRate, int sampleSize, int channels);| +WaveCopy|Wave|(Wave wave);| +WaveCrop|void|(Wave *wave, int initSample, int finalSample);| +GetWaveData|float *|(Wave wave);| +LoadMusicStream|Music|(const char *fileName);| +UnloadMusicStream|void|(Music music);| +PlayMusicStream|void|(Music music);| +UpdateMusicStream|void|(Music music);| +StopMusicStream|void|(Music music);| +PauseMusicStream|void|(Music music);| +ResumeMusicStream|void|(Music music);| +IsMusicPlaying|bool|(Music music);| +SetMusicVolume|void|(Music music, float volume);| +SetMusicPitch|void|(Music music, float pitch);| +SetMusicLoopCount|void|(Music music, int count);| +GetMusicTimeLength|float|(Music music);| +GetMusicTimePlayed|float|(Music music);| +InitAudioStream|AudioStream|(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels);| +UpdateAudioStream|void|(AudioStream stream, const void *data, int samplesCount);| +CloseAudioStream|void|(AudioStream stream);| +IsAudioBufferProcessed|bool|(AudioStream stream);| +PlayAudioStream|void|(AudioStream stream);| +PauseAudioStream|void|(AudioStream stream);| +ResumeAudioStream|void|(AudioStream stream);| +IsAudioStreamPlaying|bool|(AudioStream stream);| +StopAudioStream|void|(AudioStream stream);| +SetAudioStreamVolume|void|(AudioStream stream, float volume);| +SetAudioStreamPitch|void|(AudioStream stream, float pitch);| +Vector2|struct|| +Vector3|struct|| +Vector4|struct|| +Quaternion|struct|| +Matrix|struct|| +Color|struct|| +Rectangle|struct|| +Image|struct|| +Texture|struct|| +RenderTexture|struct|| +NPatchInfo|struct|| +CharInfo|struct|| +Font|struct|| +Camera|struct|| +Camera2D|struct|| +Mesh|struct|| +Shader|struct|| +MaterialMap|struct|| +Material|struct|| +Model|struct|| +Transform|struct|| +BoneInfo|struct|| +ModelAnimation|struct|| +Ray|struct|| +RayHitInfo|struct|| +BoundingBox|struct|| +Wave|struct|| +Sound|struct|| +Music|struct|| +AudioStream|struct|| +VrDeviceInfo|struct|| +LIGHTGRAY|#define|| +GRAY|#define|| +DARKGRAY|#define|| +YELLOW|#define|| +GOLD|#define|| +ORANGE|#define|| +PINK|#define|| +RED|#define|| +MAROON|#define|| +GREEN|#define|| +LIME|#define|| +DARKGREEN|#define|| +SKYBLUE|#define|| +BLUE|#define|| +DARKBLUE|#define|| +PURPLE|#define|| +VIOLET|#define|| +DARKPURPLE|#define|| +BEIGE|#define|| +BROWN|#define|| +DARKBROWN|#define|| +WHITE|#define|| +BLACK|#define|| +BLANK|#define|| +MAGENTA|#define|| +RAYWHITE|#define|| diff --git a/projects/Geany/raylib_compile_execute.bat b/projects/Geany/raylib_compile_execute.bat index a62a1aca..09783383 100644 --- a/projects/Geany/raylib_compile_execute.bat +++ b/projects/Geany/raylib_compile_execute.bat @@ -2,7 +2,7 @@ :: > Setup required Environment :: ------------------------------------- set RAYLIB_DIR=C:\raylib -set PATH=%PATH%;%RAYLIB_DIR%\mingw32\bin +set PATH=%PATH%;%RAYLIB_DIR%\mingw\bin set FILE_NAME=%1 set NAME_PART=%FILE_NAME:~0,-2% cd %~dp0 @@ -13,7 +13,7 @@ cmd /c if exist %NAME_PART%.exe del /F %NAME_PART%.exe :: . :: > Compiling program :: -------------------------- -gcc -o %NAME_PART%.exe %FILE_NAME% %RAYLIB_DIR%\raylib.rc.data -s -O2 -I../../src -Iexternal -lraylib -lopengl32 -lgdi32 -std=c99 -Wall -mwindows +gcc -o %NAME_PART%.exe %FILE_NAME% %RAYLIB_DIR%\src\raylib.rc.data -s -O2 -I../../src -Iexternal -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows :: . :: . > Executing program :: ------------------------- diff --git a/projects/Geany/raylib_compile_sources.bat b/projects/Geany/raylib_compile_sources.bat index f0090990..c17ffba9 100644 --- a/projects/Geany/raylib_compile_sources.bat +++ b/projects/Geany/raylib_compile_sources.bat @@ -7,7 +7,7 @@ set GRAPHICS_API=GRAPHICS_API_OPENGL_33 :: > Setup required Environment :: ------------------------------------- set RAYLIB_DIR=C:\raylib -set PATH=%PATH%;%RAYLIB_DIR%\mingw32\bin +set PATH=%PATH%;%RAYLIB_DIR%\mingw\bin cd %RAYLIB_DIR%\raylib\src :: . :: > Cleaning latest build @@ -33,8 +33,8 @@ ar rcs libraylib.a core.o rglfw.o shapes.o textures.o text.o models.o raudio.o u :: . :: > Installing raylib library :: ----------------------------- -cmd /c copy raylib.h %RAYLIB_DIR%\mingw32\i686-w64-mingw32\include /Y -cmd /c copy libraylib.a %RAYLIB_DIR%\mingw32\i686-w64-mingw32\lib /Y +cmd /c copy raylib.h %RAYLIB_DIR%\mingw\i686-w64-mingw32\include /Y +cmd /c copy libraylib.a %RAYLIB_DIR%\mingw\i686-w64-mingw32\lib /Y :: . :: > Restore environment :: ----------------------------- diff --git a/projects/Notepad++/npes_saved_mingw.txt b/projects/Notepad++/npes_saved_mingw.txt Binary files differindex 41e25823..6363218f 100644 --- a/projects/Notepad++/npes_saved_mingw.txt +++ b/projects/Notepad++/npes_saved_mingw.txt diff --git a/projects/Notepad++/npes_saved_tcc.txt b/projects/Notepad++/npes_saved_tcc.txt Binary files differindex 419e4af6..97548bdb 100644 --- a/projects/Notepad++/npes_saved_tcc.txt +++ b/projects/Notepad++/npes_saved_tcc.txt diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index e04fc932..019850e1 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -10,21 +10,33 @@ <Param name="const char *title" /> </Overload> </KeyWord> + <KeyWord name="WindowShouldClose" func="yes"> + <Overload retVal="bool" descr="Check if KEY_ESCAPE pressed or Close icon pressed"></Overload> + </KeyWord> <KeyWord name="CloseWindow" func="yes"> <Overload retVal="void" descr="Close window and unload OpenGL context"></Overload> </KeyWord> <KeyWord name="IsWindowReady" func="yes"> <Overload retVal="bool" descr="Check if window has been initialized successfully"></Overload> </KeyWord> - <KeyWord name="WindowShouldClose" func="yes"> - <Overload retVal="bool" descr="Check if KEY_ESCAPE pressed or Close icon pressed"></Overload> - </KeyWord> <KeyWord name="IsWindowMinimized" func="yes"> <Overload retVal="bool" descr="Check if window has been minimized (or lost focus)"></Overload> </KeyWord> + <KeyWord name="IsWindowResized" func="yes"> + <Overload retVal="bool" descr="Check if window has been resized"></Overload> + </KeyWord> + <KeyWord name="IsWindowHidden" func="yes"> + <Overload retVal="bool" descr="Check if window is currently hidden"></Overload> + </KeyWord> <KeyWord name="ToggleFullscreen" func="yes"> <Overload retVal="void" descr="Toggle fullscreen mode (only PLATFORM_DESKTOP)"></Overload> </KeyWord> + <KeyWord name="UnhideWindow" func="yes"> + <Overload retVal="void" descr="Show the window"></Overload> + </KeyWord> + <KeyWord name="HideWindow" func="yes"> + <Overload retVal="void" descr="Hide the window"></Overload> + </KeyWord> <KeyWord name="SetWindowIcon" func="yes"> <Overload retVal="void" descr="Set icon for window (only PLATFORM_DESKTOP)"> <Param name="Image image" /> @@ -58,12 +70,51 @@ <Param name="int height" /> </Overload> </KeyWord> + <KeyWord name="GetWindowHandle" func="yes"> + <Overload retVal="void" descr="Get native window handle"></Overload> + </KeyWord> <KeyWord name="GetScreenWidth" func="yes"> <Overload retVal="int" descr="Get current screen width"></Overload> </KeyWord> <KeyWord name="GetScreenHeight" func="yes"> <Overload retVal="int" descr="Get current screen height"></Overload> </KeyWord> + <KeyWord name="GetMonitorCount" func="yes"> + <Overload retVal="int" descr="Get number of connected monitors"></Overload> + </KeyWord> + <KeyWord name="GetMonitorWidth" func="yes"> + <Overload retVal="int" descr="Get primary monitor width"> + <Param name="int monitor" /> + </Overload> + </KeyWord> + <KeyWord name="GetMonitorHeight" func="yes"> + <Overload retVal="int" descr="Get primary monitor height"> + <Param name="int monitor" /> + </Overload> + </KeyWord> + <KeyWord name="GetMonitorPhysicalWidth" func="yes"> + <Overload retVal="int" descr="Get primary monitor physical width in millimetres"> + <Param name="int monitor" /> + </Overload> + </KeyWord> + <KeyWord name="GetMonitorPhysicalHeight" func="yes"> + <Overload retVal="int" descr="Get primary monitor physical height in millimetres"> + <Param name="int monitor" /> + </Overload> + </KeyWord> + <KeyWord name="GetMonitorName" func="yes"> + <Overload retVal="const char" descr="Get the human-readable, UTF-8 encoded name of the primary monitor"> + <Param name="int monitor" /> + </Overload> + </KeyWord> + <KeyWord name="GetClipboardText" func="yes"> + <Overload retVal="const char" descr="Get clipboard text content"></Overload> + </KeyWord> + <KeyWord name="SetClipboardText" func="yes"> + <Overload retVal="void" descr="Set clipboard text content"> + <Param name="const char *text" /> + </Overload> + </KeyWord> <!-- Cursor-related functions --> <KeyWord name="ShowCursor" func="yes"> @@ -170,6 +221,11 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="ColorFromHSV" func="yes"> + <Overload retVal="Color" descr="Returns a Color from HSV values"> + <Param name="Vector3 hsv" /> + </Overload> + </KeyWord> <KeyWord name="GetColor" func="yes"> <Overload retVal="Color" descr="Returns a Color struct from hexadecimal value"> <Param name="int hexValue" /> @@ -183,21 +239,28 @@ </KeyWord> <!-- Misc. functions --> - <KeyWord name="ShowLogo" func="yes"> - <Overload retVal="void" descr="Activate raylib logo at startup (can be done with flags)"></Overload> - </KeyWord> <KeyWord name="SetConfigFlags" func="yes"> <Overload retVal="void" descr="Setup window configuration flags (view FLAGS)"> <Param name="unsigned char flags" /> </Overload> </KeyWord> - <KeyWord name="SetTraceLog" func="yes"> - <Overload retVal="void" descr="Enable trace log message types (bit flags based)"> - <Param name="unsigned char types" /> + <KeyWord name="SetTraceLogLevel" func="yes"> + <Overload retVal="void" descr="Set the current threshold (minimum) log level"> + <Param name="int logType" /> + </Overload> + </KeyWord> + <KeyWord name="SetTraceLogExit" func="yes"> + <Overload retVal="void" descr="Set the exit threshold (minimum) log level"> + <Param name="int logType" /> + </Overload> + </KeyWord> + <KeyWord name="SetTraceLogCallback" func="yes"> + <Overload retVal="void" descr="Set a trace log callback to enable custom logging"> + <Param name="TraceLogCallback callback" /> </Overload> </KeyWord> <KeyWord name="TraceLog" func="yes"> - <Overload retVal="void" descr="Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)"> + <Overload retVal="void" descr="Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)"> <Param name="int logType" /> <Param name="const char *text" /> <Param name="..." /> @@ -216,6 +279,11 @@ </KeyWord> <!-- Files management functions --> + <KeyWord name="FileExists" func="yes"> + <Overload retVal="bool" descr="Check if file exists"> + <Param name="const char *fileName" /> + </Overload> + </KeyWord> <KeyWord name="IsFileExtension" func="yes"> <Overload retVal="bool" descr="Check file extension"> <Param name="const char *fileName" /> @@ -232,6 +300,11 @@ <Param name="const char *filePath" /> </Overload> </KeyWord> + <KeyWord name="GetFileNameWithoutExt" func="yes"> + <Overload retVal="const char" descr="Get filename string without extension (memory should be freed)"> + <Param name="const char *filePath" /> + </Overload> + </KeyWord> <KeyWord name="GetDirectoryPath" func="yes"> <Overload retVal="const char" descr="Get full path for a given fileName (uses static string)"> <Param name="const char *fileName" /> @@ -240,6 +313,15 @@ <KeyWord name="GetWorkingDirectory" func="yes"> <Overload retVal="const char" descr="Get current working directory (uses static string)"></Overload> </KeyWord> + <KeyWord name="GetDirectoryFiles" func="yes"> + <Overload retVal="char" descr="Get filenames in a directory path (memory should be freed)"> + <Param name="const char *dirPath" /> + <Param name="int *count" /> + </Overload> + </KeyWord> + <KeyWord name="ClearDirectoryFiles" func="yes"> + <Overload retVal="void" descr="Clear directory files paths buffers (free memory)"></Overload> + </KeyWord> <KeyWord name="ChangeDirectory" func="yes"> <Overload retVal="bool" descr="Change working directory, returns true if success"> <Param name="const char *dir" /> @@ -249,12 +331,17 @@ <Overload retVal="bool" descr="Check if a file has been dropped into window"></Overload> </KeyWord> <KeyWord name="GetDroppedFiles" func="yes"> - <Overload retVal="char" descr="Get dropped files names"> + <Overload retVal="char" descr="Get dropped files names (memory should be freed)"> <Param name="int *count" /> </Overload> </KeyWord> <KeyWord name="ClearDroppedFiles" func="yes"> - <Overload retVal="void" descr="Clear dropped files paths buffer"></Overload> + <Overload retVal="void" descr="Clear dropped files paths buffer (free memory)"></Overload> + </KeyWord> + <KeyWord name="GetFileModTime" func="yes"> + <Overload retVal="long" descr="Get file modification time (last write time)"> + <Param name="const char *fileName" /> + </Overload> </KeyWord> <!-- Persistent storage management --> @@ -270,6 +357,12 @@ </Overload> </KeyWord> + <KeyWord name="OpenURL" func="yes"> + <Overload retVal="void" descr="Open URL with default system browser (if available)"> + <Param name="const char *url" /> + </Overload> + </KeyWord> + <!-------------------------------------------------------------------------------------- --> <!-- Input Handling Functions (Module: core) --> <!-------------------------------------------------------------------------------------- --> @@ -392,12 +485,20 @@ </KeyWord> <KeyWord name="SetMousePosition" func="yes"> <Overload retVal="void" descr="Set mouse position XY"> - <Param name="Vector2 position" /> + <Param name="int x" /> + <Param name="int y" /> + </Overload> + </KeyWord> + <KeyWord name="SetMouseOffset" func="yes"> + <Overload retVal="void" descr="Set mouse offset"> + <Param name="int offsetX" /> + <Param name="int offsetY" /> </Overload> </KeyWord> <KeyWord name="SetMouseScale" func="yes"> <Overload retVal="void" descr="Set mouse scaling"> - <Param name="float scale" /> + <Param name="float scaleX" /> + <Param name="float scaleY" /> </Overload> </KeyWord> <KeyWord name="GetMouseWheelMove" func="yes"> @@ -543,6 +644,13 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawLineStrip" func="yes"> + <Overload retVal="void" descr="Draw lines sequence"> + <Param name="Vector2 *points" /> + <Param name="int numPoints" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawCircle" func="yes"> <Overload retVal="void" descr="Draw a color-filled circle"> <Param name="int centerX" /> @@ -551,6 +659,26 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawCircleSector" func="yes"> + <Overload retVal="void" descr="Draw a piece of a circle"> + <Param name="Vector2 center" /> + <Param name="float radius" /> + <Param name="int startAngle" /> + <Param name="int endAngle" /> + <Param name="int segments" /> + <Param name="Color color" /> + </Overload> + </KeyWord> + <KeyWord name="DrawCircleSectorLines" func="yes"> + <Overload retVal="void" descr="Draw circle sector outline"> + <Param name="Vector2 center" /> + <Param name="float radius" /> + <Param name="int startAngle" /> + <Param name="int endAngle" /> + <Param name="int segments" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawCircleGradient" func="yes"> <Overload retVal="void" descr="Draw a gradient-filled circle"> <Param name="int centerX" /> @@ -575,6 +703,28 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawRing" func="yes"> + <Overload retVal="void" descr="Draw ring"> + <Param name="Vector2 center" /> + <Param name="float innerRadius" /> + <Param name="float outerRadius" /> + <Param name="int startAngle" /> + <Param name="int endAngle" /> + <Param name="int segments" /> + <Param name="Color color" /> + </Overload> + </KeyWord> + <KeyWord name="DrawRingLines" func="yes"> + <Overload retVal="void" descr="Draw ring outline"> + <Param name="Vector2 center" /> + <Param name="float innerRadius" /> + <Param name="float outerRadius" /> + <Param name="int startAngle" /> + <Param name="int endAngle" /> + <Param name="int segments" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawRectangle" func="yes"> <Overload retVal="void" descr="Draw a color-filled rectangle"> <Param name="int posX" /> @@ -650,6 +800,23 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawRectangleRounded" func="yes"> + <Overload retVal="void" descr="Draw rectangle with rounded edges"> + <Param name="Rectangle rec" /> + <Param name="float roundness" /> + <Param name="int segments" /> + <Param name="Color color" /> + </Overload> + </KeyWord> + <KeyWord name="DrawRectangleRoundedLines" func="yes"> + <Overload retVal="void" descr="Draw rectangle with rounded edges outline"> + <Param name="Rectangle rec" /> + <Param name="float roundness" /> + <Param name="int segments" /> + <Param name="int lineThick" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawTriangle" func="yes"> <Overload retVal="void" descr="Draw a color-filled triangle"> <Param name="Vector2 v1" /> @@ -666,6 +833,13 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawTriangleFan" func="yes"> + <Overload retVal="void" descr="Draw a triangle fan defined by points"> + <Param name="Vector2 *points" /> + <Param name="int numPoints" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawPoly" func="yes"> <Overload retVal="void" descr="Draw a regular polygon (Vector version)"> <Param name="Vector2 center" /> @@ -675,18 +849,11 @@ <Param name="Color color" /> </Overload> </KeyWord> - <KeyWord name="DrawPolyEx" func="yes"> - <Overload retVal="void" descr="Draw a closed polygon defined by points"> - <Param name="Vector2 *points" /> - <Param name="int numPoints" /> - <Param name="Color color" /> - </Overload> - </KeyWord> - <KeyWord name="DrawPolyExLines" func="yes"> - <Overload retVal="void" descr="Draw polygon lines"> - <Param name="Vector2 *points" /> - <Param name="int numPoints" /> - <Param name="Color color" /> + + <KeyWord name="SetShapesTexture" func="yes"> + <Overload retVal="void" descr="Define default texture used to draw shapes"> + <Param name="Texture2D texture" /> + <Param name="Rectangle source" /> </Overload> </KeyWord> @@ -770,9 +937,15 @@ </Overload> </KeyWord> <KeyWord name="ExportImage" func="yes"> - <Overload retVal="void" descr="Export image as a PNG file"> + <Overload retVal="void" descr="Export image data to file"> + <Param name="Image image" /> <Param name="const char *fileName" /> + </Overload> + </KeyWord> + <KeyWord name="ExportImageAsCode" func="yes"> + <Overload retVal="void" descr="Export image as code file defining an array of bytes"> <Param name="Image image" /> + <Param name="const char *fileName" /> </Overload> </KeyWord> <KeyWord name="LoadTexture" func="yes"> @@ -785,6 +958,12 @@ <Param name="Image image" /> </Overload> </KeyWord> + <KeyWord name="LoadTextureCubemap" func="yes"> + <Overload retVal="TextureCubemap" descr="Load cubemap from image, multiple image cubemap layouts supported"> + <Param name="Image image" /> + <Param name="int layoutType" /> + </Overload> + </KeyWord> <KeyWord name="LoadRenderTexture" func="yes"> <Overload retVal="RenderTexture2D" descr="Load texture for rendering (framebuffer)"> <Param name="int width" /> @@ -828,6 +1007,9 @@ <Param name="Texture2D texture" /> </Overload> </KeyWord> + <KeyWord name="GetScreenData" func="yes"> + <Overload retVal="Image" descr="Get pixel data from screen buffer and return an Image (screenshot)"></Overload> + </KeyWord> <KeyWord name="UpdateTexture" func="yes"> <Overload retVal="void" descr="Update GPU texture with new data"> <Param name="Texture2D texture" /> @@ -884,14 +1066,14 @@ </Overload> </KeyWord> <KeyWord name="ImageResize" func="yes"> - <Overload retVal="void" descr="Resize and image (bilinear filtering)"> + <Overload retVal="void" descr="Resize image (Bicubic scaling algorithm)"> <Param name="Image *image" /> <Param name="int newWidth" /> <Param name="int newHeight" /> </Overload> </KeyWord> <KeyWord name="ImageResizeNN" func="yes"> - <Overload retVal="void" descr="Resize and image (Nearest-Neighbor scaling algorithm)"> + <Overload retVal="void" descr="Resize image (Nearest-Neighbor scaling algorithm)"> <Param name="Image *image" /> <Param name="int newWidth" /> <Param name="int newHeight" /> @@ -921,6 +1103,13 @@ <Param name="int aBpp" /> </Overload> </KeyWord> + <KeyWord name="ImageExtractPalette" func="yes"> + <Overload retVal="Color" descr="Extract color palette from image to maximum size (memory should be freed)"> + <Param name="Image image" /> + <Param name="int maxPaletteSize" /> + <Param name="int *extractCount" /> + </Overload> + </KeyWord> <KeyWord name="ImageText" func="yes"> <Overload retVal="Image" descr="Create an image from text (default font)"> <Param name="const char *text" /> @@ -948,11 +1137,18 @@ <KeyWord name="ImageDrawRectangle" func="yes"> <Overload retVal="void" descr="Draw rectangle within an image"> <Param name="Image *dst" /> - <Param name="Vector2 position" /> <Param name="Rectangle rec" /> <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="ImageDrawRectangleLines" func="yes"> + <Overload retVal="void" descr="Draw rectangle lines within an image"> + <Param name="Image *dst" /> + <Param name="Rectangle rec" /> + <Param name="int thick" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="ImageDrawText" func="yes"> <Overload retVal="void" descr="Draw text (default font) within an image (destination)"> <Param name="Image *dst" /> @@ -1148,6 +1344,15 @@ <Param name="Color tint" /> </Overload> </KeyWord> + <KeyWord name="DrawTextureQuad" func="yes"> + <Overload retVal="void" descr="Draw texture quad with tiling and offset parameters"> + <Param name="Texture2D texture" /> + <Param name="Vector2 tiling" /> + <Param name="Vector2 offset" /> + <Param name="Rectangle quad" /> + <Param name="Color tint" /> + </Overload> + </KeyWord> <KeyWord name="DrawTexturePro" func="yes"> <Overload retVal="void" descr="Draw a part of a texture defined by a rectangle with 'pro' parameters"> <Param name="Texture2D texture" /> @@ -1158,6 +1363,16 @@ <Param name="Color tint" /> </Overload> </KeyWord> + <KeyWord name="DrawTextureNPatch" func="yes"> + <Overload retVal="void" descr="Draws a texture (or part of it) that stretches or shrinks nicely"> + <Param name="Texture2D texture" /> + <Param name="NPatchInfo nPatchInfo" /> + <Param name="Rectangle destRec" /> + <Param name="Vector2 origin" /> + <Param name="float rotation" /> + <Param name="Color tint" /> + </Overload> + </KeyWord> <!-------------------------------------------------------------------------------------- --> <!-- Font Loading and Text Drawing Functions (Module: text) --> @@ -1176,8 +1391,15 @@ <Overload retVal="Font" descr="Load font from file with extended parameters"> <Param name="const char *fileName" /> <Param name="int fontSize" /> - <Param name="int charsCount" /> <Param name="int *fontChars" /> + <Param name="int charsCount" /> + </Overload> + </KeyWord> + <KeyWord name="LoadFontFromImage" func="yes"> + <Overload retVal="Font" descr="Load font from Image (XNA style)"> + <Param name="Image image" /> + <Param name="Color key" /> + <Param name="int firstChar" /> </Overload> </KeyWord> <KeyWord name="LoadFontData" func="yes"> @@ -1186,14 +1408,14 @@ <Param name="int fontSize" /> <Param name="int *fontChars" /> <Param name="int charsCount" /> - <Param name="bool sdf" /> + <Param name="int type" /> </Overload> </KeyWord> <KeyWord name="GenImageFontAtlas" func="yes"> <Overload retVal="Image" descr="Generate image font atlas using chars info"> <Param name="CharInfo *chars" /> - <Param name="int fontSize" /> <Param name="int charsCount" /> + <Param name="int fontSize" /> <Param name="int padding" /> <Param name="int packMethod" /> </Overload> @@ -1221,15 +1443,39 @@ </Overload> </KeyWord> <KeyWord name="DrawTextEx" func="yes"> - <Overload retVal="void" descr="Draw text using Font and additional parameters"> + <Overload retVal="void" descr="Draw text using font and additional parameters"> <Param name="Font font" /> - <Param name="const char* text" /> + <Param name="const char *text" /> <Param name="Vector2 position" /> <Param name="float fontSize" /> <Param name="float spacing" /> <Param name="Color tint" /> </Overload> </KeyWord> + <KeyWord name="DrawTextRec" func="yes"> + <Overload retVal="void" descr="Draw text using font inside rectangle limits"> + <Param name="Font font" /> + <Param name="const char *text" /> + <Param name="Rectangle rec" /> + <Param name="float fontSize" /> + <Param name="float spacing" /> + <Param name="bool wordWrap" /> + <Param name="Color tint" /> + </Overload> + </KeyWord> + <KeyWord name="DrawTextRecEx" func="yes"> + <Overload retVal="void" descr="Draw text using font inside rectangle limits with support for text selection"> + <Param name="Font font" /> + <Param name="const char *text" /> + <Param name="Rectangle rec" /> + <Param name="float fontSize" /> + <Param name="float spacing" /> + <Param name="bool wordWrap" /> + <Param name="Color tint" /> + <Param name="int selectStart" /> + <Param name="int selecFont" /> + </Overload> + </KeyWord> <!-- Text misc. functions --> <KeyWord name="MeasureText" func="yes"> @@ -1246,23 +1492,109 @@ <Param name="float spacing" /> </Overload> </KeyWord> - <KeyWord name="FormatText" func="yes"> - <Overload retVal="const char" descr="Formatting of text with variables to 'embed'"> + <KeyWord name="GetGlyphIndex" func="yes"> + <Overload retVal="int" descr="Get index position for a unicode character on font"> + <Param name="Font font" /> + <Param name="int character" /> + </Overload> + </KeyWord> + <KeyWord name="GetNextCodepoint" func="yes"> + <Overload retVal="int" descr="Returns next codepoint in a UTF8 encoded string"> + <Param name="const char *text" /> + <Param name="int *count" /> + </Overload> + </KeyWord> + + <!-- Text strings management functions --> + <!-- NOTE: Some strings allocate memory internally for returned strings, just be careful! --> + <KeyWord name="TextIsEqual" func="yes"> + <Overload retVal="bool" descr="Check if two text string are equal"> + <Param name="const char *text1" /> + <Param name="const char *text2" /> + </Overload> + </KeyWord> + <KeyWord name="int TextLength" func="yes"> + <Overload retVal="unsigned" descr="Get text length, checks for '\0' ending"> + <Param name="const char *text" /> + </Overload> + </KeyWord> + <KeyWord name="int TextCountCodepoints" func="yes"> + <Overload retVal="unsigned" descr="Get total number of characters (codepoints) in a UTF8 encoded string"> + <Param name="const char *text" /> + </Overload> + </KeyWord> + <KeyWord name="TextFormat" func="yes"> + <Overload retVal="const char" descr="Text formatting with variables (sprintf style)"> <Param name="const char *text" /> <Param name="..." /> </Overload> </KeyWord> - <KeyWord name="SubText" func="yes"> + <KeyWord name="TextSubtext" func="yes"> <Overload retVal="const char" descr="Get a piece of a text string"> <Param name="const char *text" /> <Param name="int position" /> <Param name="int length" /> </Overload> </KeyWord> - <KeyWord name="GetGlyphIndex" func="yes"> - <Overload retVal="int" descr="Returns index position for a unicode character on sprite font"> - <Param name="Font font" /> - <Param name="int character" /> + <KeyWord name="TextReplace" func="yes"> + <Overload retVal="const char" descr="Replace text string (memory should be freed!)"> + <Param name="char *text" /> + <Param name="const char *replace" /> + <Param name="const char *by" /> + </Overload> + </KeyWord> + <KeyWord name="TextInsert" func="yes"> + <Overload retVal="const char" descr="Insert text in a position (memory should be freed!)"> + <Param name="const char *text" /> + <Param name="const char *insert" /> + <Param name="int position" /> + </Overload> + </KeyWord> + <KeyWord name="TextJoin" func="yes"> + <Overload retVal="const char" descr="Join text strings with delimiter"> + <Param name="const char **textList" /> + <Param name="int count" /> + <Param name="const char *delimiter" /> + </Overload> + </KeyWord> + <KeyWord name="TextSplit" func="yes"> + <Overload retVal="const char" descr="Split text into multiple strings"> + <Param name="const char *text" /> + <Param name="char delimiter" /> + <Param name="int *count" /> + </Overload> + </KeyWord> + <KeyWord name="TextAppend" func="yes"> + <Overload retVal="void" descr="Append text at specific position and move cursor!"> + <Param name="char *text" /> + <Param name="const char *append" /> + <Param name="int *position" /> + </Overload> + </KeyWord> + <KeyWord name="TextFindIndex" func="yes"> + <Overload retVal="int" descr="Find first text occurrence within a string"> + <Param name="const char *text" /> + <Param name="const char *find" /> + </Overload> + </KeyWord> + <KeyWord name="TextToUpper" func="yes"> + <Overload retVal="const char" descr="Get upper case version of provided string"> + <Param name="const char *text" /> + </Overload> + </KeyWord> + <KeyWord name="TextToLower" func="yes"> + <Overload retVal="const char" descr="Get lower case version of provided string"> + <Param name="const char *text" /> + </Overload> + </KeyWord> + <KeyWord name="TextToPascal" func="yes"> + <Overload retVal="const char" descr="Get Pascal case notation version of provided string"> + <Param name="const char *text" /> + </Overload> + </KeyWord> + <KeyWord name="TextToInteger" func="yes"> + <Overload retVal="int" descr="Get integer value from text (negative values not supported)"> + <Param name="const char *text" /> </Overload> </KeyWord> @@ -1312,6 +1644,13 @@ <Param name="Color color" /> </Overload> </KeyWord> + <KeyWord name="DrawCubeWiresV" func="yes"> + <Overload retVal="void" descr="Draw cube wires (Vector version)"> + <Param name="Vector3 position" /> + <Param name="Vector3 size" /> + <Param name="Color color" /> + </Overload> + </KeyWord> <KeyWord name="DrawCubeTexture" func="yes"> <Overload retVal="void" descr="Draw cube textured"> <Param name="Texture2D texture" /> @@ -1399,12 +1738,12 @@ <!-- Model loading/unloading functions --> <KeyWord name="LoadModel" func="yes"> - <Overload retVal="Model" descr="Load model from files (mesh and material)"> + <Overload retVal="Model" descr="Load model from files (meshes and materials)"> <Param name="const char *fileName" /> </Overload> </KeyWord> <KeyWord name="LoadModelFromMesh" func="yes"> - <Overload retVal="Model" descr="Load model from generated mesh"> + <Overload retVal="Model" descr="Load model from generated mesh (default material)"> <Param name="Mesh mesh" /> </Overload> </KeyWord> @@ -1415,8 +1754,15 @@ </KeyWord> <!-- Mesh loading/unloading functions --> - <KeyWord name="LoadMesh" func="yes"> - <Overload retVal="Mesh" descr="Load mesh from file"> + <KeyWord name="LoadMeshes" func="yes"> + <Overload retVal="Mesh" descr="Load meshes from model file"> + <Param name="const char *fileName" /> + <Param name="int *meshCount" /> + </Overload> + </KeyWord> + <KeyWord name="ExportMesh" func="yes"> + <Overload retVal="void" descr="Export mesh data to file"> + <Param name="Mesh mesh" /> <Param name="const char *fileName" /> </Overload> </KeyWord> @@ -1425,31 +1771,70 @@ <Param name="Mesh *mesh" /> </Overload> </KeyWord> - <KeyWord name="ExportMesh" func="yes"> - <Overload retVal="void" descr="Export mesh as an OBJ file"> + + <!-- Material loading/unloading functions --> + <KeyWord name="LoadMaterials" func="yes"> + <Overload retVal="Material" descr="Load materials from model file"> <Param name="const char *fileName" /> - <Param name="Mesh mesh" /> + <Param name="int *materialCount" /> + </Overload> + </KeyWord> + <KeyWord name="LoadMaterialDefault" func="yes"> + <Overload retVal="Material" descr="Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)"></Overload> + </KeyWord> + <KeyWord name="UnloadMaterial" func="yes"> + <Overload retVal="void" descr="Unload material from GPU memory (VRAM)"> + <Param name="Material material" /> + </Overload> + </KeyWord> + <KeyWord name="SetMaterialTexture" func="yes"> + <Overload retVal="void" descr="Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)"> + <Param name="Material *material" /> + <Param name="int mapType" /> + <Param name="Texture2D texture" /> + </Overload> + </KeyWord> + <KeyWord name="SetModelMeshMaterial" func="yes"> + <Overload retVal="void" descr="Set material for a mesh"> + <Param name="Model *model" /> + <Param name="int meshId" /> + <Param name="int materialId" /> </Overload> </KeyWord> - <!-- Mesh manipulation functions --> - <KeyWord name="MeshBoundingBox" func="yes"> - <Overload retVal="BoundingBox" descr="Compute mesh bounding box limits"> - <Param name="Mesh mesh" /> + <!-- Model animations loading/unloading functions --> + <KeyWord name="LoadModelAnimations" func="yes"> + <Overload retVal="ModelAnimation" descr="Load model animations from file"> + <Param name="const char *fileName" /> + <Param name="int *animsCount" /> </Overload> </KeyWord> - <KeyWord name="MeshTangents" func="yes"> - <Overload retVal="void" descr="Compute mesh tangents "> - <Param name="Mesh *mesh" /> + <KeyWord name="UpdateModelAnimation" func="yes"> + <Overload retVal="void" descr="Update model animation pose"> + <Param name="Model model" /> + <Param name="ModelAnimation anim" /> + <Param name="int frame" /> </Overload> </KeyWord> - <KeyWord name="MeshBinormals" func="yes"> - <Overload retVal="void" descr="Compute mesh binormals"> - <Param name="Mesh *mesh" /> + <KeyWord name="UnloadModelAnimation" func="yes"> + <Overload retVal="void" descr="Unload animation data"> + <Param name="ModelAnimation anim" /> + </Overload> + </KeyWord> + <KeyWord name="IsModelAnimationValid" func="yes"> + <Overload retVal="bool" descr="Check model animation skeleton match"> + <Param name="Model model" /> + <Param name="ModelAnimation anim" /> </Overload> </KeyWord> <!-- Mesh generation functions --> + <KeyWord name="GenMeshPoly" func="yes"> + <Overload retVal="Mesh" descr="Generate polygonal mesh"> + <Param name="int sides" /> + <Param name="float radius" /> + </Overload> + </KeyWord> <KeyWord name="GenMeshPlane" func="yes"> <Overload retVal="Mesh" descr="Generate plane mesh (with subdivisions)"> <Param name="float width" /> @@ -1515,18 +1900,20 @@ </Overload> </KeyWord> - <!-- Material loading/unloading functions --> - <KeyWord name="LoadMaterial" func="yes"> - <Overload retVal="Material" descr="Load material from file"> - <Param name="const char *fileName" /> + <!-- Mesh manipulation functions --> + <KeyWord name="MeshBoundingBox" func="yes"> + <Overload retVal="BoundingBox" descr="Compute mesh bounding box limits"> + <Param name="Mesh mesh" /> </Overload> </KeyWord> - <KeyWord name="LoadMaterialDefault" func="yes"> - <Overload retVal="Material" descr="Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)"></Overload> + <KeyWord name="MeshTangents" func="yes"> + <Overload retVal="void" descr="Compute mesh tangents"> + <Param name="Mesh *mesh" /> + </Overload> </KeyWord> - <KeyWord name="UnloadMaterial" func="yes"> - <Overload retVal="void" descr="Unload material from GPU memory (VRAM)"> - <Param name="Material material" /> + <KeyWord name="MeshBinormals" func="yes"> + <Overload retVal="void" descr="Compute mesh binormals"> + <Param name="Mesh *mesh" /> </Overload> </KeyWord> @@ -1701,19 +2088,20 @@ </Overload> </KeyWord> <KeyWord name="SetShaderValue" func="yes"> - <Overload retVal="void" descr="Set shader uniform value (float)"> + <Overload retVal="void" descr="Set shader uniform value"> <Param name="Shader shader" /> <Param name="int uniformLoc" /> - <Param name="const float *value" /> - <Param name="int size" /> + <Param name="const void *value" /> + <Param name="int uniformType" /> </Overload> </KeyWord> - <KeyWord name="SetShaderValuei" func="yes"> - <Overload retVal="void" descr="Set shader uniform value (int)"> + <KeyWord name="SetShaderValueV" func="yes"> + <Overload retVal="void" descr="Set shader uniform value vector"> <Param name="Shader shader" /> <Param name="int uniformLoc" /> - <Param name="const int *value" /> - <Param name="int size" /> + <Param name="const void *value" /> + <Param name="int uniformType" /> + <Param name="int count" /> </Overload> </KeyWord> <KeyWord name="SetShaderValueMatrix" func="yes"> @@ -1723,6 +2111,13 @@ <Param name="Matrix mat" /> </Overload> </KeyWord> + <KeyWord name="SetShaderValueTexture" func="yes"> + <Overload retVal="void" descr="Set shader uniform value for texture"> + <Param name="Shader shader" /> + <Param name="int uniformLoc" /> + <Param name="Texture2D texture" /> + </Overload> + </KeyWord> <KeyWord name="SetMatrixProjection" func="yes"> <Overload retVal="void" descr="Set a custom projection matrix (replaces internal projection matrix)"> <Param name="Matrix proj" /> @@ -1763,9 +2158,8 @@ </Overload> </KeyWord> <KeyWord name="GenTextureBRDF" func="yes"> - <Overload retVal="Texture2D" descr="Generate BRDF texture using cubemap data"> + <Overload retVal="Texture2D" descr="Generate BRDF texture"> <Param name="Shader shader" /> - <Param name="Texture2D cubemap" /> <Param name="int size" /> </Overload> </KeyWord> @@ -1787,34 +2181,39 @@ <KeyWord name="EndBlendMode" func="yes"> <Overload retVal="void" descr="End blending mode (reset to default: alpha blending)"></Overload> </KeyWord> - - <!-- VR control functions --> - <KeyWord name="GetVrDeviceInfo" func="yes"> - <Overload retVal="VrDeviceInfo" descr="Get VR device information for some standard devices"> - <Param name="int vrDeviceType" /> + <KeyWord name="BeginScissorMode" func="yes"> + <Overload retVal="void" descr="Begin scissor mode (define screen area for following drawing)"> + <Param name="int x" /> + <Param name="int y" /> + <Param name="int width" /> + <Param name="int height" /> </Overload> </KeyWord> + <KeyWord name="EndScissorMode" func="yes"> + <Overload retVal="void" descr="End scissor mode"></Overload> + </KeyWord> + + <!-- VR control functions --> <KeyWord name="InitVrSimulator" func="yes"> - <Overload retVal="void" descr="Init VR simulator for selected device parameters"> - <Param name="VrDeviceInfo info" /> - </Overload> + <Overload retVal="void" descr="Init VR simulator for selected device parameters"></Overload> </KeyWord> <KeyWord name="CloseVrSimulator" func="yes"> <Overload retVal="void" descr="Close VR simulator for current device"></Overload> </KeyWord> - <KeyWord name="IsVrSimulatorReady" func="yes"> - <Overload retVal="bool" descr="Detect if VR simulator is ready"></Overload> - </KeyWord> - <KeyWord name="SetVrDistortionShader" func="yes"> - <Overload retVal="void" descr="Set VR distortion shader for stereoscopic rendering"> - <Param name="Shader shader" /> - </Overload> - </KeyWord> <KeyWord name="UpdateVrTracking" func="yes"> <Overload retVal="void" descr="Update VR tracking (position and orientation) and camera"> <Param name="Camera *camera" /> </Overload> </KeyWord> + <KeyWord name="SetVrConfiguration" func="yes"> + <Overload retVal="void" descr="Set stereo rendering configuration parameters "> + <Param name="VrDeviceInfo info" /> + <Param name="Shader distortion" /> + </Overload> + </KeyWord> + <KeyWord name="IsVrSimulatorReady" func="yes"> + <Overload retVal="bool" descr="Detect if VR simulator is ready"></Overload> + </KeyWord> <KeyWord name="ToggleVrMode" func="yes"> <Overload retVal="void" descr="Enable/Disable VR experience"></Overload> </KeyWord> @@ -1881,6 +2280,18 @@ <Param name="Sound sound" /> </Overload> </KeyWord> + <KeyWord name="ExportWave" func="yes"> + <Overload retVal="void" descr="Export wave data to file"> + <Param name="Wave wave" /> + <Param name="const char *fileName" /> + </Overload> + </KeyWord> + <KeyWord name="ExportWaveAsCode" func="yes"> + <Overload retVal="void" descr="Export wave sample data to code (.h)"> + <Param name="Wave wave" /> + <Param name="const char *fileName" /> + </Overload> + </KeyWord> <!-- Wave/Sound management functions --> <KeyWord name="PlaySound" func="yes"> diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c b/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c index 7ab55189..f2c115f3 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c @@ -17,6 +17,8 @@ </KeyWord> NOTE: Generated XML text should be copied inside raylib\Notepad++\plugins\APIs\c.xml + + WARNING: Be careful with functions that split parameters into several lines, it breaks the process! LICENSE: zlib/libpng diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 08e24c35..a572c0d6 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -4,22 +4,32 @@ // Window-related functions RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context +RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed RLAPI void CloseWindow(void); // Close window and unload OpenGL context RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully -RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus) +RLAPI bool IsWindowResized(void); // Check if window has been resized +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP) +RLAPI void UnhideWindow(void); // Show the window +RLAPI void HideWindow(void); // Hide the window RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void ShowWindow(); // Show the window -RLAPI void HideWindow(); // Hide the window -RLAPI bool IsWindowHidden(); // Check if window is currently hidden +RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI int GetMonitorWidth(int monitor); // Get primary monitor width +RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height +RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres +RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres +RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI void SetClipboardText(const char *text); // Set clipboard text content // Cursor-related functions RLAPI void ShowCursor(void); // Shows cursor @@ -54,32 +64,41 @@ RLAPI double GetTime(void); // Returns ela RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1] RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color +RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f // Misc. functions -RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags) RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS) -RLAPI void SetTraceLog(unsigned char types); // Enable trace log message types (bit flags based) -RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG) +RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level +RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging +RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) // Files management functions +RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension RLAPI const char *GetExtension(const char *fileName); // Get pointer to extension for a filename string RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (memory should be freed) RLAPI const char *GetDirectoryPath(const char *fileName); // Get full path for a given fileName (uses static string) RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) +RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, returns true if success RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer +RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) +RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Persistent storage management RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position) RLAPI int StorageLoadValue(int position); // Load integer value from storage file (from defined position) +RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) + //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ @@ -112,8 +131,9 @@ RLAPI bool IsMouseButtonUp(int button); // Detect if a mou RLAPI int GetMouseX(void); // Returns mouse position X RLAPI int GetMouseY(void); // Returns mouse position Y RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY -RLAPI void SetMousePosition(Vector2 position); // Set mouse position XY -RLAPI void SetMouseScale(float scale); // Set mouse scaling +RLAPI void SetMousePosition(int x, int y); // Set mouse position XY +RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y // Input-related functions: touch @@ -156,10 +176,15 @@ RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Colo RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineStrip(Vector2 *points, int numPoints, Color color); // Draw lines sequence RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle @@ -169,11 +194,14 @@ RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Col RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline +RLAPI void DrawTriangleFan(Vector2 *points, int numPoints, Color color); // Draw a triangle fan defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -RLAPI void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points -RLAPI void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines + +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes // Basic shapes collision detection functions RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles @@ -193,9 +221,11 @@ RLAPI Image LoadImage(const char *fileName); RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit) RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI void ExportImage(const char *fileName, Image image); // Export image as a PNG file +RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file +RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) @@ -204,6 +234,7 @@ RLAPI Color *GetImageData(Image image); RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized) RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image +RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data // Image manipulation functions @@ -215,15 +246,17 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) -RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) +RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image -RLAPI void ImageDrawRectangle(Image *dst, Vector2 position, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangle(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically @@ -257,8 +290,9 @@ RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters - +RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) @@ -267,22 +301,43 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters -RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use -RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters +RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use +RLAPI Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) // Text drawing functions RLAPI void DrawFPS(int posX, int posY); // Shows current FPS RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits +RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack); // Draw text using font inside rectangle limits with support for text selection // Text misc. functions RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' -RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string -RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font +RLAPI int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on font +RLAPI int GetNextCodepoint(const char *text, int *count); // Returns next codepoint in a UTF8 encoded string + // NOTE: 0x3f(`?`) is returned on failure, `count` will hold the total number of bytes processed + +// Text strings management functions +// NOTE: Some strings allocate memory internally for returned strings, just be careful! +RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +RLAPI unsigned int TextCountCodepoints(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string +RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style) +RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +RLAPI const char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory should be freed!) +RLAPI const char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory should be freed!) +RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -294,6 +349,7 @@ RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, floa RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters @@ -311,21 +367,30 @@ RLAPI void DrawGizmo(Vector3 position); //------------------------------------------------------------------------------------ // Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (mesh and material) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) // Mesh loading/unloading functions -RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file +RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file +RLAPI void ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM) -RLAPI void ExportMesh(const char *fileName, Mesh mesh); // Export mesh as an OBJ file -// Mesh manipulation functions -RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals +// Material loading/unloading functions +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh + +// Model animations loading/unloading functions +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Mesh generation functions +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) @@ -336,10 +401,10 @@ RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data -// Material loading/unloading functions -RLAPI Material LoadMaterial(const char *fileName); // Load material from file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +// Mesh manipulation functions +RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -376,12 +441,11 @@ RLAPI Shader GetShaderDefault(void); // Get RLAPI Texture2D GetTextureDefault(void); // Get default texture // Shader configuration functions -RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -RLAPI void SetShaderValue(Shader shader, int uniformLoc, const float *value, int size); // Set shader uniform value (float) -RLAPI void SetShaderValuei(Shader shader, int uniformLoc, const int *value, int size); // Set shader uniform value (int) -RLAPI void SetShaderValueArray(Shader shader, int uniformLoc, const float *value, int size, int count); // Set shader uniform value (array of float/vec2/vec3/vec4) -RLAPI void SetShaderValueArrayi(Shader shader, int uniformLoc, const int *value, int size, int count); // Set shader uniform value (array of int/ivec2/ivec3/ivec4) -RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) RLAPI Matrix GetMatrixModelview(); // Get internal modelview matrix @@ -391,21 +455,22 @@ RLAPI Matrix GetMatrixModelview(); // Get RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size); // Generate cubemap texture from HDR texture RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data -RLAPI Texture2D GenTextureBRDF(Shader shader, Texture2D cubemap, int size); // Generate BRDF texture using cubemap data +RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture // Shading begin/end functions RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +RLAPI void EndScissorMode(void); // End scissor mode // VR control functions -RLAPI VrDeviceInfo GetVrDeviceInfo(int vrDeviceType); // Get VR device information for some standard devices -RLAPI void InitVrSimulator(VrDeviceInfo info); // Init VR simulator for selected device parameters +RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters RLAPI void CloseVrSimulator(void); // Close VR simulator for current device -RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready -RLAPI void SetVrDistortionShader(Shader shader); // Set VR distortion shader for stereoscopic rendering RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera +RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters +RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready RLAPI void ToggleVrMode(void); // Enable/Disable VR experience RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering @@ -428,6 +493,8 @@ RLAPI Sound LoadSoundFromWave(Wave wave); // Load so RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI void ExportWave(Wave wave, const char *fileName); // Export wave data to file +RLAPI void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h) // Wave/Sound management functions RLAPI void PlaySound(Sound sound); // Play a sound @@ -468,4 +535,4 @@ RLAPI void ResumeAudioStream(AudioStream stream); // Resume RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
\ No newline at end of file +RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) diff --git a/projects/VS2015.UWP/raylib.App.UWP/App.cpp b/projects/VS2015.UWP/raylib.App.UWP/App.cpp deleted file mode 100644 index 6ce6915c..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/App.cpp +++ /dev/null @@ -1,558 +0,0 @@ -#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; - -/* -TODO list: - - Cache reference to our CoreWindow? - - Implement gestures support -*/ - -// Declare uwpWindow as exter to be used by raylib internals -// NOTE: It should be properly assigned before calling InitWindow() -extern "C" { EGLNativeWindowType uwpWindow; }; - -/* 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. - - uwpWindow = (EGLNativeWindowType)window; - - InitWindow(800, 450, NULL); -} - -// 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(); -} diff --git a/projects/VS2015.UWP/raylib.App.UWP/App.h b/projects/VS2015.UWP/raylib.App.UWP/App.h deleted file mode 100644 index 5b58528b..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/App.h +++ /dev/null @@ -1,49 +0,0 @@ -#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; - }; -} diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user b/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user deleted file mode 100644 index abe8dd89..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup /> -</Project>
\ No newline at end of file diff --git a/projects/VS2015/examples/core_basic_window.vcxproj b/projects/VS2015/examples/core_basic_window.vcxproj index dd964a97..ee01c79d 100644 --- a/projects/VS2015/examples/core_basic_window.vcxproj +++ b/projects/VS2015/examples/core_basic_window.vcxproj @@ -5,10 +5,6 @@ <Configuration>Debug.DLL</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> - <ProjectConfiguration Include="Debug.UWP|Win32"> - <Configuration>Debug.UWP</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> @@ -26,7 +22,7 @@ <ProjectGuid>{0981CA98-E4A5-4DF1-987F-A41D09131EFC}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>core_basic_window</RootNamespace> - <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> <ProjectName>core_basic_window</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> @@ -56,9 +52,6 @@ <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|Win32'"> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> @@ -105,13 +98,13 @@ <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions> <CompileAs>CompileAsC</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -122,13 +115,13 @@ <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions> <CompileAs>CompileAsC</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -140,7 +133,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData> </ClCompile> @@ -149,7 +142,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> @@ -162,7 +155,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData> </ClCompile> @@ -171,12 +164,7 @@ <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>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|Win32'"> - <Link> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> diff --git a/projects/VS2015/examples/core_basic_window_cpp.vcxproj b/projects/VS2015/examples/core_basic_window_cpp.vcxproj index 2ec74bc4..89504224 100644 --- a/projects/VS2015/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2015/examples/core_basic_window_cpp.vcxproj @@ -5,10 +5,6 @@ <Configuration>Debug.DLL</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> - <ProjectConfiguration Include="Debug.UWP|Win32"> - <Configuration>Debug.UWP</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> @@ -26,7 +22,7 @@ <ProjectGuid>{B655E850-3322-42F7-941D-6AC18FD66CA1}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>raylib_example_cpp</RootNamespace> - <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> <ProjectName>core_basic_window_cpp</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> @@ -56,9 +52,6 @@ <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|Win32'"> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> @@ -104,13 +97,13 @@ <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> @@ -121,13 +114,13 @@ <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> @@ -141,7 +134,7 @@ <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <CompileAs>CompileAsCpp</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -149,7 +142,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -162,7 +155,7 @@ <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <CompileAs>CompileAsCpp</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -170,7 +163,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> diff --git a/projects/VS2015/raylib.sln b/projects/VS2015/raylib.sln index f8ddf5cd..b0742574 100644 --- a/projects/VS2015/raylib.sln +++ b/projects/VS2015/raylib.sln @@ -35,15 +35,13 @@ Global {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|Win32 {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.UWP|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.Build.0 = Debug.UWP|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|Win32 {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.DLL|x64.ActiveCfg = Debug.UWP|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.Build.0 = Debug.UWP|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.ActiveCfg = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.Build.0 = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|Win32 diff --git a/projects/VS2015/raylib/raylib.vcxproj b/projects/VS2015/raylib/raylib.vcxproj index 2c63f382..0b3527cb 100644 --- a/projects/VS2015/raylib/raylib.vcxproj +++ b/projects/VS2015/raylib/raylib.vcxproj @@ -5,10 +5,6 @@ <Configuration>Debug.DLL</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> - <ProjectConfiguration Include="Debug.UWP|Win32"> - <Configuration>Debug.UWP</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> @@ -17,10 +13,6 @@ <Configuration>Release.DLL</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> - <ProjectConfiguration Include="Release.UWP|Win32"> - <Configuration>Release.UWP</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> @@ -30,7 +22,7 @@ <ProjectGuid>{E89D61AC-55DE-4482-AFD4-DF7242EBC859}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>raylib</RootNamespace> - <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> @@ -39,12 +31,6 @@ <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> @@ -58,13 +44,6 @@ <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.UWP|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> @@ -80,18 +59,12 @@ <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.UWP|Win32'" Label="PropertySheets"> - <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.UWP|Win32'" Label="PropertySheets"> - <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> @@ -99,9 +72,6 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.UWP|Win32'"> - <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'"> <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> </PropertyGroup> @@ -109,10 +79,6 @@ <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|Win32'"> - <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> - <IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'"> <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir> @@ -135,24 +101,6 @@ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Lib> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.UWP|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> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - </Link> - <Lib> - <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Lib> - </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'"> <ClCompile> <PrecompiledHeader> @@ -190,25 +138,6 @@ <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.UWP|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> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> @@ -246,7 +175,7 @@ <ClInclude Include="..\..\..\src\external\glad.h" /> <ClInclude Include="..\..\..\src\external\jar_mod.h" /> <ClInclude Include="..\..\..\src\external\jar_xm.h" /> - <ClInclude Include="..\..\..\src\external\mini_al.h" /> + <ClInclude Include="..\..\..\src\external\miniaudio.h" /> <ClInclude Include="..\..\..\src\external\stb_image.h" /> <ClInclude Include="..\..\..\src\external\stb_image_resize.h" /> <ClInclude Include="..\..\..\src\external\stb_image_write.h" /> diff --git a/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj new file mode 100644 index 00000000..cf7b42aa --- /dev/null +++ b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.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> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{0981CA98-E4A5-4DF1-987F-A41D09131EFC}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>core_basic_window</RootNamespace> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> + <ProjectName>core_basic_window</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</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.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> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <CompileAs>CompileAsC</CompileAs> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(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;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>$(SolutionDir)deps;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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)..\..\src;%(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;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\examples\core\core_basic_window.c" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\raylib\raylib.vcxproj"> + <Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj new file mode 100644 index 00000000..72ead7ad --- /dev/null +++ b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.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> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{B655E850-3322-42F7-941D-6AC18FD66CA1}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>raylib_example_cpp</RootNamespace> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> + <ProjectName>core_basic_window_cpp</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</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.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> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <CompileAs>CompileAsCpp</CompileAs> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <CompileAs>CompileAsCpp</CompileAs> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <CompileAs>CompileAsCpp</CompileAs> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(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;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </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)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + <Command>xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\raylib\raylib.vcxproj"> + <Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\examples\core\core_basic_window.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll Binary files differnew file mode 100644 index 00000000..47040da0 --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.dll b/projects/VS2017.ANGLE/lib/x64/libEGL.dll Binary files differnew file mode 100644 index 00000000..71c20a7a --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x64/libEGL.dll diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.lib b/projects/VS2017.ANGLE/lib/x64/libEGL.lib Binary files differnew file mode 100644 index 00000000..b440f78c --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x64/libEGL.lib diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll Binary files differnew file mode 100644 index 00000000..66fcba06 --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib Binary files differnew file mode 100644 index 00000000..af5ba5ad --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib diff --git a/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll Binary files differnew file mode 100644 index 00000000..4ffad2d7 --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.dll b/projects/VS2017.ANGLE/lib/x86/libEGL.dll Binary files differnew file mode 100644 index 00000000..a9cb4a9a --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x86/libEGL.dll diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.lib b/projects/VS2017.ANGLE/lib/x86/libEGL.lib Binary files differnew file mode 100644 index 00000000..1954ceb3 --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x86/libEGL.lib diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll Binary files differnew file mode 100644 index 00000000..47a71ff7 --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib Binary files differnew file mode 100644 index 00000000..562310cc --- /dev/null +++ b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib diff --git a/projects/VS2017.ANGLE/raylib.sln b/projects/VS2017.ANGLE/raylib.sln new file mode 100644 index 00000000..f163b7b7 --- /dev/null +++ b/projects/VS2017.ANGLE/raylib.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2024 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window_cpp", "examples\core_basic_window_cpp.vcxproj", "{B655E850-3322-42F7-941D-6AC18FD66CA1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug.DLL|x86 = Debug.DLL|x86 + Debug|x86 = Debug|x86 + Release.DLL|x86 = Release.DLL|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {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.DLL|x86.ActiveCfg = Release.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.ActiveCfg = Debug|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.Build.0 = Debug|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.ActiveCfg = Release|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {0981CA98-E4A5-4DF1-987F-A41D09131EFC} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {B655E850-3322-42F7-941D-6AC18FD66CA1} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} + EndGlobalSection +EndGlobal diff --git a/projects/VS2015.UWP/raylib/raylib.vcxproj b/projects/VS2017.ANGLE/raylib/raylib.vcxproj index ed8eb80b..5c97eb60 100644 --- a/projects/VS2015.UWP/raylib/raylib.vcxproj +++ b/projects/VS2017.ANGLE/raylib/raylib.vcxproj @@ -1,53 +1,53 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="15.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="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> + <ProjectConfiguration Include="Release.DLL|Win32"> + <Configuration>Release.DLL</Configuration> + <Platform>Win32</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> + <WindowsTargetPlatformVersion>10.0.17763.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>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -59,50 +59,58 @@ <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"> + <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|x64'" Label="PropertySheets"> + <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)'=='Release|Win32'"> <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'"> + <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> + </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir> <IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|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> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_DESKTOP</PreprocessorDefinitions> <CompileAs>CompileAsC</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Windows</SubSystem> </Link> <Lib> - <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalLibraryDirectories>$(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>libEGL.lib;libGLESv2.lib</AdditionalDependencies> </Lib> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'"> <ClCompile> <PrecompiledHeader> </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED</PreprocessorDefinitions> <CompileAs>CompileAsC</CompileAs> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\include\ANGLE</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> @@ -119,8 +127,8 @@ <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> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_DESKTOP</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> </ClCompile> <Link> @@ -128,8 +136,12 @@ <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> + <Lib> + <AdditionalLibraryDirectories>$(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>libEGL.lib;libGLESv2.lib</AdditionalDependencies> + </Lib> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader> @@ -137,23 +149,26 @@ <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> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> <Text Include="ReadMe.txt" /> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\..\src\audio.c" /> + <ClCompile Include="..\..\..\src\raudio.c" /> <ClCompile Include="..\..\..\src\core.c" /> <ClCompile Include="..\..\..\src\models.c" /> + <ClCompile Include="..\..\..\src\rglfw.c" /> <ClCompile Include="..\..\..\src\shapes.c" /> <ClCompile Include="..\..\..\src\text.c" /> <ClCompile Include="..\..\..\src\textures.c" /> @@ -164,6 +179,7 @@ <ClInclude Include="..\..\..\src\external\glad.h" /> <ClInclude Include="..\..\..\src\external\jar_mod.h" /> <ClInclude Include="..\..\..\src\external\jar_xm.h" /> + <ClInclude Include="..\..\..\src\external\miniaudio.h" /> <ClInclude Include="..\..\..\src\external\stb_image.h" /> <ClInclude Include="..\..\..\src\external\stb_image_resize.h" /> <ClInclude Include="..\..\..\src\external\stb_image_write.h" /> diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp new file mode 100644 index 00000000..b738535f --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -0,0 +1,79 @@ +#include "pch.h" +#include "app.h" + +#include "raylib.h" + +using namespace raylibUWP; + +// The main function creates an IFrameworkViewSource for our app, and runs the app. +[Platform::MTAThread] +int main(Platform::Array<Platform::String^>^) +{ + auto appSource = ref new ApplicationSource<App>(); + CoreApplication::Run(appSource); + + return 0; +} + +App::App() +{ + // This does not work... need to fix this. + SetConfigFlags(0); + + Setup(640, 480); +} + +static int posX = 100; +static int posY = 100; +static int gTime = 0; + +// This method is called every frame +void App::Update() +{ + // Update + //---------------------------------------------------------------------------------- + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y) * -5; + + auto mPos = GetMousePosition(); + + if (IsKeyPressed(KEY_A)) + { + posX -= 50; + EnableCursor(); + } + + if (IsKeyPressed(KEY_D)) + { + posX += 50; + DisableCursor(); + } + + static int pos = 0; + pos -= GetMouseWheelMove(); + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + DrawRectangle(posX, posY, 400, 100, RED); + + DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); + + DrawCircle(mPos.x, mPos.y, 40, BLUE); + + if (IsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); + + if (IsKeyDown(KEY_LEFT_ALT)) DrawRectangle(250, 250, 20, 20, BLACK); + if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK); + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); + + DrawRectangle(280, pos + 50, 20, 20, BLACK); + DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); + + EndDrawing(); + //---------------------------------------------------------------------------------- +}
\ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.h b/projects/VS2017.UWP/raylib.App.UWP/App.h new file mode 100644 index 00000000..fa33237d --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/App.h @@ -0,0 +1,25 @@ +#pragma once + +#include <string> + +#include "pch.h" + +// Define what header we use for BaseApp.h +#define PCH "pch.h" + +// Enable hold hack +#define HOLDHACK + +#include "BaseApp.h" + +namespace raylibUWP +{ + ref class App sealed : public BaseApp + { + public: + App(); + + // IFrameworkView Methods. + void Update() override; + }; +} diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png Binary files differindex e26771cb..e26771cb 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png +++ b/projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png Binary files differindex 1eb0d9d5..1eb0d9d5 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png +++ b/projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png Binary files differindex c951e031..c951e031 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png +++ b/projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png Binary files differindex dcb67271..dcb67271 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png +++ b/projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png Binary files differindex 9dd94b62..9dd94b62 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png +++ b/projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png diff --git a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h new file mode 100644 index 00000000..4cca0afa --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h @@ -0,0 +1,570 @@ +/********************************************************************************************** +* +* raylib.BaseApp - UWP App generic code for managing interface between C and C++ +* +* LICENSE: zlib/libpng +* +* CONFIGURATION: +* +* #define PCH +* This defines what header is the PCH and needs to be included +* +* #define HOLDHACK +* This enables a hack to fix flickering key presses (Temporary) +* +* Copyright (c) 2013-2019 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. +* +**********************************************************************************************/ + +#pragma once + +#if defined(PCH) +#include PCH +#endif + +#include <chrono> +#include <memory> +#include <wrl.h> + +//EGL +#include <EGL/eglplatform.h> + +#include "raylib.h" +#include "utils.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; + +extern "C" { EGLNativeWindowType uwpWindow; }; + +/* +TODO list: + - Cache reference to our CoreWindow? + - Implement gestures support +*/ + +// 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) + +//Mouse cursor locking +bool cursorLocked = false; +Vector2 mouseDelta = {0, 0}; + +//Our mouse cursor +CoreCursor ^regularCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); // The "visible arrow" cursor type + +//Base app implementation +ref class BaseApp : public Windows::ApplicationModel::Core::IFrameworkView +{ +public: + + // IFrameworkView Methods. + virtual void Initialize(Windows::ApplicationModel::Core::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, &BaseApp::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, &BaseApp::OnResuming); + } + + virtual void SetWindow(Windows::UI::Core::CoreWindow^ window) + { + window->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &BaseApp::OnWindowSizeChanged); + window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &BaseApp::OnVisibilityChanged); + window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &BaseApp::OnWindowClosed); + + window->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &BaseApp::PointerPressed); + window->PointerWheelChanged += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &BaseApp::PointerWheelChanged); + window->KeyDown += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &BaseApp::OnKeyDown); + window->KeyUp += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &BaseApp::OnKeyUp); + + Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler<MouseDevice^, MouseEventArgs^>(this, &BaseApp::MouseMoved); + + DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); + currentDisplayInformation->DpiChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &BaseApp::OnDpiChanged); + currentDisplayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &BaseApp::OnOrientationChanged); + + // The CoreWindow has been created, so EGL can be initialized. + + uwpWindow = (EGLNativeWindowType)window; + + InitWindow(width, height, NULL); + } + + virtual void Load(Platform::String^ entryPoint) {} + + void Setup(int width, int height) + { + // Set dimensions + this->width = width; + this->height = height; + } + + virtual void Run() + { + // Get display dimensions + DisplayInformation^ dInfo = DisplayInformation::GetForCurrentView(); + Vector2 screenSize = { dInfo->ScreenWidthInRawPixels, dInfo->ScreenHeightInRawPixels }; + + // Send display dimensions + UWPMessage *msg = CreateUWPMessage(); + msg->type = UWP_MSG_SET_DISPLAY_DIMS; + msg->paramVector0 = screenSize; + UWPSendMessage(msg); + + // Send the time to the core + using clock = std::chrono::high_resolution_clock; + auto timeStart = clock::now(); + + // Set fps if 0 + if (GetFPS() <= 0) SetTargetFPS(60); + + while (!mWindowClosed) + { + if (mWindowVisible) + { + // Send time + auto delta = clock::now() - timeStart; + + UWPMessage *timeMsg = CreateUWPMessage(); + timeMsg->type = UWP_MSG_SET_GAME_TIME; + timeMsg->paramDouble0 = std::chrono::duration_cast<std::chrono::seconds>(delta).count(); + UWPSendMessage(timeMsg); + + // Call update function + Update(); + + PollInput(); + + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); + } + else + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + } + } + + CloseWindow(); + } + + //Called every frame (Maybe add draw) + virtual void Update() {} + + virtual void Uninitialize() {} + +protected: + + // Input polling + void PollInput() + { + // Process Messages + { + // Loop over pending messages + while (UWPHasMessages()) + { + // Get the message + auto msg = UWPGetMessage(); + + // Carry out the command + switch(msg->type) + { + case UWP_MSG_SHOW_MOUSE: // Do the same thing because of how UWP works... + case UWP_MSG_UNLOCK_MOUSE: + { + CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor; + cursorLocked = false; + MoveMouse(GetMousePosition()); + break; + } + case UWP_MSG_HIDE_MOUSE: // Do the same thing because of how UWP works... + case UWP_MSG_LOCK_MOUSE: + { + CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; + cursorLocked = true; + break; + } + case UWP_MSG_SET_MOUSE_LOCATION: + { + MoveMouse(msg->paramVector0); + break; + } + } + + // Delete the message + DeleteUWPMessage(msg); + } + } + + // Process Keyboard + { + for (int k = 0x08; k < 0xA6; k++) { + auto state = CoreWindow::GetForCurrentThread()->GetKeyState((Windows::System::VirtualKey) k); + +#ifdef HOLDHACK + // Super hacky way of waiting three frames to see if we are ready to register the key as deregistered + // This will wait an entire 4 frames before deregistering the key, this makes sure that the key is not flickering + if (KeyboardStateHack[k] == 2) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + KeyboardStateHack[k] = 3; + } + } + else if (KeyboardStateHack[k] == 3) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + KeyboardStateHack[k] = 4; + } + } + else if (KeyboardStateHack[k] == 4) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + //Reset key... + KeyboardStateHack[k] = 0; + + //Tell core + RegisterKey(k, 0); + } + } +#endif + // Left and right alt, KeyUp and KeyDown are not called for it + // No need to hack because this is not a character + + // TODO: Maybe do all other key registrations like this, no more key events? + + if (k == 0xA4 || k == 0xA5) + { + if ((state & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down) + { + RegisterKey(k, 1); + } + else + { + RegisterKey(k, 0); + } + } + } + } + + // Process Mouse + { + + if (CurrentPointerID > -1) + { + auto point = PointerPoint::GetCurrentPoint(CurrentPointerID); + auto props = point->Properties; + + if (props->IsLeftButtonPressed) + { + RegisterClick(MOUSE_LEFT_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_LEFT_BUTTON, 0); + } + + if (props->IsRightButtonPressed) + { + RegisterClick(MOUSE_RIGHT_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_RIGHT_BUTTON, 0); + } + + if (props->IsMiddleButtonPressed) + { + RegisterClick(MOUSE_MIDDLE_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_MIDDLE_BUTTON, 0); + } + } + + CoreWindow ^window = CoreWindow::GetForCurrentThread(); + + if (cursorLocked) + { + // Track cursor movement delta, recenter it on the client + auto curMousePos = GetMousePosition(); + + auto x = curMousePos.x + mouseDelta.x; + auto y = curMousePos.y + mouseDelta.y; + + UpdateMousePosition({ x, 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 + auto x = window->PointerPosition.X - window->Bounds.X; + auto y = window->PointerPosition.Y - window->Bounds.Y; + + UpdateMousePosition({ x, 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. + + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_SET_GAMEPAD_ACTIVE; + msg->paramInt0 = i; + msg->paramBool0 = i < Gamepad::Gamepads->Size; + UWPSendMessage(msg); + } + + // Get current gamepad state + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (IsGamepadAvailable(i)) + { + // 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 + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_DOWN, ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_LEFT, ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_UP, ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y)); + + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_TRIGGER_1, ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_TRIGGER_1, ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder)); + + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE_LEFT, ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View)); // Changed for XB1 Controller + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE_RIGHT, ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)); // Changed for XB1 Controller + + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_UP, ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_RIGHT, ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_DOWN, ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadDown)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_LEFT, ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadLeft)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE, false); // Home button not supported by UWP + + // Get current axis state + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_X, (float)reading.LeftThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_Y, (float)reading.LeftThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_X, (float)reading.RightThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_Y, (float)reading.RightThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_TRIGGER, (float)reading.LeftTrigger); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_TRIGGER, (float)reading.RightTrigger); + } + } + } + } + + // Application lifecycle event handlers. + void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args) + { + // Run() won't start until the CoreWindow is activated. + CoreWindow::GetForCurrentThread()->Activate(); + } + + void OnResuming(Platform::Object^ sender, Platform::Object^ args) {} + + // Window event handlers. + void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_HANDLE_RESIZE; + UWPSendMessage(msg); + } + + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) + { + mWindowVisible = args->Visible; + } + + void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args) + { + mWindowClosed = true; + } + + // 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) + { + //Get the current active pointer ID for our loop + CurrentPointerID = args->CurrentPoint->PointerId; + args->Handled = true; + } + + void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_SCROLL_WHEEL_UPDATE; + msg->paramFloat0 = args->CurrentPoint->Properties->MouseWheelDelta; + UWPSendMessage(msg); + } + + void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args) + { + mouseDelta.x += args->MouseDelta.X; + mouseDelta.y += args->MouseDelta.Y; + } + + void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) + { +#ifdef HOLDHACK + // Start the hack + KeyboardStateHack[(int)args->VirtualKey] = 1; +#endif + + RegisterKey((int)args->VirtualKey, 1); + } + + void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) + { +#ifdef HOLDHACK + // The same hack + if (KeyboardStateHack[(int)args->VirtualKey] == 1) + { + KeyboardStateHack[(int)args->VirtualKey] = 2; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 2) + { + KeyboardStateHack[(int)args->VirtualKey] = 3; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 3) + { + KeyboardStateHack[(int)args->VirtualKey] = 4; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 4) + { + RegisterKey((int)args->VirtualKey, 0); + KeyboardStateHack[(int)args->VirtualKey] = 0; + } +#else + // No hack, allow flickers + RegisterKey((int)args->VirtualKey, 0); +#endif + } + +private: + + void RegisterKey(int key, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWPMessageType::UWP_MSG_REGISTER_KEY; + msg->paramInt0 = key; + msg->paramChar0 = status; + UWPSendMessage(msg); + } + + void MoveMouse(Vector2 pos) + { + CoreWindow ^window = CoreWindow::GetForCurrentThread(); + Point mousePosScreen = Point(pos.x + window->Bounds.X, pos.y + window->Bounds.Y); + window->PointerPosition = mousePosScreen; + } + + void RegisterGamepadButton(int gamepad, int button, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_SET_GAMEPAD_BUTTON; + msg->paramInt0 = gamepad; + msg->paramInt1 = button; + msg->paramChar0 = status; + UWPSendMessage(msg); + } + + void RegisterGamepadAxis(int gamepad, int axis, float value) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_SET_GAMEPAD_AXIS; + msg->paramInt0 = gamepad; + msg->paramInt1 = axis; + msg->paramFloat0 = value; + UWPSendMessage(msg); + } + + void UpdateMousePosition(Vector2 pos) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWP_MSG_UPDATE_MOUSE_LOCATION; + msg->paramVector0 = pos; + UWPSendMessage(msg); + } + + void RegisterClick(int button, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->type = UWPMessageType::UWP_MSG_REGISTER_CLICK; + msg->paramInt0 = button; + msg->paramChar0 = status; + UWPSendMessage(msg); + } + + bool mWindowClosed = false; + bool mWindowVisible = true; + + int width = 640; + int height = 480; + + int CurrentPointerID = -1; + +#ifdef HOLDHACK + char KeyboardStateHack[0xA6]; // 0xA6 because the highest key we compare against is 0xA5 +#endif +}; + +// Application source for creating the program +template<typename AppType> +ref class ApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource +{ +public: + virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView() + { + return ref new AppType(); + } +};
\ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest b/projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest index 56020a50..56020a50 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest +++ b/projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest diff --git a/projects/VS2015.UWP/raylib.App.UWP/packages.config b/projects/VS2017.UWP/raylib.App.UWP/packages.config index 70c3dea0..70c3dea0 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/packages.config +++ b/projects/VS2017.UWP/raylib.App.UWP/packages.config diff --git a/projects/VS2015.UWP/raylib.App.UWP/pch.cpp b/projects/VS2017.UWP/raylib.App.UWP/pch.cpp index bcb5590b..bcb5590b 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/pch.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/pch.cpp diff --git a/projects/VS2015.UWP/raylib.App.UWP/pch.h b/projects/VS2017.UWP/raylib.App.UWP/pch.h index dcbd2378..dcbd2378 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/pch.h +++ b/projects/VS2017.UWP/raylib.App.UWP/pch.h diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx Binary files differindex 0ada3be0..0ada3be0 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters index 4e83c979..4e83c979 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj index f20a276e..8296b654 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -33,8 +33,8 @@ <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> <AppContainerApplication>true</AppContainerApplication> <ApplicationType>Windows Store</ApplicationType> - <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion> - <WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion> <ApplicationTypeRevision>10.0</ApplicationTypeRevision> <ProjectName>raylib.App.UWP</ProjectName> </PropertyGroup> @@ -42,13 +42,13 @@ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="PropertySheets"> @@ -64,20 +64,20 @@ </PropertyGroup> <ItemDefinitionGroup Condition="'$(Platform)'=='ARM'"> <Link> - <AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>mincore.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\arm;$(VCInstallDir)\lib\arm;$(SolutionDir)\raylib\Debug</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> <Link> - <AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>mincore.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> + <AdditionalDependencies>mincore.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> @@ -87,7 +87,7 @@ <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions> <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings> - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>PLATFORM_UWP;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <ProjectReference> <LinkLibraryDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkLibraryDependencies> @@ -100,7 +100,7 @@ <AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions> <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings> - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>PLATFORM_UWP;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Default</CompileAs> <OmitDefaultLibName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</OmitDefaultLibName> </ClCompile> @@ -117,6 +117,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="App.h" /> + <ClInclude Include="BaseApp.h" /> <ClInclude Include="pch.h" /> </ItemGroup> <ItemGroup> @@ -132,6 +133,11 @@ <None Include="packages.config" /> <None Include="raylib.App.UWP.TemporaryKey.pfx" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\raylib.UWP\raylib.UWP.vcxproj"> + <Project>{ea91e088-7c71-4f32-b761-e054305cd519}</Project> + </ProjectReference> + </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')" /> diff --git a/projects/VS2015.UWP/raylib.UWP.sln b/projects/VS2017.UWP/raylib.UWP.sln index 087e84f4..fb528655 100644 --- a/projects/VS2015.UWP/raylib.UWP.sln +++ b/projects/VS2017.UWP/raylib.UWP.sln @@ -1,11 +1,11 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.438 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}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.UWP", "raylib.UWP\raylib.UWP.vcxproj", "{EA91E088-7C71-4F32-B761-E054305CD519}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -35,17 +35,23 @@ Global {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|ARM.Build.0 = 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 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|ARM.ActiveCfg = Debug|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|ARM.Build.0 = Debug|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x64.ActiveCfg = Debug|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x64.Build.0 = Debug|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x86.ActiveCfg = Debug|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x86.Build.0 = Debug|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|ARM.ActiveCfg = Release|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|ARM.Build.0 = Release|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x64.ActiveCfg = Release|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x64.Build.0 = Release|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x86.ActiveCfg = Release|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E32C7998-071A-419B-8869-E957374307CA} + EndGlobalSection EndGlobal diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj new file mode 100644 index 00000000..6dd20096 --- /dev/null +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <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|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</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> + <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\utils.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\core.c" /> + <ClCompile Include="..\..\..\src\models.c" /> + <ClCompile Include="..\..\..\src\raudio.c" /> + <ClCompile Include="..\..\..\src\shapes.c" /> + <ClCompile Include="..\..\..\src\text.c" /> + <ClCompile Include="..\..\..\src\textures.c" /> + <ClCompile Include="..\..\..\src\utils.c" /> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{ea91e088-7c71-4f32-b761-e054305cd519}</ProjectGuid> + <Keyword>StaticLibrary</Keyword> + <RootNamespace>raylib_UWP</RootNamespace> + <DefaultLanguage>en-US</DefaultLanguage> + <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> + <AppContainerApplication>true</AppContainerApplication> + <ApplicationType>Windows Store</ApplicationType> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion> + <ApplicationTypeRevision>10.0</ApplicationTypeRevision> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </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 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 Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <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|ARM'"> + <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)'=='Debug|x64'"> + <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|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters new file mode 100644 index 00000000..cbad7c9b --- /dev/null +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClInclude Include="..\..\..\src\camera.h" /> + <ClInclude Include="..\..\..\src\gestures.h" /> + <ClInclude Include="..\..\..\src\raylib.h" /> + <ClInclude Include="..\..\..\src\raymath.h" /> + <ClInclude Include="..\..\..\src\rlgl.h" /> + <ClInclude Include="..\..\..\src\utils.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" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\core.c" /> + <ClCompile Include="..\..\..\src\models.c" /> + <ClCompile Include="..\..\..\src\raudio.c" /> + <ClCompile Include="..\..\..\src\shapes.c" /> + <ClCompile Include="..\..\..\src\text.c" /> + <ClCompile Include="..\..\..\src\textures.c" /> + <ClCompile Include="..\..\..\src\utils.c" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/projects/VS2017/examples/core_basic_window.vcxproj b/projects/VS2017/examples/core_basic_window.vcxproj index 48e06e44..38247bee 100644 --- a/projects/VS2017/examples/core_basic_window.vcxproj +++ b/projects/VS2017/examples/core_basic_window.vcxproj @@ -22,33 +22,33 @@ <ProjectGuid>{0981CA98-E4A5-4DF1-987F-A41D09131EFC}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>core_basic_window</RootNamespace> - <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> <ProjectName>core_basic_window</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -104,7 +104,7 @@ <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -121,7 +121,7 @@ <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -142,7 +142,7 @@ <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;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> @@ -164,7 +164,7 @@ <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;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index 39a2aee7..3e3f790f 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -22,33 +22,33 @@ <ProjectGuid>{B655E850-3322-42F7-941D-6AC18FD66CA1}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>raylib_example_cpp</RootNamespace> - <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> <ProjectName>core_basic_window_cpp</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -103,7 +103,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> @@ -120,7 +120,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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> @@ -142,7 +142,7 @@ <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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.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'"> @@ -163,7 +163,7 @@ <OptimizeReferences>true</OptimizeReferences> <GenerateDebugInformation>true</GenerateDebugInformation> <AdditionalLibraryDirectories>%(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> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 8db1e511..82703397 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -22,32 +22,32 @@ <ProjectGuid>{E89D61AC-55DE-4482-AFD4-DF7242EBC859}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>raylib</RootNamespace> - <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17763.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> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -173,7 +173,7 @@ <ClInclude Include="..\..\..\src\external\glad.h" /> <ClInclude Include="..\..\..\src\external\jar_mod.h" /> <ClInclude Include="..\..\..\src\external\jar_xm.h" /> - <ClInclude Include="..\..\..\src\external\mini_al.h" /> + <ClInclude Include="..\..\..\src\external\miniaudio.h" /> <ClInclude Include="..\..\..\src\external\stb_image.h" /> <ClInclude Include="..\..\..\src\external\stb_image_resize.h" /> <ClInclude Include="..\..\..\src\external\stb_image_write.h" /> diff --git a/projects/VSCode/.vscode/c_cpp_properties.json b/projects/VSCode/.vscode/c_cpp_properties.json index d4d8e14a..496a9b2d 100644 --- a/projects/VSCode/.vscode/c_cpp_properties.json +++ b/projects/VSCode/.vscode/c_cpp_properties.json @@ -13,7 +13,7 @@ "GRAPHICS_API_OPENGL_33", "PLATFORM_DESKTOP" ], - "compilerPath": "C:/raylib/mingw32/bin/gcc.exe", + "compilerPath": "C:/raylib/mingw/bin/gcc.exe", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "clang-x64" diff --git a/projects/VSCode/.vscode/launch.json b/projects/VSCode/.vscode/launch.json index be3fa55a..afb54b7f 100644 --- a/projects/VSCode/.vscode/launch.json +++ b/projects/VSCode/.vscode/launch.json @@ -23,7 +23,7 @@ } ], "windows": { - "miDebuggerPath": "C:/raylib/mingw32/bin/gdb.exe", + "miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe", }, "osx": { "MIMode": "lldb" @@ -46,7 +46,7 @@ "MIMode": "gdb", "windows": { "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", - "miDebuggerPath": "C:/raylib/mingw32/bin/gdb.exe" + "miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe" }, "osx": { "MIMode": "lldb" diff --git a/projects/VSCode/.vscode/tasks.json b/projects/VSCode/.vscode/tasks.json index 0d8be4cf..072fa179 100644 --- a/projects/VSCode/.vscode/tasks.json +++ b/projects/VSCode/.vscode/tasks.json @@ -12,7 +12,7 @@ "DEBUGGING=TRUE" ], "windows": { - "command": "C:/raylib/mingw32/bin/mingw32-make.exe", + "command": "C:/raylib/mingw/bin/mingw32-make.exe", "args": [ "RAYLIB_PATH=C:/raylib/raylib" ], @@ -35,7 +35,7 @@ "PLATFORM=PLATFORM_DESKTOP", ], "windows": { - "command": "C:/raylib/mingw32/bin/mingw32-make.exe", + "command": "C:/raylib/mingw/bin/mingw32-make.exe", "args": [ "RAYLIB_PATH=C:/raylib/raylib", ], diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 747718fc..a00f4fab 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -2,7 +2,7 @@ # # raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 # -# Copyright (c) 2013-2018 Ramon Santamaria (@raysan5) +# Copyright (c) 2013-2019 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. @@ -24,29 +24,43 @@ .PHONY: all clean # Define required raylib variables -# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop() -PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH ?= ../.. -PROJECT_NAME ?= game -DEBUGGING ?= FALSE - -# Default path for raylib on Raspberry Pi, if installed in different path, update it! -ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_PATH ?= /home/pi/raylib -endif +PROJECT_NAME ?= game +RAYLIB_VERSION ?= 2.5.0 +RAYLIB_API_VERSION ?= 2 +RAYLIB_PATH ?= ..\.. + +# Define default options + +# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + +# Locations of your newly installed library and associated headers. See ../src/Makefile +# On Linux, if you have installed raylib but cannot compile the examples, check that +# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations. +# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED. +# To enable compile-time linking to a special version of libraylib.so, change these variables here. +# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below. +# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime, +# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH. +# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. +DESTDIR ?= /usr/local +RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib +# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. +RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC + +# Build mode for project: DEBUG or RELEASE +BUILD_MODE ?= RELEASE # Use external GLFW library instead of rglfw module -USE_EXTERNAL_GLFW ?= FALSE +# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3 +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) - +USE_WAYLAND_DISPLAY ?= FALSE # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -54,7 +68,6 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) PLATFORM_OS=WINDOWS - export PATH := C:/raylib/mingw32/bin:$(PATH) else UNAMEOS=$(shell uname) ifeq ($(UNAMEOS),Linux) @@ -84,41 +97,51 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # Emscripten required variables - EMSDK_PATH = C:/emsdk - EMSCRIPTEN_VERSION = 1.38.8 - CLANG_VERSION = e1.38.8_64bit - PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 - NODE_VERSION = 8.9.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 +# RAYLIB_PATH adjustment for different platforms. +# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? +# Required for ldconfig or other tools that do not perform path expansion. 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),BSD) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd + RAYLIB_PREFIX ?= .. + RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) endif endif +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki. +# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi + RAYLIB_PATH ?= /home/pi/raylib endif + ifeq ($(PLATFORM),PLATFORM_WEB) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5 + # Emscripten required variables + EMSDK_PATH ?= C:/emsdk + EMSCRIPTEN_VERSION ?= 1.38.31 + CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit + PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 + NODE_VERSION = 8.9.1_64bit + export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) + EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) endif +# Define raylib release directory for compiled library. +# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src + +# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries +# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH +# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux +# without formal installation from ../src/Makefile. It aids portability and is useful if you have +# multiple versions of raylib, have raylib installed to a non-standard location, or want to +# bundle libraylib.so with your game. Change it to your liking. +# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, +# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH, +# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) +# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute. +# To see which libraries a built example is linking to, ldd core/core_basic_window; +# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing. +EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH) + # Define default C compiler: gcc # NOTE: define g++ compiler if using C++ CC = gcc @@ -142,6 +165,8 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif ifeq ($(PLATFORM),PLATFORM_WEB) # HTML5 emscripten compiler + # WARNING: To compile to HTML5, code must be redesigned + # to use emscripten.h and emscripten_set_main_loop() CC = emcc endif @@ -152,78 +177,105 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) MAKE = make endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make - endif endif # Define compiler flags: # -O1 defines optimization level -# -g enable debugging +# -g include debug information on compilation # -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) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -ifeq ($(DEBUGGING), TRUE) +CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces + +ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -else - CFLAGS += -O1 -s endif -CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -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 + # resource file contains windows executable icon and properties # -Wl,--subsystem,windows hides the console window - CFLAGS += -Wl,--subsystem,windows - LDFLAGS += $(RAYLIB_PATH)/raylib.rc.data + CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -D_DEFAULT_SOURCE + ifeq ($(RAYLIB_LIBTYPE),STATIC) + CFLAGS += -D_DEFAULT_SOURCE + endif + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Explicitly enable runtime link to libraylib.so + CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) + endif 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 + # -Os # size optimization + # -O2 # optimization level 2, if used, also set --memory-init-file 0 + # -s USE_GLFW=3 # Use glfw3 library (context/input management) + # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! # -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) + # -s WASM=0 # disable Web Assembly, emitted by default + # -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow) + # -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter + # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # --profiling # include information for code profiling + # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # --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 - + CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources + ifeq ($(BUILD_MODE), DEBUG) + CFLAGS += -s ASSERTIONS=1 --profiling + endif + # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\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 +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - # RPI requried libraries + # RPI required 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 +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + # Consider -L$(RAYLIB_H_INSTALL_PATH) + INCLUDE_PATHS += -I/usr/local/include + endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include + INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external + endif +endif -# Define library paths containing required libs -LDFLAGS += -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src +# Define library paths containing required libs. +LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) - INCLUDE_PATHS += -I/usr/local/include + # Consider -L$(RAYLIB_INSTALL_PATH) LDFLAGS += -L. -Lsrc -L/usr/local/lib endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs + LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) @@ -235,8 +287,8 @@ endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = -lraylib -lopengl32 -lgdi32 - + # NOTE: WinMM library required to set high-res timer resolution + LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm # Required for physac examples #LDLIBS += -static -lpthread endif @@ -254,11 +306,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(USE_WAYLAND_DISPLAY),TRUE) LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon endif + # Explicit link to libc + ifeq ($(RAYLIB_LIBTYPE),SHARED) + LDLIBS += -lc + 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 Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling @@ -326,7 +382,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) 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 + 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 -fv endif ifeq ($(PLATFORM_OS),OSX) find . -type f -perm +ugo+x -delete @@ -335,7 +391,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif ifeq ($(PLATFORM),PLATFORM_RPI) find . -type f -executable -delete - rm -f *.o + rm -fv *.o endif ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js diff --git a/projects/VSCode/Makefile.Android b/projects/VSCode/Makefile.Android index b6c68417..29d437b1 100644 --- a/projects/VSCode/Makefile.Android +++ b/projects/VSCode/Makefile.Android @@ -22,33 +22,33 @@ #************************************************************************************************** # Define required raylib variables -PLATFORM ?= PLATFORM_ANDROID -RAYLIB_PATH ?= ..\.. +PLATFORM ?= PLATFORM_ANDROID +RAYLIB_PATH ?= ..\.. # Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version -ANDROID_ARCH ?= ARM -ANDROID_API_VERSION = 21 +ANDROID_ARCH ?= ARM +ANDROID_API_VERSION = 21 ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif # Required path variables # NOTE: JAVA_HOME must be set to JDK -JAVA_HOME ?= C:/JavaJDK -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 -ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools +JAVA_HOME ?= C:/JavaJDK +ANDROID_HOME = C:/android-sdk +ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) +ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 +ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables -PROJECT_NAME ?= raylib_game -PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_NAME ?= raylib_game +PROJECT_LIBRARY_NAME ?= main +PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c +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. @@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME) + +# Library path for libraylib.a/libraylib.so +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a diff --git a/projects/scripts/build-linux.sh b/projects/scripts/build-linux.sh index 965542ce..5a004ddd 100644 --- a/projects/scripts/build-linux.sh +++ b/projects/scripts/build-linux.sh @@ -2,13 +2,13 @@ # Change your executable name here GAME_NAME="game" -# Set your sources here (relative to the ./builds/linux directory) +# Set your sources here (relative paths!) # Example with two source folders: -# SOURCES="../../src/*.c ../../src/submodule/*.c" -SOURCES="../../core_basic_window.c" +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" -# Set your raylib/src location here, relative to the ./temp/x directory -RAYLIB_SRC="../../../../src" +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" # About this build script: it does many things, but in essence, it's # very simple. It has 3 compiler invocations: building raylib (which @@ -17,14 +17,18 @@ RAYLIB_SRC="../../../../src" # wrapped in an if statement to make the -qq flag work, it's pretty # verbose, sorry. +# Stop the script if a compilation (or something else?) fails +set -e + # Get arguments -while getopts ":hdurcq" opt; do +while getopts ":hdusrcq" opt; do case $opt in h) - echo "Usage: ./linux-build.sh [-hdurcqq]" + echo "Usage: ./linux-build.sh [-hdusrcqq]" echo " -h Show this information" echo " -d Faster builds that have debug symbols, and enable warnings" echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" echo " -r Run the executable after compilation" echo " -c Remove the temp/(debug|release) directory, ie. full recompile" echo " -q Suppress this script's informational prints" @@ -47,6 +51,9 @@ while getopts ":hdurcq" opt; do u) UPX_IT="1" ;; + s) + STRIP_IT="1" + ;; r) RUN_AFTER_BUILD="1" ;; @@ -72,23 +79,23 @@ if [ -z "$CC" ]; then CC=cc fi +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + # Flags OUTPUT_DIR="builds/linux" COMPILATION_FLAGS="-std=c99 -Os -flto" -if [ "$CC" = "clang" ]; then - # Clang 7.0.1 fails to compile with -Os, possibly the same bug as this: - # https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg25771.html - COMPILATION_FLAGS="-std=c99 -O2 -flto" - [ -z "$QUIET" ] && echo "COMPILE-WARNING: \$CC is clang, using -O2 instead of -Os." -fi FINAL_COMPILE_FLAGS="-s" WARNING_FLAGS="-Wall -Wextra -Wpedantic" -LINK_FLAGS="-lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" +LINK_FLAGS="-flto -lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" # Debug changes to flags if [ -n "$BUILD_DEBUG" ]; then OUTPUT_DIR="builds-debug/linux" COMPILATION_FLAGS="-std=c99 -O0 -g" FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" fi # Display what we're doing @@ -99,7 +106,6 @@ else fi # Create the raylib cache directory -ROOT_DIR=$(pwd) TEMP_DIR="temp/release" if [ -n "$BUILD_DEBUG" ]; then TEMP_DIR="temp/debug" @@ -131,15 +137,20 @@ mkdir -p $OUTPUT_DIR cd $OUTPUT_DIR [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." if [ -n "$REALLY_QUIET" ]; then - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS > /dev/null 2>&1 + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 else - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS fi -rm main.o +rm *.o [ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + if [ -n "$UPX_IT" ]; then [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." upx $GAME_NAME > /dev/null 2>&1 diff --git a/projects/scripts/build-osx.sh b/projects/scripts/build-osx.sh index 1a5ad743..13a421f9 100644 --- a/projects/scripts/build-osx.sh +++ b/projects/scripts/build-osx.sh @@ -2,13 +2,13 @@ # Change your executable name here GAME_NAME="game" -# Set your sources here (relative to the ./builds/osx directory) +# Set your sources here (relative paths!) # Example with two source folders: -# SOURCES="../../src/*.c ../../src/submodule/*.c" -SOURCES="../../core_basic_window.c" +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" -# Set your raylib/src location here, relative to the ./temp/x directory -RAYLIB_SRC="../../../../src" +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" # About this build script: it does many things, but in essence, it's # very simple. It has 3 compiler invocations: building raylib (which @@ -17,14 +17,18 @@ RAYLIB_SRC="../../../../src" # wrapped in an if statement to make the -qq flag work, it's pretty # verbose, sorry. +# Stop the script if a compilation (or something else?) fails +set -e + # Get arguments -while getopts ":hdurcq" opt; do +while getopts ":hdusrcq" opt; do case $opt in h) - echo "Usage: ./osx-build.sh [-hdurcqq]" + echo "Usage: ./osx-build.sh [-hdusrcqq]" echo " -h Show this information" echo " -d Faster builds that have debug symbols, and enable warnings" echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" echo " -r Run the executable after compilation" echo " -c Remove the temp/(debug|release) directory, ie. full recompile" echo " -q Suppress this script's informational prints" @@ -47,6 +51,9 @@ while getopts ":hdurcq" opt; do u) UPX_IT="1" ;; + s) + STRIP_IT="1" + ;; r) RUN_AFTER_BUILD="1" ;; @@ -72,17 +79,23 @@ if [ -z "$CC" ]; then CC=cc fi +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + # Flags OUTPUT_DIR="builds/osx" COMPILATION_FLAGS="-std=c99 -O2 -flto" FINAL_COMPILE_FLAGS="-s" WARNING_FLAGS="-Wall -Wextra -Wpedantic" -LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" +LINK_FLAGS="-flto -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" # Debug changes to flags if [ -n "$BUILD_DEBUG" ]; then OUTPUT_DIR="builds-debug/osx" COMPILATION_FLAGS="-std=c99 -O0 -g" FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" fi # Display what we're doing @@ -93,7 +106,6 @@ else fi # Create the raylib cache directory -ROOT_DIR=$(pwd) TEMP_DIR="temp/release" if [ -n "$BUILD_DEBUG" ]; then TEMP_DIR="temp/debug" @@ -127,15 +139,20 @@ mkdir -p $OUTPUT_DIR cd $OUTPUT_DIR [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." if [ -n "$REALLY_QUIET" ]; then - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS > /dev/null 2>&1 + $CC -c -I$RAYLIB_SRC $SOURCES $COMPILATION_FLAGS $WARNING_FLAGS > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 else - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS + $CC -c -I$RAYLIB_SRC $SOURCES $COMPILATION_FLAGS $WARNING_FLAGS + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS fi -rm main.o +rm *.o [ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + if [ -n "$UPX_IT" ]; then [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." upx $GAME_NAME > /dev/null 2>&1 diff --git a/projects/scripts/build-rpi.sh b/projects/scripts/build-rpi.sh new file mode 100755 index 00000000..85b39b04 --- /dev/null +++ b/projects/scripts/build-rpi.sh @@ -0,0 +1,169 @@ +#!/bin/sh +# Change your executable name here +GAME_NAME="game" + +# Set your sources here (relative paths!) +# Example with two source folders: +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" + +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" + +# About this build script: it does many things, but in essence, it's +# very simple. It has 3 compiler invocations: building raylib (which +# is not done always, see logic by searching "Build raylib"), building +# src/*.c files, and linking together those two. Each invocation is +# wrapped in an if statement to make the -qq flag work, it's pretty +# verbose, sorry. + +# Stop the script if a compilation (or something else?) fails +set -e + +# Get arguments +while getopts ":hdusrcq" opt; do + case $opt in + h) + echo "Usage: ./linux-build.sh [-hdusrcqq]" + echo " -h Show this information" + echo " -d Faster builds that have debug symbols, and enable warnings" + echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" + echo " -r Run the executable after compilation" + echo " -c Remove the temp/(debug|release) directory, ie. full recompile" + echo " -q Suppress this script's informational prints" + echo " -qq Suppress all prints, complete silence (> /dev/null 2>&1)" + echo "" + echo "* This is mostly here to make building simple \"shipping\" versions" + echo " easier, and it's a very small bit in the build scripts. The option" + echo " requires that you have upx installed and on your path, of course." + echo "" + echo "Examples:" + echo " Build a release build: ./linux-build.sh" + echo " Build a release build, full recompile: ./linux-build.sh -c" + echo " Build a debug build and run: ./linux-build.sh -d -r" + echo " Build in debug, run, don't print at all: ./linux-build.sh -drqq" + exit 0 + ;; + d) + BUILD_DEBUG="1" + ;; + u) + UPX_IT="1" + ;; + s) + STRIP_IT="1" + ;; + r) + RUN_AFTER_BUILD="1" + ;; + c) + BUILD_ALL="1" + ;; + q) + if [ -n "$QUIET" ]; then + REALLY_QUIET="1" + else + QUIET="1" + fi + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + +# Set CC if it's not set already +if [ -z "$CC" ]; then + CC=cc +fi + +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + +# Flags +OUTPUT_DIR="builds/linux" +COMPILATION_FLAGS="-std=c99 -Os -flto" +FINAL_COMPILE_FLAGS="-s" +WARNING_FLAGS="-Wall -Wextra -Wpedantic" +LINK_FLAGS="-flto -lm -ldl -lrt -lpthread -lv4l2 -lbrcmGLESv2 -lbrcmEGL -lbcm_host -L/opt/vc/lib" +# Debug changes to flags +if [ -n "$BUILD_DEBUG" ]; then + OUTPUT_DIR="builds-debug/linux" + COMPILATION_FLAGS="-std=c99 -O0 -g" + FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-lm -ldl -lrt -lpthread -lv4l2 -lbrcmGLESv2 -lbrcmEGL -lbcm_host -L/opt/vc/lib" +fi + +# Display what we're doing +if [ -n "$BUILD_DEBUG" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling in debug mode. ($COMPILATION_FLAGS $WARNING_FLAGS)" +else + [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling in release mode. ($COMPILATION_FLAGS $FINAL_COMPILE_FLAGS)" +fi + +# Create the raylib cache directory +TEMP_DIR="temp/release" +if [ -n "$BUILD_DEBUG" ]; then + TEMP_DIR="temp/debug" +fi +# If there's a -c flag, remove the cache +if [ -d "$TEMP_DIR" ] && [ -n "$BUILD_ALL" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Found cached raylib, rebuilding." + rm -r "$TEMP_DIR" +fi +# If temp directory doesn't exist, build raylib +if [ ! -d "$TEMP_DIR" ]; then + mkdir -p $TEMP_DIR + cd $TEMP_DIR + RAYLIB_DEFINES="-D_DEFAULT_SOURCE -DPLATFORM_RPI -DGRAPHICS_API_OPENGL_ES2" + RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/raudio.c" + RAYLIB_INCLUDE_FLAGS="-I$RAYLIB_SRC -I/opt/vc/include" + + if [ -n "$REALLY_QUIET" ]; then + $CC -c $RAYLIB_DEFINES $RAYLIB_INCLUDE_FLAGS $COMPILATION_FLAGS $RAYLIB_C_FILES > /dev/null 2>&1 + else + $CC -c $RAYLIB_DEFINES $RAYLIB_INCLUDE_FLAGS $COMPILATION_FLAGS $RAYLIB_C_FILES + fi + [ -z "$QUIET" ] && echo "COMPILE-INFO: Raylib compiled into object files in: $TEMP_DIR/" + cd $ROOT_DIR +fi + +# Build the actual game +mkdir -p $OUTPUT_DIR +cd $OUTPUT_DIR +[ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." +if [ -n "$REALLY_QUIET" ]; then + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 +else + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS +fi +rm *.o +[ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" + +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + +if [ -n "$UPX_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." + upx $GAME_NAME > /dev/null 2>&1 +fi + +if [ -n "$RUN_AFTER_BUILD" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Running." + if [ -n "$REALLY_QUIET" ]; then + ./$GAME_NAME > /dev/null 2>&1 + else + ./$GAME_NAME + fi +fi +cd $ROOT_DIR + +[ -z "$QUIET" ] && echo "COMPILE-INFO: All done." diff --git a/projects/scripts/build-windows.bat b/projects/scripts/build-windows.bat index b179b560..98ab548d 100644 --- a/projects/scripts/build-windows.bat +++ b/projects/scripts/build-windows.bat @@ -2,13 +2,13 @@ REM Change your executable name here set GAME_NAME=game.exe -REM Set your sources here (relative to the builds\windows directory) +REM Set your sources here (relative paths!) REM Example with two source folders: -REM set SOURCES=..\..\src\*.c ..\..\src\submodule\*.c -set SOURCES=..\..\core_basic_window.c +REM set SOURCES=src\*.c src\submodule\*.c +set SOURCES=core_basic_window.c -REM Set your raylib/src location here, relative to the ./temp/x directory -set RAYLIB_SRC=..\..\..\..\src +REM Set your raylib\src location here (relative path!) +set RAYLIB_SRC=..\..\src REM About this build script: it does many things, but in essence, it's REM very simple. It has 3 compiler invocations: building raylib (which @@ -111,13 +111,18 @@ IF DEFINED VERBOSE ( :BUILD +REM Directories +set "ROOT_DIR=%CD%" +set "SOURCES=!ROOT_DIR!\!SOURCES!" +set "RAYLIB_SRC=!ROOT_DIR!\!RAYLIB_SRC!" + REM Flags set OUTPUT_FLAG=/Fe: "!GAME_NAME!" set COMPILATION_FLAGS=/O1 /GL set WARNING_FLAGS= set SUBSYSTEM_FLAGS=/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup set LINK_FLAGS=/link /LTCG kernel32.lib user32.lib shell32.lib winmm.lib gdi32.lib opengl32.lib -set OUTPUT_DIR=builds\windows +set OUTPUT_DIR=builds\windows-msvc REM Debug changes to flags IF DEFINED BUILD_DEBUG ( set OUTPUT_FLAG=/Fe: "!GAME_NAME!" @@ -125,7 +130,7 @@ IF DEFINED BUILD_DEBUG ( set WARNING_FLAGS=/Wall set SUBSYSTEM_FLAGS= set LINK_FLAGS=/link kernel32.lib user32.lib shell32.lib winmm.lib gdi32.lib opengl32.lib - set OUTPUT_DIR=builds-debug\windows + set OUTPUT_DIR=builds-debug\windows-msvc ) IF NOT DEFINED VERBOSE ( set VERBOSITY_FLAG=/nologo @@ -139,7 +144,6 @@ IF DEFINED BUILD_DEBUG ( ) REM Create the temp directory for raylib -set "ROOT_DIR=%CD%" set "TEMP_DIR=temp\release" IF DEFINED BUILD_DEBUG ( set "TEMP_DIR=temp\debug" @@ -163,9 +167,9 @@ IF NOT EXIST !TEMP_DIR!\ ( set RAYLIB_INCLUDE_FLAGS=/I"!RAYLIB_SRC!" /I"!RAYLIB_SRC!\external\glfw\include" IF DEFINED REALLY_QUIET ( - cl.exe /w /c !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! > NUL 2>&1 + cl.exe /w /c !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! > NUL 2>&1 || exit /B ) ELSE ( - cl.exe /w /c !VERBOSITY_FLAG! !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! + cl.exe /w /c !VERBOSITY_FLAG! !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! || exit /B ) IF NOT DEFINED QUIET echo COMPILE-INFO: Raylib compiled into object files in: !TEMP_DIR!\ @@ -180,13 +184,13 @@ cd !OUTPUT_DIR! REM Build the actual game IF NOT DEFINED QUIET echo COMPILE-INFO: Compiling game code. IF DEFINED REALLY_QUIET ( - cl.exe !VERBOSITY_FLAG! /Fo"main.obj" !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! > NUL 2>&1 - cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" main.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! > NUL 2>&1 + cl.exe !VERBOSITY_FLAG! !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! > NUL 2>&1 || exit /B + cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" *.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! > NUL 2>&1 || exit /B ) ELSE ( - cl.exe !VERBOSITY_FLAG! /Fo"main.obj" !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! - cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" main.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! + cl.exe !VERBOSITY_FLAG! !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! || exit /B + cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" *.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! || exit /B ) -del main.obj +del *.obj IF NOT DEFINED QUIET echo COMPILE-INFO: Game compiled into an executable in: !OUTPUT_DIR!\ REM Run upx |
