File: qglformat.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (734 lines) | stat: -rw-r--r-- 51,436 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
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGLFormat Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGLFormat Class Reference<br /><sup><sup>[<a href="qtopengl.html">QtOpenGL</a> module]</sup></sup></h1><p>The QGLFormat class specifies the display format of an OpenGL
rendering context. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></b> { NoProfile, CoreProfile, CompatibilityProfile }</li><li><div class="fn" />enum <b><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlag</a></b> { OpenGL_Version_None, OpenGL_Version_1_1, OpenGL_Version_1_2, OpenGL_Version_1_3, ..., OpenGL_ES_Version_2_0 }</li><li><div class="fn" />class <b><a href="qglformat-openglversionflags.html">OpenGLVersionFlags</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qglformat.html#QGLFormat">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qglformat.html#QGLFormat-2">__init__</a></b> (<i>self</i>, QGL.FormatOptions&#160;<i>options</i>, int&#160;<i>plane</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qglformat.html#QGLFormat-3">__init__</a></b> (<i>self</i>, QGLFormat&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#accum">accum</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#accumBufferSize">accumBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#alpha">alpha</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#alphaBufferSize">alphaBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#blueBufferSize">blueBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#depth">depth</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#depthBufferSize">depthBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#directRendering">directRendering</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#doubleBuffer">doubleBuffer</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#greenBufferSize">greenBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#hasOverlay">hasOverlay</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#majorVersion">majorVersion</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#minorVersion">minorVersion</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#plane">plane</a></b> (<i>self</i>)</li><li><div class="fn" />OpenGLContextProfile <b><a href="qglformat.html#profile">profile</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#redBufferSize">redBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#rgba">rgba</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#sampleBuffers">sampleBuffers</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#samples">samples</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setAccum">setAccum</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setAlpha">setAlpha</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setDepth">setDepth</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setDirectRendering">setDirectRendering</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setOption">setOption</a></b> (<i>self</i>, QGL.FormatOptions&#160;<i>opt</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setOverlay">setOverlay</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setPlane">setPlane</a></b> (<i>self</i>, int&#160;<i>plane</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setProfile">setProfile</a></b> (<i>self</i>, OpenGLContextProfile&#160;<i>profile</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setRedBufferSize">setRedBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setRgba">setRgba</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setSamples">setSamples</a></b> (<i>self</i>, int&#160;<i>numSamples</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setStencil">setStencil</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a></b> (<i>self</i>, int&#160;<i>size</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setStereo">setStereo</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setSwapInterval">setSwapInterval</a></b> (<i>self</i>, int&#160;<i>interval</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setVersion">setVersion</a></b> (<i>self</i>, int&#160;<i>major</i>, int&#160;<i>minor</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#stencil">stencil</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#stencilBufferSize">stencilBufferSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#stereo">stereo</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglformat.html#swapInterval">swapInterval</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qglformat.html#testOption">testOption</a></b> (<i>self</i>, QGL.FormatOptions&#160;<i>opt</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QGLFormat <b><a href="qglformat.html#defaultFormat">defaultFormat</a></b> ()</li><li><div class="fn" />QGLFormat <b><a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a></b> ()</li><li><div class="fn" />bool <b><a href="qglformat.html#hasOpenGL">hasOpenGL</a></b> ()</li><li><div class="fn" />bool <b><a href="qglformat.html#hasOpenGLOverlays">hasOpenGLOverlays</a></b> ()</li><li><div class="fn" />OpenGLVersionFlags <b><a href="qglformat.html#openGLVersionFlags">openGLVersionFlags</a></b> ()</li><li><div class="fn" /><b><a href="qglformat.html#setDefaultFormat">setDefaultFormat</a></b> (QGLFormat&#160;<i>f</i>)</li><li><div class="fn" /><b><a href="qglformat.html#setDefaultOverlayFormat">setDefaultOverlayFormat</a></b> (QGLFormat&#160;<i>f</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qglformat.html#__eq__">__eq__</a></b> (<i>self</i>, QGLFormat)</li><li><div class="fn" />bool <b><a href="qglformat.html#__ne__">__ne__</a></b> (<i>self</i>, QGLFormat)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGLFormat class specifies the display format of an OpenGL
rendering context.</p>
<p>A display format has several characteristics:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double or single
buffering.</a></li>
<li><a href="qglformat.html#setDepth">Depth buffer.</a></li>
<li><a href="qglformat.html#setRgba">RGBA or color index
mode.</a></li>
<li><a href="qglformat.html#setAlpha">Alpha channel.</a></li>
<li><a href="qglformat.html#setAccum">Accumulation buffer.</a></li>
<li><a href="qglformat.html#setStencil">Stencil buffer.</a></li>
<li><a href="qglformat.html#setStereo">Stereo buffers.</a></li>
<li><a href="qglformat.html#setDirectRendering">Direct
rendering.</a></li>
<li><a href="qglformat.html#setOverlay">Presence of an
overlay.</a></li>
<li><a href="qglformat.html#setPlane">Plane of an overlay.</a></li>
<li><a href="qglformat.html#setSampleBuffers">Multisample
buffers.</a></li>
</ul>
<p>You can also specify preferred bit depths for the color buffer,
depth buffer, alpha buffer, accumulation buffer and the stencil
buffer with the functions: <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(),
<a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(),
<a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>(),
<a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>(),
<a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>() and
<a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<p>Note that even if you specify that you prefer a 32 bit depth
buffer (e.g. with setDepthBufferSize(32)), the format that is
chosen may not have a 32 bit depth buffer, even if there is a
format available with a 32 bit depth buffer. The main reason for
this is how the system dependant picking algorithms work on the
different platforms, and some format options may have higher
precedence than others.</p>
<p>You create and tell a QGLFormat object what rendering options
you want from an OpenGL rendering context.</p>
<p>OpenGL drivers or accelerated hardware may or may not support
advanced features such as alpha channel or stereographic viewing.
If you request some features that the driver/hardware does not
provide when you create a <a href="qglwidget.html">QGLWidget</a>,
you will get a rendering context with the nearest subset of
features.</p>
<p>There are different ways to define the display characteristics
of a rendering context. One is to create a QGLFormat and make it
the default for the entire application:</p>
<pre class="cpp">
 <span class="type">QGLFormat</span> fmt;
 fmt<span class="operator">.</span><a href="qglformat.html#setAlpha">setAlpha</a>(<span class="keyword">true</span>);
 fmt<span class="operator">.</span><a href="qglformat.html#setStereo">setStereo</a>(<span class="keyword">true</span>);
 <span class="type">QGLFormat</span><span class="operator">.</span><a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>(fmt);
