File: CastleWindow.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (636 lines) | stat: -rw-r--r-- 38,231 bytes parent folder | download
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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleWindow</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<h1 class="unit">Unit CastleWindow</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Uses">Uses</a></td><td><a class="section" href="#PasDoc-Classes">Classes, Interfaces, Objects and Records</a></td><td><a class="section" href="#PasDoc-FuncsProcs">Functions and Procedures</a></td><td><a class="section" href="#PasDoc-Types">Types</a></td><td><a class="section" href="#PasDoc-Constants">Constants</a></td><td>Variables</td></tr></table>
<a name="PasDoc-Description"></a><h2 class="description">Description</h2>
<p>
Window with OpenGL context suitable for 2D and 3D rendering of &quot;Castle Game Engine&quot;. Provides a window with OpenGL context that can contain 2D controls and 3D objects defined by our engine. <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> is the base window class, and <a class="normal" href="CastleWindow.TCastleWindow.html">TCastleWindow</a> is a comfortable class that adds a ready scene manager.

<p><a class="normal" href="CastleWindow.html#Application">Application</a> object (instance of class <a class="normal" href="CastleWindow.TCastleApplication.html">TCastleApplication</a>) is a central manager of all open <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> windows.

<p>Using this unit:

<p></p>

<ol class="paragraph_spacing">
  <li value="1"><p>Declare and create <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> instance. (Or a descendant like <a class="normal" href="CastleWindow.TCastleWindow.html">TCastleWindow</a>.)</p></li>
  <li value="2"><p>Assign Window properties and callbacks like <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnRender">OnRender</a>, <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnResize">OnResize</a>, <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Width">Width</a>, <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Height">Height</a>, <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Caption">Caption</a>.</p></li>
  <li value="3"><p>To initialize your game, you usually want to use <a class="normal" href="CastleWindow.TCastleApplication.html#OnInitialize">Application.OnInitialize</a>.

<p>If you only care about standalone programs (for normal OSes like Linux, Windows, MacOSX, but not Android) you may also just initialize your game in the main program block, although using <a class="normal" href="CastleWindow.TCastleApplication.html#OnInitialize">Application.OnInitialize</a> is still often comfortable.</p></li>
  <li value="4"><p>Call <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Open">Window.Open</a>, this will actually show the window and it's associated OpenGL context.

<p>The first window open calls <a class="normal" href="CastleWindow.TCastleApplication.html#OnInitialize">Application.OnInitialize</a>. It also calls <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnOpen">OnOpen</a> and <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnResize">OnResize</a> callbacks.</p></li>
  <li value="5"><p>Call <a class="normal" href="CastleWindow.TCastleApplication.html#Run">Application.Run</a>. This will enter message loop that will call appropriate windows' callbacks at appropriate times (OnRender, OnPress, OnRelease, OnResize, OnUpdate and many more). There are also some Application callbacks, like <a class="normal" href="CastleWindow.TCastleApplication.html#OnUpdate">Application.OnUpdate</a>.

<p>For more advanced needs you can use something like </p>

<pre class="longcode">  <span class="pascal_keyword">while</span> Application.ProcessMessage <span class="pascal_keyword">do</span> &lt;something>;</pre>

<p> instead of Application.Run.

<p>You can also call <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OpenAndRun">Window.OpenAndRun</a>, this is just a shortcut for Window.Open + Application.Run.</p></li>
  <li value="6"><p>Application.Run ends when you call <a class="normal" href="CastleWindow.TCastleApplication.html#Quit">Application.Quit</a> or when you close last visible window using <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Close">Close(true)</a>.

