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 - impega

Pages: [1]
1
Window / Re: SFML 2.0 RC, OpenGL 3.3 and Window.display()
« on: September 26, 2012, 09:42:52 am »
Instead of applying your idea to Window.cpp, I slowly changed the tutorial code until things... just worked! :D
That means I must have made a mistake while transcribing the tutorial code. 

For people interested in seeing http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction work with SFML, check out the working version here: http://pastebin.com/xnTzaW96

Pretty amazing how it only takes one line of code to get a working opengl render context in SFML :) Thanks!

2
Window / [Solved] SFML 2.0 RC, OpenGL 3.3 and Window.display()
« on: September 26, 2012, 08:37:12 am »
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/ucunPzL3

If 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()  ? 

Pages: [1]
anything