Criar abstracao de controle, para facilitar integraƧao do wii mais tarde
[Projeto-PCG.git] / geometry.h
blobca20c2f20bad607c91d91e13d1a3de243d7fb383
1 #ifndef GEOMETRIA_H
2 #define GEOMETRIA_H
3 #include "SDL/SDL.h"
4 #include "SDL/SDL_opengl.h"
6 struct Ponto {
7 double x,y;
8 Ponto () { }
9 Ponto (double x1, double y1) {x = x1; y = y1;}
12 double operator*(const Ponto &a, const Ponto &b);
13 Ponto operator-(const Ponto &a, const Ponto &b);
14 Ponto operator+(const Ponto &a, const Ponto &b);
16 struct Vetor {
17 double x,y;
20 class Linha {
21 public:
22 Ponto vertices[2];
24 void desenha();
25 Linha(double x1,double y1,double x2, double y2);
26 Linha(Ponto a, Ponto b) {vertices[0] = a; vertices[1] = b;}
29 class Rect {
30 private:
31 void normaliza();
32 public:
33 Ponto vertices[2];
34 Rect(double x1,double y1,double x2, double y2);
35 Rect(Ponto a, Ponto b) {vertices[0] = a; vertices[1] = b; normaliza();}
38 void drawCircle(double radius, int lines);
40 #endif