-
Notifications
You must be signed in to change notification settings - Fork 13
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
defaultWindowResources is undocumented #49
Comments
Ah, I can see in the DOCUMENTATION.md file that the However, my question about an example of using |
You can look at the examples to see how to use {-# OPTIONS -Wall #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Raylib.Core
import Raylib.Core.Textures
import Raylib.Types
import Raylib.Util
import Raylib.Util.Colors
startup :: IO (WindowResources, Texture)
startup = do
window <- initWindow 600 450 "loadTexture example"
setTargetFPS 60
texture <- loadTexture "/path/to/file" window -- this is what you're looking for
return (window, texture)
mainLoop :: (WindowResources, Texture) -> IO (WindowResources, Texture)
mainLoop (window, texture) = do
drawing $ do
clearBackground rayWhite
-- use the texture here
return (window, texture)
shouldClose :: (WindowResources, Texture) -> IO Bool
shouldClose _ = windowShouldClose
teardown :: (WindowResources, Texture) -> IO ()
teardown = closeWindow . fst
raylibApplication 'startup 'mainLoop 'shouldClose 'teardown |
Thank you! That's super helpful! |
Hello and thank you for creating these bindings!
I wanted to report that the
defaultWindowResources
function defined here isn't visible in the documentation. I had to click on Source forWindowResources
and that's how I found it.On a related note, I'm trying to get
loadTexture
to work which requiresWindowResources
. Would you happen to have an example of usingloadTexture
? Thanks!The text was updated successfully, but these errors were encountered: