[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get GWorld's pixel address
- To: minagawa@st.rim.or.jp (Minagawa,Kazushi)
- Subject: Re: How to get GWorld's pixel address
- From: Michael Travers <mt@media.mit.edu>
- Date: Thu, 04 May 95 15:57:02 -0400
- Cc: info-mcl@digitool.com
- In-reply-to: Your message of "Wed, 03 May 95 16:05:55 +0900." <199505030705.QAA02295@mail.st.rim.or.jp>
- Sender: owner-info-mcl@digitool.com
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.