Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [OSX] sfml 2.0 RC and opengl 3.2  (Read 2884 times)

0 Members and 1 Guest are viewing this topic.

mercurio7891

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
[OSX] sfml 2.0 RC and opengl 3.2
« 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.
« Last Edit: November 09, 2012, 09:02:26 am by Laurent »

Frite

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [OSX] sfml 2.0 RC and opengl 3.2
« Reply #1 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);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [OSX] sfml 2.0 RC and opengl 3.2
« Reply #2 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.
Laurent Gomila - SFML developer