Guest User

Untitled

a guest
Oct 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <SFML/Window.hpp>
  3.  
  4.  
  5. int main()
  6. {
  7.     sf::Window App(sf::VideoMode(800, 600, 32), "FIS");
  8.  
  9.     sf::Clock Clock;
  10.  
  11.     glClearDepth(1.0f);
  12.     glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  13.  
  14.     glEnable(GL_DEPTH_TEST);
  15.     glDepthMask(GL_TRUE);
  16.    
  17.     glMatrixMode(GL_PROJECTION);
  18.     glLoadIdentity();
  19.     gluPerspective(90.0f, 1.0f, 1.0f, 500.0f);
  20.  
  21.  
  22.     while (App.IsOpened())
  23.     {
  24.         sf::Event Event;
  25.         while (App.GetEvent(Event))
  26.         {
  27.             if (Event.Type == sf::Event::Closed)
  28.                 App.Close();
  29.  
  30.             if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
  31.                 App.Close();
  32.  
  33.             if (Event.Type == sf::Event::Resized)
  34.                 glViewport(0, 0, Event.Size.Width, Event.Size.Height);
  35.         }
  36.  
  37.         App.Display();
  38.     }
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment