Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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