|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?xml version="1.0" encoding="utf-8"?>
- <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"><p><img alt="OpenSceneGraph guide" src="https://ogstudio.github.io/2017-07-openscenegraph-guide.png"></p>
- <p>This article summarizes the work we did to produce OpenSceneGraph cross-platform guide.</p>
- <p>June marked the finish of <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide">OpenSceneGraph cross-platform guide</a> with the publishing of the last (initially planned) tutorial. The tutorial describes <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/tree/master/1.10.SampleWeb">how to build and run sample OpenSceneGraph application in Web</a> using Emscripten.
- In case you missed it, here's …</p></summary><content type="html"><p><img alt="OpenSceneGraph guide" src="https://ogstudio.github.io/2017-07-openscenegraph-guide.png"></p>
- <p>This article summarizes the work we did to produce OpenSceneGraph cross-platform guide.</p>
- <p>June marked the finish of <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide">OpenSceneGraph cross-platform guide</a> with the publishing of the last (initially planned) tutorial. The tutorial describes <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/tree/master/1.10.SampleWeb">how to build and run sample OpenSceneGraph application in Web</a> using Emscripten.
- In case you missed it, here's a <a href="https://ogstudio.github.io/openscenegraph-cross-platform-guide/">link to the final application</a>. Open it in your web browser.</p>
- <p>We started to compose the guide in February when we successfully managed to render a simple model on mobile and web.
- We spent 120 hours in five months to produce ten tutorials of the guide.</p>
- <p>We have been doing OpenSceneGraph cross-platform guide for two main reasons:</p>
- <ol>
- <li>Keep OpenSceneGraph cross-platform knowledge in easily accessible and reproducible form</li>
- <li>Share the knowledge with OpenSceneGraph community to make it stronger</li>
- </ol>
- <p>We believe we succeeded in both. Here's why:</p>
- <ol>
- <li>The guide repository has more <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/stargazers">stars</a> (aka "likes") than any other repository of ours</li>
- <li>OpenSceneGraph project leader Robert Osfield said <a href="http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg74815.html">"Great work"</a>, which means a lot</li>
- <li>The guide already has <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/issues">two issues</a></li>
- </ol>
- <p>Reaching our goal of researching OpenSceneGraph cross-platform development and providing the knowledge back to the community just made us happier.</p>
- <p>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 <a href="http://opengamestudio.org/lang/en/news/2456">promised in January</a>.</p>
- <p>That's it for summarizing the work we did to produce OpenSceneGraph cross-platform guide.</p></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"><p><img alt="iOS tutorial" src="https://ogstudio.github.io/2017-06-08-ios-refactoring.png"></p>
- <p>This article describes problems we faced during the creation of iOS tutorial in May 2017.</p>
- <p><a href="https://twitter.com/OpenGameStudio/status/826816343433498627">This February</a> 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 …</p></summary><content type="html"><p><img alt="iOS tutorial" src="https://ogstudio.github.io/2017-06-08-ios-refactoring.png"></p>
- <p>This article describes problems we faced during the creation of iOS tutorial in May 2017.</p>
- <p><a href="https://twitter.com/OpenGameStudio/status/826816343433498627">This February</a> 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.</p>
- <h3>Native library</h3>
- <p>The first question we had to answer was: should the sample application be part of Xcode project or be a separately built library?</p>
- <p>We had to consider the following facts:</p>
- <ol>
- <li>Xcode project can use C++ directly (thanks to Objective-C++) without stuff like JNI<ul>
- <li>There's no need for a separate library (+ application)</li>
- <li>Creating a separate library is an additional work (- library)</li>
- </ul>
- </li>
- <li>OpenSceneGraph builds libraries<ul>
- <li>It's easier to use standard build process (+ library)</li>
- <li>It's harder to create custom build process just for a single platform (- application)</li>
- </ul>
- </li>
- <li>OpenSceneGraph uses CMake build system, which is not supported by Xcode<ul>
- <li>Xcode project can't include CMake files (- application)</li>
- <li>It's easy to create custom CMake file that includes OpenSceneGraph CMake file to build a single library (+ library)</li>
- </ul>
- </li>
- <li>CMake can generate Xcode project<ul>
- <li>It's possible to create a CMake file that builds both OpenSceneGraph and the sample application (+ application)</li>
- <li>Xcode is the de-facto tool to create Xcode projects; it's easier to use standard build process (+ library)</li>
- </ul>
- </li>
- </ol>
- <p>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.</p>
- <h3>Refactoring</h3>
- <p>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?</p>
- <p>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.</p>
- <p>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.</p>
- <p>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:</p>
- <ol>
- <li>functions.h - contains reusable classless functions</li>
- <li>main.h - contains the rest of the sample application code</li>
- </ol>
- <p>Their contents differ slightly for each platform, but it's easy to see the whole picture now.</p>
- <p>That's it for describing problems we faced during the creation of iOS tutorial in May 2017.</p></content></entry></feed>
|