<p>User is also allowed to close a window using WindowManager facilities (clicking on &quot;X&quot; button in the frame corner, pressing Alt+F4 or something like that). By default, such user action will make window close (but you can freely customize what your program does when user tries to close the window using callback <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnCloseQuery">OnCloseQuery</a>).</p></li>
</ol>

<p>

<p>So the simplest example of using this unit can look like this:

<p></p>

<pre class="longcode">
  <span class="pascal_keyword">uses</span> CastleWindow;

  <span class="pascal_keyword">var</span>
    Window: TCastleWindowCustom;

  <span class="pascal_keyword">procedure</span> Render(Sender: TUIContainer);
  <span class="pascal_keyword">begin</span>  <span class="pascal_numeric"></span>...  <span class="pascal_keyword">end</span>;

  <span class="pascal_keyword">procedure</span> Resize(Sender: TUIContainer);
  <span class="pascal_keyword">begin</span>  <span class="pascal_numeric"></span>...  <span class="pascal_keyword">end</span>;

  <span class="pascal_keyword">begin</span>
    Window := TCastleWindowCustom.Create(Application);
    Window.OnResize := @Resize;
    Window.OnRender := @Render;
    Window.Caption := <span class="pascal_string">'Simplest CastleWindow example'</span>;
    Window.OpenAndRun;
  <span class="pascal_keyword">end</span>.
</pre>

<p>

<p><i>More component-like approach</i>: For larger programs, it makes more sense to divide functionality into controls, which are classes descending from <a class="normal" href="CastleUIControls.TUIControl.html">TUIControl</a>. You can override <a class="normal" href="CastleUIControls.TUIControl.html">TUIControl</a> methods to render, capture input and so on (see e.g. <a class="normal" href="CastleUIControls.TUIControl.html#Render">TUIControl.Render</a>, <a class="normal" href="CastleUIControls.TInputListener.html#Press">TInputListener.Press</a>, <a class="normal" href="CastleUIControls.TInputListener.html#Update">TInputListener.Update</a>.) You can then add your control to the <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Controls">TCastleWindowCustom.Controls</a> list.

<p>Some features list:

<p></p>

<ul class="paragraph_spacing">
  <li><p><a class="normal" href="CastleWindow.TCastleApplication.html#ProcessMessage">TCastleApplication.ProcessMessage</a> method. This allows you to reimplement event loop handling, which is crucial for implementing things like <a class="normal" href="CastleMessages.html#MessageInputQuery">MessageInputQuery</a> function that does modal GUI dialog box.</p></li>
  <li><p><a class="normal" href="CastleWindow.TCastleWindowCustom.html#Pressed">TCastleWindowCustom.Pressed</a> to easily and reliably check which keys are pressed.</p></li>
  <li><p>Frames per second measuring, see <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Fps">TCastleWindowCustom.Fps</a>,</p></li>
  <li><p>A menu bar under WinAPI and GTK backends.

<p>You can attach a menu to a window. Menu structure is constructed using various descendants of <a class="normal" href="CastleWindow.TMenuEntry.html">TMenuEntry</a> class. Then you have to assign such menu structure to <a class="normal" href="CastleWindow.TCastleWindowCustom.html#MainMenu">TCastleWindowCustom.MainMenu</a> property. When <code>CastleWindow</code> is implemented on top of GTK_2 or WINAPI or LCL we will show this menu and call <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnMenuClick">TCastleWindowCustom.OnMenuClick</a> when user clicks some menu item. Other backends (XLIB for now) ignore MainMenu.

<p>See <code>castle_game_engine/examples/window/window_menu.lpr</code> for an example how to use the menu.</p></li>
  <li><p>Changing screen resolution and bit depth, see <a class="normal" href="CastleWindow.TCastleApplication.html#VideoChange">TCastleApplication.VideoChange</a>.</p></li>
  <li><p>You can request OpenGL context properties: </p>

<ul class="paragraph_spacing">
  <li><p>color buffer</p></li>
  <li><p>with alpha channel (<a class="normal" href="CastleWindow.TCastleWindowCustom.html#AlphaBits">AlphaBits</a>),</p></li>
  <li><p>stencil buffer (<a class="normal" href="CastleWindow.TCastleWindowCustom.html#StencilBits">StencilBits</a>),</p></li>
  <li><p>double buffer (<a class="normal" href="CastleWindow.TCastleWindowCustom.html#DoubleBuffer">DoubleBuffer</a>),</p></li>
  <li><p>multisampling (full-screen antialiasing) buffers (by <a class="normal" href="CastleWindow.TCastleWindowCustom.html#MultiSampling">MultiSampling</a> or higher-level <a class="normal" href="CastleWindow.TCastleWindowCustom.html#AntiAliasing">AntiAliasing</a>)</p></li>
</ul>

<p> </p></li>
  <li><p>You can use native modal dialogs for things such as file selection. GTK backend will use GTK dialogs, WinAPI backend will use Windows dialog boxes, XLib backend will fall back on <a class="normal" href="CastleMessages.html">CastleMessages</a> text input.

<p>See <a class="normal" href="CastleWindow.TCastleWindowCustom.html#FileDialog">TCastleWindowCustom.FileDialog</a> (for opening and saving files) and <a class="normal" href="CastleWindow.TCastleWindowCustom.html#ColorDialog">TCastleWindowCustom.ColorDialog</a> (for choosing RGB colors).</p></li>
  <li><p><a class="normal" href="CastleWindow.TCastleWindowCustom.html#ParseParameters">TCastleWindowCustom.ParseParameters</a> method allows you to easily initialize <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> properties like initial size and position using command-line parameters like <code>--geometry WIDTHxHEIGHT</code>, <code>--display</code> etc.</p></li>
</ul>

<p></p>
<a name="PasDoc-Uses"></a><h2 class="uses">Uses</h2>
<ul class="useslist"><li>Glib2</li><li>Gdk2</li><li>Gtk2</li><li>GdkGLExt</li><li>GtkGLExt</li><li><a  href="CastleDynLib.html">CastleDynLib</a></li><li>Gdk2X</li><li>X</li><li>Xlib</li><li>SysUtils</li><li>Classes</li><li><a  href="CastleVectors.html">CastleVectors</a></li><li>GL</li><li>GLU</li><li>GLExt</li><li><a  href="CastleRectangles.html">CastleRectangles</a></li><li><a  href="CastleColors.html">CastleColors</a></li><li><a  href="CastleUtils.html">CastleUtils</a></li><li><a  href="CastleClassUtils.html">CastleClassUtils</a></li><li><a  href="CastleGLUtils.html">CastleGLUtils</a></li><li><a  href="CastleImages.html">CastleImages</a></li><li><a  href="CastleGLImages.html">CastleGLImages</a></li><li><a  href="CastleKeysMouse.html">CastleKeysMouse</a></li><li><a  href="CastleStringUtils.html">CastleStringUtils</a></li><li><a  href="CastleFilesUtils.html">CastleFilesUtils</a></li><li><a  href="CastleTimeUtils.html">CastleTimeUtils</a></li><li><a  href="CastleFileFilters.html">CastleFileFilters</a></li><li><a  href="CastleUIControls.html">CastleUIControls</a></li><li><a  href="CastleGLContainer.html">CastleGLContainer</a></li><li><a  href="CastleCameras.html">CastleCameras</a></li><li>FGL</li><li>pk3DConnexion</li><li><a  href="X3DNodes.html">X3DNodes</a></li><li><a  href="CastleScene.html">CastleScene</a></li><li><a  href="CastleSceneManager.html">CastleSceneManager</a></li><li><a  href="CastleLevels.html">CastleLevels</a></li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Classes"></a><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuEntry.html"><code>TMenuEntry</code></a></td>
<td class="itemdesc">A basic class representing basic menu building block.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuEntryWithCaption.html"><code>TMenuEntryWithCaption</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenu.html"><code>TMenu</code></a></td>
<td class="itemdesc"><a class="normal" href="CastleWindow.TMenuEntry.html">TMenuEntry</a> that contains a list of menu entries.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuItem.html"><code>TMenuItem</code></a></td>
<td class="itemdesc"><a class="normal" href="CastleWindow.TMenuEntry.html">TMenuEntry</a> that is a simple, clickable menu item.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuSeparator.html"><code>TMenuSeparator</code></a></td>
<td class="itemdesc"><a class="normal" href="CastleWindow.TMenuEntry.html">TMenuEntry</a> that acts as a visual separator (horizontal line or something like that) between menu items.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuItemChecked.html"><code>TMenuItemChecked</code></a></td>
<td class="itemdesc"><a class="normal" href="CastleWindow.TMenuItem.html">TMenuItem</a> that should visualize Checked state somehow to the user.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuItemRadio.html"><code>TMenuItemRadio</code></a></td>
<td class="itemdesc">Menu radio item.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuItemRadioGroup.html"><code>TMenuItemRadioGroup</code></a></td>
<td class="itemdesc">A group of radio buttons.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TMenuItemToggleFullScreen.html"><code>TMenuItemToggleFullScreen</code></a></td>
<td class="itemdesc">Menu item that toggles <a class="normal" href="CastleWindow.TCastleWindowCustom.html#FullScreen">TCastleWindowCustom.FullScreen</a>.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.EGLContextNotPossible.html"><code>EGLContextNotPossible</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TCastleWindowCustom.html"><code>TCastleWindowCustom</code></a></td>
<td class="itemdesc">Window with an OpenGL context.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TCastleWindow.html"><code>TCastleWindow</code></a></td>
<td class="itemdesc">Window with an OpenGL context, most comfortable to render 3D worlds with 2D controls above.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TWindowList.html"><code>TWindowList</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TCastleApplication.html"><code>TCastleApplication</code></a></td>
<td class="itemdesc">Application, managing all open <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> (OpenGL windows).</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleWindow.TCastleClipboard.html"><code>TCastleClipboard</code></a></td>
<td class="itemdesc"><a class="normal" href="CastleWindow.html#Clipboard">Clipboard</a> for cut / copy / paste of text.</td>
</tr>
</table>
<a name="PasDoc-FuncsProcs"></a><h3 class="summary">Functions and Procedures</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#Application">Application</a></b>: <a  href="CastleWindow.TCastleApplication.html">TCastleApplication</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#Clipboard">Clipboard</a></b>: <a  href="CastleWindow.TCastleClipboard.html">TCastleClipboard</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>procedure <b><a  href="CastleWindow.html#Resize2D">Resize2D</a></b>(Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#KeyString">KeyString</a></b>(const CharKey: char; const Key: <a  href="CastleKeysMouse.html#TKey">TKey</a>; const Modifiers: <a  href="CastleKeysMouse.html#TModifierKeys">TModifierKeys</a>; out S: string): boolean;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#MenuItemFromSmallId">MenuItemFromSmallId</a></b>(SearchSmallId: Integer): <a  href="CastleWindow.TMenuItem.html">TMenuItem</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#SRemoveMnemonics">SRemoveMnemonics</a></b>(const S: string): string;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a  href="CastleWindow.html#SQuoteMenuEntryCaption">SQuoteMenuEntryCaption</a></b>(const S: string): string;</code></td>
</tr>
</table>
<a name="PasDoc-Types"></a><h3 class="summary">Types</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TWindowParseOption">TWindowParseOption</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TWindowParseOptions">TWindowParseOptions</a></b> = set of <a  href="CastleWindow.html#TWindowParseOption">TWindowParseOption</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#PWindowParseOptions">PWindowParseOptions</a></b> = &circ;<a  href="CastleWindow.html#TWindowParseOptions">TWindowParseOptions</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TAntiAliasing">TAntiAliasing</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TUIContainer">TUIContainer</a></b> = <a  href="CastleUIControls.TUIContainer.html">CastleUIControls.TUIContainer</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TMenuEntryList">TMenuEntryList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleWindow.TMenuEntry.html">TMenuEntry</a>&gt;;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TWindowMessageType">TWindowMessageType</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TUpdateFunc">TUpdateFunc</a></b> = procedure;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TMenuClickFunc">TMenuClickFunc</a></b> = procedure (Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>; Item: <a  href="CastleWindow.TMenuItem.html">TMenuItem</a>);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TDropFilesFunc">TDropFilesFunc</a></b> = procedure (Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>; const FileNames: array of string);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TGLContextRetryOpenFunc">TGLContextRetryOpenFunc</a></b> = function (Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TResizeAllowed">TResizeAllowed</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#PGtkGLArea">PGtkGLArea</a></b> = PGtkWidget;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TCastleWindowBase">TCastleWindowBase</a></b> = <a  href="CastleWindow.html#TUIContainer">TUIContainer</a> deprecated;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#TGLApplication">TGLApplication</a></b> = <a  href="CastleWindow.TCastleApplication.html">TCastleApplication</a> deprecated;</code></td>
</tr>
</table>
<a name="PasDoc-Constants"></a><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#WindowPositionCenter">WindowPositionCenter</a></b> = -1000000;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#WindowDefaultSize">WindowDefaultSize</a></b> = -1000000;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#StandardParseOptions">StandardParseOptions</a></b> = [poGeometry, poScreenGeometry, poDisplay, poMacOsXProcessSerialNumber];</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#DefaultDepthBits">DefaultDepthBits</a></b> = 16;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#DefaultFpsCaptionUpdateInterval">DefaultFpsCaptionUpdateInterval</a></b> = 5000;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#DefaultLimitFPS">DefaultLimitFPS</a></b> = 100.0;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleWindow.html#DefaultAntiAliasing">DefaultAntiAliasing</a></b> = aaNone;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleWindow.html#AntiAliasingNames">AntiAliasingNames</a></b>: array [<a  href="CastleWindow.html#TAntiAliasing">TAntiAliasing</a>] of string =
  ( 'None',
    '2 samples (faster)',
    '2 samples (nicer)',
    '4 samples (faster)',
    '4 samples (nicer)',
    '8 samples (faster) (only latest GPUs)',
    '8 samples (nicer) (only latest GPUs)',
    '16 samples (faster) (only latest GPUs)',
    '16 samples (nicer) (only latest GPUs)'
  );</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Functions and Procedures</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="Application"></a><code>function <b>Application</b>: <a  href="CastleWindow.TCastleApplication.html">TCastleApplication</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Single global instance of <a class="normal" href="CastleWindow.TCastleApplication.html">TCastleApplication</a>. Automatically created / destroyed by <a class="normal" href="CastleWindow.html">CastleWindow</a> unit.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="Clipboard"></a><code>function <b>Clipboard</b>: <a  href="CastleWindow.TCastleClipboard.html">TCastleClipboard</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Single global instance of <a class="normal" href="CastleWindow.TCastleClipboard.html">TCastleClipboard</a>. Automatically created / destroyed by <a class="normal" href="CastleWindow.html">CastleWindow</a> unit.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="Resize2D"></a><code>procedure <b>Resize2D</b>(Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>);</code></td>
</tr>
<tr><td colspan="1">
<p>
A simple <a class="normal" href="CastleWindow.TCastleWindowCustom.html#OnResize">TCastleWindowCustom.OnResize</a> callback implementation, that sets 2D projection. You can use it like <code>Window.OnResize := <code>Resize2D</code>;</code> or just by calling it directly from your OnResize callback.

<p>It does </p>

<pre class="longcode">
  glViewport(Window.Rect);
  OrthoProjection(<span class="pascal_numeric">0</span>, Window.Width, <span class="pascal_numeric">0</span>, Window.Height);
</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="KeyString"></a><code>function <b>KeyString</b>(const CharKey: char; const Key: <a  href="CastleKeysMouse.html#TKey">TKey</a>; const Modifiers: <a  href="CastleKeysMouse.html#TModifierKeys">TModifierKeys</a>; out S: string): boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Describe given key. Key is given as combination of character code (may be #0) and Key code (may be K_None), and additional required <code>Modifiers</code> (although some modifiers may be already implied by CharKey). See <a class="normal" href="CastleWindow.TMenuItem.html#Key">TMenuItem.Key</a> and <a class="normal" href="CastleWindow.TMenuItem.html#CharKey">TMenuItem.CharKey</a> and <a class="normal" href="CastleWindow.TMenuItem.html#Modifiers">TMenuItem.Modifiers</a>.

<p>Only when both CharKey = #0 and Key = K_None then this combination doesn't describe any key, and we return <code>False</code>. Otherwise we return <code>True</code> and set S.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="MenuItemFromSmallId"></a><code>function <b>MenuItemFromSmallId</b>(SearchSmallId: Integer): <a  href="CastleWindow.TMenuItem.html">TMenuItem</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Search for menu item with given SmallId. SearchSmallId must be a SmallId of some existing (i.e. created and not destroyed yet) <a class="normal" href="CastleWindow.TMenuItem.html">TMenuItem</a>. This function returns this <a class="normal" href="CastleWindow.TMenuItem.html">TMenuItem</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="SRemoveMnemonics"></a><code>function <b>SRemoveMnemonics</b>(const S: string): string;</code></td>
</tr>
<tr><td colspan="1">
<p>
Returns S with each '__' replaced with single '_', any other '_' removed.

<p>In other words: with mnemonics (as defined by <a class="normal" href="CastleWindow.TMenuEntryWithCaption.html#Caption">TMenuEntryWithCaption.Caption</a> removed.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="SQuoteMenuEntryCaption"></a><code>function <b>SQuoteMenuEntryCaption</b>(const S: string): string;</code></td>
</tr>
<tr><td colspan="1">
<p>
Returns S with each underscore '_' replaced by two underscores, '__'.

<p>In other words: S will not contain any mnemonics. If you will assign S to <a class="normal" href="CastleWindow.TMenuEntryWithCaption.html#Caption">TMenuEntryWithCaption.Caption</a>, then this menu entry caption will display exactly S, without any mnemonics. Single '_' in S will be displayed exactly as single '_'.</p>
</td></tr>
</table>
<h3 class="detail">Types</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TWindowParseOption"></a><code><b>TWindowParseOption</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;<h6 class="description_section">Values</h6>
<ul>
<li>
poGeometry: &nbsp;</li>
<li>
poScreenGeometry: &nbsp;</li>
<li>
poDisplay: &nbsp;</li>
<li>
poMacOsXProcessSerialNumber: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TWindowParseOptions"></a><code><b>TWindowParseOptions</b> = set of <a  href="CastleWindow.html#TWindowParseOption">TWindowParseOption</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="PWindowParseOptions"></a><code><b>PWindowParseOptions</b> = &circ;<a  href="CastleWindow.html#TWindowParseOptions">TWindowParseOptions</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TAntiAliasing"></a><code><b>TAntiAliasing</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Anti-aliasing values for <a class="normal" href="CastleWindow.TCastleWindowCustom.html#AntiAliasing">TCastleWindowCustom.AntiAliasing</a>.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
aaNone: &nbsp;</li>
<li>
aa2SamplesFaster: 2 samples, &quot;don't care&quot; hint.</li>
<li>
aa2SamplesNicer: 2 samples, &quot;nicest&quot; hint (quincunx (5 taps) for NVidia).</li>
<li>
aa4SamplesFaster: 4 samples, &quot;don't care&quot; hint.</li>
<li>
aa4SamplesNicer: 4 samples, &quot;nicest&quot; hint (9 taps for NVidia).</li>
<li>
aa8SamplesFaster: 8 samples, &quot;don't care&quot; hint.</li>
<li>
aa8SamplesNicer: 8 samples, &quot;nicest&quot; hint.</li>
<li>
aa16SamplesFaster: 16 samples, &quot;don't care&quot; hint.</li>
<li>
aa16SamplesNicer: 16 samples, &quot;nicest&quot; hint.</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TUIContainer"></a><code><b>TUIContainer</b> = <a  href="CastleUIControls.TUIContainer.html">CastleUIControls.TUIContainer</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Expose <code>TUIContainer</code> type from <a class="normal" href="CastleWindow.html">CastleWindow</a> unit, since almost all code using <a class="normal" href="CastleWindow.html">CastleWindow</a> will need to use <code>TUIContainer</code> type for callback parameter type.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TMenuEntryList"></a><code><b>TMenuEntryList</b> = specialize TFPGObjectList&lt;<a  href="CastleWindow.TMenuEntry.html">TMenuEntry</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TWindowMessageType"></a><code><b>TWindowMessageType</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Type of message box, for <a class="normal" href="CastleWindow.TCastleWindowCustom.html#MessageOK">TCastleWindowCustom.MessageOK</a> and <a class="normal" href="CastleWindow.TCastleWindowCustom.html#MessageYesNo">TCastleWindowCustom.MessageYesNo</a>.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
mtInfo: &nbsp;</li>
<li>
mtWarning: &nbsp;</li>
<li>
mtQuestion: &nbsp;</li>
<li>
mtError: &nbsp;</li>
<li>
mtOther: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TUpdateFunc"></a><code><b>TUpdateFunc</b> = procedure;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TMenuClickFunc"></a><code><b>TMenuClickFunc</b> = procedure (Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>; Item: <a  href="CastleWindow.TMenuItem.html">TMenuItem</a>);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TDropFilesFunc"></a><code><b>TDropFilesFunc</b> = procedure (Container: <a  href="CastleWindow.html#TUIContainer">TUIContainer</a>; const FileNames: array of string);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TGLContextRetryOpenFunc"></a><code><b>TGLContextRetryOpenFunc</b> = function (Window: <a  href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a>): boolean;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TResizeAllowed"></a><code><b>TResizeAllowed</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;<h6 class="description_section">Values</h6>
<ul>
<li>
raNotAllowed: &nbsp;</li>
<li>
raOnlyAtOpen: &nbsp;</li>
<li>
raAllowed: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="PGtkGLArea"></a><code><b>PGtkGLArea</b> = PGtkWidget;</code></td>
</tr>
<tr><td colspan="1">
<p>
For now I use GtkDrawingArea when CASTLE_WINDOW_GTK_2. But, really, GLAreaGtk could be any gtk widget with CASTLE_WINDOW_GTK_2.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TCastleWindowBase"></a><code><b>TCastleWindowBase</b> = <a  href="CastleWindow.html#TUIContainer">TUIContainer</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p><p>
. In new programs, use <a class="normal" href="CastleWindow.html#TUIContainer">TUIContainer</a> as a parameter for callbacks, and <a class="normal" href="CastleWindow.TCastleWindowCustom.html">TCastleWindowCustom</a> or <a class="normal" href="CastleWindow.TCastleWindow.html">TCastleWindow</a> as window class.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TGLApplication"></a><code><b>TGLApplication</b> = <a  href="CastleWindow.TCastleApplication.html">TCastleApplication</a> deprecated;</code></td>
</tr>
<tr><td colspan="1">
<p class="hint_directive">Warning: this symbol is deprecated.</p><p>
 Deprecated name for <a class="normal" href="CastleWindow.TCastleApplication.html">TCastleApplication</a>.</p>
</td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="WindowPositionCenter"></a><code><b>WindowPositionCenter</b> = -1000000;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="WindowDefaultSize"></a><code><b>WindowDefaultSize</b> = -1000000;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="StandardParseOptions"></a><code><b>StandardParseOptions</b> = [poGeometry, poScreenGeometry, poDisplay, poMacOsXProcessSerialNumber];</code></td>
</tr>
<tr><td colspan="1">
<p>
All &quot;normal&quot; command-line options, that most programs using <a class="normal" href="CastleWindow.html">CastleWindow</a> should be able to handle without any problems.

<p>In other words, most programs calling <a class="normal" href="CastleWindow.TCastleWindowCustom.html#ParseParameters">TCastleWindowCustom.ParseParameters</a> method can safely pass as the 1st parameter this constant, <code>StandardParseOptions</code>. Or they can simply call overloaded version of <a class="normal" href="CastleWindow.TCastleWindowCustom.html#ParseParameters">TCastleWindowCustom.ParseParameters</a> that doesn't take any parameters, it is always equivalent to calling <a class="normal" href="CastleWindow.TCastleWindowCustom.html#ParseParameters">TCastleWindowCustom.ParseParameters</a>(<code>StandardParseOptions</code>).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefaultDepthBits"></a><code><b>DefaultDepthBits</b> = 16;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefaultFpsCaptionUpdateInterval"></a><code><b>DefaultFpsCaptionUpdateInterval</b> = 5000;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefaultLimitFPS"></a><code><b>DefaultLimitFPS</b> = 100.0;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefaultAntiAliasing"></a><code><b>DefaultAntiAliasing</b> = aaNone;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="AntiAliasingNames"></a><code><b>AntiAliasingNames</b>: array [<a  href="CastleWindow.html#TAntiAliasing">TAntiAliasing</a>] of string =
  ( 'None',
    '2 samples (faster)',
    '2 samples (nicer)',
    '4 samples (faster)',
    '4 samples (nicer)',
    '8 samples (faster) (only latest GPUs)',
    '8 samples (nicer) (only latest GPUs)',
    '16 samples (faster) (only latest GPUs)',
    '16 samples (nicer) (only latest GPUs)'
  );</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:13</em>
</span>
</td></tr></table></body></html>