home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / DOUBLEB.TXT < prev    next >
Text File  |  1994-04-23  |  2KB  |  52 lines

  1. >3.2 How do I speed up my OPL programs?
  2. >--------------------------------------
  3. >iii.The graphics on the Series 3/3a are generally very fast,
  4. >    but the fastest graphics command in OPL is gCOPY. If you are
  5. >    performing any complex tasks with many moving windows, you
  6. >    may be able to produce a considerable speed increase by
  7. >    instead using only gCOPY's onto one displayed window.
  8. Another popular way in the graphic/game worlds is double buffering. This
  9. is where you would display one bitmap whilst drawing in the other; once
  10. the drawing is complete you switch the buffers so that the one you
  11. were drawing on is now displayed and the other will be the one you
  12. will now draw into. This can be simply achieved by creating two
  13. windows using and using gORDER to move the windows between levels
  14. It works quite nicely if you have an array WIN%(2) pointing to the
  15. two bitmaps and a variable currwin% which you can use as follows:
  16.  
  17. use WIN%(currwin%)                // select current window to draw into
  18.  
  19. ... draw ...
  20.  
  21. gORDER(WIN%(currwin%),0)        // displays it and hides the other for free
  22.  
  23. currwin%=3-currwin%                // switch to the next buffer for the next
  24.                                 // drawing (can't tell I can program C++
  25.                                 // can you ;-))
  26.  
  27. Make sure the two bitmaps are defined to be the same size though!
  28.  
  29. BTW, do the later versions of the 3a still have the '%=' bug where if
  30. you type those characters really quickly (as you would if you were
  31. programming) the machine would interpret it as the diamond key and
  32. switch you to outline mode. It's particularly annoying because you
  33. cannot program the diamond key functions like in the other programs.
  34. God! Don't they teach orthogonality anymore :-)
  35.  
  36. >try some slower double buffering method where you again have
  37. >2 windows, but draw to the one in the background before bringing
  38. >it to the foreground and calling gUPDATE.
  39. Oops, got a little ahead of me there; but it's 4:30am. So tough:-)
  40. Also, it's not actually that slow. I manage to move 5 objects w/
  41. no trouble.
  42.  
  43. >7.6 Sprites
  44. >-----------
  45. >The Series 3a offers limited support for *a* SPRITE with a set
  46. >of commands. What is not made clear in the manual is that
  47. >ONLY 1 sprite is available.
  48. Yeah, that was so annoying when I found that out! Hope this doesn't
  49. mean that they're going to release another machine until I've made
  50. my money back on this one!
  51.  
  52.