I have been going through the tutorials at http://www.sfml-dev.org/tutorials/1.6/ and I have ran into a problem in the using views tutorial.
Here is the section of code I am working on:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main(){
// Create instance of Window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
sf::Vector2 Center(1000, 1000);
sf::Vector2 HalfSize(400, 300);
sf::View View1(Center, HalfSize);
// So on...
I am using Mac OSX 10.8 and I am compiling with g++. I get the error message:
error: missing template arguments before ‘Center’
How can I correct this error?
EDIT: I somehow read the tutorial wrong. Ment to be Vector2f.
Your problem is exactly as the error says, you’re missing a type for the
Vector2template, and judging by constructor of theViewclass,You want a
Vector2<float>. These types have already beentypedef‘d for you in theVector2.hpp