So I want to have a window that has three buttons that can be pressed, using the mouse, and depending on which button is pressed, the window changes. I have no idea how to do this, could someone please help? Here is an example:
#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
sf::Texture mainMenu;
mainMenu.loadFromFile("menu1.jpg");
sf::Sprite menu1(mainMenu); //This loads an image with three buttons to be pressed
sf::RenderWindow window(sf::VideoMode(800,600,64),"Help me D:");
sf::Event event1;
window.clear();
window.draw(menu1);
window.display();
int _tmain(int argc, _TCHAR* argv[])
{
while(window.isOpen())
{
while(window.pollEvent(event1))
{
if (event1.type == sf::Event::Closed)
{
window.close();
}
if(//mouse is pressed at a certain spot) //THIS IS WHERE IM CONFUSED
{
// Do some stuff................
}
}
}
}
Thanks for any help