Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

2016-october-recap.html 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <style>
  6. #header
  7. {
  8. background: #2BA6E3;
  9. padding: 0.7em;
  10. text-align: left;
  11. }
  12. #header a
  13. {
  14. color: white;
  15. text-decoration: none;
  16. padding: 0.5em 1em 0.5em 1em;
  17. }
  18. .news_item
  19. {
  20. background: #FFFFFF;
  21. width: 720px;
  22. padding: 1em;
  23. margin-top: 2em;
  24. margin-bottom: 2em;
  25. border: 1px solid #E0E0E0;
  26. text-align: left;
  27. }
  28. .news_item_contents
  29. {
  30. color: #444;
  31. line-height: 1.5em;
  32. }
  33. .news_item_date
  34. {
  35. margin-bottom: 2em;
  36. color: #aaa;
  37. }
  38. body
  39. {
  40. background: #FAFAFA;
  41. }
  42. code, pre
  43. {
  44. font-family: monospace, serif;
  45. font-size: 1em;
  46. color: #7f0a0c;
  47. }
  48. figure
  49. {
  50. margin: 0px;
  51. padding: 0px;
  52. }
  53. img
  54. {
  55. width: 720px;
  56. }
  57. html
  58. {
  59. font-family: sans-serif;
  60. }
  61. a
  62. {
  63. color: #3A91CB;
  64. text-decoration: none;
  65. }
  66. #lang
  67. {
  68. float: right;
  69. }
  70. figcaption
  71. {
  72. color: #aaa;
  73. }
  74. table
  75. {
  76. border-collapse: collapse;
  77. }
  78. table, th, td
  79. {
  80. border: 1px solid #aaa;
  81. padding: 0.5em;
  82. margin-top: 0.5em;
  83. margin-bottom: 0.5em;
  84. }
  85. </style>
  86. </head>
  87. <body>
  88. <center>
  89. <div id="header">
  90. <a href="../../en/news/index.html">News</a>
  91. <a href="../../en/page/games.html">Games</a>
  92. <a href="../../en/page/about.html">About</a>
  93. <div id="lang">
  94. <a href="2016-october-recap.html">EN</a>
  95. <a href="../../ru/news/2016-october-recap.html">RU</a>
  96. </div>
  97. </div>
  98. <h1>In the news</h1>
  99. <div class="news_item">
  100. <h2 class="news_item_title">
  101. <a href="2016-october-recap.html">October 2016 recap</a>
  102. </h2>
  103. <p class="news_item_date">
  104. 2016-11-19 00:00
  105. </p>
  106. <div class="news_item_contents">
  107. <figure>
  108. <img src="../../images/2016-11-19_2016-october-recap.png" alt="Gaining Android support was like climbing a mountain for us" /><figcaption>Gaining Android support was like climbing a mountain for us</figcaption>
  109. </figure>
  110. <p>This article describes how we spent a month building OpenSceneGraph (OSG) for Android: the first attempt to build OSG, the search for OSG alternatives, and the success in building OSG.</p>
  111. <p><strong>First attempt to build OSG.</strong></p>
  112. <p>Having no prior knowledge of Android development, we grabbed the latest Android Studio and started doing beginner tutorials. We passed Java part pretty fast. Everything worked out of the box. Then came C++ part and related problems.</p>
  113. <p><strong>CMake. </strong>To work with C++, Android Studio uses custom CMake, which conflicts with the system one. This was a clear indication that we had to set up a separate development environment specifically for Android.</p>
  114. <p><strong>KVM. </strong>We got Ubuntu under VirtualBox installed. All went fine until we tried to use Android Emulator. Turned out, VirtualBox could not run Android Emulator, because a virtual machine cannot provide kernel virtualization inside already virtualized environment.</p>
  115. <p><strong>Chroot for Android. </strong>Since we had a successful experience with chroot to build OGS Editor before, we decided to place Android development environment into chroot. With minor tweaking, we could finally run Android Emulator and build C++ project.</p>
  116. <p><strong>OSG. </strong>Building OSG seemed like a piece of cake at the time. However, all we got was a crash. Thinking that we got it wrong the first time, we tried to rebuild OSG once again. And the same crash again. Searching for the problem did not reveal any hint. Nobody helped us at the OSG mailing list.</p>
  117. <p>We were in despair.</p>
  118. <p><strong>The search for OSG alternatives.</strong></p>
  119. <p>Since OSG community did not help us, we decided to search for an alternative open source project to fit our Android needs (and may be more).</p>
  120. <p>And we found it: <a href="http://babylonhx.gamestudiohx.com/">BabylonHX</a>. The home page looked awesome: it rendered WebGL in the background! We thought we finally found the gem we were looking for. However, the example on the home page simply did not work.</p>
  121. <p>You can probably understand our feelings at the time.</p>
  122. <p><strong>The success in building OSG.</strong></p>
  123. <p>We realized nobody would make OSG work under Android for us. We had to do it ourselves.</p>
  124. <p>Since <a href="http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/178-building-openscenegraph-for-android-3-4">OSG 3.4 document</a> on building for Android was very short, we no longer trusted it and headed to <a href="http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/44-building-openscenegraph-for-android-3-0-3-0-1">original OSG 3.0 document</a>. While following it, we faced a dead link to third party dependencies. The search for an alternative download link lead us to a <a href="https://xinyustudio.wordpress.com/2013/09/24/install-osg-for-android-on-ubuntu-13-04-step-by-step-tutorials/">2013 tutorial</a> on building OSG 3.0 for Android.</p>
  125. <p>After following the tutorial, we finally got OSG to run under Android! But there was a nuance: both OSG and Android tools used in the tutorial were ancient. In a few days, we gradually updated both OSG and Android tools to their latest versions.</p>
  126. <p>During the update process, we learned two things that prevented us from having OSG to work in the first place:</p>
  127. <ul>
  128. <li>Android API headers changed in NDK r12</li>
  129. <li>OSG only works as a static library under Android</li>
  130. </ul>
  131. <p>That’s it for describing how we spent the month building OSG for Android: the first attempt to build OSG, the search for OSG alternatives, and the success in building OSG.</p>
  132. </div>
  133. </div>
  134. </center>
  135. </body>
  136. </html>