- What is This Repo?
- How to Create a New Project?
- Windows Build Steps
- Web Build Steps
- Automatic Deployment
- Viewing Your Published Project
- Further Resources
This repository is designed to jumpstart your Raylib projects, offering pre-configurations for Windows and Web builds. The libraries are already pre-compiled for Visual Studio 2022 and Emscripten. GitHub Actions handle web builds and deployments automatically.
- Copy the
HelloRaylibfolder from theprojectsdirectory. - Rename this copied folder to your project's name.
- Modify the
CMakeLists.txtwithin your newly named folder.project("Your_Project_Name")
- Include your project in the root
CMakeLists.txt.add_subdirectory("projects/Your_Project_Name")
- Create a directory named
vs.mkdir vs
- Move into that directory.
cd vs - Generate the build files.
cmake .. -G "Visual Studio 17 2022" - When building don't forget to set the working library for your build.
- Right-click on your project in the Solution Explorer.
- Select
Properties. - Under
Configuration Properties>Debugging>Working Directory, set the path to the directory containing your project's executable. - it should be located at
bin/<project-name>/Debugorbin/<project-name>/Release
- Make sure you select a single startup project in the Solution Explorer.
- Right-click on your solution in the Solution Explorer.
- Select
Set Startup Projects.... - Select
Single startup projectand select your project from the dropdown menu.
- Install Docker for Windows.
- Run
windows_docker_build_web.bat. - Locate your build in
bin/Emscripten/Your_Project_Name/. - To serve the project locally, use the following commands:
- Navigate to emscripten build location folder
cd bin/Emscripten/Your_Project_Name/
- Invoke
emrunemrun Your_Project_Name.html
- Navigate to emscripten build location folder
Make sure to enable GitHub Pages in your repository settings to benefit from automatic deployments through GitHub Actions.
After enabling GitHub Pages and once the GitHub Actions build is complete, your project can be accessed at:
https://<github-username>.github.io/RepositoryName/Project/Project.html
Example Game