You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
;; Main Loop
(loop
with compute =t
while (not (window-should-close))
when compute
do (progn
(pre-compute-mandel-set mandel) ;; renders mandel set into texture using DrawPixel
(setf compute nil))
do (let ((game-time (cl-raylib:get-time)))
(begin-drawing)
(clear-background
*status-panel-background-color*)
(render-visual mandel game-time) ;; see below - simply draws the texture.
(end-drawing)))
;; Pre-compute
(defunpre-compute-mandel-set (state)
(unless (mandel-target-texture state)
(setf (mandel-target-texture state)
(load-render-texture (visual-width state) (visual-height state))))
(formatt"computing...")
(begin-texture-mode (mandel-target-texture state)) ;; tests in C show I don't need clear-background here.
(loop
for y below (visual-height state)
do (loop
for x below (visual-width state)
do (draw-pixel
x y (mandel-core
state
y x))))
(draw-line (visual-left state)
(visual-top state)
(+ (visual-left state) (visual-width state))
(+ (visual-top state) (visual-height state))
(make-rgba 25500))
(end-texture-mode)
(formatt"...done!~%"))
;; transfer from texture to screen
(defmethodrender-visual ((state mandel-state) game-time)
(let ((target-texture (mandel-target-texture state)))
(when target-texture
(draw-texture
(render-texture-texture target-texture)
(visual-left state) (visual-top state) (make-rgba 000)))))
Neither the set pixels nor the line drawn to the texture ever show on the screen.
To see if it is raylib or the bindings (or me?!), here my C test code:
I recommend to close this issue, since the code below is working. So it must be a problem in my code, even though I am not sure, where. Storing the RenderTexture2D instance in a CLOS object might have to do with it.
Neither the set pixels nor the line drawn to the texture ever show on the screen.
To see if it is raylib or the bindings (or me?!), here my C test code:
With the C code (which nominally does the very same logical sequence as the lisp code), the pixels show as expected.
The text was updated successfully, but these errors were encountered: