int o = al_get_display_orientation(display); if (o == ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES) { al_change_display_option(display, ALLEGRO_SUPPORTED_ORIENTATIONS, ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES); } else { al_change_display_option(display, ALLEGRO_SUPPORTED_ORIENTATIONS, ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES); }