</pre>
<p>Or you can specify the desired format when creating an object of
your <a href="qglwidget.html">QGLWidget</a> subclass:</p>
<pre class="cpp">
 <span class="type">QGLFormat</span> fmt;
 fmt<span class="operator">.</span><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a>(<span class="keyword">false</span>);                 <span class="comment">// single buffer</span>
 fmt<span class="operator">.</span><a href="qglformat.html#setDirectRendering">setDirectRendering</a>(<span class="keyword">false</span>);              <span class="comment">// software rendering</span>
 MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
</pre>
<p>After the widget has been created, you can find out which of the
requested features the system was able to provide:</p>
<pre class="cpp">
 <span class="type">QGLFormat</span> fmt;
 fmt<span class="operator">.</span><a href="qglformat.html#setOverlay">setOverlay</a>(<span class="keyword">true</span>);
 fmt<span class="operator">.</span><a href="qglformat.html#setStereo">setStereo</a>(<span class="keyword">true</span>);
 MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
 <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>stereo()) {
     <span class="comment">// ok, goggles off</span>
     <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>hasOverlay()) {
         <a href="qtcore.html#qFatal">qFatal</a>(<span class="string">"Cool hardware required"</span>);
     }
 }
</pre>
<div class="LegaleseLeft">
<p>OpenGL is a trademark of Silicon Graphics, Inc. in the United
States and other countries.</p>
</div>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="OpenGLContextProfile-enum" />QGLFormat.OpenGLContextProfile</h3><p>This enum describes the OpenGL context profiles that can be
specified for contexts implementing OpenGL version 3.2 or higher.
These profiles are different from OpenGL ES profiles.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.NoProfile</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">OpenGL version is lower than 3.2.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.CoreProfile</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Functionality deprecated in OpenGL version 3.0
is not available.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.CompatibilityProfile</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Functionality from earlier OpenGL versions is
available.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.7.</p>


