-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
402 lines (264 loc) · 15.7 KB
/
index.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>ongamex's blog</title>
<meta property="og:title" content="ongamex's blog" />
<meta name="twitter:title" content="ongamex's blog" />
<meta name="author" content="ongamex"/>
<link href='https://ongamex.github.io/images/me.jpg' rel='icon' type='image/x-icon'/>
<meta property="og:image" content="https://ongamex.github.io/images/me.jpg" />
<meta name="twitter:image" content="https://ongamex.github.io/images/me.jpg" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@ongamex92" />
<meta name="twitter:creator" content="@ongamex92" />
<meta property="og:url" content="https://ongamex.github.io/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="ongamex's blog" />
<meta name="generator" content="Hugo 0.31" />
<link rel="canonical" href="https://ongamex.github.io/" />
<link rel="alternate" href="https://ongamex.github.io/index.xml" type="application/rss+xml" title="ongamex's blog">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://ongamex.github.io/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
<link rel="stylesheet" href="https://ongamex.github.io/css/highlighting.css" />
<link rel="stylesheet" href="https://ongamex.github.io/css/pygment_highlights.css" />
<link rel="stylesheet" href="https://ongamex.github.io/css/highlight.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.css" integrity="sha256-sCl5PUOGMLfFYctzDW3MtRib0ctyUvI9Qsmq2wXOeBY=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/default-skin/default-skin.min.css" integrity="sha256-BFeI1V+Vh1Rk37wswuOYn5lsTcaU96hGaI7OUVCLjPc=" crossorigin="anonymous" />
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-105845169-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='//www.google-analytics.com/analytics.js'></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top navbar-custom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://ongamex.github.io/">ongamex's blog</a>
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav navbar-nav navbar-right">
<li>
<a title="Blog" href="/">Blog</a>
</li>
<li>
<a title="About" href="/page/about/">About</a>
</li>
<li>
<a title="Tags" href="/tags">Tags</a>
</li>
</ul>
</div>
<div class="avatar-container">
<div class="avatar-img-border">
<a title="ongamex's blog" href="https://ongamex.github.io/">
<img class="avatar-img" src="https://ongamex.github.io/images/me.jpg" alt="ongamex's blog" />
</a>
</div>
</div>
</div>
</nav>
<header class="header-section ">
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h1>ongamex's blog</h1>
<hr class="small">
<span class="page-subheading">a blog about games and programming</span>
</div>
</div>
</div>
</div>
</div>
</header>
<div role="main" class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="posts-list">
<article class="post-preview">
<a href="https://ongamex.github.io/post/004.anyobject/">
<h2 class="post-title">C++ minimal std::any</h2>
</a>
<span class="post-meta">
<i class="fa fa-calendar-o"></i> Posted on November 23, 2017
| <i class="fa fa-clock-o"></i> 2 min (240 mots)
</span>
<div class="post-entry">
A few days ago I wrote a simple alternative to std::any. It is heavily inspired by Sean Parent’s talk Better Code: Runtime Polymorphism.
If you don’t know what std::any is, basically it is a structure that can hold data of any type, while maintaining the value semantics.
With C++11 this is really easily done in just a few lines. I’m still unsure how and where can I use it.
// "struct object" is the magic type.
<a href="https://ongamex.github.io/post/004.anyobject/" class="post-read-more">[Read More]</a>
</div>
<span class="post-meta">
#<a href="https://ongamex.github.io/tags/c++/">C++</a>
</span>
</article>
<article class="post-preview">
<a href="https://ongamex.github.io/post/002.cpp.reflections/">
<h2 class="post-title">C++ reflection/introspection system</h2>
</a>
<span class="post-meta">
<i class="fa fa-calendar-o"></i> Posted on September 28, 2017
| <i class="fa fa-clock-o"></i> 4 min (692 mots)
</span>
<div class="post-entry">
Why do I need this? As some of you may know, I’m writing a game in my spare time. In order to make the level/game editor usable, I have to be able to quickly display and edit values. Doing the UI/Serialization/UndoRedo by hand for every type is just too much. The solution to that problem is usually some kind of reflection or introspection system.
Unfortunately C++ does not have a built in solution.
<a href="https://ongamex.github.io/post/002.cpp.reflections/" class="post-read-more">[Read More]</a>
</div>
</article>
<article class="post-preview">
<a href="https://ongamex.github.io/post/003.maya2danim/">
<h2 class="post-title">2D Animation In Maya: Import images as planes</h2>
</a>
<span class="post-meta">
<i class="fa fa-calendar-o"></i> Posted on September 8, 2017
| <i class="fa fa-clock-o"></i> 2 min (419 mots)
</span>
<div class="post-entry">
A while ago I wanted to create a simple 2D “cut-out” animation, just a few images imported and assigned on a planes. Unfortunately, Maya did not had this functionally built in. Doing this by hand requires you to:
Create a File Texture Create some material and assign the texture as diffuse colour and alpha Create a plane with correct width/height ratio Modify the UV channel Assign the previously created material to the plane And on top of that you’ve got to do it for every single image that you want to use.
<a href="https://ongamex.github.io/post/003.maya2danim/" class="post-read-more">[Read More]</a>
</div>
<span class="post-meta">
#<a href="https://ongamex.github.io/tags/maya/">Maya</a>
</span>
</article>
<article class="post-preview">
<a href="https://ongamex.github.io/post/001.codesnippets/">
<h2 class="post-title">C++ Code Snippets 1</h2>
</a>
<span class="post-meta">
<i class="fa fa-calendar-o"></i> Posted on September 4, 2017
| <i class="fa fa-clock-o"></i> 3 min (591 mots)
</span>
<div class="post-entry">
This is a set of some code snippets that you might find useful.
The 1st one is pretty popular, but I use it in the snippets below. Basically it is
A way to retrieve the size of a C++ array. template <typename T, size_t N> char (&TArrSize_Safe(T (&)[N]))[N]; #define ARRSZ(A) (sizeof(TArrSize_Safe(A))) // Usage int myArray[1234]; printf("myArray has %d elements!" ARRSZ(myArray)); printf style std::string formatting: // The caller is EXPECTED to call va_end on the va_list args inline void string_format(std::string& retval, const char* const fmt_str, va_list args) { // [CAUTION] // Under Windows with msvc it is fine to call va_start once and then use the va_list multiple times.
<a href="https://ongamex.github.io/post/001.codesnippets/" class="post-read-more">[Read More]</a>
</div>
<span class="post-meta">
#<a href="https://ongamex.github.io/tags/c++/">C++</a>
</span>
</article>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center footer-links">
<li>
<a href="mailto:[email protected]" title="Email me">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://twitter.com/ongamex92" title="Twitter">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://reddit.com/u/ongamex" title="Reddit">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-reddit-alien fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://ongamex.github.io/index.xml" title="RSS">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="credits copyright text-muted">
<a href="ongamex.github.io">ongamex</a>
•
2017
•
<a href="https://ongamex.github.io/">ongamex's blog</a>
</p>
<p class="credits theme-by text-muted">
<a href="http://gohugo.io">Hugo v0.31</a> powered • Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>
</p>
</div>
</div>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js" integrity="sha384-/y1Nn9+QQAipbNQWU65krzJralCnuOasHncUFXGkdwntGeSvQicrYkiUBwsgUqc1" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/contrib/auto-render.min.js" integrity="sha384-dq1/gEHSxPZQ7DdrM82ID4YVol9BYyU7GbWlIwnwyPzotpoc57wDw/guX8EaYGPx" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ongamex.github.io/js/main.js"></script>
<script src="https://ongamex.github.io/js/highlight.min.js"></script>
<script> hljs.initHighlightingOnLoad(); </script><script> renderMathInElement(document.body); </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.js" integrity="sha256-UplRCs9v4KXVJvVY+p+RSo5Q4ilAUXh7kpjyIP5odyc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe-ui-default.min.js" integrity="sha256-PWHOlUzc96pMc8ThwRIXPn8yH4NOLu42RQ0b9SpnpFk=" crossorigin="anonymous"></script>
<script src="https://ongamex.github.io/js/load-photoswipe.js"></script>
</body>
</html>