proton:linux_setup
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
proton:linux_setup [2012/02/26 11:21] – created aki | 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' |
- | === Compiling RTBareBones === | + | ==== Grabbing Proton SDK ==== |
+ | |||
+ | 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> | ||
+ | cd ~ | ||
+ | git clone https:// | ||
+ | </ | ||
+ | |||
+ | 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. | ||
+ | |||
+ | Let's make the RTPack tool now. | ||
+ | |||
+ | <code bash> | ||
+ | cd proton/ | ||
+ | sh linux_compile.sh | ||
+ | </ | ||
+ | |||
+ | Hopefully that worked. | ||
+ | |||
+ | **Note:** By default, RTPack is compiled with the RT_NO_PVR flag, so support for a weird texture format called PVRTC isn't included. | ||
+ | |||
+ | |||
+ | ==== Compiling | ||
This is the process I follow when compiling the examples. You may vary this to your needs if you want since cmake is quite flexible in what it can do. But it's a safe bet to follow these quidelines if you are not yet too familiar with cmake. | This is the process I follow when compiling the examples. You may vary this to your needs if you want since cmake is quite flexible in what it can do. But it's a safe bet to follow these quidelines if you are not yet too familiar with cmake. | ||
- | It' | + | Generally with linux stuff, you make a " |
- | So fire up your console | + | Before building RTBareBones, |
- | First let's make a directory where the building will happen. | + | <code bash> |
+ | sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev | ||
+ | </ | ||
+ | |||
+ | |||
+ | Before we compile it, we need to build the media. This is where we build fonts, and convert jpg/pngs etc into more optimized formats. | ||
<code bash> | <code bash> | ||
- | cd RTBareBones/ | + | cd ~/proton/RTBareBones/ |
- | mkdir build | + | sh update_media.sh |
</ | </ | ||
- | Then enter that directory, call cmake and then make. | + | Now we need to compile RTBareBones, just do: |
<code bash> | <code bash> | ||
- | cd build | + | cd ~/ |
- | cmake .. | + | sh linux_compile.sh |
- | make | + | |
</ | </ | ||
- | The argument to cmake (..) tells where it's supposed to search for the CMakeLists.txt | + | (If you look at linux_compile.sh, it creates |
- | If the build finishes without errors you'll end up with a binary called '' | + | If the build finishes without errors you'll end up with a binary called '' |
- | In order to run the compiled program you'll need to change to the directory which contains the images and other resources and execute the binary from there. This way the program can find the resources and load them correctly. | + | To try it: |
<code bash> | <code bash> | ||
- | cd ../../bin | + | cd ../bin |
- | ../ | + | ./RTBareBones |
</ | </ | ||
- | Now you should see the application window. | + | You should see a spinning triangle and some font stretching effects. |
+ | ====Compiling and running the other examples==== | ||
- | === Building RTPack | + | 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: | ||
+ | |||
+ | To do this in linux using RTPack, you need to move into your projects media directory and run build_media.sh, | ||
+ | |||
+ | Let's build RTSimpleApp, | ||
+ | |||
+ | <code bash> | ||
+ | cd RTSimpleApp/ | ||
+ | sh linux_compile.sh | ||
+ | cd ../media | ||
+ | sh build_media.sh | ||
+ | cd ../bin | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | If that worked, the final stuff (.rtfont and .rttex and .rtpack files probably) will be copied into ../ | ||
+ | |||
+ | ===How update_media.sh works=== | ||
+ | |||
+ | The resource building script goes to the subdirectories of the '' | ||
+ | ==== Debug builds | ||
+ | |||
+ | The process described above for building the examples produces a binary that can be called a release build. We didn't give any special instructions for cmake so it chose the default settings. Especially the binary doesn' | ||
+ | |||
+ | Let's use the RTBareBones as an example. This is one place where the out-of-source builds used above come handy. You already have a release build made to a directory '' | ||
+ | |||
+ | <code bash> | ||
+ | cd RTBareBones/ | ||
+ | mkdir build-debug | ||
+ | cd build-debug | ||
+ | cmake -DCMAKE_BUILD_TYPE=Debug .. | ||
+ | make | ||
+ | </ | ||
+ | Now you have the debug and release builds in separate subdirectories and they don't mess with each other. You can off course have more subdirectories to different kinds of builds as you desire. | ||
- | === update_media | + | ==== Building ==== |
+ | 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. | ||
- | === debug builds === | ||
+ | ==== IDEs ==== | ||
- | === IDEs === | + | I've gotten things to work ok with VScode, I use it remotely on my Windows machine and ssh into the linux box. I set the project dir to " |
+ | The only problem is I can't get breakpoints in ../ | ||
proton/linux_setup.txt · Last modified: 2023/06/08 13:21 by seth