<h3 class="fn"><a name="OpenGLVersionFlag-enum" />QGLFormat.OpenGLVersionFlag</h3><p>This enum describes the various OpenGL versions that are
recognized by Qt. Use the <a href="qglformat.html#openGLVersionFlags">QGLFormat.openGLVersionFlags</a>()
function to identify which versions that are supported at
runtime.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_None</tt></td>
<td class="topAlign"><tt>0x00000000</tt></td>
<td class="topAlign">If no OpenGL is present or if no OpenGL
context is current.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_1_1</tt></td>
<td class="topAlign"><tt>0x00000001</tt></td>
<td class="topAlign">OpenGL version 1.1 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_1_2</tt></td>
<td class="topAlign"><tt>0x00000002</tt></td>
<td class="topAlign">OpenGL version 1.2 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_1_3</tt></td>
<td class="topAlign"><tt>0x00000004</tt></td>
<td class="topAlign">OpenGL version 1.3 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_1_4</tt></td>
<td class="topAlign"><tt>0x00000008</tt></td>
<td class="topAlign">OpenGL version 1.4 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_1_5</tt></td>
<td class="topAlign"><tt>0x00000010</tt></td>
<td class="topAlign">OpenGL version 1.5 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_2_0</tt></td>
<td class="topAlign"><tt>0x00000020</tt></td>
<td class="topAlign">OpenGL version 2.0 or higher is present. Note
that version 2.0 supports all the functionality of version
1.5.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_2_1</tt></td>
<td class="topAlign"><tt>0x00000040</tt></td>
<td class="topAlign">OpenGL version 2.1 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_3_0</tt></td>
<td class="topAlign"><tt>0x00001000</tt></td>
<td class="topAlign">OpenGL version 3.0 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_3_1</tt></td>
<td class="topAlign"><tt>0x00002000</tt></td>
<td class="topAlign">OpenGL version 3.1 or higher is present. Note
that OpenGL version 3.1 or higher does not necessarily support all
the features of version 3.0 and lower.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_3_2</tt></td>
<td class="topAlign"><tt>0x00004000</tt></td>
<td class="topAlign">OpenGL version 3.2 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_3_3</tt></td>
<td class="topAlign"><tt>0x00008000</tt></td>
<td class="topAlign">OpenGL version 3.3 or higher is present.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_Version_4_0</tt></td>
<td class="topAlign"><tt>0x00010000</tt></td>
<td class="topAlign">OpenGL version 4.0 or higher is present.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGLFormat.OpenGL_ES_CommonLite_Version_1_0</tt></td>
<td class="topAlign"><tt>0x00000100</tt></td>
<td class="topAlign">OpenGL ES version 1.0 Common Lite or higher is
present.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGLFormat.OpenGL_ES_Common_Version_1_0</tt></td>
<td class="topAlign"><tt>0x00000080</tt></td>
<td class="topAlign">OpenGL ES version 1.0 Common or higher is
present. The Common profile supports all the features of Common
Lite.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGLFormat.OpenGL_ES_CommonLite_Version_1_1</tt></td>
<td class="topAlign"><tt>0x00000400</tt></td>
<td class="topAlign">OpenGL ES version 1.1 Common Lite or higher is
present.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGLFormat.OpenGL_ES_Common_Version_1_1</tt></td>
<td class="topAlign"><tt>0x00000200</tt></td>
<td class="topAlign">OpenGL ES version 1.1 Common or higher is
present. The Common profile supports all the features of Common
Lite.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGLFormat.OpenGL_ES_Version_2_0</tt></td>
<td class="topAlign"><tt>0x00000800</tt></td>
<td class="topAlign">OpenGL ES version 2.0 or higher is present.
Note that OpenGL ES version 2.0 does not support all the features
of OpenGL ES 1.x. So if OpenGL_ES_Version_2_0 is returned, none of
the ES 1.x flags are returned.</td>
</tr>
</table>
<p>See also <a href="http://www.opengl.org">http://www.opengl.org</a> for more
information about the different revisions of OpenGL.</p>
<p>This enum was introduced or modified in Qt 4.2.</p>
<p>The OpenGLVersionFlags type is a typedef for <a href="qflags.html">QFlags</a>&lt;OpenGLVersionFlag&gt;. It stores an OR
combination of OpenGLVersionFlag values.</p>
<p><b>See also</b> <a href="qglformat.html#openGLVersionFlags">openGLVersionFlags</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGLFormat" />QGLFormat.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qglformat.html">QGLFormat</a> object with
the following default settings:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double buffer:</a>
Enabled.</li>
<li><a href="qglformat.html#setDepth">Depth buffer:</a>
Enabled.</li>
<li><a href="qglformat.html#setRgba">RGBA:</a> Enabled (i.e., color
index disabled).</li>
<li><a href="qglformat.html#setAlpha">Alpha channel:</a>
Disabled.</li>
<li><a href="qglformat.html#setAccum">Accumulator buffer:</a>
Disabled.</li>
<li><a href="qglformat.html#setStencil">Stencil buffer:</a>
Enabled.</li>
<li><a href="qglformat.html#setStereo">Stereo:</a> Disabled.</li>
<li><a href="qglformat.html#setDirectRendering">Direct
rendering:</a> Enabled.</li>
<li><a href="qglformat.html#setOverlay">Overlay:</a> Disabled.</li>
<li><a href="qglformat.html#setPlane">Plane:</a> 0 (i.e., normal
plane).</li>
<li><a href="qglformat.html#setSampleBuffers">Multisample
buffers:</a> Disabled.</li>
</ul>


<h3 class="fn"><a name="QGLFormat-2" />QGLFormat.__init__ (<i>self</i>, <a href="qgl-formatoptions.html">QGL.FormatOptions</a>&#160;<i>options</i>, int&#160;<i>plane</i>&#160;=&#160;0)</h3><p>Creates a <a href="qglformat.html">QGLFormat</a> object that is
a copy of the current <a href="qglformat.html#defaultFormat">defaultFormat</a>().</p>
<p>If <i>options</i> is not 0, the default format is modified by
the specified format options. The <i>options</i> parameter should
be <a href="qgl.html#FormatOption-enum">QGL.FormatOption</a>
values OR'ed together.</p>
<p>This constructor makes it easy to specify a certain desired
format in classes derived from <a href="qglwidget.html">QGLWidget</a>, for example:</p>
<pre class="cpp">
 <span class="comment">// The rendering in MyGLWidget depends on using</span>
 <span class="comment">// stencil buffer and alpha channel</span>
 MyGLWidget<span class="operator">.</span>MyGLWidget(<span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">*</span> parent)
     : <span class="type"><a href="qglwidget.html">QGLWidget</a></span>(<span class="type"><a href="qglformat.html">QGLFormat</a></span>(QGL<span class="operator">.</span>StencilBuffer <span class="operator">|</span> QGL<span class="operator">.</span>AlphaChannel)<span class="operator">,</span> parent)
 {
     <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>stencil())
         <a href="qtcore.html#qWarning">qWarning</a>(<span class="string">"Could not get stencil buffer; results will be suboptimal"</span>);
     <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>alpha())
         <a href="qtcore.html#qWarning">qWarning</a>(<span class="string">"Could not get alpha channel; results will be suboptimal"</span>);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }
