Skip to content

add function to get RenderTexture inner texture field.#21

Merged
bakpakin merged 2 commits intojanet-lang:masterfrom
AlecTroemel:master
Sep 21, 2021
Merged

add function to get RenderTexture inner texture field.#21
bakpakin merged 2 commits intojanet-lang:masterfrom
AlecTroemel:master

Conversation

@AlecTroemel
Copy link
Contributor

this is useful to render at a different resolution then the window.

(use ../build/jaylib)

(set-trace-log-callback nil)

(init-window 800 600 "Test Game")
(set-target-fps 60)

(def target (load-render-texture 400 300))

(while (not (window-should-close))
  (begin-texture-mode target)
    (draw-circle 200 150 60 :black)
  (end-texture-mode)

  (begin-drawing)
    (clear-background :white)
    (draw-texture-ex (get-rendertexture-texture target) [0 0] 0 2 :white)
  (end-drawing))
(close-window)

thank you for this great library! I'm open to any suggestions :)

@bakpakin
Copy link
Member

bakpakin commented May 9, 2021

Looks pretty good, although with out usual naming convention I believe the function should be called get-render-texture-texture2d.

@bakpakin bakpakin merged commit 6cd5c6a into janet-lang:master Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants