File: qglformat.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (657 lines) | stat: -rw-r--r-- 69,485 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgl.cpp -->
  <title>Qt 4.8: QGLFormat Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtopengl.html">QtOpenGL</a></li>
<li>QGLFormat</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QGLFormat Class Reference</h1>
<!-- $$$QGLFormat-brief -->
<p>The QGLFormat class specifies the display format of an OpenGL rendering context. <a href="#details">More...</a></p>
<!-- @@@QGLFormat -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QGLFormat&gt;</span></pre><ul>
<li><a href="qglformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></b> { NoProfile, CoreProfile, CompatibilityProfile }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><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 }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlags</a></b></td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat">QGLFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat-2">QGLFormat</a></b> ( QGL::FormatOptions <i>options</i>, int <i>plane</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat-3">QGLFormat</a></b> ( const QGLFormat &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#dtor.QGLFormat">~QGLFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#accum">accum</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#accumBufferSize">accumBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#alpha">alpha</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#alphaBufferSize">alphaBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#blueBufferSize">blueBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#depth">depth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#depthBufferSize">depthBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#directRendering">directRendering</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#doubleBuffer">doubleBuffer</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#greenBufferSize">greenBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOverlay">hasOverlay</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#majorVersion">majorVersion</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#minorVersion">minorVersion</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#plane">plane</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenGLContextProfile </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#profile">profile</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#redBufferSize">redBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#rgba">rgba</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#sampleBuffers">sampleBuffers</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#samples">samples</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAccum">setAccum</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAlpha">setAlpha</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDepth">setDepth</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDirectRendering">setDirectRendering</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setOption">setOption</a></b> ( QGL::FormatOptions <i>opt</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setOverlay">setOverlay</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setPlane">setPlane</a></b> ( int <i>plane</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setProfile">setProfile</a></b> ( OpenGLContextProfile <i>profile</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setRedBufferSize">setRedBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setRgba">setRgba</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSamples">setSamples</a></b> ( int <i>numSamples</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStencil">setStencil</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStereo">setStereo</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSwapInterval">setSwapInterval</a></b> ( int <i>interval</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setVersion">setVersion</a></b> ( int <i>major</i>, int <i>minor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stencil">stencil</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stencilBufferSize">stencilBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stereo">stereo</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#swapInterval">swapInterval</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#testOption">testOption</a></b> ( QGL::FormatOptions <i>opt</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat &amp; </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-eq">operator=</a></b> ( const QGLFormat &amp; <i>other</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#defaultFormat">defaultFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#fromPlatformWindowFormat">fromPlatformWindowFormat</a></b> ( const QPlatformWindowFormat &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOpenGL">hasOpenGL</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOpenGLOverlays">hasOpenGLOverlays</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenGLVersionFlags </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#openGLVersionFlags">openGLVersionFlags</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDefaultFormat">setDefaultFormat</a></b> ( const QGLFormat &amp; <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDefaultOverlayFormat">setDefaultOverlayFormat</a></b> ( const QGLFormat &amp; <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPlatformWindowFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#toPlatformWindowFormat">toPlatformWindowFormat</a></b> ( const QGLFormat &amp; <i>format</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-not-eq-17">operator!=</a></b> ( const QGLFormat &amp; <i>a</i>, const QGLFormat &amp; <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-eq-eq-26">operator==</a></b> ( const QGLFormat &amp; <i>a</i>, const QGLFormat &amp; <i>b</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QGLFormat-description -->
<div class="descr">
<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&#x2e; 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="qtglobal.html#qFatal">qFatal</a>(<span class="string">&quot;Cool hardware required&quot;</span>);
     }
 }</pre>
