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.

148 lines
5.8KB

  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/osg-sample.html">EN</a>
  86. <a href="../../ru/news/osg-sample.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="osg-sample.html">OpenSceneGraph sample</a>
  94. </h2>
  95. <p class="news_item_date">
  96. 2017-05-12 00:00
  97. </p>
  98. <div class="news_item_contents">
  99. <p><img src="../../images/2017-05_osg-sample.png" alt="Rocket in the distance" /></p>
  100. <p>This article describes creation of the tutorials for building sample OpenSceneGraph application under Linux, macOS, Windows, and Android in April 2017.</p>
  101. <p>Previous tutorials described how to install OpenSceneGraph under Linux, macOS, Windows and render a model using the standard <strong>osgviewer</strong> tool. This time we worked on a <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide-application">sample OpenSceneGraph application</a> that would run under Linux, macOS, Windows, and Android.</p>
  102. <p>The application is very basic and has the following features:</p>
  103. <ol>
  104. <li>Render window creation</li>
  105. <li>Model loading</li>
  106. <li>Model rendering with simple GLSL shaders</li>
  107. <li>Model motion with a mouse under Linux, macOS, Windows and a finger under Android</li>
  108. </ol>
  109. <p>Creating the tutorials for Linux, macOS, Windows was so easy and straightforward, that it only took us half a month. We spent the second half of the month creating Android tutorial.</p>
  110. <p>Our <a href="2016-october-recap.html">first successful Android build</a> last year included hacks and non-obvious steps to make OpenSceneGraph run under Android. This time we wanted a cleaner, faster, and cheaper approach.</p>
  111. <p>The approach we ended up with requires just a few files and a few changes to the original Android Studio project (with C++ support) to make sample OpenSceneGraph application run under Android.</p>
  112. <p>Here's a quick rundown of the files:</p>
  113. <ol>
  114. <li>GLES2 surface</li>
  115. <li>Render activity to render to the surface</li>
  116. <li>Native library Java interface</li>
  117. <li>Native library C++ implementation</li>
  118. <li>CMake file to build native library</li>
  119. <li>Render activity layout</li>
  120. <li>Model to display</li>
  121. </ol>
  122. <p>Here's a quick rundown of the project changes:</p>
  123. <ol>
  124. <li>Update Android manifest to use GLES2 and render activity</li>
  125. <li>Reference native library's CMake file in the project's CMake file</li>
  126. </ol>
  127. <p>OpenSceneGraph documentation suggests building OpenSceneGraph outside Android Studio with CMake. However, this approach has the following limitations:</p>
  128. <ol>
  129. <li>You have to build OpenSceneGraph for each target architecture</li>
  130. <li>You have to manually copy/reference built OpenSceneGraph libraries into Android Studio project</li>
  131. </ol>
  132. <p>Our approach includes building OpenSceneGraph for those target architectures that Android Studio project is built for. Also, OpenSceneGraph is already referenced, so no extra work is required: you just need to rebuild the project, and you're done.</p>
  133. <p>That's it for describing the creation of the tutorials for building sample OpenSceneGraph application under Linux, macOS, Windows, and Android in April 2017.</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>