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

65 строки
8.9KB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <feed xmlns="http://www.w3.org/2005/Atom"><title>Opensource Game Studio - News</title><link href="https://ogstudio.github.io/" rel="alternate"></link><link href="https://ogstudio.github.io/feeds/news.atom.xml" rel="self"></link><id>https://ogstudio.github.io/</id><updated>2017-07-01T00:00:00+07:00</updated><entry><title>OpenSceneGraph cross-platform guide</title><link href="https://ogstudio.github.io/openscenegraph-cross-platform-guide.html" rel="alternate"></link><published>2017-07-01T00:00:00+07:00</published><updated>2017-07-01T00:00:00+07:00</updated><author><name>Opensource Game Studio</name></author><id>tag:ogstudio.github.io,2017-07-01:/openscenegraph-cross-platform-guide.html</id><summary type="html">&lt;p&gt;&lt;img alt="OpenSceneGraph guide" src="https://ogstudio.github.io/2017-07-openscenegraph-guide.png"&gt;&lt;/p&gt;
  3. &lt;p&gt;This article summarizes the work we did to produce OpenSceneGraph cross-platform guide.&lt;/p&gt;
  4. &lt;p&gt;June marked the finish of &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide"&gt;OpenSceneGraph cross-platform guide&lt;/a&gt; with the publishing of the last (initially planned) tutorial. The tutorial describes &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/tree/master/1.10.SampleWeb"&gt;how to build and run sample OpenSceneGraph application in Web&lt;/a&gt; using Emscripten.
  5. In case you missed it, here's …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="OpenSceneGraph guide" src="https://ogstudio.github.io/2017-07-openscenegraph-guide.png"&gt;&lt;/p&gt;
  6. &lt;p&gt;This article summarizes the work we did to produce OpenSceneGraph cross-platform guide.&lt;/p&gt;
  7. &lt;p&gt;June marked the finish of &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide"&gt;OpenSceneGraph cross-platform guide&lt;/a&gt; with the publishing of the last (initially planned) tutorial. The tutorial describes &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/tree/master/1.10.SampleWeb"&gt;how to build and run sample OpenSceneGraph application in Web&lt;/a&gt; using Emscripten.
  8. In case you missed it, here's a &lt;a href="https://ogstudio.github.io/openscenegraph-cross-platform-guide/"&gt;link to the final application&lt;/a&gt;. Open it in your web browser.&lt;/p&gt;
  9. &lt;p&gt;We started to compose the guide in February when we successfully managed to render a simple model on mobile and web.
  10. We spent 120 hours in five months to produce ten tutorials of the guide.&lt;/p&gt;
  11. &lt;p&gt;We have been doing OpenSceneGraph cross-platform guide for two main reasons:&lt;/p&gt;
  12. &lt;ol&gt;
  13. &lt;li&gt;Keep OpenSceneGraph cross-platform knowledge in easily accessible and reproducible form&lt;/li&gt;
  14. &lt;li&gt;Share the knowledge with OpenSceneGraph community to make it stronger&lt;/li&gt;
  15. &lt;/ol&gt;
  16. &lt;p&gt;We believe we succeeded in both. Here's why:&lt;/p&gt;
  17. &lt;ol&gt;
  18. &lt;li&gt;The guide repository has more &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/stargazers"&gt;stars&lt;/a&gt; (aka "likes") than any other repository of ours&lt;/li&gt;
  19. &lt;li&gt;OpenSceneGraph project leader Robert Osfield said &lt;a href="http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg74815.html"&gt;"Great work"&lt;/a&gt;, which means a lot&lt;/li&gt;
  20. &lt;li&gt;The guide already has &lt;a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/issues"&gt;two issues&lt;/a&gt;&lt;/li&gt;
  21. &lt;/ol&gt;
  22. &lt;p&gt;Reaching our goal of researching OpenSceneGraph cross-platform development and providing the knowledge back to the community just made us happier.&lt;/p&gt;
  23. &lt;p&gt;However, our journey does not stop here. Using the knowledge of the guide, we now continue to work on bringing our tools to support mobile and web, just as we &lt;a href="http://opengamestudio.org/lang/en/news/2456"&gt;promised in January&lt;/a&gt;.&lt;/p&gt;
  24. &lt;p&gt;That's it for summarizing the work we did to produce OpenSceneGraph cross-platform guide.&lt;/p&gt;</content></entry><entry><title>iOS tutorial</title><link href="https://ogstudio.github.io/ios-tutorial.html" rel="alternate"></link><published>2017-06-08T10:00:00+07:00</published><updated>2017-06-08T10:00:00+07:00</updated><author><name>Opensource Game Studio</name></author><id>tag:ogstudio.github.io,2017-06-08:/ios-tutorial.html</id><summary type="html">&lt;p&gt;&lt;img alt="iOS tutorial" src="https://ogstudio.github.io/2017-06-08-ios-refactoring.png"&gt;&lt;/p&gt;
  25. &lt;p&gt;This article describes problems we faced during the creation of iOS tutorial in May 2017.&lt;/p&gt;
  26. &lt;p&gt;&lt;a href="https://twitter.com/OpenGameStudio/status/826816343433498627"&gt;This February&lt;/a&gt; we managed to get simple model rendered under iOS in just a few days. We expected to finish iOS tutorial in no time. However, the reality reminded us: it's easy to come up …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="iOS tutorial" src="https://ogstudio.github.io/2017-06-08-ios-refactoring.png"&gt;&lt;/p&gt;
  27. &lt;p&gt;This article describes problems we faced during the creation of iOS tutorial in May 2017.&lt;/p&gt;
  28. &lt;p&gt;&lt;a href="https://twitter.com/OpenGameStudio/status/826816343433498627"&gt;This February&lt;/a&gt; we managed to get simple model rendered under iOS in just a few days. We expected to finish iOS tutorial in no time. However, the reality reminded us: it's easy to come up with a hackish demo that works for one person, but it's hard to create a concise example that works for everyone.&lt;/p&gt;
  29. &lt;h3&gt;Native library&lt;/h3&gt;
  30. &lt;p&gt;The first question we had to answer was: should the sample application be part of Xcode project or be a separately built library?&lt;/p&gt;
  31. &lt;p&gt;We had to consider the following facts:&lt;/p&gt;
  32. &lt;ol&gt;
  33. &lt;li&gt;Xcode project can use C++ directly (thanks to Objective-C++) without stuff like JNI&lt;ul&gt;
  34. &lt;li&gt;There's no need for a separate library (+ application)&lt;/li&gt;
  35. &lt;li&gt;Creating a separate library is an additional work (- library)&lt;/li&gt;
  36. &lt;/ul&gt;
  37. &lt;/li&gt;
  38. &lt;li&gt;OpenSceneGraph builds libraries&lt;ul&gt;
  39. &lt;li&gt;It's easier to use standard build process (+ library)&lt;/li&gt;
  40. &lt;li&gt;It's harder to create custom build process just for a single platform (- application)&lt;/li&gt;
  41. &lt;/ul&gt;
  42. &lt;/li&gt;
  43. &lt;li&gt;OpenSceneGraph uses CMake build system, which is not supported by Xcode&lt;ul&gt;
  44. &lt;li&gt;Xcode project can't include CMake files (- application)&lt;/li&gt;
  45. &lt;li&gt;It's easy to create custom CMake file that includes OpenSceneGraph CMake file to build a single library (+ library)&lt;/li&gt;
  46. &lt;/ul&gt;
  47. &lt;/li&gt;
  48. &lt;li&gt;CMake can generate Xcode project&lt;ul&gt;
  49. &lt;li&gt;It's possible to create a CMake file that builds both OpenSceneGraph and the sample application (+ application)&lt;/li&gt;
  50. &lt;li&gt;Xcode is the de-facto tool to create Xcode projects; it's easier to use standard build process (+ library)&lt;/li&gt;
  51. &lt;/ul&gt;
  52. &lt;/li&gt;
  53. &lt;/ol&gt;
  54. &lt;p&gt;After evaluating the pros and cons of each approach, we decided to turn the sample application into a library and include it in Xcode project. The downside of this approach is that simulator and real device builds need separate library builds.&lt;/p&gt;
  55. &lt;h3&gt;Refactoring&lt;/h3&gt;
  56. &lt;p&gt;The second question we had to answer was: should there be a single source code base for all platforms or several ones, one for each platform?&lt;/p&gt;
  57. &lt;p&gt;While doing Android tutorial we used single source code base because it worked fine for desktop and Android. As we started to work through iOS tutorial, it became apparent that particular features may or may not work on some platforms. For example, one feature may work on desktop and iOS, but not Android. Another feature may work on iOS and Android, but not desktop. Since we didn't want to pollute the code with #ifdefs, we started to put each platform combination into a separate file. The number of files grew rapidly. The files were reusable, but it became extremely hard to see the whole picture.&lt;/p&gt;
  58. &lt;p&gt;At this point, we realized there's the second question. We reminded ourselves that the main purpose of the sample source code is to teach how to do basic OpenSceneGraph things, not create a reusable library with API that is stable across several years.&lt;/p&gt;
  59. &lt;p&gt;That's when our home grown feature tool came into play. With its help, we separated the code into several parts, which in the end produce just two files for each platform:&lt;/p&gt;
  60. &lt;ol&gt;
  61. &lt;li&gt;functions.h - contains reusable classless functions&lt;/li&gt;
  62. &lt;li&gt;main.h - contains the rest of the sample application code&lt;/li&gt;
  63. &lt;/ol&gt;
  64. &lt;p&gt;Their contents differ slightly for each platform, but it's easy to see the whole picture now.&lt;/p&gt;
  65. &lt;p&gt;That's it for describing problems we faced during the creation of iOS tutorial in May 2017.&lt;/p&gt;</content></entry></feed>