home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / euphor10.zip / SELECT.E < prev    next >
Text File  |  1993-05-05  |  725b  |  30 lines

  1.         -------------------------------------
  2.         -- search for a good graphics mode --
  3.         -------------------------------------
  4.  
  5. constant nice_color_modes = {261,260,259,258,257,256,18,19,16,14,13,4},
  6.      nice_mono_modes = {17, 11, 15, 6, 5}
  7.  
  8. global function select_mode(integer choice)
  9. -- try to select the choice mode, 
  10. -- but if it fails try other modes
  11.     sequence vc, modes
  12.  
  13.     vc = video_config()
  14.     if vc[VC_COLOR] then
  15.     modes = choice & nice_color_modes
  16.     else
  17.     modes = choice & nice_mono_modes
  18.     end if
  19.     for i = 1 to length(modes) do
  20.         graphics_mode(modes[i])
  21.         vc = video_config()
  22.         if vc[VC_XPIXELS] > 0 then
  23.         return 1    
  24.         end if
  25.     end for
  26.     return 0
  27. end function
  28.  
  29.  
  30.