break up Client::run() into multiple methods
This commit is contained in:
parent
a4df9488a9
commit
893cac5d9a
@ -74,7 +74,6 @@ bool Client::create_window(bool fullscreen, int width, int height)
|
||||
sf::ContextSettings cs = sf::ContextSettings(0, 0, 0,
|
||||
OPENGL_CONTEXT_MAJOR, OPENGL_CONTEXT_MINOR);
|
||||
m_window = new sf::RenderWindow(mode, "Treacherous Terrain", style, cs);
|
||||
m_window->setMouseCursorVisible(false);
|
||||
grab_mouse(true);
|
||||
if (!initgl())
|
||||
return false;
|
||||
|
@ -94,6 +94,12 @@ void Client::run(bool fullscreen, int width, int height, std::string pname)
|
||||
m_clock.restart();
|
||||
recenter_cursor();
|
||||
|
||||
run_main_menu();
|
||||
}
|
||||
|
||||
void Client::run_main_menu()
|
||||
{
|
||||
m_window->setMouseCursorVisible(true);
|
||||
sfg::SFGUI sfgui;
|
||||
sfg::Label::Ptr label = sfg::Label::Create("Label Test");
|
||||
sfg::Window::Ptr window(sfg::Window::Create());
|
||||
@ -139,6 +145,12 @@ void Client::run(bool fullscreen, int width, int height, std::string pname)
|
||||
m_window->display();
|
||||
}
|
||||
|
||||
run_client();
|
||||
}
|
||||
|
||||
void Client::run_client()
|
||||
{
|
||||
m_window->setMouseCursorVisible(false);
|
||||
double last_time = 0.0;
|
||||
while (m_window->isOpen())
|
||||
{
|
||||
|
@ -24,6 +24,8 @@ class Client
|
||||
~Client();
|
||||
void run(bool fullscreen, int width, int height, std::string pname);
|
||||
protected:
|
||||
void run_main_menu();
|
||||
void run_client();
|
||||
void connect(int port, const char *host);
|
||||
void disconnect();
|
||||
bool create_window(bool fullscreen, int width, int height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user