Skip to content

Commit

Permalink
Set window title based on version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Helios-vmg committed Oct 28, 2017
1 parent 5a69dfa commit 2c8fd2e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cppred/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,26 @@ void Engine::initialize_audio(){
this->audio_device.reset(new AudioDevice);
}

const char *to_string(PokemonVersion version){
switch (version){
case PokemonVersion::Red:
return "Pok\xC3\xA9mon Red";
break;
case PokemonVersion::Blue:
return "Pok\xC3\xA9mon Blue";
default:
return "Pok\xC3\xA9mon ?";
}
}

void Engine::run(){
if (std::this_thread::get_id() != this->main_thread_id)
throw std::runtime_error("Engine::run() must be called from the main thread!");

PokemonVersion version = PokemonVersion::Red;
bool continue_running = true;
while (continue_running){
this->video_device->set_window_title(to_string(version));
this->wait_remainder = 0;
this->restart_requested = false;
this->debug_mode = false;
Expand Down

0 comments on commit 2c8fd2e

Please sign in to comment.