SFML community forums

Help => Graphics => Topic started by: led on December 20, 2009, 11:22:03 pm

Title: OpenGL and SFML weird thing
Post by: led on December 20, 2009, 11:22:03 pm
Hey,
my window freezes, and me and my professor can't figure out what it is
Code: [Select]
#include <GL/GLee.h>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

using namespace sf;

int main()
{
RenderWindow Window(sf::VideoMode(800,600,32),"GL SandBox");
//Window.PreserveOpenGLStates(true);
//glMatrixMode(GL_PROJECTION);
//glLoadIdentity();
//glOrtho(0,800,0,600,-1,1);
//glMatrixMode(GL_MODELVIEW);
/*Vector2f Vertices[4] =
{
Vector2f(350,250), //Canto superior esquerdo
Vector2f(450,250), //Canto superior direito
Vector2f(450,350), //Canto inferior direito
Vector2f(350,350) //Canto inferior esquerdo
};*/
while (Window.IsOpened())
{
Window.Clear();
//glEnableClientState(GL_VERTEX_ARRAY);
//glVertexPointer(2,GL_FLOAT,0,Vertices);
//glDrawArrays(GL_QUADS,0,4);
Window.Display();

}


return 0;
}


Please try runing in your pc if it works, i already tried using Window.hpp but no result either... :roll:
btw, Win XP SP3, VS2008 SP1
Title: OpenGL and SFML weird thing
Post by: Laurent on December 20, 2009, 11:45:52 pm
If you don't call Window.GetEvent, then SFML will never let the window proceed its events and then it just stops responding.
Title: OpenGL and SFML weird thing
Post by: led on December 21, 2009, 12:31:45 am
Thanks for the help, it solved the problem. :D