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

Untitled

By: a guest on Jul 24th, 2012  |  syntax: C++  |  size: 1.05 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // exemplo 2D.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. using namespace std;
  6. #include <SFML/Graphics.hpp>
  7. using namespace std;
  8. #include <vector>
  9. #include <SFML/OpenGL.hpp>
  10.  
  11.  
  12. int main()
  13. {
  14.    
  15.         sf::RenderWindow window(sf::VideoMode(700, 700), "SFML works!");
  16.     sf::Text text("Ola MUNDO!");
  17.     text.setColor(sf::Color::Blue);
  18.         text.setPosition(150,100);
  19.  
  20.         sf::RectangleShape Shape(sf::Vector2f(40, 40));
  21.         Shape.setPosition(30,30);
  22.                 Shape.setFillColor(sf::Color::Yellow);
  23.                
  24.                
  25.                
  26.                 glMatrixMode(GL_PROJECTION);
  27.         glLoadIdentity();
  28.         glOrtho(0, window.getSize().x, 0, window.getSize().y, -1, 1);
  29.         glMatrixMode(GL_MODELVIEW);
  30.  
  31.  
  32.  
  33.  
  34.         while (window.isOpen())
  35.     {
  36.         sf::Event event;
  37.         while (window.pollEvent(event))
  38.         {
  39.             if (event.type == sf::Event::Closed)
  40.                 window.close();
  41.         }
  42.  
  43.         window.clear();
  44.         window.draw(text);
  45.                 window.draw(Shape);
  46.         window.display();
  47.         }
  48.  
  49.     return 0;
  50. }