~ubuntu-branches/ubuntu/utopic/castle-game-engine/utopic

« back to all changes in this revision

Viewing changes to doc/pasdoc/html/CastleWindowModes.TGLMode.html

  • Committer: Package Import Robot
  • Author(s): Abou Al Montacir
  • Date: 2013-04-27 18:06:40 UTC
  • Revision ID: package-import@ubuntu.com-20130427180640-eink4nmwzuivez1c
Tags: upstream-4.0.1
ImportĀ upstreamĀ versionĀ 4.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
 
2
<html>
 
3
<head>
 
4
<title>Castle Game Engine: CastleWindowModes: Class TGLMode</title>
 
5
<meta name="generator" content="PasDoc 0.12.1">
 
6
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
 
7
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
 
8
</head>
 
9
<body>
 
10
<table class="container"><tr><td class="navigation">
 
11
<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">
 
12
<a name="TGLMode"></a><h1 class="cio">Class TGLMode</h1>
 
13
<table class="sections wide_list">
 
14
<tr>
 
15
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td>Fields</td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
 
16
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
 
17
<p class="unitlink">
 
18
<a  href="CastleWindowModes.html">CastleWindowModes</a></p>
 
19
<h2 class="declaration">Declaration</h2>
 
20
<p class="declaration">
 
21
<code>type TGLMode = class(TObject)</code></p>
 
22
<h2 class="description">Description</h2>
 
23
<p>
 
24
Enter / exit modal box on a <a class="normal" href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a>. Saves/restores the state of <a class="normal" href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a> properties (see <a class="normal" href="CastleWindowModes.TWindowState.html">TWindowState</a>) and various OpenGL state.</p>
 
25
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
 
26
<ul class="hierarchy"><li class="ancestor">TObject</li>
 
27
<li class="thisitem">TGLMode</li></ul><h2 class="overview">Overview</h2>
 
28
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
 
29
<table class="summary wide_list">
 
30
<tr class="list">
 
31
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
32
<td class="itemcode"><code>constructor <b><a  href="CastleWindowModes.TGLMode.html#Create">Create</a></b>(AWindow: <a  href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a>; AttribsToPush: <a  href="CastleGLUtils.html#TGLbitfield">TGLbitfield</a>; APushPopMessagesTheme: boolean);</code></td>
 
33
</tr>
 
34
<tr class="list2">
 
35
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
36
<td class="itemcode"><code>constructor <b><a  href="CastleWindowModes.TGLMode.html#CreateReset">CreateReset</a></b>(AWindow: <a  href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a>; AttribsToPush: <a  href="CastleGLUtils.html#TGLbitfield">TGLbitfield</a>; APushPopMessagesTheme: boolean; NewDraw, NewResize, NewCloseQuery: <a  href="CastleWindow.html#TWindowFunc">TWindowFunc</a>);</code></td>
 
37
</tr>
 
38
<tr class="list">
 
39
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
40
<td class="itemcode"><code>destructor <b><a  href="CastleWindowModes.TGLMode.html#Destroy">Destroy</a></b>; override;</code></td>
 
41
</tr>
 
42
</table>
 
43
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
 
44
<table class="summary wide_list">
 
45
<tr class="list">
 
46
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
47
<td class="itemcode"><code>property <b><a  href="CastleWindowModes.TGLMode.html#FakeMouseDown">FakeMouseDown</a></b>: boolean
 
48
      read FFakeMouseDown write FFakeMouseDown default false;</code></td>
 
49
</tr>
 
50
<tr class="list2">
 
51
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
52
<td class="itemcode"><code>property <b><a  href="CastleWindowModes.TGLMode.html#RestoreProjectionMatrix">RestoreProjectionMatrix</a></b>: boolean
 
53
      read FRestoreProjectionMatrix write FRestoreProjectionMatrix default true;</code></td>
 
54
</tr>
 
55
<tr class="list">
 
56
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
57
<td class="itemcode"><code>property <b><a  href="CastleWindowModes.TGLMode.html#RestoreModelviewMatrix">RestoreModelviewMatrix</a></b>: boolean
 
