mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Updated Easy Raylib Setup for Windows with Visual Studio (markdown)
@ -4,64 +4,78 @@
|
||||
## Download Visual Studio 2019
|
||||
Get Visual Studio from https://visualstudio.microsoft.com/downloads/
|
||||
The community edition is free and is perfectly suited for game development with raylib.
|
||||
|
||||

|
||||
|
||||
## Install Visual Studio
|
||||
Run the installer to put Visual Studio 2019 on your computer. See https://docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=msvc-160 for more info.
|
||||
Be sure to install the Desktop development with C++ and Universal Windows Platform development workflows.
|
||||
|
||||

|
||||
|
||||
## Create a folder for your game
|
||||
Create a folder for you game. It can be anywhere on your computer.
|
||||
|
||||

|
||||
|
||||
## Download the Raylib Sources
|
||||
Download the raylib source code, from
|
||||
https://github.com/raysan5/raylib
|
||||
You can get the zip file or clone the repository in git, both will work the same.
|
||||
|
||||

|
||||
|
||||
## Copy Raylib into your game folder
|
||||
Extract the zip file, or copy the cloned raylib repository into a folder named raylib in your game folder. source code.
|
||||
|
||||

|
||||
This folder should contain all the raylib
|
||||
|
||||
## Download Premake5
|
||||
Download premake version 5.0 from https://premake.github.io/
|
||||
|
||||

|
||||
|
||||
Put the premake5. Exe into your game folder.
|
||||
|
||||

|
||||
|
||||
## Download the premake5.lua file from raylibExras
|
||||
Download the premake5.lua and premake-2019.bat files from
|
||||
https://github.com/JeffM2501/raylibExtras/tree/index/Premake/Game
|
||||
|
||||

|
||||
Copy them into your game folder.
|
||||
|
||||
## Create a folder for your game source code
|
||||
Make a folder for your actual game’s source code. In this case we will be starting with the “advanced game” template from the raylib sources, since it is a great place to start any project from.
|
||||
|
||||

|
||||
|
||||
## Setup premake5.lua file
|
||||
Open the premake5.lua file in notepad++ or some other text editor (regular notepad is fine).
|
||||
Find the two instances of “YourGame” and replace them with the name of your game project.
|
||||
|
||||

|
||||

|
||||
Save the file and close it.
|
||||
|
||||
## Run premake-2019.bat
|
||||
Double click the premake-2019.bat file, or run it from a console. This will generate all the visual studio project files for the game. You will end up with a .sln file for your game in the root folder.
|
||||
|
||||

|
||||
|
||||
The same premake system can be used on linux, just use the command premake5 gmake instead of premake5 vs2019
|
||||
|
||||
## Open your .sln file
|
||||
Double click the sln file to open your game project in Visual Studio. It will include both your game files and the raylib library, all ready to build.
|
||||
|
||||

|
||||
|
||||
## Develop your game.
|
||||
You can now build, debug, and run your game from Visual Studio.
|
||||
![image](https://user-images.githubusercontent.com/322174/107885060-de6c4580-6eac-11eb-87a5-9a209cb03a7a.png
|
||||
![image](https://user-images.githubusercontent.com/322174/1078850
|
||||
60-de6c4580-6eac-11eb-87a5-9a209cb03a7a.png
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user