home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / ADProScripts.lha / GetModeID.adpro < prev    next >
Encoding:
Text File  |  1994-01-31  |  2.0 KB  |  94 lines

  1. /*
  2. ** GetModeID.adpro
  3. **
  4. ** $VER: GetModeID.adpro 1.0.0 (12.1.94)
  5. **
  6. ** This REXX program is used to get the ModeID of a particular screen mode.
  7. ** This is particularly useful when used with the ADPro Get & Set screen mode
  8. ** rexx commands which require a screen mode ID. This will also get mode IDs
  9. ** for third party graphics cards supported through ADPro's render libraries.
  10. **
  11. ** This the screen mode requestor will only show currently available screen modes.
  12. **
  13. ** RTG boards that provide color mapped modes that emulate the Workbench will
  14. ** be shown as using the Amiga render library.
  15. **
  16. ** This script requires ADPro v2.5.0 (or higher).
  17. **
  18. ** Copyright © 1994 ASDG, Incorporated
  19. ** All Rights Reserved
  20. */
  21.  
  22.  
  23. ADDRESS "ADPro"
  24. OPTIONS RESULTS
  25.  
  26. NL = '0A'X
  27. SQ = '27'X
  28. DQ = '22'X
  29. TRUE  = 1
  30. FALSE = 0
  31. TempDefaults = "T:TempADProDefaults"
  32.  
  33.  
  34. /*
  35. ** Save the current environment.
  36. */
  37.  
  38. SAVE_DEFAULTS TempDefaults
  39.  
  40.  
  41. /*
  42. ** Get a screen mode requestor
  43. */
  44.  
  45. continue = TRUE
  46. DO WHILE (continue = TRUE)
  47.     ADPRO_TO_FRONT
  48.  
  49.     GET_SCREEN_MODE '"Select a screen mode"' Amiga "XXX" 320 200 4
  50.     ScreenMode = ADPRO_RESULT
  51.     IF (RC ~= 0) THEN DO
  52.         ADPRO_TO_FRONT
  53.         OKAY1 "Could not get screen modes."
  54.         CALL ErrorOut 10
  55.     END
  56.  
  57.     PARSE VAR ScreenMode RenderLib ModeID Width Height Depth
  58.  
  59.     text = "Selected screen mode information:" || NL || NL||, 
  60.         "Render Library = " || RenderLib || NL ||,
  61.         "Mode ID        = " || ModeID || NL ||,
  62.         "Width          = " || Width || NL ||,    
  63.         "Height         = " || Height || NL ||,
  64.         "Depth          = " || Depth 
  65.        
  66.     OKAYN '"GetScreenModeID.adpro"' '"'text'"' '"Check another mode...|Cancel"'
  67.     IF (RC = 0) THEN DO
  68.         ADPRO_TO_FRONT
  69.         OKAY1 "Process aborted."
  70.         CALL ErrorOut 10
  71.     END
  72.  
  73.     ELSE IF (RC = 1) THEN
  74.         continue = TRUE
  75. END
  76.  
  77. CALL ErrorOut 0
  78.  
  79.  
  80. ErrorOut:
  81.     PARSE ARG ExitCode
  82.  
  83.     IF (EXISTS( TempDefaults )) THEN DO
  84.         LOAD_DEFAULTS TempDefaults
  85.         IF (RC ~= 0) THEN DO
  86.             ADPRO_TO_FRONT
  87.             OKAY1 "Error restoring settings."
  88.         END
  89.  
  90.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  91.     END
  92.  
  93.     EXIT ExitCode
  94.