SFML community forums

Help => Window => Topic started by: aXyde on November 07, 2009, 01:15:01 pm

Title: Creating OpenGL 3.2 Context
Post by: aXyde on November 07, 2009, 01:15:01 pm
Hi,

As the topic says: How do i create an OpenGL 3.2 Context with SFML. I saw in some tutorial[1] that for SDL you would just have to call SDL_GL_SetAttribute(). Is there an equivalent way for doing this with SFML?

Greets

[1] http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_(C_/_SDL)
Title: Creating OpenGL 3.2 Context
Post by: Laurent on November 07, 2009, 01:40:17 pm
There's no way to do it with SFML 1.5.

In the latest SVN revisions of SFML 2, you can do it like this:
Code: [Select]
sf::ContextSettings settings;
settings.MajorVersion = 3;
settings.MinorVersion = 2;

sf::Window window(mode, title, style, settings);
Title: Creating OpenGL 3.2 Context
Post by: enigma on January 09, 2010, 04:37:04 pm
Hi to all,
I'm new to SFML, but I'm trying it, and is a very nice library.
I need to create an OpenGL 3.2 context (for working with the core specification). I've downloaded and compiled SFML 2.0, but I can't find this class:
Code: [Select]

sf::ContextSettings settings;

Thanks!
Title: Creating OpenGL 3.2 Context
Post by: Laurent on January 09, 2010, 06:19:55 pm
Well, it is there.

What does "I can't find this class" mean? Do you have a compile error?
Title: Creating OpenGL 3.2 Context
Post by: enigma on January 10, 2010, 01:44:04 am
Quote from: "Laurent"

What does "I can't find this class" mean? Do you have a compile error?


Yes, 'ContextSetting' is not a member of 'sf'.
Note, I include only Window.hpp.
Thanks.
Title: Creating OpenGL 3.2 Context
Post by: OniLinkPlus on January 10, 2010, 03:01:57 am
Quote from: "enigma"
Quote from: "Laurent"

What does "I can't find this class" mean? Do you have a compile error?


Yes, 'ContextSetting' is not a member of 'sf'.
Note, I include only Window.hpp.
Thanks.
The class is sf::ContextSettings, not sf::ContextSetting.
Title: Creating OpenGL 3.2 Context
Post by: enigma on January 10, 2010, 12:49:20 pm
Quote from: "OniLink10"

The class is sf::ContextSettings, not sf::ContextSetting.


Yes, is my mistake to write to the forum.
But I don't understand where is the problem.
Title: Creating OpenGL 3.2 Context
Post by: enigma on January 10, 2010, 02:30:16 pm
Solved  :D !
I had downloaded an old (wrong) version of SFML 2.0  :oops: by this link (http://sfml.svn.sourceforge.net/viewvc/sfml/trunk.tar.gz?view=tar).
Sorry  :oops:!
Title: Creating OpenGL 3.2 Context
Post by: Laurent on January 10, 2010, 04:53:06 pm
This is not an old / wrong version, this is the trunk which is the future SFML 1.6. SFML 2 is a separate branch (branches/sfml2), so that I can maintain both at the same time.
Title: Creating OpenGL 3.2 Context
Post by: enigma on January 11, 2010, 08:01:40 am
Yes, it was my mistake, sorry  :D.
However thanks for help!