<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi,</div><div><br></div><div>as I understand correctly the ‘old’ QGLxxx classes will be replaced by new QOpenGLxxx classes.</div><div>I tried the following code below, and found out that QGLContext is correctly setting the color depth,</div><div>while QOpenGLContext always defaults to 8.</div><div><br></div><div>
<pre style="margin-top: 0px; margin-bottom: 0px;"><!--StartFragment--><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">QSurfaceFormat</span><span style=" color:#c0c0c0;"> </span>ogfrmt;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>ogfrmt.setRedBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>ogfrmt.setGreenBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>ogfrmt.setBlueBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">QOpenGLContext</span><span style=" color:#c0c0c0;"> </span>*oglc<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QOpenGLContext</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>oglc->setFormat(ogfrmt);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>oglc->create();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>qDebug()<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"QOpenGLContext</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">red</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">buffer</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">size:"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>oglc->format().redBufferSize();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">QGLFormat</span><span style=" color:#c0c0c0;"> </span>gfrmt;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>gfrmt.setRedBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>gfrmt.setBlueBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>gfrmt.setGreenBufferSize(<span style=" color:#000080;">6</span>);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">QGLContext</span><span style=" color:#c0c0c0;"> </span>*glc<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QGLContext</span>(gfrmt);</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>glc-><span style="font-style: italic;">create</span>();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;">    </span>qDebug()<span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"QGLContext</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">red</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">buffer</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">size:"</span><span style=" color:#c0c0c0;"> </span><<<span style=" color:#c0c0c0;"> </span>glc->format().redBufferSize();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><br><!--EndFragment--></pre><div><br></div></div><div>Is this a known bug, or is the above code simply wrong?</div><div><br></div><div>Cheers,</div><div><br></div><div>Kurt</div></body></html>