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 240y 16Bit =Available Full Screen Mode:320x by 240y 24Bit =Not Supported Full Screen Mode:320x by 240y 32Bit =Available Full Screen Mode:640x by 480y 16Bit =Available Full Screen Mode:640x by 480y 24Bit =Not Supported Full Screen Mode:640x by 480y 32Bit =Available Full Screen Mode:800x by 600y 16Bit =Available Full Screen Mode:800x by 600y 24Bit =Not Supported Full Screen Mode:800x by 600y 32Bit =Available Full Screen Mode:1024x by 768y 16Bit =Available Full Screen Mode:1024x by 768y 24Bit =Not Supported Full Screen Mode:1024x by 768y 32Bit =Available |
|