<div class="LegaleseLeft"><p>OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.</p>
</div></div>
<p><b>See also </b><a href="qglcontext.html">QGLContext</a> and <a href="qglwidget.html">QGLWidget</a>.</p>
<!-- @@@QGLFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$OpenGLContextProfile$$$NoProfile$$$CoreProfile$$$CompatibilityProfile -->
<h3 class="fn"><a name="OpenGLContextProfile-enum"></a>enum QGLFormat::<span class="name">OpenGLContextProfile</span></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 valign="top" class="odd"><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&#x2e;</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>
<!-- @@@OpenGLContextProfile -->
<!-- $$$OpenGLVersionFlag$$$OpenGL_Version_None$$$OpenGL_Version_1_1$$$OpenGL_Version_1_2$$$OpenGL_Version_1_3$$$OpenGL_Version_1_4$$$OpenGL_Version_1_5$$$OpenGL_Version_2_0$$$OpenGL_Version_2_1$$$OpenGL_ES_Common_Version_1_0$$$OpenGL_ES_CommonLite_Version_1_0$$$OpenGL_ES_Common_Version_1_1$$$OpenGL_ES_CommonLite_Version_1_1$$$OpenGL_ES_Version_2_0$$$OpenGL_Version_3_0$$$OpenGL_Version_3_1$$$OpenGL_Version_3_2$$$OpenGL_Version_3_3$$$OpenGL_Version_4_0 -->
<h3 class="flags"><a name="OpenGLVersionFlag-enum"></a>enum QGLFormat::<span class="name">OpenGLVersionFlag</span><br/>flags QGLFormat::<span class="name">OpenGLVersionFlags</span></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 valign="top" class="odd"><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&#x2e;</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&#x2e; 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>
<!-- @@@OpenGLVersionFlag -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGLFormat[overload1]$$$QGLFormat -->
<h3 class="fn"><a name="QGLFormat"></a>QGLFormat::<span class="name">QGLFormat</span> ()</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&#x2e;, 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&#x2e;, normal plane).</li>
<li><a href="qglformat.html#setSampleBuffers">Multisample buffers:</a> Disabled.</li>
</ul>
<!-- @@@QGLFormat -->
<!-- $$$QGLFormat$$$QGLFormatQGL::FormatOptionsint -->
<h3 class="fn"><a name="QGLFormat-2"></a>QGLFormat::<span class="name">QGLFormat</span> ( <span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <i>options</i>, <span class="type">int</span> <i>plane</i> = 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="qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get stencil buffer; results will be suboptimal&quot;</span>);
     <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>alpha())
         <a href="qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get alpha channel; results will be suboptimal&quot;</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&#x2e; <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>
