Sourceforge getting so slow to work with past week.
If ESC will get that error, if close the window by clicking on the cross seems ok.
Here is the code.
How do I make the window go full screen?
#include <fstream>
#include <SFML/Graphics.hpp>
sf::RenderWindow App;
bool render()
{
return false;
}
bool update()
{
sf::Event Event;
if (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
{
return true;
}
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{
return true;
}
// Resize event : adjust viewport
if (Event.Type == sf::Event::Resized)
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
}
return false;
}
int main()
{
// Create the main window
App.Create(sf::VideoMode(1280, 768, 32), "SFML Window");
// Create a clock for measuring the time elapsed
sf::Clock Clock;
// Set the color and depth clear values
glClearDepth(1.f);
glClearColor(0.f, 0.f, 0.f, 0.f);
// Enable Z-buffer read and write
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
bool Running = true;
while (Running)
{
if(update()) {
Running = false;
}
if(Running)
{
render();
App.Display();
}
}
return EXIT_SUCCESS;
}