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.


Messages - 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 / Re: Linking GLEW with SFML 2.0
« on: December 12, 2012, 02:23:31 pm »
Ah, thank you.
I assumed that SFML already linked opengl, as it was working before, however I suppose that that was more of an internal link than one I could work with.
For some reason (not sure why) adding "-lGL" to the linker didn't work, however adding "OpenGL.framework" allowed the program to compile.
Everything looks all nice now, so I'll see how it turns out, thanks.

3
Window / Re: Linking GLEW with SFML 2.0
« on: December 12, 2012, 01:30:47 pm »
Tried that, now I am getting 6 linker errors when I try to compile, all complaining about missing symbols in my render methods ("_glBegin", "_glClear", "_glClearColor", "_glEnd").
I don't use any of these symbols WITH the "_" character in my code, but I do call a "glBegin"-style version of it.  Does GLEW somehow make these old methods disappear?

4
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]
anything