Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: C++  |  size: 1.04 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2. #include <vector>
  3. #include <SFML/Graphics.hpp>
  4.  
  5. #include "chain.h"
  6.  
  7. #ifdef _DEBUG
  8. #pragma comment (lib, "sfml-system-s-d.lib")
  9. #pragma comment (lib, "sfml-window-s-d.lib")
  10. #pragma comment (lib, "sfml-graphics-s-d.lib")
  11. #else
  12. #pragma comment (lib, "sfml-system-s.lib")
  13. #pragma comment (lib, "sfml-window-s.lib")
  14. #pragma comment (lib, "sfml-graphics-s.lib")
  15. #endif
  16.  
  17. float Gravity;
  18. std::vector <Chain*> ChainArray;
  19.  
  20. int main()
  21. {
  22.         sf::RenderWindow App(sf::VideoMode(600, 400, 32), "Chain Link >> Tech Demo");
  23.         App.UseVerticalSync(true);
  24.  
  25.         sf::Event Event;
  26.         sf::Image Image;
  27.         Image.LoadFromFile("media/chain.PNG");
  28.  
  29.         /*All loading of chain elements will be loaded here*/
  30.  
  31.         while(App.IsOpened())
  32.         {
  33.                 while(App.GetEvent(Event))
  34.                 {
  35.                         /*Handels Closing the program*/
  36.                         if (Event.Type == sf::Event::Closed)
  37.                                 App.Close();
  38.                         if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
  39.                                 App.Close();
  40.                 }
  41.  
  42.                 App.Clear(sf::Color(255, 255, 255));
  43.                 App.Display();
  44.         }
  45.  
  46.         return 0;
  47. }