home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / screen / exam01.dba
Encoding:
Text File  |  1999-11-15  |  1.6 KB  |  63 lines

  1. Rem * Title  : Display Mode Switching
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 1
  6. rem ==========================================
  7. rem This program will check for graphics modes
  8. rem ------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.     
  13. rem has the computer what graphic modes it has
  14. perform checklist for display modes
  15.  
  16. print "THE CURRENT SCREEN TYPE IS ",screen type()
  17. print "THE CURRENT SCREEN WIDTH IS ",screen width()
  18. print "THE CURRENT SCREEN HEIGHT IS ",screen height()
  19. print "THE CURRENT SCREEN DEPTH IS ",screen depth()
  20. print "THE CURRENT SCREEN FRAME RATE IS ",screen fps()
  21. print 
  22. if check display mode(800,600,16) then print "800x600x16 exists!"
  23.  
  24. for t=1 to checklist quantity()
  25.  
  26.     rem Clear screen
  27.     cls 
  28.  
  29.     width=checklist value a(t)
  30.     height=checklist value b(t)
  31.     depth=checklist value c(t)
  32.         
  33.     rem Set screen to new display mode
  34.     set display mode width,height,depth
  35.  
  36.     print "YOUR SCREEN CAN BE ",width," WIDTH BY ",height," HEIGHT AND A "," DEPTH OF ",depth
  37.     print "PRESS LEFT MOUSE BUTTON"    
  38.     
  39.     repeat
  40.  
  41.         rem Pick a random color
  42.         ink rgb(rnd(255),rnd(255),rnd(255)),1
  43.  
  44.         rem Were across screen to draw box
  45.         x=rnd(640)
  46.  
  47.         rem Were down screen to draw box
  48.         y=rnd(460)+20
  49.         
  50.         rem Draw box on screen
  51.         box x,y,x+40,y+40
  52.         
  53.     rem Wait for left mouse button to be pressed
  54.     until mouseclick()=1
  55.  
  56. next t
  57.  
  58. rem Delete from memory the checklist string$
  59. empty checklist
  60.  
  61. rem End the program
  62. end
  63.