mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Update the docs
@ -1,9 +1,9 @@
|
|||||||
To build your raylib game for GNU/Linux you need to download raylib git repository and install some dependencies. raylib already comes with ready-to-use makefiles to compile source code, examples and templates that you can use on your projects.
|
To build your raylib game for GNU/Linux you need to download raylib git repository and install some dependencies. raylib already comes with ready-to-use makefiles to compile source code, examples and templates that you can use on your projects.
|
||||||
|
|
||||||
This guide is for Ubuntu/Debian distros, that use APT as package manager; it is tested on Ubuntu 14.04.
|
This guide is for all GNU/Linux distros (I will use APT as package manager, for Debian based distros).
|
||||||
|
|
||||||
### Install basis and useful packages
|
### Install basis and useful packages
|
||||||
You have to install GCC compilers, Make tool and git (for downloading raylib repository):
|
You have to install GCC compilers, Make tool and git (for downloading raylib repository).
|
||||||
|
|
||||||
sudo apt install build-essential git
|
sudo apt install build-essential git
|
||||||
|
|
||||||
@ -11,35 +11,44 @@ You have to install GCC compilers, Make tool and git (for downloading raylib rep
|
|||||||
#### Install raylib dependencies
|
#### Install raylib dependencies
|
||||||
raylib requires GLFW3 (Windows and input management) and OpenAL Soft (audio system management). Just install them:
|
raylib requires GLFW3 (Windows and input management) and OpenAL Soft (audio system management). Just install them:
|
||||||
|
|
||||||
sudo apt install libopenal1 libopenal-dev
|
sudo apt install libopenal-dev
|
||||||
|
|
||||||
GLFW3 depends on some other libraries:
|
GLFW3 depends on some other libraries:
|
||||||
|
|
||||||
sudo apt install mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev
|
sudo apt install mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev
|
||||||
|
|
||||||
Now, you need to download GLFW3 from sources and build it (you also need cmake tool; if you have not, just do: `sudo apt install cmake`):
|
Now, you need to download GLFW3 from sources and build it (you also need cmake tool; if you don't have, just do: `sudo apt install cmake`):
|
||||||
|
|
||||||
git clone https://github.com/glfw/glfw.git glfw
|
wget https://github.com/glfw/glfw/releases/download/3.2/glfw-3.2.zip
|
||||||
|
unzip glfw-3.2.zip
|
||||||
cd glfw
|
cd glfw
|
||||||
cmake .
|
cmake .
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
#### Compile raylib source code
|
#### Build raylib source code
|
||||||
First, you need to download raylib repository from git; after you can compile it for GNU/Linux:
|
You can compile three different type of raylib library:
|
||||||
|
|
||||||
|
* The static library (default method);
|
||||||
|
* The dynamic shared library;
|
||||||
|
* The web library.
|
||||||
|
|
||||||
|
First of all, you need to download raylib repository from Github; after you can compile it:
|
||||||
|
|
||||||
git clone https://github.com/raysan5/raylib.git raylib
|
git clone https://github.com/raysan5/raylib.git raylib
|
||||||
cd raylib/src/
|
cd raylib/src/
|
||||||
make PLATFORM=PLATFORM_DESKTOP
|
make PLATFORM=PLATFORM_DESKTOP # To make the static version.
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP SHARED=YES # To make the dynamic shared version.
|
||||||
|
make PLATFORM=PLATFORM_WEB # To make web version.
|
||||||
|
|
||||||
_NOTE:_ By default raylib is compiled for OpenGL 3.3 Core graphics API backend; to compile for OpenGL 1.1 graphics API just type:
|
_NOTE:_ By default raylib is compiled for OpenGL 3.3 Core graphics API backend; to compile for OpenGL 1.1 graphics API just add `GRAPHICS=GRAPHICS_API_OPENGL_11` to the make command.
|
||||||
|
|
||||||
make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_11
|
If you want, you can install the library in the standard directories, or remove it:
|
||||||
|
|
||||||
If you want, you can move the library and header in standards directories:
|
sudo make install # Static version.
|
||||||
|
sudo make install SHARED=YES # Dynamic shared version.
|
||||||
sudo cp libraylib.a /usr/local/lib/libraylib.a
|
|
||||||
sudo mkdir /usr/local/include/raylib # If there is not the directory
|
sudo make unistall
|
||||||
sudo cp raylib.h /usr/local/include/raylib/raylib.h
|
sudo make unistall SHARED=YES
|
||||||
|
|
||||||
### Compile raylib examples
|
### Compile raylib examples
|
||||||
Just move to folder `raylib/examples/` and run:
|
Just move to folder `raylib/examples/` and run:
|
||||||
@ -54,7 +63,6 @@ To force one example recompile:
|
|||||||
|
|
||||||
make core_basic_window PLATFORM=PLATFORM_DESKTOP -B
|
make core_basic_window PLATFORM=PLATFORM_DESKTOP -B
|
||||||
|
|
||||||
|
|
||||||
**If you have any doubt, [just let me know][raysan5].**
|
**If you have any doubt, [just let me know][raysan5].**
|
||||||
|
|
||||||
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
|
[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San"
|
||||||
Reference in New Issue
Block a user