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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Mystor

Pages: [1]
1
Window / Mac - OpenGL higher than 2.1
« on: December 12, 2012, 03:28:52 pm »
EDIT: I just realized that I am an idiot - I forgot to call window.getSettings()... I am still only getting a 2.1 context.  I have updated the below.

I am running on a brand new MBP, but it seems as though SFML will not let me select a OpenGL version higher than 2.1.
Nor will it allow me to have a non-0 depth bits, stencil bits, or antialiasing. Nevermind those work.
I am using the SFML 2.0 Release Preview (the one with the installer on the site).
Is this a limitation of the SFML mac implementation, does my computer really not support OGL 3, am I doing something silly, or should I really just be using a different version of SFML.

the code I am running is below (in main):
Code: [Select]
sf::ContextSettings wSettings;
wSettings.depthBits = 24;
wSettings.stencilBits = 8;
wSettings.antialiasingLevel = 2;
wSettings.majorVersion = 3;
wSettings.minorVersion = 2;

// Create the main window
sf::Window window(sf::VideoMode(800, 600), "SFML window", sf::Style::Default, wSettings);

sf::ContextSettings actualSettings = window.getSettings();
std::cout << "depth bits:" << actualSettings.depthBits << std::endl;
std::cout << "stencil bits:" << actualSettings.stencilBits << std::endl;
std::cout << "antialiasing level:" << actualSettings.antialiasingLevel << std::endl;
std::cout << "version:" << actualSettings.majorVersion << "." << actualSettings.minorVersion << std::endl;

It outputs:
Code: [Select]
depth bits:24
stencil bits:8
antialiasing level:2
version:2.1

I can probably live with that (A.K.A. It has shaders), but its always nice to have access to newer features.

2
Window / Linking GLEW with SFML 2.0
« on: December 12, 2012, 05:33:05 am »
I am using SFML as a wrapper around OpenGL for the most part, for which it has been doing great. 

However, I have noticed that the OpenGL functions are provided by Apple's OpenGL.framework (I think), and that some functions for OpenGL, such as glGenVertexArrays(), don't actually exist, instead an extension version such as glGenVertexArraysAPPLE() (great name apple!) exist.  I don't think it would be too bold to assume that this function call is not cross platform, and some browsing brought me to the conclusion that my life would be better if I used GLEW.

Unfortunately, I cannot prove whether or not this is fact as I am unable to get my xCode project to link to the GLEW binaries.

I added /opt/local/include to my header search paths and /opt/local/lib to my library search paths, and then installed GLEW through macports (>> sudo port install glew).

xCode seems to pick up the header files just fine and is suggesting GLEW code completion in my project now, however, I cannot get the glew library to link.

When I add -libGLEW to my Linker Flags, the linker throws an exception, saying that it cannot find the library libGLEW.

I looked in /opt/local/lib, and libGLEW.dylib (alias to libGLEW.1.9.0.dylib) is present, so I am not certain what is going on.

Any suggestions on what I am doing wrong, or whether or not I want GLEW?

Also, if I manage to get GLEW set up, any precautionary tales to working with GLEW + SFML?

EDIT: I figured this fit in the window forum as it has to do with GL, but you can move it to another forum if you feel it fits better there.

Pages: [1]