Add 2018-08 article
This commit is contained in:
@@ -9,6 +9,9 @@ Lang: ru
|
||||
Эта статья описывает то, как создание третьего кросс-платформенного примера
|
||||
OpenSceneGraph привело нас к разработке через создание примеров.
|
||||
|
||||
**ИЗМЕНЕНИЯ ОТ 2018-08**: третий пример был переименован в четвёртый в связи
|
||||
с причинами, изложенными в [следующей статье][article-2018-august].
|
||||
|
||||
**Третий кросс-платформенный пример OpenSceneGraph**
|
||||
|
||||
Третий кросс-платформенный пример OpenSceneGraph содержит реализацию
|
||||
@@ -63,6 +66,7 @@ HTTP в приложение, чтобы клиенты HTTP могли взаи
|
||||
|
||||
|
||||
[screenshot]: {attach}/images/2018-06-27-example-driven-development.png
|
||||
[article-2018-august]: {filename}/articles/2018-08-21-examples-and-dependencies-ru.md
|
||||
|
||||
[osgcpe-03]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.RemoteDebugging
|
||||
[debug-broker]: https://github.com/OGStudio/debug-broker
|
||||
|
||||
@@ -9,10 +9,13 @@ Lang: en
|
||||
This article explains how the third OpenSceneGraph cross-platform example
|
||||
opened our eyes to example-driven development.
|
||||
|
||||
**2018-08 EDIT**: the third example has been renamed to the fourth one due to
|
||||
the reasons described in the [next article][article-2018-august].
|
||||
|
||||
**The third OpenSceneGraph cross-platform example**
|
||||
|
||||
The third OpenSceneGraph cross-platform example explains how to implement
|
||||
[remote debugging across platforms][osgcpe-03]. This example is less about
|
||||
[remote debugging across platforms][osgcpe-04]. This example is less about
|
||||
OpenSceneGraph and more about different platforms.
|
||||
|
||||
Remote anything nowadays assumes the use of HTTP(s) over TCP/IP. Thus, the
|
||||
@@ -57,8 +60,9 @@ That's it for explaining how the third OpenSceneGraph cross-platform example
|
||||
opened our eyes to example-driven development.
|
||||
|
||||
[screenshot]: {attach}/images/2018-06-27-example-driven-development.png
|
||||
[article-2018-august]: {filename}/articles/2018-08-21-examples-and-dependencies.md
|
||||
|
||||
[osgcpe-03]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.RemoteDebugging
|
||||
[osgcpe-04]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging
|
||||
[debug-broker]: https://github.com/OGStudio/debug-broker
|
||||
[debug-ui]: https://github.com/OGStudio/debug-ui
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
Title: Примеры и зависимости
|
||||
Date: 2018-08-21 00:00
|
||||
Category: News
|
||||
Slug: examples-and-dependencies
|
||||
Lang: ru
|
||||
|
||||
![Screenshot][screenshot]
|
||||
|
||||
Эта статья описывает два новых кросс-платформенных примера OpenSceneGraph
|
||||
и изменение в работе с зависимостями.
|
||||
|
||||
**Примеры клиента HTTP и выбора узла сцены**
|
||||
|
||||
После окончания работы над [примером удалённой отладки][osgcpe-04] и
|
||||
[сообщения об этом][article-2018-june] мы с удивлением обнаружили, что
|
||||
безопасное соединение HTTPS между отлаживаемым приложением и брокером
|
||||
отладки работало лишь в веб-версии примера. Десктопная и мобильная версии
|
||||
работали лишь с помощью обычного соединения HTTP.
|
||||
|
||||
Т.к. текущая схема отладки не имеет авторизации, отладка по обычному соединению
|
||||
HTTP не несёт никаких проблем. Однако, если мы хотим получить доступ к ресурсам,
|
||||
расположенным на популярных сайтах вроде GitHub и BitBucket, мы обязаны
|
||||
поддерживать HTTPS.
|
||||
|
||||
Необходимость поддержки HTTPS на каждой платформе побудила нас создать
|
||||
[пример клиента HTTP][osgcpe-03]. Оказалось, что каждая платформа имеет
|
||||
собственные правила по работе с HTTPS:
|
||||
|
||||
* веб (Emscripten) предоставляет Fetch API
|
||||
* десктоп может использовать Mongoose с OpenSSL
|
||||
* Android предоставляет HttpUrlConnection в языке Java
|
||||
* iOS предоставляет NSURLSession в языке Objective-C
|
||||
|
||||
Необходимость поддержки разных языков на разных платформах привела к
|
||||
созданию так называемого шаблона "хозяин-гость":
|
||||
|
||||
* гость (не привязан к платформе)
|
||||
* имеет сетевое представление
|
||||
* используется кросс-платформенным кодом на C++
|
||||
* хозяин (определённая платформа)
|
||||
* опрашивает гостя на наличие ожидающих выполнение запросов
|
||||
* обрабатывает их
|
||||
* сообщает результат гостю
|
||||
|
||||
[Пример выбора узла сцены][osgcpe-05] оказался простым и не создал особых проблем.
|
||||
|
||||
**Изменение в работе с зависимостями**
|
||||
|
||||
Больше года нам приходилось жить со следующими [недостатками][osg-shortcomings]
|
||||
сборки OpenSceneGraph официальными средствами:
|
||||
|
||||
* проблемы сборки под macOS ввиду использования определённых флагов сборки
|
||||
* обход механизмов проверки зависимостей для использования PNG на Android
|
||||
* принадлежность сборок iOS под симулятор и устройство к разным проектам Xcode
|
||||
* ожидания в 20-30 минут для сборки OpenSceneGraph
|
||||
|
||||
Эти недостатки замедляли нас и усложняли разработку новых примеров. После того,
|
||||
как мы десятый раз столкнулись с указанными проблемами в этом месяце, мы решили
|
||||
исправить их раз и навсегда. Теперь мы собираем OpenSceneGraph как часть каждого
|
||||
примера за 2-3 минуты без какой-либо магии. Также мы использовали этот подход
|
||||
включения зависимости как части каждого примера для остальных библиотек вроде
|
||||
Mongoose и libpng-android.
|
||||
|
||||
Теперь без этих препятствий мы можем разрабатывать быстрее. Это значительно
|
||||
облегчит создание следующей технической демонстрации Mahjong 2!
|
||||
|
||||
На этом мы заканчиваем описание двух новых кросс-платформенных примеров
|
||||
OpenSceneGraph и изменения в работе с зависимостями.
|
||||
|
||||
[screenshot]: {attach}/images/2018-08-21-examples-and-dependencies.png
|
||||
|
||||
[article-2018-june]: {filename}/articles/2018-06-27-example-driven-development.md
|
||||
|
||||
[osgcpe-03]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.HTTPClient
|
||||
[osgcpe-04]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging
|
||||
[osgcpe-05]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/05.NodeSelection
|
||||
|
||||
[osg-shortcomings]: http://forum.openscenegraph.org/viewtopic.php?t=17443
|
||||
@@ -0,0 +1,78 @@
|
||||
Title: Examples and dependencies
|
||||
Date: 2018-08-21 00:00
|
||||
Category: News
|
||||
Slug: examples-and-dependencies
|
||||
Lang: en
|
||||
|
||||
![Screenshot][screenshot]
|
||||
|
||||
This article describes two new OpenSceneGraph cross-platform examples and the
|
||||
change in handling dependencies.
|
||||
|
||||
**Examples of HTTP client and node selection**
|
||||
|
||||
Once we finished working on [the remote debugging example][osgcpe-04] and
|
||||
[reported its completion][article-2018-june], 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.
|
||||
|
||||
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.
|
||||
|
||||
The need to support HTTPS on each platform spurred us to create
|
||||
[HTTP client example][osgcpe-03]. Turned out, each platform had its own
|
||||
preferred way of doing secure HTTP:
|
||||
|
||||
* web (Emscripten) provides Fetch API
|
||||
* desktop is fine with Mongoose and OpenSSL
|
||||
* Android provides HttpUrlConnection in Java
|
||||
* iOS provides NSURLSession in Objective-C
|
||||
|
||||
The need to support different languages on different platforms resulted
|
||||
in the creation of so-called 'host-guest' pattern:
|
||||
|
||||
* guest (platform agnostic)
|
||||
* provides networking representation
|
||||
* used by cross-platform C++ code
|
||||
* host (specific platform)
|
||||
* polls guest for pending requests
|
||||
* processes them
|
||||
* reports results back to the guest
|
||||
|
||||
[Node selection example][osgcpe-05] was straightforward and caused no troubles.
|
||||
|
||||
**The change in handling dependencies**
|
||||
|
||||
For over a year we had to deal with the following
|
||||
[shortcomings][osg-shortcomings] when building OpenSceneGraph across platforms
|
||||
using conventional methods:
|
||||
|
||||
* macOS builds failing due to certain compile flags we use
|
||||
* hacking PNG plugin safety guards to have PNG support under Android
|
||||
* iOS simulator and device builds of the same example being in separate Xcode projects
|
||||
* OpenSceneGraph taking 20-30 minutes to build
|
||||
|
||||
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.
|
||||
|
||||
With these obstacles out of the way, we can now iterate faster. Just in time
|
||||
for the next technical demonstration of Mahjong 2!
|
||||
|
||||
That's it for describing two new OpenSceneGraph cross-platform examples and
|
||||
the change in handling dependencies.
|
||||
|
||||
[screenshot]: {attach}/images/2018-08-21-examples-and-dependencies.png
|
||||
|
||||
[article-2018-june]: {filename}/articles/2018-06-27-example-driven-development.md
|
||||
|
||||
[osgcpe-03]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.HTTPClient
|
||||
[osgcpe-04]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging
|
||||
[osgcpe-05]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/05.NodeSelection
|
||||
|
||||
[osg-shortcomings]: http://forum.openscenegraph.org/viewtopic.php?t=17443
|
||||
BIN
pelican/content/images/2018-08-21-examples-and-dependencies.png
Normal file
BIN
pelican/content/images/2018-08-21-examples-and-dependencies.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
Reference in New Issue
Block a user