I'm not using events so I'm not calling GetEvent.
anyways,
int main()
{
lua_State* settings = lua.initialize_script("resource/scripts/settings.lua");
Game.initialize_app(settings, "Stick War");
while(Game.game_state == Game.Menu)
{
Input.update_mouse();
Input.update_keyboard();
if(Input.keyboard.esc)
{
Game.exit();
}
std::cout << Input.mouse.mouse_x << std::endl;
std::cout << Input.mouse.mouse_y << std::endl;
Game.App.Clear();
Game.App.Display();
}
Game.exit();
}
and the CGame class
class CGame: public CBase
{
public:
sf::RenderWindow App;
int game_state;
enum GameState{
Menu,
Setup,
Ingame
};
//create window
int initialize_app(lua_State* L, std::string app_name)
{
set_fullscreen(L);
if(fullscreen)
{
App.Create(sf::VideoMode(1024, 768, 32), app_name, sf::Style::Fullscreen);
}
else
{
App.Create(sf::VideoMode(1024, 768, 32), app_name);
}
return 0;
};
//call when app is closed
int exit(void)
{
App.Close();
return 0;
};
private:
int set_fullscreen(lua_State* L)
{
fullscreen = CScript::lua_retreive_boolean(L, "Fullscreen");
return 0;
};
bool fullscreen;
};
This is probably horrible coding, but please bear with me, as I'm still a beginner