Nice! :)
What exactly is the reason for leaving out the include files & guards? ???
Also could you (or am I allowed to) format the main loop a bit better? I mean at the moment it's just a hugh block of code which seems quite hard to read. Or is there a reason why you don't insert spaces/break lines? ;)
So this
while(app.pollEvent(eve))if(eve.type==sf::Event::Closed)app.close();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))cam.zoom(1.05f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::W))cam.move(0.f,-10.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::E))cam.zoom(0.95f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))cam.move(-10.f,0.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::S))cam.move(0.f,10.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))cam.move(10.f,0.f);
Would turn into this
while(app.pollEvent(eve))
if(eve.type==sf::Event::Closed)
app.close();
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))
cam.zoom(1.05f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::W))
cam.move(0.f,-10.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::E))
cam.zoom(0.95f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))
cam.move(-10.f,0.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::S))
cam.move(0.f,10.f);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))
cam.move(10.f,0.f);
Or at least add a space after the if-statement, so one can differentiat what is the check and what is the action with one look. :D
What exactly is the reason for leaving out the include files & guards?
#pragma once - Not part of the standard :(
include guards - No idea really ;D
includes and pre compiled headers - vc++ doesn't require includes of bases and members if they are in precompiled header, this may vary across compilers, I don't know, also anyone is free to do whatever they want: include std and sfml files directly or in precompiled header(that may or may not work on same rules between compilers and almost certainly is not going to be named same all the time)
Also could you (or am I allowed to) format the main loop a bit better?
Knock yourself out, my formatting isn't best. I try to always use sharp brackets or not break the line if they're missing so I don't do something like:
while(app.pollEvent(foo))
{
if(foo.type==sf::Event::Closed)
std::cout<<"Boo.. hoo..hoo :'(\n";
}
and then change it into:
{
if(foo.type==sf::Event::Closed)
app.close();
std::cout<<"Boo.. hoo..hoo :'(\n";
}