
Untitled
By: a guest on
Jul 24th, 2012 | syntax:
C++ | size: 1.05 KB | hits: 13 | expires: Never
// exemplo 2D.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
using namespace std;
#include <SFML/Graphics.hpp>
using namespace std;
#include <vector>
#include <SFML/OpenGL.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(700, 700), "SFML works!");
sf::Text text("Ola MUNDO!");
text.setColor(sf::Color::Blue);
text.setPosition(150,100);
sf::RectangleShape Shape(sf::Vector2f(40, 40));
Shape.setPosition(30,30);
Shape.setFillColor(sf::Color::Yellow);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, window.getSize().x, 0, window.getSize().y, -1, 1);
glMatrixMode(GL_MODELVIEW);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.draw(Shape);
window.display();
}
return 0;
}