</pre>
<p>Note that there are <a href="qgl.html#FormatOption-enum">QGL.FormatOption</a> values to turn
format settings both on and off, e.g. <a href="qgl.html#FormatOption-enum">QGL.DepthBuffer</a> and <a href="qgl.html#FormatOption-enum">QGL.NoDepthBuffer</a>, <a href="qgl.html#FormatOption-enum">QGL.DirectRendering</a> and <a href="qgl.html#FormatOption-enum">QGL.IndirectRendering</a>, etc.</p>
<p>The <i>plane</i> parameter defaults to 0 and is the plane which
this format should be associated with. Not all OpenGL
implementations supports overlay/underlay rendering planes.</p>
<p><b>See also</b> <a href="qglformat.html#defaultFormat">defaultFormat</a>(), <a href="qglformat.html#setOption">setOption</a>(), and <a href="qglformat.html#setPlane">setPlane</a>().</p>


<h3 class="fn"><a name="QGLFormat-3" />QGLFormat.__init__ (<i>self</i>, <a href="qglformat.html">QGLFormat</a>&#160;<i>other</i>)</h3><p>Constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="accum" />bool QGLFormat.accum (<i>self</i>)</h3><p>Returns true if the accumulation buffer is enabled; otherwise
returns false. The accumulation buffer is disabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setAccum">setAccum</a>()
and <a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>


<h3 class="fn"><a name="accumBufferSize" />int QGLFormat.accumBufferSize (<i>self</i>)</h3><p>Returns the accumulation buffer size.</p>
<p><b>See also</b> <a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>(),
<a href="qglformat.html#accum">accum</a>(), and <a href="qglformat.html#setAccum">setAccum</a>().</p>


<h3 class="fn"><a name="alpha" />bool QGLFormat.alpha (<i>self</i>)</h3><p>Returns true if the alpha buffer in the framebuffer is enabled;
otherwise returns false. The alpha buffer is disabled by
default.</p>
<p><b>See also</b> <a href="qglformat.html#setAlpha">setAlpha</a>()
and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="alphaBufferSize" />int QGLFormat.alphaBufferSize (<i>self</i>)</h3><p>Returns the alpha buffer size.</p>
<p><b>See also</b> <a href="qglformat.html#alpha">alpha</a>(),
<a href="qglformat.html#setAlpha">setAlpha</a>(), and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="blueBufferSize" />int QGLFormat.blueBufferSize (<i>self</i>)</h3><p>Returns the blue buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>().</p>


<h3 class="fn"><a name="defaultFormat" /><a href="qglformat.html">QGLFormat</a> QGLFormat.defaultFormat ()</h3><p>Returns the default <a href="qglformat.html">QGLFormat</a> for
the application. All <a href="qglwidget.html">QGLWidget</a> objects
that are created use this format unless another format is
specified, e.g. when they are constructed.</p>
<p>If no special default format has been set using <a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>(), the
default format is the same as that created with <a href="qglformat.html#QGLFormat">QGLFormat</a>().</p>
<p><b>See also</b> <a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>().</p>


<h3 class="fn"><a name="defaultOverlayFormat" /><a href="qglformat.html">QGLFormat</a> QGLFormat.defaultOverlayFormat ()</h3><p>Returns the default <a href="qglformat.html">QGLFormat</a> for
overlay contexts.</p>
<p>The default overlay format is:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double buffer:</a>
Disabled.</li>
<li><a href="qglformat.html#setDepth">Depth buffer:</a>
Disabled.</li>
<li><a href="qglformat.html#setRgba">RGBA:</a> Disabled (i.e.,
color index enabled).</li>
<li><a href="qglformat.html#setAlpha">Alpha channel:</a>
Disabled.</li>
<li><a href="qglformat.html#setAccum">Accumulator buffer:</a>
Disabled.</li>
<li><a href="qglformat.html#setStencil">Stencil buffer:</a>
Disabled.</li>
<li><a href="qglformat.html#setStereo">Stereo:</a> Disabled.</li>
<li><a href="qglformat.html#setDirectRendering">Direct
rendering:</a> Enabled.</li>
<li><a href="qglformat.html#setOverlay">Overlay:</a> Disabled.</li>
<li><a href="qglformat.html#setSampleBuffers">Multisample
buffers:</a> Disabled.</li>
<li><a href="qglformat.html#setPlane">Plane:</a> 1 (i.e., first
overlay plane).</li>
</ul>
<p><b>See also</b> <a href="qglformat.html#setDefaultOverlayFormat">setDefaultOverlayFormat</a>()
and <a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>().</p>


<h3 class="fn"><a name="depth" />bool QGLFormat.depth (<i>self</i>)</h3><p>Returns true if the depth buffer is enabled; otherwise returns
false. The depth buffer is enabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setDepth">setDepth</a>()
and <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>


<h3 class="fn"><a name="depthBufferSize" />int QGLFormat.depthBufferSize (<i>self</i>)</h3><p>Returns the depth buffer size.</p>
<p><b>See also</b> <a href="qglformat.html#depth">depth</a>(),
<a href="qglformat.html#setDepth">setDepth</a>(), and <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>


<h3 class="fn"><a name="directRendering" />bool QGLFormat.directRendering (<i>self</i>)</h3><p>Returns true if direct rendering is enabled; otherwise returns
false.</p>
<p>Direct rendering is enabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setDirectRendering">setDirectRendering</a>().</p>


<h3 class="fn"><a name="doubleBuffer" />bool QGLFormat.doubleBuffer (<i>self</i>)</h3><p>Returns true if double buffering is enabled; otherwise returns
false. Double buffering is enabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a>().</p>


<h3 class="fn"><a name="greenBufferSize" />int QGLFormat.greenBufferSize (<i>self</i>)</h3><p>Returns the green buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>().</p>


<h3 class="fn"><a name="hasOpenGL" />bool QGLFormat.hasOpenGL ()</h3><p>Returns true if the window system has any OpenGL support;
otherwise returns false.</p>
<p><b>Warning:</b> This function must not be called until the
<a href="qapplication.html">QApplication</a> object has been
created.</p>


<h3 class="fn"><a name="hasOpenGLOverlays" />bool QGLFormat.hasOpenGLOverlays ()</h3><p>Returns true if the window system supports OpenGL overlays;
otherwise returns false.</p>
<p><b>Warning:</b> This function must not be called until the
<a href="qapplication.html">QApplication</a> object has been
created.</p>


<h3 class="fn"><a name="hasOverlay" />bool QGLFormat.hasOverlay (<i>self</i>)</h3><p>Returns true if overlay plane is enabled; otherwise returns
false.</p>
<p>Overlay is disabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setOverlay">setOverlay</a>().</p>


<h3 class="fn"><a name="majorVersion" />int QGLFormat.majorVersion (<i>self</i>)</h3><p>Returns the OpenGL major version.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qglformat.html#setVersion">setVersion</a>() and <a href="qglformat.html#minorVersion">minorVersion</a>().</p>


<h3 class="fn"><a name="minorVersion" />int QGLFormat.minorVersion (<i>self</i>)</h3><p>Returns the OpenGL minor version.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qglformat.html#setVersion">setVersion</a>() and <a href="qglformat.html#majorVersion">majorVersion</a>().</p>


<h3 class="fn"><a name="openGLVersionFlags" /><a href="qglformat-openglversionflags.html">OpenGLVersionFlags</a> QGLFormat.openGLVersionFlags ()</h3><p>Identifies, at runtime, which OpenGL versions that are supported
by the current platform.</p>
<p>Note that if OpenGL version 1.5 is supported, its predecessors
(i.e., version 1.4 and lower) are also supported. To identify the
support of a particular feature, like multi texturing, test for the
version in which the feature was first introduced (i.e., version
1.3 in the case of multi texturing) to adapt to the largest
possible group of runtime platforms.</p>
<p>This function needs a valid current OpenGL context to work;
otherwise it will return <a href="qglformat.html#OpenGLVersionFlag-enum">OpenGL_Version_None</a>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#hasOpenGL">hasOpenGL</a>() and <a href="qglformat.html#hasOpenGLOverlays">hasOpenGLOverlays</a>().</p>


<h3 class="fn"><a name="plane" />int QGLFormat.plane (<i>self</i>)</h3><p>Returns the plane of this format. The default for normal formats
is 0, which means the normal plane. The default for overlay formats
is 1, which is the first overlay plane.</p>
<p><b>See also</b> <a href="qglformat.html#setPlane">setPlane</a>()
and <a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a>().</p>


<h3 class="fn"><a name="profile" /><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a> QGLFormat.profile (<i>self</i>)</h3><p>Returns the OpenGL context profile.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qglformat.html#setProfile">setProfile</a>().</p>


<h3 class="fn"><a name="redBufferSize" />int QGLFormat.redBufferSize (<i>self</i>)</h3><p>Returns the red buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>().</p>


<h3 class="fn"><a name="rgba" />bool QGLFormat.rgba (<i>self</i>)</h3><p>Returns true if RGBA color mode is set. Returns false if color
index mode is set. The default color mode is RGBA.</p>
<p><b>See also</b> <a href="qglformat.html#setRgba">setRgba</a>().</p>


<h3 class="fn"><a name="sampleBuffers" />bool QGLFormat.sampleBuffers (<i>self</i>)</h3><p>Returns true if multisample buffer support is enabled; otherwise
returns false.</p>
<p>The multisample buffer is disabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>().</p>


<h3 class="fn"><a name="samples" />int QGLFormat.samples (<i>self</i>)</h3><p>Returns the number of samples per pixel when multisampling is
enabled. By default, the highest number of samples that is
available is used.</p>
<p><b>See also</b> <a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qglformat.html#setSamples">setSamples</a>().</p>


<h3 class="fn"><a name="setAccum" />QGLFormat.setAccum (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables the accumulation buffer;
otherwise disables the accumulation buffer.</p>
<p>The accumulation buffer is disabled by default.</p>
<p>The accumulation buffer is used to create blur effects and
multiple exposures.</p>
<p><b>See also</b> <a href="qglformat.html#accum">accum</a>() and
<a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>


<h3 class="fn"><a name="setAccumBufferSize" />QGLFormat.setAccumBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred accumulation buffer size, where <i>size</i> is
the bit depth for each RGBA component.</p>
<p><b>See also</b> <a href="qglformat.html#accum">accum</a>(),
<a href="qglformat.html#setAccum">setAccum</a>(), and <a href="qglformat.html#accumBufferSize">accumBufferSize</a>().</p>


<h3 class="fn"><a name="setAlpha" />QGLFormat.setAlpha (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables the alpha buffer; otherwise
disables the alpha buffer.</p>
<p>The alpha buffer is disabled by default.</p>
<p>The alpha buffer is typically used for implementing transparency
or translucency. The A in RGBA specifies the transparency of a
pixel.</p>
<p><b>See also</b> <a href="qglformat.html#alpha">alpha</a>() and
<a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="setAlphaBufferSize" />QGLFormat.setAlphaBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred alpha buffer size to <i>size</i>. This
function implicitly enables the alpha channel.</p>
<p><b>See also</b> <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and
<a href="qglformat.html#alphaBufferSize">alphaBufferSize</a>().</p>


<h3 class="fn"><a name="setBlueBufferSize" />QGLFormat.setBlueBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred blue buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#blueBufferSize">blueBufferSize</a>(), <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and
<a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="setDefaultFormat" />QGLFormat.setDefaultFormat (<a href="qglformat.html">QGLFormat</a>&#160;<i>f</i>)</h3><p>Sets a new default <a href="qglformat.html">QGLFormat</a> for
the application to <i>f</i>. For example, to set single buffering
as the default instead of double buffering, your main() might
contain code like this:</p>
<pre class="cpp">
 <span class="type"><a href="qapplication.html">QApplication</a></span> a(argc<span class="operator">,</span> argv);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span> f;
 f<span class="operator">.</span><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a>(<span class="keyword">false</span>);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span><span class="operator">.</span>setDefaultFormat(f);
</pre>
<p><b>See also</b> <a href="qglformat.html#defaultFormat">defaultFormat</a>().</p>


<h3 class="fn"><a name="setDefaultOverlayFormat" />QGLFormat.setDefaultOverlayFormat (<a href="qglformat.html">QGLFormat</a>&#160;<i>f</i>)</h3><p>Sets a new default <a href="qglformat.html">QGLFormat</a> for
overlay contexts to <i>f</i>. This format is used whenever a
<a href="qglwidget.html">QGLWidget</a> is created with a format
that <a href="qglformat.html#hasOverlay">hasOverlay</a>()
enabled.</p>
<p>For example, to get a double buffered overlay context (if
available), use code like this:</p>
<pre class="cpp">
 <span class="type"><a href="qglformat.html">QGLFormat</a></span> f <span class="operator">=</span> <span class="type"><a href="qglformat.html">QGLFormat</a></span><span class="operator">.</span><a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a>();
 f<span class="operator">.</span><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a>(<span class="keyword">true</span>);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span><span class="operator">.</span>setDefaultOverlayFormat(f);
</pre>
<p>As usual, you can find out after widget creation whether the
underlying OpenGL system was able to provide the requested
specification:</p>
<pre class="cpp">
 <span class="comment">// ...continued from above</span>
 MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(<span class="type"><a href="qglformat.html">QGLFormat</a></span>(QGL<span class="operator">.</span>HasOverlay)<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
 <span class="keyword">if</span> (myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>hasOverlay()) {
     <span class="comment">// Yes, we got an overlay, let's check _its_ format:</span>
     <span class="type"><a href="qglcontext.html">QGLContext</a></span><span class="operator">*</span> olContext <span class="operator">=</span> myWidget<span class="operator">-</span><span class="operator">&gt;</span>overlayContext();
     <span class="keyword">if</span> (olContext<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>doubleBuffer())
         ; <span class="comment">// yes, we got a double buffered overlay</span>
     <span class="keyword">else</span>
         ; <span class="comment">// no, only single buffered overlays are available</span>
 }
</pre>
<p><b>See also</b> <a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a>().</p>


<h3 class="fn"><a name="setDepth" />QGLFormat.setDepth (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables the depth buffer; otherwise
disables the depth buffer.</p>
<p>The depth buffer is enabled by default.</p>
<p>The purpose of a depth buffer (or Z-buffering) is to remove
hidden surfaces. Pixels are assigned Z values based on the distance
to the viewer. A pixel with a high Z value is closer to the viewer
than a pixel with a low Z value. This information is used to decide
whether to draw a pixel or not.</p>
<p><b>See also</b> <a href="qglformat.html#depth">depth</a>() and
<a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>


<h3 class="fn"><a name="setDepthBufferSize" />QGLFormat.setDepthBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the minimum depth buffer size to <i>size</i>.</p>
<p><b>See also</b> <a href="qglformat.html#depthBufferSize">depthBufferSize</a>(), <a href="qglformat.html#setDepth">setDepth</a>(), and <a href="qglformat.html#depth">depth</a>().</p>


<h3 class="fn"><a name="setDirectRendering" />QGLFormat.setDirectRendering (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables direct rendering; otherwise
disables direct rendering.</p>
<p>Direct rendering is enabled by default.</p>
<p>Enabling this option will make OpenGL bypass the underlying
window system and render directly from hardware to the screen, if
this is supported by the system.</p>
<p><b>See also</b> <a href="qglformat.html#directRendering">directRendering</a>().</p>


<h3 class="fn"><a name="setDoubleBuffer" />QGLFormat.setDoubleBuffer (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true sets double buffering; otherwise sets
single buffering.</p>
<p>Double buffering is enabled by default.</p>
<p>Double buffering is a technique where graphics are rendered on
an off-screen buffer and not directly to the screen. When the
drawing has been completed, the program calls a swapBuffers()
function to exchange the screen contents with the buffer. The
result is flicker-free drawing and often better performance.</p>
<p>Note that single buffered contexts are currently not supported
with EGL.</p>
<p><b>See also</b> <a href="qglformat.html#doubleBuffer">doubleBuffer</a>(), <a href="qglcontext.html#swapBuffers">QGLContext.swapBuffers</a>(), and
<a href="qglwidget.html#swapBuffers">QGLWidget.swapBuffers</a>().</p>


<h3 class="fn"><a name="setGreenBufferSize" />QGLFormat.setGreenBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred green buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#greenBufferSize">greenBufferSize</a>(), <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(), and
<a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="setOption" />QGLFormat.setOption (<i>self</i>, <a href="qgl-formatoptions.html">QGL.FormatOptions</a>&#160;<i>opt</i>)</h3><p>Sets the format option to <i>opt</i>.</p>
<p><b>See also</b> <a href="qglformat.html#testOption">testOption</a>().</p>


<h3 class="fn"><a name="setOverlay" />QGLFormat.setOverlay (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables an overlay plane; otherwise
disables the overlay plane.</p>
<p>Enabling the overlay plane will cause <a href="qglwidget.html">QGLWidget</a> to create an additional context in
an overlay plane. See the <a href="qglwidget.html">QGLWidget</a>
documentation for further information.</p>
<p><b>See also</b> <a href="qglformat.html#hasOverlay">hasOverlay</a>().</p>


<h3 class="fn"><a name="setPlane" />QGLFormat.setPlane (<i>self</i>, int&#160;<i>plane</i>)</h3><p>Sets the requested plane to <i>plane</i>. 0 is the normal plane,
1 is the first overlay plane, 2 is the second overlay plane, etc.;
-1, -2, etc. are underlay planes.</p>
<p>Note that in contrast to other format specifications, the plane
specifications will be matched exactly. This means that if you
specify a plane that the underlying OpenGL system cannot provide,
an <a href="qglwidget.html#isValid">invalid</a> <a href="qglwidget.html">QGLWidget</a> will be created.</p>
<p><b>See also</b> <a href="qglformat.html#plane">plane</a>().</p>


<h3 class="fn"><a name="setProfile" />QGLFormat.setProfile (<i>self</i>, <a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a>&#160;<i>profile</i>)</h3><p>Set the OpenGL context profile to <i>profile</i>. The
<i>profile</i> is ignored if the requested OpenGL version is less
than 3.2.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qglformat.html#profile">profile</a>().</p>


<h3 class="fn"><a name="setRedBufferSize" />QGLFormat.setRedBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred red buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#redBufferSize">redBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(),
<a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(),
and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>


<h3 class="fn"><a name="setRgba" />QGLFormat.setRgba (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true sets RGBA mode. If <i>enable</i> is
false sets color index mode.</p>
<p>The default color mode is RGBA.</p>
<p>RGBA is the preferred mode for most OpenGL applications. In RGBA
color mode you specify colors as red + green + blue + alpha
quadruplets.</p>
<p>In color index mode you specify an index into a color lookup
table.</p>
<p><b>See also</b> <a href="qglformat.html#rgba">rgba</a>().</p>


<h3 class="fn"><a name="setSampleBuffers" />QGLFormat.setSampleBuffers (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true, a GL context with multisample buffer
support is picked; otherwise ignored.</p>
<p><b>See also</b> <a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), <a href="qglformat.html#setSamples">setSamples</a>(), and <a href="qglformat.html#samples">samples</a>().</p>


<h3 class="fn"><a name="setSamples" />QGLFormat.setSamples (<i>self</i>, int&#160;<i>numSamples</i>)</h3><p>Set the preferred number of samples per pixel when multisampling
is enabled to <i>numSamples</i>. By default, the highest number of
samples available is used.</p>
<p><b>See also</b> <a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qglformat.html#samples">samples</a>().</p>


<h3 class="fn"><a name="setStencil" />QGLFormat.setStencil (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables the stencil buffer; otherwise
disables the stencil buffer.</p>
<p>The stencil buffer is enabled by default.</p>
<p>The stencil buffer masks certain parts of the drawing area so
that masked parts are not drawn on.</p>
<p><b>See also</b> <a href="qglformat.html#stencil">stencil</a>()
and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>


<h3 class="fn"><a name="setStencilBufferSize" />QGLFormat.setStencilBufferSize (<i>self</i>, int&#160;<i>size</i>)</h3><p>Set the preferred stencil buffer size to <i>size</i>.</p>
<p><b>See also</b> <a href="qglformat.html#stencilBufferSize">stencilBufferSize</a>(),
<a href="qglformat.html#setStencil">setStencil</a>(), and <a href="qglformat.html#stencil">stencil</a>().</p>


<h3 class="fn"><a name="setStereo" />QGLFormat.setStereo (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>If <i>enable</i> is true enables stereo buffering; otherwise
disables stereo buffering.</p>
<p>Stereo buffering is disabled by default.</p>
<p>Stereo buffering provides extra color buffers to generate
left-eye and right-eye images.</p>
<p><b>See also</b> <a href="qglformat.html#stereo">stereo</a>().</p>


<h3 class="fn"><a name="setSwapInterval" />QGLFormat.setSwapInterval (<i>self</i>, int&#160;<i>interval</i>)</h3><p>Set the preferred swap interval. This can be used to sync the GL
drawing into a system window to the vertical refresh of the screen.
Setting an <i>interval</i> value of 0 will turn the vertical
refresh syncing off, any value higher than 0 will turn the vertical
syncing on.</p>
<p>Under Windows and under X11, where the
<tt>WGL_EXT_swap_control</tt> and <tt>GLX_SGI_video_sync</tt>
extensions are used, the <i>interval</i> parameter can be used to
set the minimum number of video frames that are displayed before a
buffer swap will occur. In effect, setting the <i>interval</i> to
10, means there will be 10 vertical retraces between every buffer
swap.</p>
<p>Under Windows the <tt>WGL_EXT_swap_control</tt> extension has to
be present, and under X11 the <tt>GLX_SGI_video_sync</tt> extension
has to be present.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#swapInterval">swapInterval</a>().</p>


<h3 class="fn"><a name="setVersion" />QGLFormat.setVersion (<i>self</i>, int&#160;<i>major</i>, int&#160;<i>minor</i>)</h3><p>Set the OpenGL version to the <i>major</i> and <i>minor</i>
numbers. If a context compatible with the requested OpenGL version
cannot be created, a context compatible with version 1.x is created
instead.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qglformat.html#majorVersion">majorVersion</a>() and <a href="qglformat.html#minorVersion">minorVersion</a>().</p>


<h3 class="fn"><a name="stencil" />bool QGLFormat.stencil (<i>self</i>)</h3><p>Returns true if the stencil buffer is enabled; otherwise returns
false. The stencil buffer is enabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setStencil">setStencil</a>() and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>


<h3 class="fn"><a name="stencilBufferSize" />int QGLFormat.stencilBufferSize (<i>self</i>)</h3><p>Returns the stencil buffer size.</p>
<p><b>See also</b> <a href="qglformat.html#stencil">stencil</a>(),
<a href="qglformat.html#setStencil">setStencil</a>(), and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>


<h3 class="fn"><a name="stereo" />bool QGLFormat.stereo (<i>self</i>)</h3><p>Returns true if stereo buffering is enabled; otherwise returns
false. Stereo buffering is disabled by default.</p>
<p><b>See also</b> <a href="qglformat.html#setStereo">setStereo</a>().</p>


<h3 class="fn"><a name="swapInterval" />int QGLFormat.swapInterval (<i>self</i>)</h3><p>Returns the currently set swap interval. -1 is returned if
setting the swap interval isn't supported in the system GL
implementation.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qglformat.html#setSwapInterval">setSwapInterval</a>().</p>


<h3 class="fn"><a name="testOption" />bool QGLFormat.testOption (<i>self</i>, <a href="qgl-formatoptions.html">QGL.FormatOptions</a>&#160;<i>opt</i>)</h3><p>Returns true if format option <i>opt</i> is set; otherwise
returns false.</p>
<p><b>See also</b> <a href="qglformat.html#setOption">setOption</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QGLFormat.__eq__ (<i>self</i>, <a href="qglformat.html">QGLFormat</a>)</h3><h3 class="fn"><a name="__ne__" />bool QGLFormat.__ne__ (<i>self</i>, <a href="qglformat.html">QGLFormat</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.12.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt&#160;4.8.7</td></tr></table></div></address></body></html>