Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hoocker

Pages: [1]
1
Graphics / Re: Draw point
« on: November 09, 2012, 12:58:27 am »
Ok, I'll take a look at the documentation and anything I ask again here, thanks

2
Graphics / Re: Draw point
« on: November 09, 2012, 12:43:13 am »
And by using this command sf :: Shape :: Line (..), when I click a point will come where I clicked?

3
Graphics / Draw point
« on: November 08, 2012, 11:52:03 pm »
I have a very simple code and would like to know how can I when I click with the mouse on the screen and draw a point when clicking a second time, a second point to draw a line connecting one point to another?
My code so far is this:
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <math.h>
#define PI 3.1416
#include "Vector2D.h"

using namespace std;

int main(){
    // Inicializacao da biblioteca
    sf::RenderWindow* app = new sf::RenderWindow(sf::VideoMode(800, 600, 32), "Exercicio 2");
    Vector2D vetor(3,4);
    Vector2D va(3,4);
    Vector2D vb(4,5);
    va+=vb;

    // Gameloop - Le os eventos
    while (app->IsOpened()) {
         //Leitura dos eventos
         sf::Event* event = new sf::Event();
         while (app->GetEvent(*event)) {
            if (event->Type == sf::Event::Closed) {
                app->Close();
            }
        }

        if (app->GetInput().IsKeyDown(sf::Key::Escape)) {//se apertar ESC o jogo fecha
            return EXIT_SUCCESS;
        }



        app->Clear(sf::Color(255, 255, 255));

        sf::Shape Circle = sf::Shape::Circle(200, 200, 5, sf::Color(125, 200, 240), 1, sf::Color(0, 0, 0));

        app->Draw(Circle);
        app->Display();

    }
    return EXIT_SUCCESS;
}
 

Pages: [1]
anything