GTK: sdl openGL crashes with special scalers; turn off scalers when gl is checked

TODO: a solution in sdl-video so we don't segfault in this situation
This commit is contained in:
punkrockguy318 2010-02-24 10:18:52 +00:00
parent cc09e4dad1
commit 3f99f5d6bc
1 changed files with 14 additions and 1 deletions

View File

@ -380,6 +380,19 @@ int setYscale(GtkWidget* w, gpointer p)
return 0; return 0;
} }
void setGl(GtkWidget* w, gpointer p)
{
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
g_config->setOption("SDL.OpenGL", 1);
else
g_config->setOption("SDL.OpenGL", 0);
g_config->save();
// set scpecial scaler to none; openGL crashes with special scalers on
gtk_combo_box_set_active(GTK_COMBO_BOX(p), 0);
}
void openVideoConfig() void openVideoConfig()
{ {
GtkWidget* win; GtkWidget* win;
@ -428,7 +441,7 @@ void openVideoConfig()
// openGL check // openGL check
glChk = gtk_check_button_new_with_label("Enable OpenGL"); glChk = gtk_check_button_new_with_label("Enable OpenGL");
g_signal_connect(GTK_OBJECT(glChk), "clicked", G_CALLBACK(toggleOption), (gpointer)"SDL.OpenGL"); g_signal_connect(GTK_OBJECT(glChk), "clicked", G_CALLBACK(setGl), (gpointer)scalerCombo);
// sync with config // sync with config
g_config->getOption("SDL.OpenGL", &buf); g_config->getOption("SDL.OpenGL", &buf);