Search
lxdream.org :: lxdream/src/display.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/display.c
changeset 531:f0fee3ba71d1
prev477:9a373f2ff009
next541:6986c644d58a
author nkeynes
date Mon Nov 19 08:47:39 2007 +0000 (11 years ago)
permissions -rw-r--r--
last change Move name-to-driver mappings to display.c and audio.c respectively
Move responsibility for invoking texcache_gl_init() to the driver
file annotate diff log raw
1.1 --- a/src/display.c Wed Oct 31 09:10:23 2007 +0000
1.2 +++ b/src/display.c Mon Nov 19 08:47:39 2007 +0000
1.3 @@ -24,6 +24,11 @@
1.4 #include "display.h"
1.5 #include "pvr2/pvr2.h"
1.6
1.7 +display_driver_t display_driver_list[] = {
1.8 + &display_gtk_driver,
1.9 + &display_null_driver,
1.10 + NULL };
1.11 +
1.12 typedef struct keymap_entry {
1.13 uint16_t keycode;
1.14 input_key_callback_t callback;
1.15 @@ -148,6 +153,20 @@
1.16 }
1.17 }
1.18
1.19 +display_driver_t get_display_driver_by_name( const char *name )
1.20 +{
1.21 + int i;
1.22 + if( name == NULL ) {
1.23 + return display_driver_list[0];
1.24 + }
1.25 + for( i=0; display_driver_list[i] != NULL; i++ ) {
1.26 + if( strcasecmp( display_driver_list[i]->name, name ) == 0 ) {
1.27 + return display_driver_list[i];
1.28 + }
1.29 + }
1.30 +
1.31 + return NULL;
1.32 +}
1.33
1.34
1.35 gboolean display_set_driver( display_driver_t driver )
1.36 @@ -159,8 +178,8 @@
1.37 display_driver = driver;
1.38 if( driver->init_driver != NULL )
1.39 rv = driver->init_driver();
1.40 - if( rv ) {
1.41 - texcache_gl_init();
1.42 + if( !rv ) {
1.43 + display_driver = NULL;
1.44 }
1.45 return rv;
1.46 }
.