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 revisionPrevious revision
Next revisionBoth sides next revision
proton:linux_setup [2012/02/26 11:59] akiproton:linux_setup [2012/02/26 14:42] aki
Line 5: Line 5:
 The build scripts available for Linux use [[http://www.cmake.org/|cmake]] so you have to have that installed. In addition you need a bunch of other usual build tools like gcc, libc, make and possibly others. The Linux version uses SDL so you'll also need some development packages for SDL. It's usually called SDL-devel and in order to hear sounds you'll also need SDL_mixer-devel. This is not a complete list of the dependencies so you might need to try if the building succeeds and if not then install some more dependencies. Sometimes the build process outputs a sane error message that tells what is missing, sometimes it doesn't. Good luck :-P The build scripts available for Linux use [[http://www.cmake.org/|cmake]] so you have to have that installed. In addition you need a bunch of other usual build tools like gcc, libc, make and possibly others. The Linux version uses SDL so you'll also need some development packages for SDL. It's usually called SDL-devel and in order to hear sounds you'll also need SDL_mixer-devel. This is not a complete list of the dependencies so you might need to try if the building succeeds and if not then install some more dependencies. Sometimes the build process outputs a sane error message that tells what is missing, sometimes it doesn't. Good luck :-P
  
-=== Compiling and running RTBareBones ===+==== Compiling and running RTBareBones ====
  
 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.
Line 41: Line 41:
 Now you should see the application window. Now you should see the application window.
  
-=== 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: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. 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.
Line 82: Line 82:
 The rest of the examples can be compiled and run in a similar way. The rest of the examples can be compiled and run in a similar way.
  
-== 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 and other tricks ===+==== 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't contain any debug symbols so it's not really suitable for a debugger. Luckily doing debug builds with cmake is quite easy. 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't contain any debug symbols so it's not really suitable for a debugger. Luckily doing debug builds with cmake is quite easy.
Line 102: Line 102:
 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 ===+==== 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,...) 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>
 +[user@localhost]$ ./rtsimpleapp -l
 +Available video modes:
 +
 +Windows
 +Windows Wide
 +OSX
 +OSX Wide
 +Linux
 +Linux Wide
 +iPhone
 +iPhone Landscape
 +[...]
 +</code>
 +
 +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>
 +./rtsimpleapp "iPad Landscape"
 +</code>
 +
 +Note that you need to enclose modes with spaces between quotes.
 +
 +==== IDEs ====
 +
 +All of the tools mentioned on this page work from the command line. It means that no IDE is chosen for you beforehand. You are free to use any editor or IDE you like, be it emacs or vi or something more sophisticated.
 +
 +As a personal preference I'm using QtCreator. It has a nice built-in importer for cmake projects. Although QtCreator is mainly meant for Qt development it's a great IDE for any C++ development. You can open the CMakeLists.txt file with QtCreator and it automatically imports the project in to the IDE. You might need to set some paths or such in the project settings but it's relatively easy to get the building work with Ctrl+B and running with Ctrl+R. QtCreator also has a great UI for debugger.
 +
 +You can set multiple run configurations so you can run the applications with different command line arguments for example - perhaps setting a different window resolution for each configuration.
  
proton/linux_setup.txt · Last modified: 2023/06/08 13:21 by seth