Hi,
The title makes very little sense but I couldn't think of any other way to describe my problem. I was doing a fair bit of C++ and I know pretty much the basics of most things (except pointers, those things are just so confusing for me), and I decided that I wanted to start doing graphical things. And SFML was right for me
Any way, I've been writing my game for about 3 or 4 days on and off, and I've run into several problems. I'm making functions, eg. my mainmenu() and game() functions. And they both include the header which is the window creation (the sf::RenderWindow class). And what I want ideally to happen, is when you launch the .exe the main menu will appear, then if you click the start button it'll take you to the game. Without having to close the exe and launch another one.
I'm pretty sure this is possible but you never know.
SO in summary, my two problems are: How do I get two different functions that use the same window but in order. As I said earlier, you launch the game and then main menu comes up, click a button then bada bing badaboom you're playing the game.
And my seconds problem is how do I make a button (how ever, only answer this if you can be bothered, I'm pretty sure there are answers for this, but I haven't done much searching).
My Window.h
sf::RenderWindow window(sf::VideoMode(1920,1080),"Alpha");
And then I have the two functions that use that. And should I post the code for them or not? For my problem in question I don't think I need to but if it would help you understand what I'm blabbering on about then I will.
Both of my two functions
int mainmenu() and int game()
use the Window.h include file so that they both use the same window, and they also both have a
while (window.isOpen())
in them.
I think that's my problem.
Any way, any help would be much appreciated and just ask if you need any more information