Compare commits

..

12 Commits

Author SHA1 Message Date
449e777902 update raylib to 4.5 2023-07-17 16:25:13 +03:00
Jonathan Moallem
feb10e3dd3
Updated Makefile explanation to reflect raylib 4.2.3 changes 2022-07-06 21:25:39 +10:00
Jonathan Moallem
254969d834
Merge pull request #17 from return215/update-raylib-cpp
Update raylib-cpp to 4.2.3
2022-07-06 21:23:31 +10:00
return215
0b445b10ba Add contributor to README 2022-07-06 09:22:49 +07:00
return215
f8e5c9ce55 Update makefile to use raylib submodule 2022-07-02 09:28:29 +07:00
return215
554392bfba Update raylib-cpp to 4.2.3
raylib-cpp no longer vendors raylib 4.0, so raylib has to be added
as a separate submodule.
2022-07-02 09:20:58 +07:00
Aryeh
87a7a9b673
Merge pull request #16 from CapsCollective/remove-license-clause
Removed third clause from License
2022-02-22 16:31:25 +11:00
Aryeh
6c08a8d73e updated makefile to include zlib license 2022-02-13 16:35:38 +11:00
jason-cannon
8e46d1769e
Updated raylib-cpp to 4.0.1 and raylib to 4.0 (#14)
* Updating Raylib-CPP to 4.0.1

* Updating Contributor List

Co-authored-by: Jason Cannon <jcannon98188@gmail.com>
2021-11-23 18:51:01 +11:00
Jonathan Moallem
5a09daf7d6
Merge pull request #13 from CapsCollective/use-cxxflags
Updated Makefile to use CXXFLAGS for macro passing
2021-10-15 08:10:35 +11:00
Jonathan Moallem
e18255ba57
Updated readme content 2021-10-07 23:38:43 +11:00
Jonathan Moallem
f735e84d8c
Updated macro passing in Makefile to use CXXFLAGS 2021-10-07 23:36:59 +11:00
8 changed files with 33 additions and 22 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "vendor/raylib-cpp"]
path = vendor/raylib-cpp
url = https://github.com/robloach/raylib-cpp
[submodule "vendor/raylib"]
path = vendor/raylib
url = https://github.com/raysan5/raylib

View File

@ -1,3 +1,9 @@
# Copyright (c) 2020 Jonathan Moallem (@J-Mo63) & Aryeh Zinn (@Raelr)
#
# This code is released under an unmodified zlib license.
# For conditions of distribution and use, please see:
# https://opensource.org/licenses/Zlib
# Define custom functions
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
platformpth = $(subst /,$(PATHSEP),$1)
@ -11,9 +17,6 @@ objects := $(patsubst src/%, $(buildDir)/%, $(patsubst %.cpp, %.o, $(sources)))
depends := $(patsubst %.o, %.d, $(objects))
compileFlags := -std=c++17 -I include
linkFlags = -L lib/$(platform) -l raylib
ifdef MACRO_DEFS
macroDefines := -D $(MACRO_DEFS)
endif
# Check for Windows
ifeq ($(OS), Windows_NT)
@ -68,15 +71,15 @@ submodules:
# Copy the relevant header files into includes
include: submodules
$(MKDIR) $(call platformpth, ./include)
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
$(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
$(call COPY,depends/raylib/src,./include,raylib.h)
$(call COPY,depends/raylib/src,./include,raymath.h)
$(call COPY,depends/raylib-cpp/include,./include,*.hpp)
# Build the raylib static library file and copy it into lib
lib: submodules
cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
cd depends/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
$(MKDIR) $(call platformpth, lib/$(platform))
$(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
$(call COPY,depends/raylib/$(libGenDir),lib/$(platform),libraylib.a)
# Link the program and create the executable
$(target): $(objects)
@ -88,7 +91,7 @@ $(target): $(objects)
# Compile objects to the build directory
$(buildDir)/%.o: src/%.cpp Makefile
$(MKDIR) $(call platformpth, $(@D))
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines)
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS)
# Run the executable
execute:

View File

@ -92,18 +92,18 @@ $ make ARGS="--somearg"
```
### Specifying Custom Macro Definitions
You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using the `MACRO_DEFS` flag:
You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using `CXXFLAGS`:
#### macOS & Linux
```console
$ make MACRO_DEFS=MY_MACRO
$ make CXXFLAGS=-DMY_MACRO=1
```
#### Windows
```console
> mingw32-make MACRO_DEFS=MY_MACRO
> mingw32-make CXXFLAGS=-DMY_MACRO=1
```
### Specifying a Non-Default Compiler
@ -127,9 +127,9 @@ $ make CXX=g++
It's pretty simple actually:
1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork)
2. Create your feature branch (git checkout -b cool-new-feature)
3. Commit your changes (git commit -m "Added some feature")
4. Push to the branch (git push origin cool-new-feature)
2. Create your feature branch (`git checkout -b cool-new-feature`)
3. Commit your changes (`git commit -m "Added some feature"`)
4. Push to the branch (`git push origin cool-new-feature`)
5. Create a new pull request for it!
### Contributors
@ -137,6 +137,8 @@ It's pretty simple actually:
- [Raelr](https://github.com/Raelr) Aryeh Zinn - co-creator, maintainer
- [mTvare6](https://github.com/mTvare6) mTvare6 - contributor
- [rafaeldelboni](https://github.com/rafaeldelboni) Rafael Delboni - contributor
- [jason-cannon](https://github.com/jason-cannon) Jason Cannon - contributor
- [return215](https://github.com/return215) Muhammad Hidayat - contributor
## Licence

1
depends/raylib Submodule

@ -0,0 +1 @@
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64

1
depends/raylib-cpp Submodule

@ -0,0 +1 @@
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef

View File

@ -111,7 +111,7 @@ include: submodules
...
```
`submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib-cpp repository under the `/vendor` directory and then raylib itself under its own `/vendor` directory. The reason for this, is to make sure that the pulled versions of raylib and the bindings match in version. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
`submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib and raylib-cpp repositories. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
```Makefile
submodules:
git submodule update --init --recursive
@ -125,8 +125,8 @@ Next, the target proceeds to call another custom function, `COPY` (a platform ag
```Makefile
include: submodules
$(MKDIR) $(call platformpth, ./include)
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
$(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
$(call COPY,vendor/raylib/src,./include,raylib.h)
$(call COPY,vendor/raylib/src,./include,raymath.h)
$(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
```
@ -139,9 +139,9 @@ Moving on to the body of the target, we move into raylib's `/src` directory and
To complete the target, it then copies that library file into the relevant directory for your platform under `/lib`.
```Makefile
lib: submodules
cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
$(MKDIR) $(call platformpth, lib/$(platform))
$(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
cd vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
$(MKDIR) $(call platformpth, lib/$(platform))
$(call COPY,vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
```
Once all of these targets have been fulfilled, `setup` ends and your project should now contain a copy of the relevant static library for your platform in `/lib`, and all the necessary header files under `/include`.

1
vendor/raylib vendored Submodule

@ -0,0 +1 @@
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64

2
vendor/raylib-cpp vendored

@ -1 +1 @@
Subproject commit 725379892203da857593547e93fc30044e239ab6
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef