diff --git a/apps/opencs/main.cpp b/apps/opencs/main.cpp index f2e2156865..844a7895e8 100644 --- a/apps/opencs/main.cpp +++ b/apps/opencs/main.cpp @@ -35,6 +35,7 @@ void setQSurfaceFormat() format.setSamples(ds->getMultiSamples()); format.setStencilBufferSize(ds->getMinimumNumStencilBits()); format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); + format.setAlphaBufferSize(ds->getMinimumNumAlphaBits()); QSurfaceFormat::setDefaultFormat(format); } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index bd1f2c2d30..8ab2f657da 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -72,6 +72,13 @@ namespace CSVRender mWidget = new osgQOpenGLWidget(this); + // Not the most idiomatic place to do this, but osgQt needs its guts rearranging to do things properly. + // We *should* be setting this (or relying on the fact that we want the default value) on the default + // osg::DisplaySettings instance or the View's instance. + // Then osgQt should, but doesn't, use that to create a GraphicsTraits instance, and propagate the details from + // that to Qt for us. + mWidget->setTextureFormat(GL_RGB8); + mRenderer = mWidget->getCompositeViewer(); osg::ref_ptr window = new osgViewer::GraphicsWindowEmbedded(0, 0, width(), height());