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.

183 rindas
7.3KB

  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>Examples and dependencies</title>
  7. <link rel="stylesheet" href="http://opengamestudio.org/theme/css/normalize.css" />
  8. <link rel="stylesheet" href="http://opengamestudio.org/theme/css/foundation.min.css" />
  9. <link rel="stylesheet" href="http://opengamestudio.org/theme/css/style.css" />
  10. <link rel="stylesheet" href="http://opengamestudio.org/theme/css/pygments.css" />
  11. <script src="http://opengamestudio.org/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="http://opengamestudio.org">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. <header>
  38. <h3 class="article-title"><a href="http://opengamestudio.org/examples-and-dependencies.html" rel="bookmark"
  39. title="Permalink to Examples and dependencies">Examples and dependencies</a></h3>
  40. </header>
  41. <h6 class="subheader" title="2018-08-21T00:00:00+03:00">Вт 21 августа 2018
  42. <a class="button secondary small translation-button" href="http://opengamestudio.org/examples-and-dependencies-ru.html">ru</a>
  43. </h6> <p><img alt="Screenshot" src="http://opengamestudio.org/2018-08-21-examples-and-dependencies.png"></p>
  44. <p>This article describes two new OpenSceneGraph cross-platform examples and the
  45. change in handling dependencies.</p>
  46. <p><strong>Examples of HTTP client and node selection</strong></p>
  47. <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
  48. <a href="http://opengamestudio.org/example-driven-development.html">reported its completion</a>, we were surprised by the fact
  49. that secure HTTP connection between a debugged application and debug broker
  50. was only working in the web version of the example. Desktop and mobile versions
  51. only worked with insecure HTTP.</p>
  52. <p>Since current debug scheme has no authentication, insecure debugging over HTTP
  53. doesn't really hurt. However, if we want to access resources located at popular
  54. sites like GitHub and BitBucket, we have to support secure HTTP.</p>
  55. <p>The need to support HTTPS on each platform spurred us to create
  56. <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
  57. preferred way of doing secure HTTP:</p>
  58. <ul>
  59. <li>web (Emscripten) provides Fetch API</li>
  60. <li>desktop is fine with Mongoose and OpenSSL</li>
  61. <li>Android provides HttpUrlConnection in Java</li>
  62. <li>iOS provides NSURLSession in Objective-C</li>
  63. </ul>
  64. <p>The need to support different languages on different platforms resulted
  65. in the creation of so-called 'host-guest' pattern:</p>
  66. <ul>
  67. <li>guest (platform agnostic)<ul>
  68. <li>provides networking representation</li>
  69. <li>used by cross-platform C++ code</li>
  70. </ul>
  71. </li>
  72. <li>host (specific platform)<ul>
  73. <li>polls guest for pending requests</li>
  74. <li>processes them</li>
  75. <li>reports results back to the guest</li>
  76. </ul>
  77. </li>
  78. </ul>
  79. <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>
  80. <p><strong>The change in handling dependencies</strong></p>
  81. <p>For over a year we had to deal with the following
  82. <a href="http://forum.openscenegraph.org/viewtopic.php?t=17443">shortcomings</a> when building OpenSceneGraph across platforms
  83. using conventional methods:</p>
  84. <ul>
  85. <li>macOS builds failing due to certain compile flags we use</li>
  86. <li>hacking PNG plugin safety guards to have PNG support under Android</li>
  87. <li>iOS simulator and device builds of the same example being in separate Xcode projects</li>
  88. <li>OpenSceneGraph taking 20-30 minutes to build</li>
  89. </ul>
  90. <p>These shortcomings were slowing us down and complicating the development of
  91. new examples. Upon hitting these problems ten more times this month we decided
  92. it was time to solve them once and for all. Now OpenSceneGraph is built as part
  93. of each example in 2-3 minutes, and there's no more dependency magic involved.
  94. We took the same approach of building dependencies as part of each example to
  95. other external libraries like Mongoose and libpng-android, too.</p>
  96. <p>With these obstacles out of the way, we can now iterate faster. Just in time
  97. for the next technical demonstration of Mahjong 2!</p>
  98. <p>That's it for describing two new OpenSceneGraph cross-platform examples and
  99. the change in handling dependencies.</p>
  100. <p class="subheader">Category: <a href="http://opengamestudio.org/category/news.html">News</a>
  101. </p>
  102. </article>
  103. </div>
  104. <!-- End Main Content -->
  105. <!-- Sidebar -->
  106. <aside class="large-3 columns">
  107. <!--k
  108. <h5 class="sidebar-title">Site</h5>
  109. <ul class="side-nav">
  110. <li><a href="http://opengamestudio.org/archives.html">Archives</a>
  111. <li><a href="http://opengamestudio.org/tags.html">Tags</a>
  112. <li><a href="http://opengamestudio.org/feeds/all.atom.xml" rel="alternate">Atom feed</a></li>
  113. </ul>
  114. <h5 class="sidebar-title">Categories</h5>
  115. <ul class="side-nav">
  116. <li><a href="http://opengamestudio.org/category/news.html">News</a></li>
  117. </ul>
  118. -->
  119. <h5 class="sidebar-title">Ads</h5>
  120. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  121. <!-- ogs2 -->
  122. <ins class="adsbygoogle"
  123. style="display:block"
  124. data-ad-client="ca-pub-4473792248813084"
  125. data-ad-slot="9024247127"
  126. data-ad-format="auto"></ins>
  127. <script>
  128. (adsbygoogle = window.adsbygoogle || []).push({});
  129. </script>
  130. </aside> <!-- End Sidebar -->
  131. </div> <!-- End Main Content and Sidebar -->
  132. <!-- Footer -->
  133. <footer class="row">
  134. <div class="large-12 columns">
  135. <hr />
  136. <div class="row">
  137. <div class="large-7 columns">
  138. <p>Proudly powered by <a href="http://getpelican.com">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.</p>
  139. </div>
  140. </div>
  141. </div>
  142. <script type="text/javascript">
  143. var _gaq = _gaq || [];
  144. _gaq.push(['_setAccount', 'UA-3773114-1']);
  145. _gaq.push(['_trackPageview']);
  146. (function() {
  147. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  148. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  149. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  150. })();
  151. </script>
  152. </footer>