2
« on: June 22, 2011, 11:09:08 pm »
I have a similar problem on Ubuntu 11.04 with SFML2, OpenGL 3.3.0 NVIDIA 270.41.06 (nvidia-current restricted driver), with a Segmentation Fault on glCreateShader. In the GLEW header, this seems to some kind of function pointer, which is NULL. Messing around with some of my code and the opengl example, i was able to reduce to this:
#include <GL/glew.h>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL", sf::Style::Default, sf::ContextSettings(32));
sf::Image backgroundImage;
backgroundImage.LoadFromFile("resources/background.jpg"); //comment out to get segfault
GLuint vertex_shader;
vertex_shader = glCreateShader(GL_VERTEX_SHADER);
return EXIT_SUCCESS;
}
It seems that some OpenGL/GLEW initialisation is unclean - there is a segfault when the marked piece of code is commented out. Of course, you need to have some backround.jpg in working-directory/resources.
Is this just something I'll have to work around in SFML2/Go back to SFML 1.6 for, or has someone had this kind of problem before?[/code]