… | |
… | |
70 | -resizeable => 0; |
70 | -resizeable => 0; |
71 | |
71 | |
72 | $SDL_EV = new SDL::Event; |
72 | $SDL_EV = new SDL::Event; |
73 | $SDL_EV->set_unicode (1); |
73 | $SDL_EV->set_unicode (1); |
74 | |
74 | |
75 | $SDL_TIMER = add Glib::Timeout 1000/50, sub { |
75 | $SDL_TIMER = add Glib::Timeout 1000 / $MAX_FPS, sub { |
76 | ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->() |
76 | ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->() |
77 | while $SDL_EV->poll; |
77 | while $SDL_EV->poll; |
78 | |
78 | |
79 | 1 |
79 | 1 |
80 | }; |
80 | }; |
… | |
… | |
124 | |
124 | |
125 | sub config_dialog { |
125 | sub config_dialog { |
126 | my $dialog = new CFClient::UI::FancyFrame x => 300, y => 100, |
126 | my $dialog = new CFClient::UI::FancyFrame x => 300, y => 100, |
127 | child => (my $vbox = new CFClient::UI::VBox); |
127 | child => (my $vbox = new CFClient::UI::VBox); |
128 | $vbox->add (new CFClient::UI::Label align => 0, text => "Setup"); |
128 | $vbox->add (new CFClient::UI::Label align => 0, text => "Setup"); |
129 | $vbox->add (my $table = new CFClient::UI::Table); |
129 | $vbox->add (my $table = new CFClient::UI::Table expand => 1); |
130 | |
130 | |
131 | $table->add (0, 0, new CFClient::UI::Label align => 1, text => "Video Mode"); |
131 | $table->add (0, 0, new CFClient::UI::Label align => 1, text => "Video Mode"); |
132 | $table->add (1, 0, my $hbox = new CFClient::UI::HBox); |
132 | $table->add (1, 0, my $hbox = new CFClient::UI::HBox); |
133 | |
133 | |
134 | $hbox->add (my $mode_slider = new CFClient::UI::Slider req_w => 100, range => [$CFG->{sdl_mode}, 0, scalar @SDL_MODES, 1]); |
134 | $hbox->add (my $mode_slider = new CFClient::UI::Slider req_w => 100, range => [$CFG->{sdl_mode}, 0, scalar @SDL_MODES, 1]); |