From f3a258ad69aa2bf1d1c7e5958d8a756a9aef9a71 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Nov 2017 13:24:02 +0100 Subject: [PATCH] Updated Compile for Raspberry Pi (markdown) --- Compile-for-Raspberry-Pi.md | 42 ++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/Compile-for-Raspberry-Pi.md b/Compile-for-Raspberry-Pi.md index 5784474..15fb7fd 100644 --- a/Compile-for-Raspberry-Pi.md +++ b/Compile-for-Raspberry-Pi.md @@ -1,30 +1,52 @@ -To build your raylib game for Raspberry Pi you need to download raylib git repository and install some dependencies. raylib already comes with ready-to-use makefiles to compile source code and examples. +To build your raylib game for Raspberry Pi you need to download raylib git repository (develop branch recommended) and install some dependencies. raylib already comes with ready-to-use makefiles to compile source code and examples. -### Supported Devices +### Supported Devices and OS -Right now, we only support the [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) OS on Raspberry Pi 2 & 3 devices. +Currently ALL Raspberry Pi devices are supported by raylib (1, 2, 3, Zero and variants). OS suppoted are Raspbian Jessie (latest update) and [Raspbian Stretch](https://www.raspberrypi.org/downloads/raspbian/). + +### Supported OpenGL backends + + - OpenGL ES 2.0 in native mode (no X11) + - OpenGL 1.1 on X11 desktop mode (**only RPI 2 and 3**) + - OpenGL 2.1 on X11 desktop mode (**only RPI 2 and 3**) ### Installing dependencies -raylib only requires one additional library dependency to the ones that already comes with Raspbian, this library is OpenAL Soft (audio system management). Just install it: +raylib only requires one additional library dependency to the ones that already comes with Raspbian if used in native mode, this library is OpenAL Soft (audio system management). Just install it: sudo apt-get install libopenal1 libopenal-dev +If using raylib on desktop mode, another additional dependency is required: + + sudo apt-get install libglfw3 + ### Compiling raylib source code -Before compiling your game, raylib library must be recompiled for Raspbian. To do that, just navigate to `raylib\src\` directory and run: +Before compiling your game, raylib library must be recompiled for Raspbian. To do that, just navigate to `raylib\src\` directory and run one of the following options depending on your needs: - make PLATFORM=PLATFORM_RPI +1. To use OpenGL ES 2.0 in native mode (no X11): +``` +make PLATFORM=PLATFORM_RPI +``` +2. To use desktop OpenGL 1.1 or 2.1 (X11 window) +``` +make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21 +``` ### Compiling raylib examples -Just move to folder `raylib/examples/` and run: - make PLATFORM=PLATFORM_RPI RAYLIB_PATH=.. +Just move to folder `raylib/examples/` and run one of those options (depending on target OpenGL version): + + make PLATFORM=PLATFORM_RPI + make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21 To compile just one specific example: - make core/core_basic_window PLATFORM=PLATFORM_RPI RAYLIB_PATH=.. + make core/core_basic_window PLATFORM=PLATFORM_RPI + make core/core_basic_window PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21 To force one example recompile: - make core/core_basic_window PLATFORM=PLATFORM_RPI -B RAYLIB_PATH=.. + make core/core_basic_window PLATFORM=PLATFORM_RPI -B + make core/core_basic_window PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21 -B +