Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

147 lines
6.4KB

  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. #lang
  19. {
  20. float: right;
  21. }
  22. .news_item
  23. {
  24. background: #FFFFFF;
  25. width: 720px;
  26. padding: 1em;
  27. margin-top: 2em;
  28. margin-bottom: 2em;
  29. border: 1px solid #E0E0E0;
  30. text-align: left;
  31. }
  32. .news_item_contents
  33. {
  34. color: #444;
  35. line-height: 1.5em;
  36. }
  37. .news_item_date
  38. {
  39. margin-bottom: 2em;
  40. color: #aaa;
  41. }
  42. html
  43. {
  44. font-family: sans-serif;
  45. }
  46. body
  47. {
  48. background: #FAFAFA;
  49. }
  50. code, pre
  51. {
  52. font-family: monospace, serif;
  53. font-size: 1em;
  54. color: #7f0a0c;
  55. }
  56. img
  57. {
  58. width: 720px;
  59. }
  60. a
  61. {
  62. color: #3A91CB;
  63. }
  64. table
  65. {
  66. border-collapse: collapse;
  67. }
  68. table, th, td
  69. {
  70. border: 1px solid #aaa;
  71. padding: 0.5em;
  72. margin-top: 0.5em;
  73. margin-bottom: 0.5em;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div id="header">
  79. <strong id="title">Open Game Studio</strong>
  80. <a href="../../en/news/index.html">News</a>
  81. <a href="../../en/game/index.html">Games</a>
  82. <a href="../../en/tool/index.html">Tools</a>
  83. <a href="../../en/page/about.html">About</a>
  84. <div id="lang">
  85. <a href="../../en/news/examples-and-dependencies.html">EN</a>
  86. <a href="../../ru/news/examples-and-dependencies.html">RU</a>
  87. </div>
  88. </div>
  89. <center>
  90. <h1>In the news...</h1>
  91. <div class="news_item">
  92. <h2 class="news_item_title">
  93. <a href="examples-and-dependencies.html">Examples and dependencies</a>
  94. </h2>
  95. <p class="news_item_date">
  96. 2018-08-21 00:00
  97. </p>
  98. <div class="news_item_contents">
  99. <p><img src="../../images/2018-08-21-examples-and-dependencies.png" alt="Cloud" /></p>
  100. <p>This article describes two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
  101. <p><strong>Examples of HTTP client and node selection</strong></p>
  102. <p>Once we finished working on <a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging">the remote debugging example</a> and <a href="example-driven-development.html">reported its completion</a>, we were surprised by the fact that secure HTTP connection between a debugged application and debug broker was only working in the web version of the example. Desktop and mobile versions only worked with insecure HTTP.</p>
  103. <p>Since current debug scheme has no authentication, insecure debugging over HTTP doesn't really hurt. However, if we want to access resources located at popular sites like GitHub and BitBucket, we have to support secure HTTP.</p>
  104. <p>The need to support HTTPS on each platform spurred us to create <a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.HTTPClient">HTTP client example</a>. Turned out, each platform had its own preferred way of doing secure HTTP:</p>
  105. <ul>
  106. <li>web (Emscripten) provides Fetch API</li>
  107. <li>desktop is fine with Mongoose and OpenSSL</li>
  108. <li>Android provides HttpUrlConnection in Java</li>
  109. <li>iOS provides NSURLSession in Objective-C</li>
  110. </ul>
  111. <p>The need to support different languages on different platforms resulted in the creation of so-called 'host-guest' pattern:</p>
  112. <ul>
  113. <li>guest (platform agnostic)<ul>
  114. <li>provides networking representation</li>
  115. <li>used by cross-platform C++ code</li></ul></li>
  116. <li>host (specific platform)<ul>
  117. <li>polls guest for pending requests</li>
  118. <li>processes them</li>
  119. <li>reports results back to the guest</li></ul></li>
  120. </ul>
  121. <p><a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/05.NodeSelection">Node selection example</a> was straightforward and caused no troubles.</p>
  122. <p><strong>The change in handling dependencies</strong></p>
  123. <p>For over a year we had to deal with the following <a href="http://forum.openscenegraph.org/viewtopic.php?t=17443">shortcomings</a> when building OpenSceneGraph across platforms using conventional methods:</p>
  124. <ul>
  125. <li>macOS builds failing due to certain compile flags we use</li>
  126. <li>hacking PNG plugin safety guards to have PNG support under Android</li>
  127. <li>iOS simulator and device builds of the same example being in separate Xcode projects</li>
  128. <li>OpenSceneGraph taking 20-30 minutes to build</li>
  129. </ul>
  130. <p>These shortcomings were slowing us down and complicating the development of new examples. Upon hitting these problems ten more times this month we decided it was time to solve them once and for all. Now OpenSceneGraph is built as part of each example in 2-3 minutes, and there's no more dependency magic involved. We took the same approach of building dependencies as part of each example to other external libraries like Mongoose and libpng-android, too.</p>
  131. <p>With these obstacles out of the way, we can now iterate faster. Just in time for the next technical demonstration of Mahjong 2!</p>
  132. <p>That's it for describing two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
  133. </div>
  134. </div>
  135. <div id="footer">
  136. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  137. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  138. The site is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
  139. </div>
  140. </center>
  141. </body>
  142. </html>