58
      read FRestoreModelviewMatrix write FRestoreModelviewMatrix default true;</code></td>
 
59
</tr>
 
60
<tr class="list2">
 
61
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
62
<td class="itemcode"><code>property <b><a  href="CastleWindowModes.TGLMode.html#RestoreTextureMatrix">RestoreTextureMatrix</a></b>: boolean
 
63
      read FRestoreTextureMatrix write FRestoreTextureMatrix default true;</code></td>
 
64
</tr>
 
65
</table>
 
66
<h2 class="description">Description</h2>
 
67
<h3 class="detail">Methods</h3>
 
68
<table class="detail wide_list">
 
69
<tr class="list">
 
70
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
71
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(AWindow: <a  href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a>; AttribsToPush: <a  href="CastleGLUtils.html#TGLbitfield">TGLbitfield</a>; APushPopMessagesTheme: boolean);</code></td>
 
72
</tr>
 
73
<tr><td colspan="2">
 
74
<p>
 
75
Constructor saves open <a class="normal" href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a> and OpenGL state. Destructor will restore them.
 
76
 
 
77
<p>Some gory details (that you will usually not care about... the point is: everything works sensibly of the box) :
 
78
 
 
79
<p></p>
 
80
 
 
81
<ul class="paragraph_spacing">
 
82
  <li><p>We save/restore: </p>
 
83
 
 
84
<ul class="compact_spacing">
 
85
  <li><p><a class="normal" href="CastleWindowModes.TWindowState.html">TWindowState</a></p></li>
 
86
  <li><p>OpenGL attributes specified in AttribsToPush</p></li>
 
87
  <li><p>OpenGL matrix mode</p></li>
 
88
  <li><p>OpenGL matrices (saved without using OpenGL stack)</p></li>
 
89
  <li><p>OpenGL PIXEL_STORE_* state</p></li>
 
90
  <li><p><a class="normal" href="CastleMessages.html#MessagesTheme">MessagesTheme</a> (only if APushPopMessagesTheme)</p></li>
 
91
</ul>
 
92
 
 
93
<p> </p></li>
 
94
  <li><p>OpenGL context connected to this window is also made current during constructor and destructor. Also, <a class="normal" href="CastleWindow.TCastleWindowBase.html#PostRedisplay">TCastleWindowBase.PostRedisplay</a> is called (since new callbacks, as well as original callbacks, probably want to redraw window contents.)</p></li>
 
95
  <li><p> All pressed keys and mouse butons are saved and faked to be released, by calling <a class="normal" href="CastleWindow.TCastleWindowBase.html#EventRelease">TCastleWindowBase.EventRelease</a> with original callbacks. This way, if user releases some keys/mouse inside modal box, your original <a class="normal" href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a> callbacks will not miss this fact. This way e.g. user scripts in VRML/X3D worlds that observe keys work fine.
 
