From b9a49da6f3881b2eff6aa52080ebccffa2df012d Mon Sep 17 00:00:00 2001 From: William Grant Date: Sat, 8 Jul 2023 20:25:31 +0100 Subject: [PATCH 1/2] Add -s flags to projects/CMake/CMakeLists.txt for newer versions of raylib --- projects/CMake/CMakeLists.txt | 3 +++ projects/CMake/README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 513d21e..fcd8770 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -35,6 +35,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp) if (${PLATFORM} STREQUAL "Web") # Tell Emscripten to build an example.html file. set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html") + + # Required linker flags for using Raylib with Emscripten + target_link_options(${PROJECT_NAME} PRIVATE -sEXPORTED_FUNCTIONS=['_main','_malloc'] -sEXPORTED_RUNTIME_METHODS=ccall -sUSE_GLFW=3) endif() # That's it! You should have an example executable that you can run. Have fun! diff --git a/projects/CMake/README.md b/projects/CMake/README.md index 2337682..481181e 100644 --- a/projects/CMake/README.md +++ b/projects/CMake/README.md @@ -16,7 +16,7 @@ make ``` mkdir build cd build -emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" +emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release emmake make ``` From e6d91b56cbfbaadff39323731de149fc4bc22697 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 10 Jul 2023 00:06:34 -0400 Subject: [PATCH 2/2] Add a for raylib 4.5 badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b12376d..b2b317c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png) -# raylib-cpp [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) +# raylib-cpp ![Targeting raylib 4.5](https://img.shields.io/badge/for_raylib-4.5-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for [raylib](https://www.raylib.com), a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around *raylib*'s struct interfaces. *raylib-cpp* is not required to use *raylib* in C++, but the classes do bring using the raylib API more inline with C++'s language paradigm.