From f10f44b0ac5af54678f58f792cc1d204c39427a4 Mon Sep 17 00:00:00 2001 From: matusz Date: Sun, 29 Mar 2009 19:12:08 +0000 Subject: [PATCH] glade port: reenable gtkglext 3d rendering --- desmume/src/cli/main.cpp | 4 ++-- desmume/src/gtk-glade/main.cpp | 34 +++++++++++----------------------- desmume/src/gtk/main.cpp | 2 +- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index 50186e422..64d61956d 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -170,8 +170,8 @@ fill_config( struct my_config *config, printf( " --disable-sound Disables the sound emulation\n"); printf( " --disable-limiter Disables the 60 fps limiter\n"); printf( " --3d-engine=ENGINE Select 3d rendering engine, available ENGINES:\n"); - printf( " 0 = 3d disabled - default\n"); - printf( " 1 = internal desmume software rasterizer\n"); + printf( " 0 = 3d disabled\n"); + printf( " 1 = internal desmume software rasterizer (default)\n"); #ifdef INCLUDE_OPENGL_2D printf( " --opengl-2d Enables using OpenGL for screen rendering\n"); printf( " --soft-convert Use software colour conversion during OpenGL\n"); diff --git a/desmume/src/gtk-glade/main.cpp b/desmume/src/gtk-glade/main.cpp index 78d5171fb..33b98d64d 100755 --- a/desmume/src/gtk-glade/main.cpp +++ b/desmume/src/gtk-glade/main.cpp @@ -124,7 +124,7 @@ fill_configured_features( struct configured_features *config, \n\ --3d-engine=ENGINE Selects 3D rendering engine\n\ 0 = disabled\n\ - 1 = internal desmume rasterizer\n\ + 1 = internal desmume rasterizer (default)\n\ 2 = gtkglext off-screen 3d opengl\n\n")); #endif g_print( _("\ @@ -171,11 +171,11 @@ fill_configured_features( struct configured_features *config, char *end_char; int engine = strtoul( &argv[i][12], &end_char, 10); - if ( engine == 0 || engine == 1) { + if ( engine >= 0 && engine <= 2) { config->engine_3d = engine; } else { - g_printerr( _("Only 0(disabled) or 1(gtkglext off-screen 3d) are currently supported\n")); + g_printerr( _("Supported 3d engines: 0, 1, 2; use --help option for details\n")); good_args = 0; } } @@ -529,31 +529,19 @@ common_gtk_glade_main( struct configured_features *my_config) { gtk_widget_show(pDrawingArea2); { - int use_null_3d = !my_config->engine_3d; + int engine = my_config->engine_3d; #ifdef GTKGLEXT_AVAILABLE - if ( !use_null_3d) { + if ( my_config->engine_3d==2 ) /* setup the gdk 3D emulation */ - if ( init_opengl_gdk_3Demu(GDK_DRAWABLE(pWindow->window))) { - NDS_3D_SetDriver(1); - - if (!gpu3D->NDS_3D_Init()) { - fprintf( stderr, _("Failed to initialise openGL 3D emulation; " - "removing 3D support\n")); - use_null_3d = 1; + if(!init_opengl_gdk_3Demu(GDK_DRAWABLE(pWindow->window))){ + fprintf( stderr, _("Failed to initialise openGL 3D emulation; " + "removing 3D support\n")); + engine = 0; } - } - else { - fprintf( stderr, _("Failed to setup openGL 3D emulation; " - "removing 3D support\n")); - use_null_3d = 1; - } - } #endif - if ( use_null_3d) { - NDS_3D_SetDriver ( 0); - gpu3D->NDS_3D_Init(); - } + NDS_3D_ChangeCore(engine); + if(gpu3D == GPU3D_NULL); } // on_menu_tileview_activate(NULL,NULL); diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 9920b881b..0d10e5f0d 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -186,7 +186,7 @@ fill_configured_features( struct configured_features *config, #endif { "3d-engine", 0, 0, G_OPTION_ARG_INT, &config->engine_3d, "Select 3d rendering engine. Available engines:\n" "\t\t\t\t 0 = 3d disabled\n" - "\t\t\t\t 1 = internal rasterizer\n" + "\t\t\t\t 1 = internal rasterizer (default)\n" // GTKGLEXT and LIBOSMESA are currently exclusive, so, no conflict below #ifdef GTKGLEXT_AVAILABLE "\t\t\t\t 2 = gtkglext off-screen opengl\n"