Hi guy, this may sound as a really simple question, but I have SFML 1.6 and I want to control my RenderWindow from another function...
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;
int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Guessing Game");
App.SetFramerateLimit(60); //Set FPS limit to 60 FPS
//Variables
bool atmainmenu = true;
//End Variables
// Start main loop
while (App.IsOpened())
{
printmessage(atmainmenu);
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::M)){
}
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::F)){
}
}
// Display window on screen
App.Display();
}
return EXIT_SUCCESS;
}
void printmessage(bool atmainmenu)
{
if(atmainmenu){
//$$$$$$$################# HERE <----
}
}
That is my code, but I want to control 'App' from atmainmenu. Is there anything I have to do? thanks
waco001