No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

examples-and-dependencies.html 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. text-decoration: none;
  64. }
  65. table
  66. {
  67. border-collapse: collapse;
  68. }
  69. table, th, td
  70. {
  71. border: 1px solid #aaa;
  72. padding: 0.5em;
  73. margin-top: 0.5em;
  74. margin-bottom: 0.5em;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div id="header">
  80. <strong id="title">Open Game Studio</strong>
  81. <a href="../../en/news/index.html">News</a>
  82. <a href="../../en/game/index.html">Games</a>
  83. <a href="../../en/tool/index.html">Tools</a>
  84. <a href="../../en/page/about.html">About</a>
  85. <div id="lang">
  86. <a href="../../en/news/examples-and-dependencies.html">EN</a>
  87. <a href="../../ru/news/examples-and-dependencies.html">RU</a>
  88. </div>
  89. </div>
  90. <center>
  91. <h1>In the news...</h1>
  92. <div class="news_item">
  93. <h2 class="news_item_title">
  94. <a href="examples-and-dependencies.html">Examples and dependencies</a>
  95. </h2>
  96. <p class="news_item_date">
  97. 2018-08-21 00:00
  98. </p>
  99. <div class="news_item_contents">
  100. <p><img src="../../images/2018-08-21-examples-and-dependencies.png" alt="Cloud" /></p>
  101. <p>This article describes two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
  102. <p><strong>Examples of HTTP client and node selection</strong></p>
  103. <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>
  104. <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>
  105. <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>
  106. <ul>
  107. <li>web (Emscripten) provides Fetch API</li>
  108. <li>desktop is fine with Mongoose and OpenSSL</li>
  109. <li>Android provides HttpUrlConnection in Java</li>
  110. <li>iOS provides NSURLSession in Objective-C</li>
  111. </ul>
  112. <p>The need to support different languages on different platforms resulted in the creation of so-called 'host-guest' pattern:</p>
  113. <ul>
  114. <li>guest (platform agnostic)<ul>
  115. <li>provides networking representation</li>
  116. <li>used by cross-platform C++ code</li></ul></li>
  117. <li>host (specific platform)<ul>
  118. <li>polls guest for pending requests</li>
  119. <li>processes them</li>
  120. <li>reports results back to the guest</li></ul></li>
  121. </ul>
  122. <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>
  123. <p><strong>The change in handling dependencies</strong></p>
  124. <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>
  125. <ul>
  126. <li>macOS builds failing due to certain compile flags we use</li>
  127. <li>hacking PNG plugin safety guards to have PNG support under Android</li>
  128. <li>iOS simulator and device builds of the same example being in separate Xcode projects</li>
  129. <li>OpenSceneGraph taking 20-30 minutes to build</li>
  130. </ul>
  131. <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>
  132. <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>
  133. <p>That's it for describing two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
  134. </div>
  135. </div>
  136. <div id="footer">
  137. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  138. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  139. The site is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
  140. </div>
  141. </center>
  142. </body>
  143. </html>