SFML community forums
Help => Window => Topic started by: xRedx22 on April 10, 2010, 09:47:26 pm
-
I figured out how to create an OpenGL context without a window, but I couldn't figure out how to set the version of the context and then create a window using the same context.
Basically, what I am trying to do is create an OpenGL 3.2 context, check shader extensions with GLEW, and then display a window. Is there anyway to do this with the SFML 2 window package and GLEW?
-
sf::VideoMode mode;
mode.Width = 1024;
mode.Height = 768;
mode.BitsPerPixel = 32;
sf::ContextSettings settings;
settings.DepthBits = 24;
settings.StencilBits = 8;
settings.AntialiasingLevel = 4;
settings.MajorVersion = 3;
settings.MinorVersion = 2;
Screen.Create(mode, title, sf::Style::Fullscreen, settings);
Is that what you are looking for?
-
Actually, I gave up on creating the context before, so I just want to use GLEW calls, but thanks for helping.
My main problem now is that I tried creating a context with MajorVersion 3 settings, but when I use GLEW, it doesn't say OpenGL 3 is supported in the context (which I know my hardware supports from previous tests).
Is there anything special I have to do with GLEW to get this to work?
-
I don't think so, I'm not having any issues with a 3.2 context myself. :/
-
Are you adding GLEW from source?
Because that's what I am doing.
Could you explain what you did with GLEW to get it to work with SFML 2 so I could try that?
-
No, I seem to recall I had issues with that, possibly because of a conflict with SFML's own GLEW. At the time it was easier for me to just handle the extensions myself, manually, but if you come up with a better way of handling it, you should share it. :)
-
Well, I got it to work with GLee, so I guess my GLEW and the internal GLEW were conflicting with each other.
-
Are you sure you have a correct context before initializing and callid Glew? I do this way in SFML2:
{
sf::Context context;
GlewInit();
GlewCalls();
}
Maybe that isn't what you are looking for.
-
I just realized that I was initializing GLEW before I called GLEW_VERSION_3_0 :oops:
Well anyways, thanks for helping me with a problem that didn't need fixing. :)