Added support for single buffering, if double buffering is not available.
authorMike Gorchak
Tue, 05 May 2009 17:50:34 +0000
changeset 3116b17f1ae7ad66
parent 3115 1102a3305928
child 3117 39da34152ad6
Added support for single buffering, if double buffering is not available.
src/video/qnxgf/SDL_hiddi_joystick.h
src/video/qnxgf/SDL_qnxgf.c
src/video/qnxgf/SDL_qnxgf.h
     1.1 --- a/src/video/qnxgf/SDL_hiddi_joystick.h	Tue May 05 17:47:41 2009 +0000
     1.2 +++ b/src/video/qnxgf/SDL_hiddi_joystick.h	Tue May 05 17:50:34 2009 +0000
     1.3 @@ -29,6 +29,4 @@
     1.4  
     1.5  #include <inttypes.h>
     1.6  
     1.7 -
     1.8 -
     1.9  #endif /* __SDL_HIDDI_JOYSTICK_H__ */
     2.1 --- a/src/video/qnxgf/SDL_qnxgf.c	Tue May 05 17:47:41 2009 +0000
     2.2 +++ b/src/video/qnxgf/SDL_qnxgf.c	Tue May 05 17:50:34 2009 +0000
     2.3 @@ -91,88 +91,88 @@
     2.4  {
     2.5     /* ATI Rage 128 graphics driver (devg-ati_rage128)      */
     2.6     {"ati_rage128", SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
     2.7 -                   SDL_GF_UNACCELERATED_3D},
     2.8 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
     2.9     /* Fujitsu Carmine graphics driver (devg-carmine.so)    */
    2.10     {"carmine",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.11 -                   SDL_GF_ACCELERATED_3D},
    2.12 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.13     /* C&T graphics driver (devg-chips.so)                  */
    2.14     {"chips",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION | 
    2.15 -                   SDL_GF_UNACCELERATED_3D},
    2.16 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.17     /* Fujitsu Coral graphics driver (devg-coral.so)        */
    2.18     {"coral",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.19 -                   SDL_GF_ACCELERATED_3D},
    2.20 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.21     /* Intel integrated graphics driver (devg-extreme2.so)  */
    2.22     {"extreme2",    SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.23 -                   SDL_GF_ACCELERATED_3D},
    2.24 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.25     /* Unaccelerated FB driver (devg-flat.so)               */
    2.26     {"flat",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
    2.27 -                   SDL_GF_UNACCELERATED_3D},
    2.28 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    2.29     /* NS Geode graphics driver (devg-geode.so)             */
    2.30     {"geode",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.31 -                   SDL_GF_UNACCELERATED_3D},
    2.32 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.33     /* Geode LX graphics driver (devg-geodelx.so)           */
    2.34     {"geodelx",     SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
    2.35 -                   SDL_GF_UNACCELERATED_3D},
    2.36 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.37     /* Intel integrated graphics driver (devg-gma9xx.so)    */
    2.38     {"gma",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.39 -                   SDL_GF_ACCELERATED_3D},
    2.40 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.41     /* Intel integrated graphics driver (devg-i810.so)      */
    2.42     {"i810",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.43 -                   SDL_GF_UNACCELERATED_3D},
    2.44 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.45     /* Intel integrated graphics driver (devg-i830.so)      */
    2.46     {"i830",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.47 -                   SDL_GF_UNACCELERATED_3D},
    2.48 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.49     /* Geode LX graphics driver (devg-lx800.so)             */
    2.50     {"lx800",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.51 -                   SDL_GF_UNACCELERATED_3D},
    2.52 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.53     /* Matrox Gxx graphics driver (devg-matroxg.so)         */
    2.54     {"matroxg",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.55 -                   SDL_GF_UNACCELERATED_3D},
    2.56 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.57     /* Intel Poulsbo graphics driver (devg-poulsbo.so)      */
    2.58     {"poulsbo",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.59 -                   SDL_GF_ACCELERATED_3D},
    2.60 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.61     /* ATI Radeon driver (devg-radeon.so)                   */
    2.62     {"radeon",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.63 -                   SDL_GF_UNACCELERATED_3D},
    2.64 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.65     /* ATI Rage driver (devg-rage.so)                       */
    2.66     {"rage",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.67 -                   SDL_GF_UNACCELERATED_3D},
    2.68 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.69     /* S3 Savage graphics driver (devg-s3_savage.so)        */
    2.70     {"s3_savage",   SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.71 -                   SDL_GF_UNACCELERATED_3D},
    2.72 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.73     /* SiS630 integrated graphics driver (devg-sis630.so)   */
    2.74     {"sis630",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.75 -                   SDL_GF_UNACCELERATED_3D},
    2.76 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.77     /* PowerVR SGX 535 graphics driver (devg-poulsbo.so)    */
    2.78     {"sgx",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.79 -                   SDL_GF_ACCELERATED_3D},
    2.80 +                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.81     /* SM Voyager GX graphics driver (devg-smi5xx.so)       */
    2.82     {"smi5xx",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.83 -                   SDL_GF_UNACCELERATED_3D},
    2.84 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.85     /* Silicon Motion graphics driver (devg-smi7xx.so)      */
    2.86     {"smi7xx",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.87 -                   SDL_GF_UNACCELERATED_3D},
    2.88 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.89     /* SVGA unaccelerated gfx driver (devg-svga.so)         */
    2.90     {"svga",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
    2.91 -                   SDL_GF_UNACCELERATED_3D},
    2.92 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    2.93     /* nVidia TNT graphics driver (devg-tnt.so)             */
    2.94     {"tnt",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.95 -                   SDL_GF_UNACCELERATED_3D},
    2.96 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    2.97     /* VIA integrated graphics driver (devg-tvia.so)        */
    2.98     {"tvia",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
    2.99 -                   SDL_GF_UNACCELERATED_3D},
   2.100 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
   2.101     /* VIA UniChrome graphics driver (devg-unichrome.so)    */
   2.102     {"unichrome",   SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION | 
   2.103 -                   SDL_GF_UNACCELERATED_3D},
   2.104 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
   2.105     /* VESA unaccelerated gfx driver (devg-vesa.so)         */
   2.106     {"vesa",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
   2.107 -                   SDL_GF_UNACCELERATED_3D},
   2.108 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
   2.109     /* VmWare graphics driver (devg-volari.so)              */
   2.110     {"vmware",      SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
   2.111 -                   SDL_GF_UNACCELERATED_3D},
   2.112 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
   2.113     /* XGI XP10 graphics driver (devg-volari.so)            */
   2.114     {"volari",      SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
   2.115 -                   SDL_GF_UNACCELERATED_3D},
   2.116 +                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
   2.117     /* End of list */
   2.118     {NULL,          0x00000000}
   2.119  };
   2.120 @@ -532,6 +532,8 @@
   2.121     SDL_DisplayData* didata;
   2.122     uint32_t it;
   2.123  
   2.124 +   /* Stop collecting mouse events */
   2.125 +   hiddi_disable_mouse();
   2.126     /* Delete GF input devices */
   2.127     gf_delinputdevices(_this);
   2.128  
   2.129 @@ -1289,6 +1291,13 @@
   2.130           surfaces=2;
   2.131        }
   2.132  
   2.133 +      /* If driver has no support of video memory allocation, then */
   2.134 +      /* disable double buffering, use single buffer present copy  */
   2.135 +      if ((didata->caps & SDL_GF_VIDEOMEMORY)!=SDL_GF_VIDEOMEMORY)
   2.136 +      {
   2.137 +         surfaces=1;
   2.138 +      }
   2.139 +
   2.140        /* Free main surface */
   2.141        if (didata->surface[0]!=NULL)
   2.142        {
     3.1 --- a/src/video/qnxgf/SDL_qnxgf.h	Tue May 05 17:47:41 2009 +0000
     3.2 +++ b/src/video/qnxgf/SDL_qnxgf.h	Tue May 05 17:50:34 2009 +0000
     3.3 @@ -100,12 +100,14 @@
     3.4     uint32_t caps;
     3.5  } GF_DeviceCaps;
     3.6  
     3.7 -#define SDL_GF_UNACCELERATED         0x00000000
     3.8 -#define SDL_GF_ACCELERATED           0x00000001
     3.9 -#define SDL_GF_NOLOWRESOLUTION       0x00000000
    3.10 -#define SDL_GF_LOWRESOLUTION         0x00000002
    3.11 -#define SDL_GF_UNACCELERATED_3D      0x00000000
    3.12 -#define SDL_GF_ACCELERATED_3D        0x00000004
    3.13 +#define SDL_GF_UNACCELERATED         0x00000000  /* driver is unaccelerated  */
    3.14 +#define SDL_GF_ACCELERATED           0x00000001  /* driver is accelerated    */
    3.15 +#define SDL_GF_NOLOWRESOLUTION       0x00000000  /* no modes below 640x480   */
    3.16 +#define SDL_GF_LOWRESOLUTION         0x00000002  /* support modes <640x480   */
    3.17 +#define SDL_GF_UNACCELERATED_3D      0x00000000  /* software OpenGL ES       */
    3.18 +#define SDL_GF_ACCELERATED_3D        0x00000004  /* hardware acc. OpenGL ES  */
    3.19 +#define SDL_GF_NOVIDEOMEMORY         0x00000000  /* no video memory alloc.   */
    3.20 +#define SDL_GF_VIDEOMEMORY           0x00000008  /* has video memory alloc.  */
    3.21  
    3.22  /****************************************************************************/
    3.23  /* SDL_VideoDevice functions declaration                                    */