Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

326 lignes
14KB

  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <!-- Set the viewport width to device width for mobile -->
  5. <meta name="viewport" content="width=device-width" />
  6. <title>Opensource Game Studio</title>
  7. <link rel="stylesheet" href="https://kornerr.github.io/pelican/theme/css/normalize.css" />
  8. <link rel="stylesheet" href="https://kornerr.github.io/pelican/theme/css/foundation.min.css" />
  9. <link rel="stylesheet" href="https://kornerr.github.io/pelican/theme/css/style.css" />
  10. <link rel="stylesheet" href="https://kornerr.github.io/pelican/theme/css/pygments.css" />
  11. <script src="https://kornerr.github.io/pelican/theme/js/custom.modernizr.js"></script>
  12. <!-- So Firefox can bookmark->"abo this site" -->
  13. <link href="feeds/all.atom.xml" rel="alternate" title="Opensource Game Studio" type="application/atom+xml">
  14. </head>
  15. <body>
  16. <!-- Nav Bar -->
  17. <nav>
  18. <!-- Show menu items and pages -->
  19. <div class="row">
  20. <div class="large-12 columns top-bar">
  21. <h1><a href="https://kornerr.github.io/pelican">Opensource Game Studio</a></h1>
  22. </div>
  23. </div>
  24. <div class="row top-menu">
  25. <div class="large-12 columns">
  26. <a href="/pages/projects.html" class="menu-button secondary">Projects</a>
  27. <a href="/pages/about.html" class="menu-button secondary">About</a>
  28. </div>
  29. </div>
  30. </nav>
  31. <!-- End Nav -->
  32. <!-- Main Page Content and Sidebar -->
  33. <div class="row">
  34. <!-- Main Blog Content -->
  35. <div class="large-9 columns">
  36. <article>
  37. <a href="https://kornerr.github.io/pelican/ios-tutorial.html"><h3 class="article-title">iOS tutorial</h3></a>
  38. <h6 class="subheader" title="2017-06-08T10:00:00+07:00">Thu 08 June 2017
  39. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/ios-tutorial-ru.html">ru</a>
  40. </h6><p><img alt="iOS tutorial" src="https://kornerr.github.io/pelican/2017-06-08-ios-refactoring.png"></p>
  41. <p>This article describes problems we faced during the creation of iOS tutorial in May 2017.</p>
  42. <p><a href="https://twitter.com/OpenGameStudio/status/826816343433498627">This February</a> we managed to get simple model rendered under iOS in just a few days. We expected to finish iOS tutorial in no time. However, the reality reminded us: it's easy to come up with a hackish demo that works for one person, but it's hard to create a concise example that works for everyone.</p>
  43. <h3>Native library</h3>
  44. <p>The first question we had to answer was: should the sample application be part of Xcode project or be a separately built library?</p>
  45. <p>We had to consider the following facts:</p>
  46. <ol>
  47. <li>Xcode project can use C++ directly (thanks to Objective-C++) without stuff like JNI<ul>
  48. <li>There's no need for a separate library (+ application)</li>
  49. <li>Creating a separate library is an additional work (- library)</li>
  50. </ul>
  51. </li>
  52. <li>OpenSceneGraph builds libraries<ul>
  53. <li>It's easier to use standard build process (+ library)</li>
  54. <li>It's harder to create custom build process just for a single platform (- application)</li>
  55. </ul>
  56. </li>
  57. <li>OpenSceneGraph uses CMake build system, which is not supported by Xcode<ul>
  58. <li>Xcode project can't include CMake files (- application)</li>
  59. <li>It's easy to create custom CMake file that includes OpenSceneGraph CMake file to build a single library (+ library)</li>
  60. </ul>
  61. </li>
  62. <li>CMake can generate Xcode project<ul>
  63. <li>It's possible to create a CMake file that builds both OpenSceneGraph and the sample application (+ application)</li>
  64. <li>Xcode is the de-facto tool to create Xcode projects; it's easier to use standard build process (+ library)</li>
  65. </ul>
  66. </li>
  67. </ol>
  68. <p>After evaluating the pros and cons of each approach, we decided to turn the sample application into a library and include it in Xcode project. The downside of this approach is that simulator and real device builds need separate library builds.</p>
  69. <h3>Refactoring</h3>
  70. <p>The second question we had to answer was: should there be a single source code base for all platforms or several ones, one for each platform?</p>
  71. <p>While doing Android tutorial we used single source code base because it worked fine for desktop and Android. As we started to work through iOS tutorial, it became apparent that particular features may or may not work on some platforms. For example, one feature may work on desktop and iOS, but not Android. Another feature may work on iOS and Android, but not desktop. Since we didn't want to pollute the code with #ifdefs, we started to put each platform combination into a separate file. The number of files grew rapidly. The files were reusable, but it became extremely hard to see the whole picture.</p>
  72. <p>At this point, we realized there's the second question. We reminded ourselves that the main purpose of the sample source code is to teach how to do basic OpenSceneGraph things, not create a reusable library with API that is stable across several years.</p>
  73. <p>That's when our home grown feature tool came into play. With its help, we separated the code into several parts, which in the end produce just two files for each platform:</p>
  74. <ol>
  75. <li>functions.h - contains reusable classless functions</li>
  76. <li>main.h - contains the rest of the sample application code</li>
  77. </ol>
  78. <p>Their contents differ slightly for each platform, but it's easy to see the whole picture now.</p>
  79. <p>That's it for describing problems we faced during the creation of iOS tutorial in May 2017.</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/news.html">News</a>
  80. </p>
  81. </article>
  82. <hr class="gradient"/>
  83. <article>
  84. <a href="https://kornerr.github.io/pelican/pelican-review.html"><h3 class="article-title">Pelican review</h3></a>
  85. <h6 class="subheader" title="2017-06-03T22:00:00+07:00">Sat 03 June 2017
  86. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/pelican-review-ru.html">ru</a>
  87. </h6><p>So far so nice. Pelican is really cool, and provides a quick starting guided
  88. to get up and running real fast.</p>
  89. <p>Much more smooth than Jekyll.</p>
  90. <p>I &lt;3 Python and its ecosystem. Something is just EASIER in Python.</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  91. </p>
  92. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/pelican-review.html">Read More</a>
  93. <hr class="gradient"/>
  94. </article>
  95. <article>
  96. <a href="https://kornerr.github.io/pelican/keyboard-review.html"><h3 class="article-title">My first review</h3></a>
  97. <h6 class="subheader" title="2017-06-01T10:20:00+07:00">Thu 01 June 2017
  98. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/keyboard-review-ru.html">ru</a>
  99. </h6><p>Here is a full review, guys.</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  100. </p>
  101. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/keyboard-review.html">Read More</a>
  102. <hr class="gradient"/>
  103. </article>
  104. <article>
  105. <a href="https://kornerr.github.io/pelican/kr10.html"><h3 class="article-title">kr10</h3></a>
  106. <h6 class="subheader" title="2017-01-01T10:04:00+07:00">Sun 01 January 2017
  107. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr10-ru.html">ru</a>
  108. </h6><p>kr10</p>
  109. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  110. </p>
  111. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr10.html">Read More</a>
  112. <hr class="gradient"/>
  113. </article>
  114. <article>
  115. <a href="https://kornerr.github.io/pelican/kr9.html"><h3 class="article-title">kr9</h3></a>
  116. <h6 class="subheader" title="2017-01-01T09:04:00+07:00">Sun 01 January 2017
  117. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr9-ru.html">ru</a>
  118. </h6><p>kr9</p>
  119. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  120. </p>
  121. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr9.html">Read More</a>
  122. <hr class="gradient"/>
  123. </article>
  124. <article>
  125. <a href="https://kornerr.github.io/pelican/kr8.html"><h3 class="article-title">kr8</h3></a>
  126. <h6 class="subheader" title="2017-01-01T08:04:00+07:00">Sun 01 January 2017
  127. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr8-ru.html">ru</a>
  128. </h6><p>kr8</p>
  129. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  130. </p>
  131. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr8.html">Read More</a>
  132. <hr class="gradient"/>
  133. </article>
  134. <article>
  135. <a href="https://kornerr.github.io/pelican/kr7.html"><h3 class="article-title">kr7</h3></a>
  136. <h6 class="subheader" title="2017-01-01T07:04:00+07:00">Sun 01 January 2017
  137. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr7-ru.html">ru</a>
  138. </h6><p>kr7</p>
  139. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  140. </p>
  141. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr7.html">Read More</a>
  142. <hr class="gradient"/>
  143. </article>
  144. <article>
  145. <a href="https://kornerr.github.io/pelican/kr6.html"><h3 class="article-title">kr6</h3></a>
  146. <h6 class="subheader" title="2017-01-01T06:04:00+07:00">Sun 01 January 2017
  147. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr6-ru.html">ru</a>
  148. </h6><p>kr6</p>
  149. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  150. </p>
  151. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr6.html">Read More</a>
  152. <hr class="gradient"/>
  153. </article>
  154. <article>
  155. <a href="https://kornerr.github.io/pelican/kr5.html"><h3 class="article-title">kr5</h3></a>
  156. <h6 class="subheader" title="2017-01-01T05:04:00+07:00">Sun 01 January 2017
  157. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr5-ru.html">ru</a>
  158. </h6><p>kr5</p>
  159. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  160. </p>
  161. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr5.html">Read More</a>
  162. <hr class="gradient"/>
  163. </article>
  164. <article>
  165. <a href="https://kornerr.github.io/pelican/kr4.html"><h3 class="article-title">kr4</h3></a>
  166. <h6 class="subheader" title="2017-01-01T04:04:00+07:00">Sun 01 January 2017
  167. <a class="button secondary small translation-button" href="https://kornerr.github.io/pelican/kr4-ru.html">ru</a>
  168. </h6><p>kr4</p>
  169. <p>LANG: en</p><p class="subheader">Category: <a href="https://kornerr.github.io/pelican/category/review.html">Review</a>
  170. </p>
  171. <a class="button radius secondary small right" href="https://kornerr.github.io/pelican/kr4.html">Read More</a>
  172. <hr class="gradient"/>
  173. </article>
  174. <!-- /#posts-list -->
  175. <div class="pagination-centered">
  176. <h6 class="subheader">Page 1 of 2</h6>
  177. <p>
  178. <a href="https://kornerr.github.io/pelican/index2.html">Next &raquo;</a>
  179. </p>
  180. </div>
  181. </div>
  182. <!-- End Main Content -->
  183. <!-- Sidebar -->
  184. <aside class="large-3 columns">
  185. <!--k
  186. <h5 class="sidebar-title">Site</h5>
  187. <ul class="side-nav">
  188. <li><a href="https://kornerr.github.io/pelican/archives.html">Archives</a>
  189. <li><a href="https://kornerr.github.io/pelican/tags.html">Tags</a>
  190. <li><a href="https://kornerr.github.io/pelican/feeds/all.atom.xml" rel="alternate">Atom feed</a></li>
  191. </ul>
  192. <h5 class="sidebar-title">Categories</h5>
  193. <ul class="side-nav">
  194. <li><a href="https://kornerr.github.io/pelican/category/news.html">News</a></li>
  195. <li><a href="https://kornerr.github.io/pelican/category/review.html">Review</a></li>
  196. </ul>
  197. -->
  198. <h5 class="sidebar-title">Projects</h5>
  199. <ul class="side-nav">
  200. <li><a href="/pages/ogs-mahjong.html">OGS Mahjong</a></li>
  201. <li><a href="/pages/ogs-editor.html">OGS Editor</a></li>
  202. <li><a href="/pages/openscenegraph-guide.html">OpenSceneGraph guide</a></li>
  203. </ul>
  204. </aside> <!-- End Sidebar -->
  205. </div> <!-- End Main Content and Sidebar -->
  206. <!-- Footer -->
  207. <footer class="row">
  208. <div class="large-12 columns">
  209. <hr />
  210. <div class="row">
  211. <div class="large-7 columns">
  212. <p>Proudly powered by <a href="http://getpelican.com">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.</p>
  213. </div>
  214. </div>
  215. </div>
  216. </footer>