proton:linux_setup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
proton:linux_setup [2018/07/28 09:08] – [Compiling and running RTBareBones] seth | proton:linux_setup [2023/06/08 13:21] (current) – [IDEs] seth | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Compiling the examples for Linux ==== | ==== Compiling the examples for Linux ==== | ||
- | In order to build the examples | + | This page will tell you how to get some examples |
- | The build scripts available for Linux use [[http:// | + | The examples may have weird window sizes and in non-desktop environments things like mouse cursor movement won' |
==== Grabbing Proton SDK ==== | ==== Grabbing Proton SDK ==== | ||
- | Ok, this was tested on a Raspberry Pi with Stretch, but normal linux distributions should be roughly | + | First, let's install some tools and libraries we need in case you don't have them. |
+ | <code bash> | ||
+ | sudo apt install git build-essential libffi-dev zlib1g-dev libssl-dev | ||
+ | </ | ||
+ | |||
+ | Now we'll grab the ProtonSDK source tree from git. | ||
<code bash> | <code bash> | ||
Line 14: | Line 19: | ||
</ | </ | ||
- | Projects you compile are put INTO the Proton directory. | + | Projects you compile are put INTO the Proton directory. |
There is no lib/dll to make for Proton, the .cpp files are just used directly in the projects. | There is no lib/dll to make for Proton, the .cpp files are just used directly in the projects. | ||
Line 36: | Line 41: | ||
Generally with linux stuff, you make a " | Generally with linux stuff, you make a " | ||
- | So to compile | + | Before building |
<code bash> | <code bash> | ||
- | cd proton/ | + | sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev |
+ | </ | ||
+ | |||
+ | |||
+ | Before we compile it, we need to build the media. | ||
+ | |||
+ | <code bash> | ||
+ | cd ~/ | ||
+ | sh update_media.sh | ||
+ | </ | ||
+ | |||
+ | Now we need to compile RTBareBones, | ||
+ | |||
+ | <code bash> | ||
+ | cd ~/proton/ | ||
sh linux_compile.sh | sh linux_compile.sh | ||
</ | </ | ||
Line 52: | Line 71: | ||
cd ../bin | cd ../bin | ||
./ | ./ | ||
- | </bash> | + | </code> |
- | + | ||
- | On my Raspberry Pi I see a spinning triangle fullscreen. | + | |
+ | You should see a spinning triangle and some font stretching effects. | ||
====Compiling and running the other examples==== | ====Compiling and running the other examples==== | ||
- | The compilation process for the other examples is exactly the same that what was explained for RTBareBones above. But in addition the other examples than RTBareBones need resources to be built as explained here: [[proton: | + | The compilation process for the other examples is exactly the same that what was explained for RTBareBones above. |
- | For instructions how to compile RTPack | + | But in addition the other examples than RTBareBones need resources to be built as explained here: [[proton:win_setup2|Compiling RTSimpleApp]]. |
- | The resulting binary called '' | + | To do this in linux using RTPack, you need to move into your projects media directory and run build_media.sh, which itself runs RTPack/ |
- | Now let's build RTSimpleApp | + | Let's build RTSimpleApp, then build its media: |
<code bash> | <code bash> | ||
cd RTSimpleApp/ | cd RTSimpleApp/ | ||
- | mkdir build | + | sh linux_compile.sh |
- | cd build | + | cd ../media |
- | cmake .. | + | sh build_media.sh |
- | make | + | |
- | </ | + | |
- | + | ||
- | Next we'll build the resources. There is a helper script available that can be used in Linux to do this. There are similar helper scripts for Windows as well. The difference is that while there is a separate Windows script called update_media.bat for each example there is only one script for Linux that tries to take care of all the examples. | + | |
- | + | ||
- | Run the script and see it do its job: | + | |
- | + | ||
- | <code bash> | + | |
- | cd ../../media | + | |
- | ../ | + | |
- | </ | + | |
- | + | ||
- | This will convert the fonts and images to correct format and copy the converted resources to the '' | + | |
- | + | ||
- | <code bash> | + | |
cd ../bin | cd ../bin | ||
- | ../linux/ | + | ./RTSimpleApp |
</ | </ | ||
- | The rest of the examples can be compiled | + | If that worked, |
===How update_media.sh works=== | ===How update_media.sh works=== | ||
The resource building script goes to the subdirectories of the '' | The resource building script goes to the subdirectories of the '' | ||
- | |||
==== Debug builds | ==== Debug builds | ||
Line 116: | Line 118: | ||
You basically only have to run cmake manually once per build directory. After that you can just run make. If the CMakeLists.txt file has been changed it is noticed by the build scripts and cmake is run automatically with the same parameters as it was run the first time. | You basically only have to run cmake manually once per build directory. After that you can just run make. If the CMakeLists.txt file has been changed it is noticed by the build scripts and cmake is run automatically with the same parameters as it was run the first time. | ||
- | ==== Command line arguments ==== | ||
- | |||
- | The Linux versions of the examples accept a few command line arguments. You can choose the video mode and emulated environment (e.g. iOS, Android, | ||
- | |||
- | <code bash> | ||
- | [user@localhost]$ ./ | ||
- | Available video modes: | ||
- | |||
- | Windows | ||
- | Windows Wide | ||
- | OSX | ||
- | OSX Wide | ||
- | Linux | ||
- | Linux Wide | ||
- | iPhone | ||
- | iPhone Landscape | ||
- | [...] | ||
- | </ | ||
- | |||
- | You can choose any of these modes by giving the name of it as an argument to the program. For example testing how an application might look on an iPad you can command: | ||
- | |||
- | <code bash> | ||
- | ./ | ||
- | </ | ||
- | |||
- | Note that you need to enclose modes with spaces between quotes. | ||
==== IDEs ==== | ==== IDEs ==== | ||
- | All of the tools mentioned | + | I've gotten things to work ok with VScode, I use it remotely |
- | + | ||
- | As a personal preference | + | |
- | You can set multiple run configurations so you can run the applications | + | The only problem is I can't get breakpoints in ../ |
proton/linux_setup.1532768918.txt.gz · Last modified: 2018/07/28 09:08 by seth