C++ Project 2016-2017: Arkanoid
transformation.h
Go to the documentation of this file.
1 
3 #ifndef SCREEN_H
4 #define SCREEN_H
5 
6 #include "../../logic/math/vector2D.h"
7 
8 #include <SFML/Graphics.hpp>
9 #include <iostream>
10 #include <memory>
11 
12 using namespace std;
13 
14 namespace arkanoidSFML {
15 
18  private:
19  double widthScale;
20  double heightScale;
21 
22  static Transformation* singleton;
23 
30 
39  Transformation(double gridWidth, double gridHeight, double windowWidth, double windowHeight);
40 
41  // Not implemented (--> cant copy)
42  Transformation(Transformation const &other);
43  Transformation& operator=(Transformation const &other);
44 
45  public:
46 
52  static Transformation* getInstance();
53 
64  static Transformation* getInstance(double gridWidth, double gridHeight, double windowWidth, double windowHeight);
65 
73  arkanoid::Vector2D convertVector(const sf::Vector2f &vector);
74 
82  double convertX(double x);
83 
91  double convertY(double y);
92 
93 
94  };
95 
96 }
97 
98 #endif /* SCREEN_H */
Singleton: This class provides a method to convert screen pixels to their corresponding coordinates i...
All the game gui elements of the Arkanoid game.
Definition: ball_sfml.cpp:10
Representation of a vector.
Definition: vector2D.h:14