Hello everyone
I just starting doing SFML but I got stuck because I want window application instead of having console window that keep coming up every time I run the program
I get the error saying
WinMain must return a value
I am using Visual Studio express 2012
the code does work in Console Window but when I went to Project > SFML 2.0 Properties > Linker > System > Subsystem and I changed Console (/SUBSYSTEM:CONSOLE) TO Windows(/SUBSYSTEM:WINDOWS)
The code that I learn are blow
#include <SFML/Graphics.hpp>
#include <iostream>
#include <stdlib.h>
#include <ctime>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800,600,32),"First SFML Game");
sf::Texture ptexture;
sf::Sprite playerImage;
if(!ptexture.loadFromFile("background.png"))
std::cout << "Error could not load player image"<< std::endl;
playerImage.setTexture(ptexture);
sf::Vector2u Size(400,400);
Window.setSize(sf::Vector2u(400,400));
Window.setTitle("Coding Made Easy");
Window.setPosition(sf::Vector2i(200,100));
while(Window.isOpen())
{
sf::Event Event;
while(Window.pollEvent(Event))
{
if(Event.type==sf::Event::Closed)
Window.close();
}
Window.clear(sf::Color(0, 255, 255));
Window.draw(playerImage);
Window.display();
}
}
Second Questions that does bugged me lots.....if you going start new applications and why does I have keep setting SFML every time i start my VS Express 2012.........Surely that Once I have setup SFML then it should stay there on every time i open the VS Express 2012 and do you know what I mean?
P.S. I just bought SFML Game Development book now on my Ipad