[futurebasic] QDFX problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: MacMuse <MacMuse@...>
Date: Sat, 6 Dec 1997 22:10:13 EST
Like most of you who ask for help, I have spent the better part of this 
evening trying to do this simple routine and I can't make it work. Using 
Ariel Pub's QDFX DCOD ( which I have used before to draw to the whole 
screen with success) I am trying to draw to a 332 x 300 rectangle in the 
middle of my screen. If I set x and y to 0, the pictures draw in the 
upper left corner of the screen without problem. But allowing x and y to 
carry the values as indicated here ( on a 640 x 480 scrn x = 154, y = 90) 
the pictures draw with the right half of the screen to the left and the 
left half to the right with a slice of noise at the bottom.
Can someone help me with what I'm doing wrong.

TIA

Roger M. Clary
MacMUSE Software
MacMuse@...
http://members.aol.com/macmuse 

'----------------------------------------------

LOCAL FN QDFx(FxNum,PRsrcNum,x,y)
  DIM dT,dL,dB,dR
  machType = SYSTEM(_machType)
  WINDOW OUTPUT _splashScrn
  
  pH& = FN GETPICTURE(PRsrcNum)
  LONG IF pH& <> _nil                             ' report error if nil 
in real program!
    
    IF machType => _gestaltMacIIfx THEN dLay = 3 ELSE dLay = 1
    sz = 8 
    dir = 1
    IF FxNum = 11 THEN dLay = 0
    dT = y : dL = x                               ' set destination rect
    dB = dT + 300                                 ' demo does entire 
window...
    dR = dL + 332
    
    CALL GETGWORLD(currGW&,currDev&)              ' save current gWorld
    
    ' acquire new gWorld
    qdErr = FN NEWGWORLD(offPort&,0,dT,0,0,_pixelsLocked)
    LONG IF qdErr = _noErr
      

      CALL SETGWORLD(offPort&,0) 
      CALL ERASERECT(dT)
      PICTURE(0,0),pH&                            ' draw pict offscreen
      CALL SETGWORLD(currGW&,currDev&)            ' restore output 
onscreen
      callBk& = _nil                              ' no call back routine
      
      ' -------------
      ' Now call QDFx. 
      CALL "DCOD",2000,result,(FxNum,offPort&,@dT,@dT,sz,dLay,dir,callBk&)
      
      CALL DISPOSEGWORLD(offPort&) 
    END IF
  END IF
END FN


LOCAL FN bldWnd
  scrnWdt% = SYSTEM(_scrnWidth)
  scrnHgt% = SYSTEM(_scrnHeight)
  WINDOW _splashScrn,"",(0,0)-(scrnWdt%,scrnHgt%),_dialogPlain
  CALL SETRECT (rect, 0, 0, WINDOW (_width), WINDOW (_height))
  COLOR _zBlack
  CALL PAINTRECT (rect)
  x = (scrnWdt%/2) - 166
  y = (scrnHgt%/2) - 150
  hasQD32 = (SYSTEM(_maxColors) = 32)
  LONG IF hasQD32
    FN QDFx (3,153,x,y)
    DELAY 2000
    FN QDFx (5,152,x,y)
  END IF
END FN