-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples-and-dependencies.html
145 lines (143 loc) · 5.92 KB
/
examples-and-dependencies.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style>
body
{
background: #FAFAFA;
}
code, pre
{
font-family: monospace, serif;
font-size: 1em;
color: #7f0a0c;
}
figure
{
margin: 0px;
padding: 0px;
}
img
{
width: 720px;
}
html
{
font-family: sans-serif;
}
#header
{
background: #2BA6E3;
padding: 0.7em;
text-align: left;
}
#header a
{
color: white;
text-decoration: none;
padding: 0.5em 1em 0.5em 1em;
}
a
{
color: #3A91CB;
text-decoration: none;
}
.news_item
{
background: #FFFFFF;
width: 720px;
padding: 1em;
margin-top: 2em;
margin-bottom: 2em;
border: 1px solid #E0E0E0;
text-align: left;
}
.news_item_contents
{
color: #444;
line-height: 1.5em;
}
.news_item_date
{
margin-bottom: 50px;
color: #aaa;
}
#lang
{
float: right;
}
</style>
</head>
<body>
<center>
<div id="header">
<a href="index.html">News</a>
<a href="games.html">Games</a>
<a href="tools.html">Tools</a>
<a href="about.html">About</a>
<div id="lang">
<a href="examples-and-dependencies.html">EN</a>
<a href="examples-and-dependencies-ru.html">RU</a>
</div>
</div>
<h1>In the news</h1>
<div class="news_item">
<h2 class="news_item_title">
<a href="
2018-08-21-examples-and-dependencies.html
">
Examples and dependencies
</a>
</h2>
<p class="news_item_date">
2018-08-21 00:00
</p>
<div class="news_item_contents">
<figure>
<img src="images/2018-08-21-examples-and-dependencies.png" alt="Screenshot" /><figcaption>Screenshot</figcaption>
</figure>
<p>This article describes two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
<p><strong>Examples of HTTP client and node selection</strong></p>
<p>Once we finished working on <a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging">the remote debugging example</a> and <a href="2018-06-27-example-driven-development.html">reported its completion</a>, 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.</p>
<p>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.</p>
<p>The need to support HTTPS on each platform spurred us to create <a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/03.HTTPClient">HTTP client example</a>. Turned out, each platform had its own preferred way of doing secure HTTP:</p>
<ul>
<li>web (Emscripten) provides Fetch API</li>
<li>desktop is fine with Mongoose and OpenSSL</li>
<li>Android provides HttpUrlConnection in Java</li>
<li>iOS provides NSURLSession in Objective-C</li>
</ul>
<p>The need to support different languages on different platforms resulted in the creation of so-called ‘host-guest’ pattern:</p>
<ul>
<li>guest (platform agnostic)
<ul>
<li>provides networking representation</li>
<li>used by cross-platform C++ code</li>
</ul></li>
<li>host (specific platform)
<ul>
<li>polls guest for pending requests</li>
<li>processes them</li>
<li>reports results back to the guest</li>
</ul></li>
</ul>
<p><a href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/05.NodeSelection">Node selection example</a> was straightforward and caused no troubles.</p>
<p><strong>The change in handling dependencies</strong></p>
<p>For over a year we had to deal with the following <a href="http://forum.openscenegraph.org/viewtopic.php?t=17443">shortcomings</a> when building OpenSceneGraph across platforms using conventional methods:</p>
<ul>
<li>macOS builds failing due to certain compile flags we use</li>
<li>hacking PNG plugin safety guards to have PNG support under Android</li>
<li>iOS simulator and device builds of the same example being in separate Xcode projects</li>
<li>OpenSceneGraph taking 20-30 minutes to build</li>
</ul>
<p>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.</p>
<p>With these obstacles out of the way, we can now iterate faster. Just in time for the next technical demonstration of Mahjong 2!</p>
<p>That’s it for describing two new OpenSceneGraph cross-platform examples and the change in handling dependencies.</p>
</div>
</div>
</center>
<script type="text/javascript">
</script>
</body>
</html>