Thanks , John , Mike
Yes rather slow , probably this is the "slow downer" (still in Racket bytecode )
(define (poke x y r g b)
(let ((pos (* 4 (+ x (* 500 y)))))
(ptr-set! ptr _byte pos b)
(ptr-set! ptr _byte (+ pos 1) g)
(ptr-set! ptr _byte (+ pos 2) r)))
ptr is the position of the back buffer , but for one frame this has to be ran 250000 times -- much better will be to include it into the main calculation routine and increasing the address by 4bytes every cycle (p += 4 in basic) , here pos is just an offset to the base address ptr. There may be a problem (due to the modern OOP way of thinking -- ptr is an object , not a number (it is a cpointer) ) , i still have to use the pointer and the offset separated , while it is in fact just a number. Very often objects do the opposite of their (raison d'ĂȘtre) reason of existence , they make coding difficult and result slow execution time -- Racket Scheme goes that far that even a color is an object (make-object color% etc ... ) and then you need methods getting a color / rgb channel of a color etc ...
(define gray (send the-color-database find-color "gray"))
"O TEMPORA O MORES"
best , Rob
(i'll replace this uselessness by adding in my FreePascal generated LIB -- poke (scrptr + pos , ubyte) -- simple as that, no need to make things more complicated than they are )
(when (agree?)
( defmacro I() 'we ))