Skip to content

Commit 2c8fd2e

Browse files
committed
Set window title based on version.
1 parent 5a69dfa commit 2c8fd2e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cppred/Engine.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,26 @@ void Engine::initialize_audio(){
3333
this->audio_device.reset(new AudioDevice);
3434
}
3535

36+
const char *to_string(PokemonVersion version){
37+
switch (version){
38+
case PokemonVersion::Red:
39+
return "Pok\xC3\xA9mon Red";
40+
break;
41+
case PokemonVersion::Blue:
42+
return "Pok\xC3\xA9mon Blue";
43+
default:
44+
return "Pok\xC3\xA9mon ?";
45+
}
46+
}
47+
3648
void Engine::run(){
3749
if (std::this_thread::get_id() != this->main_thread_id)
3850
throw std::runtime_error("Engine::run() must be called from the main thread!");
3951

4052
PokemonVersion version = PokemonVersion::Red;
4153
bool continue_running = true;
4254
while (continue_running){
55+
this->video_device->set_window_title(to_string(version));
4356
this->wait_remainder = 0;
4457
this->restart_requested = false;
4558
this->debug_mode = false;

0 commit comments

Comments
 (0)