Results 1 to 18 of 18

Thread: Building RTBareBones on Linux and a small fix

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Lesser Knight
    Join Date
    Jan 2012
    Location
    Finland
    Posts
    31

    Default Building RTBareBones on Linux and a small fix

    Hello everybody, new first time poster here

    I checked out Proton source code yesterday and started tinkering with it. The first thing I set out to do was to build the Android version of RTBareBones and try it out. As my development environment is Linux I had to try things out a bit in order to get things running. By following the instructions for Windows [1] and looking at the various .bat scripts this was actually very easy (way easier than on Windows actually, since Android NDK usage on Linux is so much easier).

    I did have to do one small change to the source code. The file shared/GUI/RTFont.h includes RTFontFileFormat.h but the file name is actually rtfontfileformat.h the only difference being the case of the letters. I changed the include to the lower case file name but as good a change would be to change the rtfontfileformat.h file to CamelCase. This discrepancy obviously makes no difference on Windows but on Linux where file name case matters it stopped the compilation. I leave it to Seth to decide which change to make to the source code do you prefer CamelCase headers or is rtfontfileformat.h lower case for some reason.

    With that change in place I run these commands:

    Code:
    $> cd RTBareBones/android
    $> android update project -p .
    $> ndk-build
    $> mkdir -p assets/interface
    $> cp ../bin/interface/* assets/interface/
    $> ant debug
    That produced the .apk file which I was then able to install to a device and run. Easy enough

    Running 'android update project -p .' modified RTBareBones/android/local.properties to have the correct Android SDK location it says in the file comments that this file shouldn't be checked in to a version control system in the first place

    I did have the latest versions of Android SDK and NDK setup and in use already before starting this, so that eased things up compared to the Windows quide [1].

    Next I'm thinking to try to run the barebones example on a Linux desktop which I suppose will need a bit more coding...

    Cheers, Aki

    [1] http://www.rtsoft.com/wiki/doku.php?...:android_setup

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Thanks very much for the info! - I've gone ahead and changed rtfontfileformat.h to RTFontFileFormat.h on svn.

    Hmm, didn't know about 'android update project -p', I should probably kill local.properties as you suggest and possibly have that run every time it's built... one less thing to worry about.
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Lesser Knight
    Join Date
    Jan 2012
    Location
    Finland
    Posts
    31

    Default

    Thanks for the reply.

    Quote Originally Posted by Seth View Post
    Thanks very much for the info! - I've gone ahead and changed rtfontfileformat.h to RTFontFileFormat.h on svn.
    Bit of a mistake there: the file is now called RTFileFormat.h in svn missing "Font" from between.

    Quote Originally Posted by Seth View Post
    Hmm, didn't know about 'android update project -p', I should probably kill local.properties as you suggest and possibly have that run every time it's built... one less thing to worry about.
    It's enough to ever run the 'android update project' command only once. Unless you change the Android SDK location, the Android build target version or something similar.

    In other news: today I've been hacking together a Linux desktop version of the barebones example and after a lot of copy-pasting code (from the WebOS side mostly) I managed to get it running It's using SDL like the WebOS version so it was mostly just copying stuff and commenting out things that didn't make sense to me. What I've got now is the barebones example running on a window and with ESC it terminates. Animations of the example seem to run. I don't really know what else works and what not.

    That's enough for today, I'm off to bed now

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Bit of a mistake there: the file is now called RTFileFormat.h in svn missing "Font" from between.
    Oh god, arghg, sloppy. :wheelchair: Fixed...!

    It's using SDL like the WebOS version so it was mostly just copying stuff and commenting out things that didn't make sense to me. What I've got now is the barebones example running on a window and with ESC it terminates. Animations of the example seem to run. I don't really know what else works and what not.
    Excellent.. hmm, yeah I hadn't really though of taking advantage of SDL for a linux version, but it makes a lot of sense.

    One problem I assume you'll hit when you get to other samples is the command line util RTPack.exe - (turns jpgs/pngs into .rttex optimized texture format, converts bmfont files to .rtfont, etc) - without it there is no way to build resources in linux.

    However, in theory it CAN be tweaked to compile in linux (its source is in tools/RTPack), it does require Clanlib V1.X though. It does use PVR libraries to output pvrct compression which I don't think have linux versions, but that support could be #ifdef'ed out, ... I never use it anyway.

    It's enough to ever run the 'android update project -p' command only once.
    My thinking is by putting that in the normal build scripts people would never have to even think about running in once - aiming for "easy as possible", but with Android setups.. man, long way to go.

    Anyway, good stuff.
    Seth A. Robinson
    Robinson Technologies

  5. #5
    Lesser Knight
    Join Date
    Jan 2012
    Location
    Finland
    Posts
    31

    Default

    Quote Originally Posted by Seth View Post
    One problem I assume you'll hit when you get to other samples is the command line util RTPack.exe - (turns jpgs/pngs into .rttex optimized texture format, converts bmfont files to .rtfont, etc) - without it there is no way to build resources in linux.

    However, in theory it CAN be tweaked to compile in linux (its source is in tools/RTPack), it does require Clanlib V1.X though. It does use PVR libraries to output pvrct compression which I don't think have linux versions, but that support could be #ifdef'ed out, ... I never use it anyway.
    Third day in a row, third project compiling on Linux Today I tweaked the RTPack tool to compile on Linux. It turned out Imagination provides the PVRTexLib for linux too (even both 32 and 64 bit versions). So I didn't have to ifdef any functionality out. I haven't yet tested the tool though. It compiles and when run without arguments it prints the help text. That's precisely how much I know currently. Tomorrow I'll check if the functionality also works.

    Btw. I have been using CMake for the build scripts. There are now build scripts for the barebones example and the RTPack tool.

    Next I'll check if RTPack really works here too and try to get the RTSimpleApp running on Linux. After that I could clean up the changed code and scripts a bit and start submitting patches.

  6. #6
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Excellent!!
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Small patches from me
    By user in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 07-29-2011, 10:01 AM
  2. Many errors in Android build ( RTBareBones )
    By mmortall in forum Proton SDK
    Replies: 5
    Last Post: 06-19-2011, 05:54 PM
  3. Problem with RTBareBones.xcodeproj
    By rzuf in forum Proton SDK
    Replies: 1
    Last Post: 11-02-2010, 01:16 PM
  4. Small patch
    By Jonanin in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-04-2010, 09:18 AM
  5. Building Novashell on Linux.
    By erikharrison in forum Novashell Game Creation System
    Replies: 2
    Last Post: 04-01-2009, 09:25 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •