You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
5.3KB

  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <link rel="stylesheet" href="../../style.css">
  6. </head>
  7. <body>
  8. <script data-goatcounter="https://services.opengamestudio.org:443/count" async src="//services.opengamestudio.org:443/count.js"></script>
  9. <div id="header">
  10. <div>
  11. <strong id="title">Open Game Studio</strong>
  12. <div id="lang">
  13. <a href="../../en/news/osg-sample.html">EN</a>
  14. <a href="../../ru/news/osg-sample.html">RU</a>
  15. </div>
  16. </div>
  17. <div class="header2">
  18. <div class="menu">
  19. <a href="../../en/news/index.html">News</a>
  20. <a href="../../en/game/index.html">Games</a>
  21. <a href="../../en/tool/index.html">Tools</a>
  22. <a href="../../en/page/about.html">About</a>
  23. </div>
  24. <a class="discord" href="https://discord.gg/3A6THQabNf">
  25. <img src="../../images/discord.png"></img>
  26. </a>
  27. <div class="clear"></div>
  28. </div>
  29. </div>
  30. <h3 class="left_item_title">In the news...</h3>
  31. <center>
  32. <div class="news_item">
  33. <h2 class="news_item_title">
  34. <a href="osg-sample.html">OpenSceneGraph sample</a>
  35. </h2>
  36. <p class="news_item_date">
  37. 2017-05-12 00:00
  38. </p>
  39. <div class="news_item_contents">
  40. <p><img src="../../images/2017-05_osg-sample.png" alt="Rocket in the distance" /></p>
  41. <p>This article describes creation of the tutorials for building sample OpenSceneGraph application under Linux, macOS, Windows, and Android in April 2017.</p>
  42. <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>
  43. <p>The application is very basic and has the following features:</p>
  44. <ol>
  45. <li>Render window creation</li>
  46. <li>Model loading</li>
  47. <li>Model rendering with simple GLSL shaders</li>
  48. <li>Model motion with a mouse under Linux, macOS, Windows and a finger under Android</li>
  49. </ol>
  50. <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>
  51. <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>
  52. <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>
  53. <p>Here's a quick rundown of the files:</p>
  54. <ol>
  55. <li>GLES2 surface</li>
  56. <li>Render activity to render to the surface</li>
  57. <li>Native library Java interface</li>
  58. <li>Native library C++ implementation</li>
  59. <li>CMake file to build native library</li>
  60. <li>Render activity layout</li>
  61. <li>Model to display</li>
  62. </ol>
  63. <p>Here's a quick rundown of the project changes:</p>
  64. <ol>
  65. <li>Update Android manifest to use GLES2 and render activity</li>
  66. <li>Reference native library's CMake file in the project's CMake file</li>
  67. </ol>
  68. <p>OpenSceneGraph documentation suggests building OpenSceneGraph outside Android Studio with CMake. However, this approach has the following limitations:</p>
  69. <ol>
  70. <li>You have to build OpenSceneGraph for each target architecture</li>
  71. <li>You have to manually copy/reference built OpenSceneGraph libraries into Android Studio project</li>
  72. </ol>
  73. <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>
  74. <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>
  75. </div>
  76. </div>
  77. <div id="disqus_thread"></div>
  78. <script>
  79. var disqus_config = function () {
  80. this.page.url = "https://opengamestudio.org/en/news/osg-sample.html";
  81. this.page.identifier = "osg-sample.html";
  82. };
  83. (function() { // DON'T EDIT BELOW THIS LINE
  84. var d = document, s = d.createElement('script');
  85. s.src = 'https://opengamestudio.disqus.com/embed.js';
  86. s.setAttribute('data-timestamp', +new Date());
  87. (d.head || d.body).appendChild(s);
  88. })();
  89. </script>
  90. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  91. <div id="footer">
  92. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  93. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  94. </div>
  95. </center>
  96. </body>
  97. </html>