User Tools

Site Tools


proton:linux_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
proton:linux_setup [2018/07/28 08:54]
seth [Compiling the examples for Linux]
proton:linux_setup [2018/07/28 09:15] (current)
seth [Command line arguments]
Line 13: Line 13:
 git clone https://​github.com/​SethRobinson/​proton.git git clone https://​github.com/​SethRobinson/​proton.git
 </​code>​ </​code>​
 +
 +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 compiled for many platforms easier. ​ Nothing to setup.
 +
 +There is no lib/dll to make for Proton, the .cpp files are just used directly in the projects. ​ There is however a tool called RTPack that is used to build fonts (.rtfont files), images (.rttex files, don't have to use them though), and general purpose compression. (one gotcha: compressed files use the .rtpack extension EXCEPT .rtfont/​.rttex,​ those keep the same extension. ​ Proton'​s file handling automatically decompresses things when needed)
 +
 +Let's make the RTPack tool now.
 +
 +<code bash>
 +cd proton/​RTPack/​linux
 +sh linux_compile.sh
 +</​code>​
 +
 +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. ​ If you really want that, you an go download the PVRTC libs. [[proton:​rtpack|(more info here)]], but you probably don't need it unless you're trying to optimize an iOS game or something. ​ It was a big thing in 2010, I don't know about now.
 +
 +
 ==== Compiling and running RTBareBones ==== ==== Compiling and running RTBareBones ====
  
Line 19: Line 36:
 Generally with linux stuff, you make a "​build"​ directory and do your stuff there. ​ We do that too, but we do it from the <project name>/​linux/​build which is slightly different. ​ This is a side effect of linux related things being relegated to the linux dir due to the originally window-centric approach of Proton. Generally with linux stuff, you make a "​build"​ directory and do your stuff there. ​ We do that too, but we do it from the <project name>/​linux/​build which is slightly different. ​ This is a side effect of linux related things being relegated to the linux dir due to the originally window-centric approach of Proton.
  
-So to compile RTBareBones,​ just do this:+So to compile RTBareBones,​ just do:
  
 <code bash> <code bash>
Line 29: Line 46:
  
 If the build finishes without errors you'll end up with a binary called ''​RTBareBones''​ in the ../bin directory. If the build finishes without errors you'll end up with a binary called ''​RTBareBones''​ in the ../bin directory.
-==== 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:​win_setup2|Compiling RTSimpleApp]]. You can do this resource building in Linux as well. The difference is that you need to compile the RTPack tool before ​it can be done. +To try it:
- +
-For instructions how to compile RTPack in Linux see [[proton:​rtpack|instructions from here]]. +
- +
-The resulting binary called ''​RTPack''​ will appear to a subdirectory called ''​build''​. Let it stay there. +
- +
-Now let's build RTSimpleApp just like RTBareBones:+
  
 <code bash> <code bash>
-cd RTSimpleApp/linux +cd ../bin 
-mkdir build +./​RTBareBones
-cd build +
-cmake .+
-make+
 </​code>​ </​code>​
  
-Next we'll build the resourcesThere 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 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.+On my Raspberry Pi I see a spinning triangle fullscreen Under Gnome or something I assume it would open in a window due to SDL2 being smart? (Not sure, didn't test it-Seth )
  
-Run the script ​and see it do its job:+====Compiling ​and running the other examples====
  
-<code bash> +The compilation process for the other examples is exactly the same that what was explained for RTBareBones above
-cd ../​../​media +
-../​../​tools/​linux/​update_media.sh +
-</​code>​+
  
-This will convert ​the fonts and images to correct format and copy the converted ​resources to the ''​bin''​ directory of the exampleNext you can run the example:+But in addition ​the other examples than RTBareBones need resources to be built as explained here: [[proton:​win_setup2|Compiling RTSimpleApp]] 
 + 
 +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/​linux/​build_media.sh to do the work. 
 + 
 +Let's build RTSimpleApp,​ then build its media:
  
 <code bash> <code bash>
 +cd RTSimpleApp/​linux
 +sh linux_compile.sh
 +cd ../media
 +sh build_media.sh
 cd ../bin cd ../bin
-../linux/​build/​rtsimpleapp+./RTSimpleApp
 </​code>​ </​code>​
  
-The rest of the examples can be compiled ​and run in a similar way.+If that worked, ​the final stuff (.rtfont and .rttex and .rtpack files probably) will be copied into ../​bin/​interface, ​and you'​ll ​run the app.
  
-=== How update_media.sh works ===+===How update_media.sh works===
  
 The resource building script goes to the subdirectories of the ''​media''​ directory and converts fonts and images to the Proton format. It uses a configuration file called ''​texture_conversion_flags.txt''​ that contains options for converting the images. The examples'​ ''​media''​ directories already contain these configuration files but if you'll build your own applications and want to use this system make sure you have these files in place. The resource building script goes to the subdirectories of the ''​media''​ directory and converts fonts and images to the Proton format. It uses a configuration file called ''​texture_conversion_flags.txt''​ that contains options for converting the images. The examples'​ ''​media''​ directories already contain these configuration files but if you'll build your own applications and want to use this system make sure you have these files in place.
- 
 ==== Debug builds ​ ==== ==== Debug builds ​ ====
  
Line 90: Line 101:
  
 ==== Command line arguments ==== ==== Command line arguments ====
 +
 +**Note 7/​28/​2018:​** ​ I don't think any of this applies anymore since I switched the linux builds to use the normal SDL/​SDL2Main.cpp file as a base? -Seth
  
 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,​...) from a predefined set of presets. You can get a list of the available modes by running any of the examples with option ''​-l''​. 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,​...) from a predefined set of presets. You can get a list of the available modes by running any of the examples with option ''​-l''​.
  
 <code bash> <code bash>
-[user@localhost]$ ./rtsimpleapp ​-l+[user@localhost]$ ./RTSimpleApp ​-l
 Available video modes: Available video modes:
  
Line 111: Line 124:
  
 <code bash> <code bash>
-./rtsimpleapp ​"iPad Landscape"​+./RTSimpleApp ​"iPad Landscape"​
 </​code>​ </​code>​
  
proton/linux_setup.1532768096.txt.gz · Last modified: 2018/07/28 08:54 by seth