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 [2012/02/26 11:59] – 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 and running RTBareBones | + | ==== Grabbing Proton SDK ==== |
- | + | ||
- | 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's a good practice to do so called out-of-source builds. This way the compiled object and other files don't pollute the source directory but instead they are put to a directory of their own. With cmake out-of-source builds are really easy. | + | |
- | + | ||
- | So fire up your console and let's start typing. | + | |
- | + | ||
- | First let's make a directory where the building will happen. | + | |
+ | First, let's install some tools and libraries we need in case you don't have them. | ||
<code bash> | <code bash> | ||
- | cd RTBareBones/ | + | sudo apt install git build-essential libffi-dev zlib1g-dev libssl-dev |
- | mkdir build | + | |
</ | </ | ||
- | Then enter that directory, call cmake and then make. | + | Now we'll grab the ProtonSDK source tree from git. |
<code bash> | <code bash> | ||
- | cd build | + | cd ~ |
- | cmake .. | + | git clone https:// |
- | make | + | |
</ | </ | ||
- | The argument to cmake (..) tells where it's supposed to search | + | Projects you compile are put INTO the Proton directory. Sort of weird, but the end result is all paths and dependencies are relative when possible which make compiling |
- | If the build finishes without errors you'll end up with a binary called '' | + | There is no lib/dll to make for Proton, |
- | 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. | + | Let's make the RTPack tool now. |
<code bash> | <code bash> | ||
- | cd ../../bin | + | cd proton/RTPack/linux |
- | ../ | + | sh linux_compile.sh |
</ | </ | ||
- | Now you should see the application window. | + | Hopefully that worked. |
- | === Compiling and running | + | **Note:** By default, RTPack is compiled with the RT_NO_PVR flag, so support for a weird texture format called PVRTC isn't included. |
- | 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: | ||
- | Compiling | + | ==== Compiling |
+ | |||
+ | This is the process | ||
+ | |||
+ | Generally with linux stuff, you make a "build" | ||
+ | |||
+ | Before | ||
<code bash> | <code bash> | ||
- | cd tools/ | + | sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev |
- | ./build.sh | + | |
</ | </ | ||
- | The resulting binary called '' | ||
- | Now let' | + | Before we compile it, we need to build the media. |
<code bash> | <code bash> | ||
- | cd RTSimpleApp/linux | + | cd ~/proton/ |
- | mkdir build | + | sh update_media.sh |
- | cd build | + | |
- | cmake .. | + | |
- | 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. | + | Now we need to compile RTBareBones, |
- | Run the script | + | <code bash> |
+ | cd ~/ | ||
+ | sh linux_compile.sh | ||
+ | </ | ||
+ | |||
+ | (If you look at linux_compile.sh, | ||
+ | |||
+ | If the build finishes without errors you'll end up with a binary called '' | ||
+ | |||
+ | To try it: | ||
<code bash> | <code bash> | ||
- | cd ../../media | + | cd ../bin |
- | ../../ | + | ./RTBareBones |
</ | </ | ||
- | This will convert the fonts and images to correct format | + | You should see a spinning triangle |
+ | ====Compiling | ||
+ | |||
+ | The compilation process for the other examples is exactly | ||
+ | |||
+ | But in addition the other examples than RTBareBones need resources to be built as explained here: [[proton: | ||
+ | |||
+ | To do this in linux using RTPack, | ||
+ | |||
+ | Let's build RTSimpleApp, | ||
<code bash> | <code bash> | ||
+ | cd RTSimpleApp/ | ||
+ | sh linux_compile.sh | ||
+ | cd ../media | ||
+ | sh build_media.sh | ||
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 | + | |
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' | 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' | ||
Line 102: | Line 114: | ||
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. | 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. | ||
- | == Building == | + | ==== 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. | 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. | ||
- | === 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.1330257586.txt.gz · Last modified: 2012/02/26 11:59 by aki