Commits (12)
......@@ -537,10 +537,8 @@ int main(int argc, char **argv)
QOffscreenSurface *surface = new QOffscreenSurface();
surface->create();
QOpenGLContext context;
context.setScreen(screen);
context.create();
context.makeCurrent(surface);
//make the globally shared OpenGLContext current
QOpenGLContext::globalShareContext()->makeCurrent(surface);
#endif
......
......@@ -394,11 +394,7 @@ void samples(int _samples) {
/// Get opengl MSAA sample count
int samples() {
#if defined(ARCH_DARWIN) //Disable MSAA on OSX by default until workaround is found.
return OpenFlipperSettings().value("Core/OpenGL/Samples",0).toInt();
#else
return OpenFlipperSettings().value("Core/OpenGL/Samples",4).toInt();
#endif
}
/// Store opengl stereo mode setting
......
......@@ -1621,8 +1621,8 @@ void DrawMeshT<Mesh>::updatePickingVertices_opt(ACG::GLState& _state)
rebuild();
}
if(ACG::compatibilityProfile())
pickVertexMethod_ = 1; // no texture buffers supported during compilation
if(ACG::compatibilityProfile())
pickVertexMethod_ = 1; // no texture buffers supported during compilation
if (numVerts_)
{
......@@ -2072,7 +2072,7 @@ void DrawMeshT<Mesh>::updatePickingFaces_opt(ACG::GLState& _state )
rebuild();
}
if (!ACG::compatibilityProfile() && meshComp_ && meshComp_->getNumTriangles())
if (meshComp_ && meshComp_->getNumTriangles())
{
// upload tri->face lookup-table to texture buffer
pickFaceTriToFaceMapTBO_.setBufferData(sizeof(int) * meshComp_->getNumTriangles(), meshComp_->mapToOriginalFaceIDPtr(), GL_R32I, GL_STATIC_DRAW);
......
......@@ -794,8 +794,6 @@ TextureBuffer::~TextureBuffer() {
void TextureBuffer::setBufferData(
size_t _size, const void* _data, GLenum _internalFormat, GLenum _usage) {
if(!ACG::compatibilityProfile())
{
if (supportsTextureBuffer()) {
// setup buffer object
if (!buffer_)
......@@ -819,9 +817,6 @@ if(!ACG::compatibilityProfile())
}
else
std::cerr << "TextureBuffer::setData - gpu does not support buffer textures!" << std::endl;
} else{
std::cerr << "TextureBuffer::setData - currently only in core profile available!" << std::endl;
}
}
bool TextureBuffer::getBufferData(void* _dst) {
......
......@@ -45,10 +45,11 @@
bool ACG::Profile::isCoreProfile()
{
return QGLContext::currentContext()->format().profile() != QGLFormat::CoreProfile;
return QGLContext::currentContext()->format().profile() == QGLFormat::CoreProfile;
}
bool ACG::Profile::isCompatibilityProfile()
{
return QGLContext::currentContext()->format().profile() != QGLFormat::CompatibilityProfile;
// We treat Qt NoProfile the same way as compatibility profile to support OSX
return QGLContext::currentContext()->format().profile() != QGLFormat::CoreProfile;
}