> Can I put pixels in one at high speed and then blit it to a real
> window, thereby speeding it up by orders of magnitude over trying to
> put the individual pixels on the real window?
Drawing pixels one by one is slow anyway (but drawing them on
offscreen area should be faster than drawing directly to the
screen). Blitting will also give you less flicker (or no flicker at
all).
Offscreen areas are very useful if they don't change much and are good
for fast background redrawing or tiles.
Can't comment on other questions at the moment.
--
Janis Dzerins
If million people say a stupid thing it's still a stupid thing.
You can certainly blit from the off-screen port to a window.
See gp:with-pixmap-graphics-port, create-pixmap-port, destroy-pixmap-port
(in-package :cl-user)
(defparameter *a* (capi:contain (make-instance 'capi:output-pane)))
(defparameter *b* (gp:create-pixmap-port *A* 100 100 :clear t :background :yellow))
(gp:draw-line *b* 0 0 100 100 :foreground :red)
(gp:draw-circle *b* 50 50 25 :foreground :blue)
(gp:copy-pixels *a* *b* 0 0 100 100 0 0)
(gp:copy-pixels *a* *b* 100 100 100 100 0 0)
(gp:destroy-pixmap-port *b*)
>See gp:with-pixmap-graphics-port, create-pixmap-port, destroy-pixmap-port
Thanks. That was what I was looking for. It wasn't obvious to me that a
pixmap port was off screen, and I was confused by the fact that it wanted a
pane too.
I'm also wondering if there is some way to quickly change all the pixels of a
pixmap port. For example, suppose I have a vector of 8-bit bytes, with each
three bytes being the RGB components for one pixel. What is the fastest way
to convert/copy such a vector into a pixmap port? Do I have to set the
graphics state and use draw-point, for each pixel? That is very slow, even
off-screen. Is there some much faster way?
The vector you need about is a bitmap (.bmp). Use the gp:draw-image routines
like before. You are going to have to figure out how tp create a bitmap on
the fly (if that is what you need) with its associated color map. Read in
an external bitmap and use cl:descibe to start to figure out its structure.
Creating bitmaps on the fly might be counter-productive, usually I just use
MS Paint.
Wade
It just takes programming.
Good Luck, Wade