I started following this tutorial on
http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction but instead of using GLUT I decided on using SFML 2.0 RC. The goal is to draw a simple triangle in 2D.
The full source of the tutorial is here:
https://gitorious.org/wikibooks-opengl/modern-tutorials/blobs/master/tut01_intro/triangle.cpp My code using SFML 2.0 RC is here:
http://pastebin.com/ucunPzL3If you look at the tutorial code on line 105 you'll see a call to glutSwapBuffers() at the end of the onDisplay() function.
Since I'm not using GLUT, I figured this should be App.display() (where App is of type sf::Window).
So I placed App.display() after the call to onDisplay() in the main loop, but that doesn't show any triangle.
I also tried passing sf::Window App to the onDisplay() function with a pointer, and calling App->display() at the end, and inside onDisplay() but that didn't show a triangle either.
The tutorial code works fine on my system when compiling with
g++ -o main main.cpp -lglut -lGLEW -lGL
And my code is compiled (without glut) using:
g++ -o main main.cpp -lsfml-window -lsfml-system -lGLEW -lGL
What's the best way to replace glutSwapBuffers() ?