SFML community forums
Help => General => Topic started by: FierceForm on July 05, 2011, 10:06:33 pm
-
Hello,
So I'm trying to change the OpenGL version on my SFML Project. I took out the important code to show you what I am currently doing below.
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/OpenGL.hpp>
#include <iostream>
int main(int argc, char *argv[])
{
sf::Window Win;
sf::ContextSettings cs;
cs.MajorVersion = 2;
cs.MinorVersion = 0;
cs.DepthBits = 32;
cs.StencilBits = 0;
cs.AntialiasingLevel = 0;
Win.Create(sf::VideoMode(1024, 768, 32), "Sortmania", sf::Style::Default, cs);
std::cout<< Win.GetSettings().MajorVersion << "." << Win.GetSettings().MinorVersion;
return 0;
}
However, when I run that code, no matter what I put in for the MajorVersion and MinorVersion, it returns the same version, 2.1. I want to get this working so that I can change it to OpenGL 3.2 when OS X Lion comes out (I understand that it does have 3.2, and the release date is soon). I've tried setting it to a few versions, but I'm not sure it's working. Is this supposed to happen, and will work with 3.2, or am I missing something?
EDIT:
Also, it's quite interesting that I can set the antialiasing level to something impossibly high (1024) and it returns the same antialiasing level.
-
Can we get some information like what version of SFML you are using?
-
SFML 2, latest from the repository.
-
If you use anything below 3.0 you'll get 2.1, since this is the only version that OS X < Lion implements. Specifying a version less than 3.0 is always meaningless with OpenGL, you can really choose the version only since GL 3.0.
-
Yeah, so when OS X Lion comes out, it'll work when I select 3.2 without any changes?
-
Yes it should work.