ScreenModeExist
Status = ScreenModeExist(Width, Height, Depth)
 
Parameters:

    Width = The required screen Width you wish to query
    Height = The required screen Height you wish to query
    Depth = The required screen Depth you wish to query (16bit ,24bit or 32bit)
Returns:

    Status = If you computer has the requested screen mode, it's return a true(1) if not it'll be False(0)
 

      The ScreenModeExist functions checks what full screen modes your computers display device supports. When developing your game, it's very important not to make assumptions about the type of display that the players your game might have. As such, it's a good habit to check if a screen mode exists before attempting to open the screen of that size.


      Valid Depths

           16 = 16bit
           24 = 24 bit
           32 = 32bit




FACTS:


      * ScreenModeExist checks a full Screen display mode is available, it's not required if your using a windowed screen mode for your program.




Mini Tutorial:


      This example checks if your video cards supports certain full screen display modes.


  
; Check What 320*240 modes your video card supports
  For Depth= 16 To 32 Step 8
     Show_Info_AboutMode(320,240,depth)
  Next
  Print ""
  
; Check What 640*480 modes your video card supports
  For Depth= 16 To 32 Step 8
     Show_Info_AboutMode(640,480,depth)
  Next
  Print ""
  
  
; Check What 800*600 modes your video card supports
  For Depth= 16 To 32 Step 8
     Show_Info_AboutMode(800,600,depth)
  Next
  Print ""
  
; Check What 1024*768 modes your video card supports
  For Depth= 16 To 32 Step 8
     Show_Info_AboutMode(1024,768,depth)
  Next
  
; Show the Screen to the user and wait for a key press before ending
  Sync
  WaitKey
  
  
  
Function  Show_Info_AboutMode(width,height,depth)
  
; Check if your video card has this Full Screen mode ?
  If ScreenModeExist(Width,Height,Depth)=true
   ; if it does, then set this string variable to "Available"
     Exists$="Available"
  Else
   ; if it doesn't, then set this string variable to "Not Supported"
     Exists$="Not Supported"
  EndIf
  
; Converted the screen width/height/depth into a string for display
  s$=Str$(width)+"x by "+Str$(height)+"y "+Str$(Depth)+"Bit ="
  
; Display this screen mode size and whether it exists or not
  Print "Full Screen Mode:"+s$+Exists$
EndFunction
  




On my computer, This example would output. Remember, not every computer has the same display modes.


  
  Full Screen Mode:320x by 24016Bit =Available
  Full Screen Mode:320x by 24024Bit =Not Supported
  Full Screen Mode:320x by 24032Bit =Available
  
  Full Screen Mode:640x by 48016Bit =Available
  Full Screen Mode:640x by 48024Bit =Not Supported
  Full Screen Mode:640x by 48032Bit =Available
  
  Full Screen Mode:800x by 60016Bit =Available
  Full Screen Mode:800x by 60024Bit =Not Supported
  Full Screen Mode:800x by 60032Bit =Available
  
  Full Screen Mode:1024x by 76816Bit =Available
  Full Screen Mode:1024x by 76824Bit =Not Supported
  Full Screen Mode:1024x by 76832Bit =Available
  

 
Related Info: GetScreenType | OpenScreen :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com