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

Author Topic: SFML 2 OpenGL version  (Read 4042 times)

0 Members and 1 Guest are viewing this topic.

FierceForm

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
SFML 2 OpenGL version
« 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.

Code: [Select]
#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.
-FierceForm

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML 2 OpenGL version
« Reply #1 on: July 05, 2011, 10:30:23 pm »
Can we get some information like what version of SFML you are using?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

FierceForm

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
SFML 2 OpenGL version
« Reply #2 on: July 05, 2011, 10:32:58 pm »
SFML 2, latest from the repository.
-FierceForm

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 OpenGL version
« Reply #3 on: July 05, 2011, 11:02:14 pm »
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.
Laurent Gomila - SFML developer

FierceForm

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
SFML 2 OpenGL version
« Reply #4 on: July 05, 2011, 11:03:30 pm »
Yeah, so when OS X Lion comes out, it'll work when I select 3.2 without any changes?
-FierceForm

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 OpenGL version
« Reply #5 on: July 05, 2011, 11:12:54 pm »
Yes it should work.
Laurent Gomila - SFML developer

 

anything