[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get GWorld's pixel address



    From: minagawa@st.rim.or.jp (Minagawa,Kazushi)
    
    I'm having a problem with getting GWorld's pixel address using the
    GetPixBaseAddr trap.  I must be doing something wrong.  
    
    Here's the code. 
    
    (defun access-to-gworld ()
            (rlet ((gw-p :ointer)
                      (gw-r :rect
                                :topleft #@(0 0)
                                :bottomright #@(100 100)))
        (#_NewGWorld gw-p 32 gw-r (%null-ptr) (%null-ptr) 0)
        (with-macptrs ((pix-addr (#_GetPixBaseAddr (#_GetGWorldPxMap gw-p))))
          (print (%get-byte pix-addr)))))
    
Your problem is that gw-p is a pointer to the GWorld, not the GWorld
itself.  Or more accurately, it is a pointer to a pointer to the
GWorld...in any case, you want to remove one level of indirection.  
If you do (#_GetGWorldPixmap (%get-ptr gw-p)) it ought to work.