1
Window / Pointer to the Input class
« on: May 22, 2010, 02:22:32 am »
Thanks problem solved.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
const sf::Input& Input = renderWindow.GetInput();
//*********************************************************
sf::Input &input = Input; //This same approach worked for
menu.setInput(&input); //pointing to the renderWindow
//**********************************************************
while(renderWindow.IsOpened()) {
// Process events
sf::Event Event;
while (renderWindow.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
renderWindow.Close();
}
// Fill the background black
renderWindow.Clear(sf::Color(0, 0, 0, 255));
//if menu is not done run the menu loop otherwise start the rest of the program
if(!menu.cleanMenu()){
bool bResult = lgcManager.Loop();
}else{
menu.loop();
}
// Display window contents on screen
renderWindow.Display();
}
void MainMenu::setInput(sf::Input inp){
mpInput = inp;
}
error C2440: 'initializing' : cannot convert from 'const sf::Input' to 'sf::Input &'
1> Conversion loses qualifiers