96
 
 
97
<p>If <a class="normal" href="CastleWindowModes.TGLMode.html#FakeMouseDown">FakeMouseDown</a> then at destruction (after restoring original callbacks) we will also notify your original callbacks that user pressed these buttons (by sending TCastleWindowBase.EventMouseDown). Note that <a class="normal" href="CastleWindowModes.TGLMode.html#FakeMouseDown">FakeMouseDown</a> feature turned out to be usually more troublesome than usefull &mdash; too often some unwanted MouseDown event was caused by this mechanism. That's because if original callbacks do something in MouseDown (like e.g. activate some click) then you don't want to generate fake MouseDown by <a class="normal" href="CastleWindowModes.TGLMode.html#Destroy">TGLMode.Destroy</a>. So the default value of <a class="normal" href="CastleWindowModes.TGLMode.html#FakeMouseDown">FakeMouseDown</a> is <code>False</code>. But this means that original callbacks have to be careful and <i>never assume</i> that when some button is pressed (because it's included in MousePressed, or has EventRelease generated for it) then for sure there occurred some MouseDown for it. </p></li>
 
98
  <li><p>At destructor, we notify original callbacks about size changes by sending <a class="normal" href="CastleWindow.TCastleWindowBase.html#EventResize">TCastleWindowBase.EventResize</a>. This way your original callbacks know about size changes, and can set OpenGL projection etc.</p></li>
 
99
  <li><p> We call IgnoreNextIdleSpeed at the end, when closing our mode, see TCastleWindowBase.IgnoreNextIdleSpeed for comments why this is needed.</p></li>
 
100
  <li><p>This also performs important optimization to avoid closing / reinitializing window <a class="normal" href="CastleWindow.TCastleWindowCustom.html#Controls">TCastleWindowCustom.Controls</a> OpenGL resources, see <a class="normal" href="CastleUIControls.TUIControl.html#DisableContextOpenClose">TUIControl.DisableContextOpenClose</a>.</p></li>
 
101
</ul>
 
102
 
 
103
<p></p>
 
104
</td></tr>
 
105
</table>
 
106
<table class="detail wide_list">
 
107
<tr class="list">
 
108
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
109
<td class="itemcode"><a name="CreateReset"></a><code>constructor <b>CreateReset</b>(AWindow: <a  href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a>; AttribsToPush: <a  href="CastleGLUtils.html#TGLbitfield">TGLbitfield</a>; APushPopMessagesTheme: boolean; NewDraw, NewResize, NewCloseQuery: <a  href="CastleWindow.html#TWindowFunc">TWindowFunc</a>);</code></td>
 
110
</tr>
 
111
<tr><td colspan="2">
 
112
<p>
 
113
Save OpenGL and <a class="normal" href="CastleWindow.TCastleWindowBase.html">TCastleWindowBase</a> state, and then change this to a standard state. Destructor will restore saved state.
 
114
 
 
115
<p>This is a shortcut for <a class="normal" href="CastleWindowModes.TGLMode.html#Create">Create</a> followed by <a class="normal" href="CastleWindowModes.TWindowState.html#SetStandardState">TWindowState.SetStandardState</a>, see there for explanation of parameters.</p>
 
116
</td></tr>
 
117
</table>
 
118
<table class="detail wide_list">
 
119
<tr class="list">
 
120
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
121
<td class="itemcode"><a name="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
 
122
</tr>
 
123
<tr><td colspan="2">
 
124
&nbsp;</td></tr>
 
125
</table>
 
126
<h3 class="detail">Properties</h3>
 
127
<table class="detail wide_list">
 
128
<tr class="list">
 
129
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
130
<td class="itemcode"><a name="FakeMouseDown"></a><code>property <b>FakeMouseDown</b>: boolean
 
131
      read FFakeMouseDown write FFakeMouseDown default false;</code></td>
 
132
</tr>
 
133
<tr><td colspan="2">
 
134
&nbsp;</td></tr>
 
135
</table>
 
136
<table class="detail wide_list">
 
137
<tr class="list">
 
138
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
139
<td class="itemcode"><a name="RestoreProjectionMatrix"></a><code>property <b>RestoreProjectionMatrix</b>: boolean
 
140
      read FRestoreProjectionMatrix write FRestoreProjectionMatrix default true;</code></td>
 
141
</tr>
 
142
<tr><td colspan="2">
 
143
&nbsp;</td></tr>
 
144
</table>
 
145
<table class="detail wide_list">
 
146
<tr class="list">
 
147
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
148
<td class="itemcode"><a name="RestoreModelviewMatrix"></a><code>property <b>RestoreModelviewMatrix</b>: boolean
 
149
      read FRestoreModelviewMatrix write FRestoreModelviewMatrix default true;</code></td>
 
150
</tr>
 
151
<tr><td colspan="2">
 
152
&nbsp;</td></tr>
 
153
</table>
 
154
<table class="detail wide_list">
 
155
<tr class="list">
 
156
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
 
157
<td class="itemcode"><a name="RestoreTextureMatrix"></a><code>property <b>RestoreTextureMatrix</b>: boolean
 
158
      read FRestoreTextureMatrix write FRestoreTextureMatrix default true;</code></td>
 
159
</tr>
 
160
<tr><td colspan="2">
 
161
&nbsp;</td></tr>
 
162
</table>
 
163
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.12.1</a> on 2013-02-04 20:26:53</em>
 
164
</span>
 
165
</td></tr></table></body></html>