<!-- @@@QGLFormat -->
<!-- $$$QGLFormat$$$QGLFormatconstQGLFormat& -->
<h3 class="fn"><a name="QGLFormat-3"></a>QGLFormat::<span class="name">QGLFormat</span> ( const <span class="type">QGLFormat</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QGLFormat -->
<!-- $$$~QGLFormat[overload1]$$$~QGLFormat -->
<h3 class="fn"><a name="dtor.QGLFormat"></a>QGLFormat::<span class="name">~QGLFormat</span> ()</h3>
<p>Destroys the <a href="qglformat.html">QGLFormat</a>.</p>
<!-- @@@~QGLFormat -->
<!-- $$$accum[overload1]$$$accum -->
<h3 class="fn"><a name="accum"></a><span class="type">bool</span> QGLFormat::<span class="name">accum</span> () const</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>
<!-- @@@accum -->
<!-- $$$accumBufferSize[overload1]$$$accumBufferSize -->
<h3 class="fn"><a name="accumBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">accumBufferSize</span> () const</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>
<!-- @@@accumBufferSize -->
<!-- $$$alpha[overload1]$$$alpha -->
<h3 class="fn"><a name="alpha"></a><span class="type">bool</span> QGLFormat::<span class="name">alpha</span> () const</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>
<!-- @@@alpha -->
<!-- $$$alphaBufferSize[overload1]$$$alphaBufferSize -->
<h3 class="fn"><a name="alphaBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">alphaBufferSize</span> () const</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>
<!-- @@@alphaBufferSize -->
<!-- $$$blueBufferSize[overload1]$$$blueBufferSize -->
<h3 class="fn"><a name="blueBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">blueBufferSize</span> () const</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>
<!-- @@@blueBufferSize -->
<!-- $$$defaultFormat[overload1]$$$defaultFormat -->
<h3 class="fn"><a name="defaultFormat"></a><span class="type">QGLFormat</span> QGLFormat::<span class="name">defaultFormat</span> ()<tt> [static]</tt></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&#x2e; 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>
<!-- @@@defaultFormat -->
<!-- $$$defaultOverlayFormat[overload1]$$$defaultOverlayFormat -->
<h3 class="fn"><a name="defaultOverlayFormat"></a><span class="type">QGLFormat</span> QGLFormat::<span class="name">defaultOverlayFormat</span> ()<tt> [static]</tt></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&#x2e;, 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&#x2e;, 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>
<!-- @@@defaultOverlayFormat -->
<!-- $$$depth[overload1]$$$depth -->
<h3 class="fn"><a name="depth"></a><span class="type">bool</span> QGLFormat::<span class="name">depth</span> () const</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>
<!-- @@@depth -->
<!-- $$$depthBufferSize[overload1]$$$depthBufferSize -->
<h3 class="fn"><a name="depthBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">depthBufferSize</span> () const</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>
<!-- @@@depthBufferSize -->
<!-- $$$directRendering[overload1]$$$directRendering -->
<h3 class="fn"><a name="directRendering"></a><span class="type">bool</span> QGLFormat::<span class="name">directRendering</span> () const</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>
<!-- @@@directRendering -->
<!-- $$$doubleBuffer[overload1]$$$doubleBuffer -->
<h3 class="fn"><a name="doubleBuffer"></a><span class="type">bool</span> QGLFormat::<span class="name">doubleBuffer</span> () const</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>
<!-- @@@doubleBuffer -->
<!-- $$$fromPlatformWindowFormat[overload1]$$$fromPlatformWindowFormatconstQPlatformWindowFormat& -->
<h3 class="fn"><a name="fromPlatformWindowFormat"></a><span class="type">QGLFormat</span> QGLFormat::<span class="name">fromPlatformWindowFormat</span> ( const <span class="type"><a href="qplatformwindowformat.html">QPlatformWindowFormat</a></span> &amp; <i>format</i> )<tt> [static]</tt></h3>
<p>Returns an OpenGL format for the platform window format specified by <i>format</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@fromPlatformWindowFormat -->
<!-- $$$greenBufferSize[overload1]$$$greenBufferSize -->
<h3 class="fn"><a name="greenBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">greenBufferSize</span> () const</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>
<!-- @@@greenBufferSize -->
<!-- $$$hasOpenGL[overload1]$$$hasOpenGL -->
<h3 class="fn"><a name="hasOpenGL"></a><span class="type">bool</span> QGLFormat::<span class="name">hasOpenGL</span> ()<tt> [static]</tt></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>
<!-- @@@hasOpenGL -->
<!-- $$$hasOpenGLOverlays[overload1]$$$hasOpenGLOverlays -->
<h3 class="fn"><a name="hasOpenGLOverlays"></a><span class="type">bool</span> QGLFormat::<span class="name">hasOpenGLOverlays</span> ()<tt> [static]</tt></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>
<!-- @@@hasOpenGLOverlays -->
<!-- $$$hasOverlay[overload1]$$$hasOverlay -->
<h3 class="fn"><a name="hasOverlay"></a><span class="type">bool</span> QGLFormat::<span class="name">hasOverlay</span> () const</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>
<!-- @@@hasOverlay -->
<!-- $$$majorVersion[overload1]$$$majorVersion -->
<h3 class="fn"><a name="majorVersion"></a><span class="type">int</span> QGLFormat::<span class="name">majorVersion</span> () const</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>
<!-- @@@majorVersion -->
<!-- $$$minorVersion[overload1]$$$minorVersion -->
<h3 class="fn"><a name="minorVersion"></a><span class="type">int</span> QGLFormat::<span class="name">minorVersion</span> () const</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>
<!-- @@@minorVersion -->
<!-- $$$openGLVersionFlags[overload1]$$$openGLVersionFlags -->
<h3 class="fn"><a name="openGLVersionFlags"></a><span class="type"><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlags</a></span> QGLFormat::<span class="name">openGLVersionFlags</span> ()<tt> [static]</tt></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&#x2e;, 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&#x2e;, 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>
<!-- @@@openGLVersionFlags -->
<!-- $$$plane[overload1]$$$plane -->
<h3 class="fn"><a name="plane"></a><span class="type">int</span> QGLFormat::<span class="name">plane</span> () const</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>
<!-- @@@plane -->
<!-- $$$profile[overload1]$$$profile -->
<h3 class="fn"><a name="profile"></a><span class="type"><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></span> QGLFormat::<span class="name">profile</span> () const</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>
<!-- @@@profile -->
<!-- $$$redBufferSize[overload1]$$$redBufferSize -->
<h3 class="fn"><a name="redBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">redBufferSize</span> () const</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>
<!-- @@@redBufferSize -->
<!-- $$$rgba[overload1]$$$rgba -->
<h3 class="fn"><a name="rgba"></a><span class="type">bool</span> QGLFormat::<span class="name">rgba</span> () const</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>
<!-- @@@rgba -->
<!-- $$$sampleBuffers[overload1]$$$sampleBuffers -->
<h3 class="fn"><a name="sampleBuffers"></a><span class="type">bool</span> QGLFormat::<span class="name">sampleBuffers</span> () const</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>
<!-- @@@sampleBuffers -->
<!-- $$$samples[overload1]$$$samples -->
<h3 class="fn"><a name="samples"></a><span class="type">int</span> QGLFormat::<span class="name">samples</span> () const</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>
<!-- @@@samples -->
<!-- $$$setAccum[overload1]$$$setAccumbool -->
<h3 class="fn"><a name="setAccum"></a><span class="type">void</span> QGLFormat::<span class="name">setAccum</span> ( <span class="type">bool</span> <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>
<!-- @@@setAccum -->
<!-- $$$setAccumBufferSize[overload1]$$$setAccumBufferSizeint -->
<h3 class="fn"><a name="setAccumBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setAccumBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setAccumBufferSize -->
<!-- $$$setAlpha[overload1]$$$setAlphabool -->
<h3 class="fn"><a name="setAlpha"></a><span class="type">void</span> QGLFormat::<span class="name">setAlpha</span> ( <span class="type">bool</span> <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>
<!-- @@@setAlpha -->
<!-- $$$setAlphaBufferSize[overload1]$$$setAlphaBufferSizeint -->
<h3 class="fn"><a name="setAlphaBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setAlphaBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setAlphaBufferSize -->
<!-- $$$setBlueBufferSize[overload1]$$$setBlueBufferSizeint -->
<h3 class="fn"><a name="setBlueBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setBlueBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setBlueBufferSize -->
<!-- $$$setDefaultFormat[overload1]$$$setDefaultFormatconstQGLFormat& -->
<h3 class="fn"><a name="setDefaultFormat"></a><span class="type">void</span> QGLFormat::<span class="name">setDefaultFormat</span> ( const <span class="type">QGLFormat</span> &amp; <i>f</i> )<tt> [static]</tt></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>
<!-- @@@setDefaultFormat -->
<!-- $$$setDefaultOverlayFormat[overload1]$$$setDefaultOverlayFormatconstQGLFormat& -->
<h3 class="fn"><a name="setDefaultOverlayFormat"></a><span class="type">void</span> QGLFormat::<span class="name">setDefaultOverlayFormat</span> ( const <span class="type">QGLFormat</span> &amp; <i>f</i> )<tt> [static]</tt></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>
<!-- @@@setDefaultOverlayFormat -->
<!-- $$$setDepth[overload1]$$$setDepthbool -->
<h3 class="fn"><a name="setDepth"></a><span class="type">void</span> QGLFormat::<span class="name">setDepth</span> ( <span class="type">bool</span> <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>
<!-- @@@setDepth -->
<!-- $$$setDepthBufferSize[overload1]$$$setDepthBufferSizeint -->
<h3 class="fn"><a name="setDepthBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setDepthBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setDepthBufferSize -->
<!-- $$$setDirectRendering[overload1]$$$setDirectRenderingbool -->
<h3 class="fn"><a name="setDirectRendering"></a><span class="type">void</span> QGLFormat::<span class="name">setDirectRendering</span> ( <span class="type">bool</span> <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>
<!-- @@@setDirectRendering -->
<!-- $$$setDoubleBuffer[overload1]$$$setDoubleBufferbool -->
<h3 class="fn"><a name="setDoubleBuffer"></a><span class="type">void</span> QGLFormat::<span class="name">setDoubleBuffer</span> ( <span class="type">bool</span> <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>
<!-- @@@setDoubleBuffer -->
<!-- $$$setGreenBufferSize[overload1]$$$setGreenBufferSizeint -->
<h3 class="fn"><a name="setGreenBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setGreenBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setGreenBufferSize -->
<!-- $$$setOption[overload1]$$$setOptionQGL::FormatOptions -->
<h3 class="fn"><a name="setOption"></a><span class="type">void</span> QGLFormat::<span class="name">setOption</span> ( <span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <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>
<!-- @@@setOption -->
<!-- $$$setOverlay[overload1]$$$setOverlaybool -->
<h3 class="fn"><a name="setOverlay"></a><span class="type">void</span> QGLFormat::<span class="name">setOverlay</span> ( <span class="type">bool</span> <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>
<!-- @@@setOverlay -->
<!-- $$$setPlane[overload1]$$$setPlaneint -->
<h3 class="fn"><a name="setPlane"></a><span class="type">void</span> QGLFormat::<span class="name">setPlane</span> ( <span class="type">int</span> <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>
<!-- @@@setPlane -->
<!-- $$$setProfile[overload1]$$$setProfileOpenGLContextProfile -->
<h3 class="fn"><a name="setProfile"></a><span class="type">void</span> QGLFormat::<span class="name">setProfile</span> ( <span class="type"><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></span> <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&#x2e;</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#profile">profile</a>().</p>
<!-- @@@setProfile -->
<!-- $$$setRedBufferSize[overload1]$$$setRedBufferSizeint -->
<h3 class="fn"><a name="setRedBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setRedBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setRedBufferSize -->
<!-- $$$setRgba[overload1]$$$setRgbabool -->
<h3 class="fn"><a name="setRgba"></a><span class="type">void</span> QGLFormat::<span class="name">setRgba</span> ( <span class="type">bool</span> <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>
<!-- @@@setRgba -->
<!-- $$$setSampleBuffers[overload1]$$$setSampleBuffersbool -->
<h3 class="fn"><a name="setSampleBuffers"></a><span class="type">void</span> QGLFormat::<span class="name">setSampleBuffers</span> ( <span class="type">bool</span> <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>
<!-- @@@setSampleBuffers -->
<!-- $$$setSamples[overload1]$$$setSamplesint -->
<h3 class="fn"><a name="setSamples"></a><span class="type">void</span> QGLFormat::<span class="name">setSamples</span> ( <span class="type">int</span> <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>
<!-- @@@setSamples -->
<!-- $$$setStencil[overload1]$$$setStencilbool -->
<h3 class="fn"><a name="setStencil"></a><span class="type">void</span> QGLFormat::<span class="name">setStencil</span> ( <span class="type">bool</span> <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>
<!-- @@@setStencil -->
<!-- $$$setStencilBufferSize[overload1]$$$setStencilBufferSizeint -->
<h3 class="fn"><a name="setStencilBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setStencilBufferSize</span> ( <span class="type">int</span> <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>
<!-- @@@setStencilBufferSize -->
<!-- $$$setStereo[overload1]$$$setStereobool -->
<h3 class="fn"><a name="setStereo"></a><span class="type">void</span> QGLFormat::<span class="name">setStereo</span> ( <span class="type">bool</span> <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>
<!-- @@@setStereo -->
<!-- $$$setSwapInterval[overload1]$$$setSwapIntervalint -->
<h3 class="fn"><a name="setSwapInterval"></a><span class="type">void</span> QGLFormat::<span class="name">setSwapInterval</span> ( <span class="type">int</span> <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>
<!-- @@@setSwapInterval -->
<!-- $$$setVersion[overload1]$$$setVersionintint -->
<h3 class="fn"><a name="setVersion"></a><span class="type">void</span> QGLFormat::<span class="name">setVersion</span> ( <span class="type">int</span> <i>major</i>, <span class="type">int</span> <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>
<!-- @@@setVersion -->
<!-- $$$stencil[overload1]$$$stencil -->
<h3 class="fn"><a name="stencil"></a><span class="type">bool</span> QGLFormat::<span class="name">stencil</span> () const</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>
<!-- @@@stencil -->
<!-- $$$stencilBufferSize[overload1]$$$stencilBufferSize -->
<h3 class="fn"><a name="stencilBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">stencilBufferSize</span> () const</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>
<!-- @@@stencilBufferSize -->
<!-- $$$stereo[overload1]$$$stereo -->
<h3 class="fn"><a name="stereo"></a><span class="type">bool</span> QGLFormat::<span class="name">stereo</span> () const</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>
<!-- @@@stereo -->
<!-- $$$swapInterval[overload1]$$$swapInterval -->
<h3 class="fn"><a name="swapInterval"></a><span class="type">int</span> QGLFormat::<span class="name">swapInterval</span> () const</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>
<!-- @@@swapInterval -->
<!-- $$$testOption[overload1]$$$testOptionQGL::FormatOptions -->
<h3 class="fn"><a name="testOption"></a><span class="type">bool</span> QGLFormat::<span class="name">testOption</span> ( <span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <i>opt</i> ) const</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>
<!-- @@@testOption -->
<!-- $$$toPlatformWindowFormat[overload1]$$$toPlatformWindowFormatconstQGLFormat& -->
<h3 class="fn"><a name="toPlatformWindowFormat"></a><span class="type"><a href="qplatformwindowformat.html">QPlatformWindowFormat</a></span> QGLFormat::<span class="name">toPlatformWindowFormat</span> ( const <span class="type">QGLFormat</span> &amp; <i>format</i> )<tt> [static]</tt></h3>
<p>Returns a platform window format for the OpenGL format specified by <i>format</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@toPlatformWindowFormat -->
<!-- $$$operator=[overload1]$$$operator=constQGLFormat& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QGLFormat</span> &amp; QGLFormat::<span class="name">operator=</span> ( const <span class="type">QGLFormat</span> &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=$$$operator!=constQGLFormat&constQGLFormat& -->
<h3 class="fn"><a name="operator-not-eq-17"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QGLFormat</span> &amp; <i>a</i>, const <span class="type">QGLFormat</span> &amp; <i>b</i> )</h3>
<p>Returns false if all the options of the two <a href="qglformat.html">QGLFormat</a> objects <i>a</i> and <i>b</i> are equal; otherwise returns true.</p>
<!-- @@@operator!= -->
<!-- $$$operator==$$$operator==constQGLFormat&constQGLFormat& -->
<h3 class="fn"><a name="operator-eq-eq-26"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QGLFormat</span> &amp; <i>a</i>, const <span class="type">QGLFormat</span> &amp; <i>b</i> )</h3>
<p>Returns true if all the options of the two <a href="qglformat.html">QGLFormat</a> objects <i>a</i> and <i>b</i> are equal; otherwise returns false.</p>
<!-- @@@operator== -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>