Skip to content

add function to get RenderTexture inner texture field. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 21, 2021

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