SFML community forums

Help => General => Topic started by: mercurio7891 on November 09, 2012, 08:56:12 am

Title: [OSX] sfml 2.0 RC and opengl 3.2
Post by: mercurio7891 on November 09, 2012, 08:56:12 am
Following this thread

http://en.sfml-dev.org/forums/index.php?topic=9083.msg61236#msg61236

and after adding the following code to SFContext.mm to the function SFContext::createContext

// Add support for OpenGL 3.2 on Mac OS X Lion and later
    if (settings.majorVersion > 3 || (settings.majorVersion == 3 && settings.minorVersion >= 2)) {
        attrs.push_back(NSOpenGLPFAOpenGLProfile);
        attrs.push_back(NSOpenGLProfileVersion3_2Core);
    } else {
        attrs.push_back(NSOpenGLPFAOpenGLProfile);
        attrs.push_back(NSOpenGLProfileVersionLegacy);
    }

 

It gives the following error upon attempting to create a opengl 3.2 context

2012-11-09 15:42:08.715 sfml-test-d[8498:5503] invalid share context
2012-11-09 15:42:08.717 sfml-test-d[8498:5503] invalid context
Error. Unable to create the context.
Failed to activate the window's context
Failed to activate the window's context
......

My mac does support opengl 3.2 core profile.
Title: Re: [OSX] sfml 2.0 RC and opengl 3.2
Post by: Frite on November 10, 2012, 01:09:24 pm
I've got the same problem than you and have fixed it by forcing the creation of only the 3.2 context.
It's weird but had worked for me..

so to resume just add :

Code: [Select]
attrs.push_back(NSOpenGLPFAOpenGLProfile);
attrs.push_back(NSOpenGLProfileVersion3_2Core);
Title: Re: [OSX] sfml 2.0 RC and opengl 3.2
Post by: Laurent on November 10, 2012, 01:26:29 pm
Quote
It's weird
Not that much. Contexts created with different settings may not be able to share their resources. And SFML internally creates non-3.2 contexts, and shares them with your own contexts.