extract size alongside data when reding in textures
This commit is contained in:
parent
ada9c1368f
commit
cf520852d0
|
@ -19,7 +19,7 @@ import Foreign.Ptr
|
||||||
import Classes.Bindable
|
import Classes.Bindable
|
||||||
import Types.Texture
|
import Types.Texture
|
||||||
|
|
||||||
newTexture :: FilePath -> GL.GLuint -> IO Texture
|
newTexture :: FilePath -> GL.GLuint -> IO (V2 Word, Texture)
|
||||||
newTexture fp slot = do
|
newTexture fp slot = do
|
||||||
|
|
||||||
-- read in image from filesystem
|
-- read in image from filesystem
|
||||||
|
@ -56,7 +56,7 @@ newTexture fp slot = do
|
||||||
-- free (texData tex)
|
-- free (texData tex)
|
||||||
|
|
||||||
-- pass texture object out
|
-- pass texture object out
|
||||||
return tex
|
return (fmap fromIntegral dimensions, tex)
|
||||||
|
|
||||||
loadTexture :: Texture -> V2 GL.GLsizei -> Ptr () -> IO ()
|
loadTexture :: Texture -> V2 GL.GLsizei -> Ptr () -> IO ()
|
||||||
loadTexture tex dimensions data_ =
|
loadTexture tex dimensions data_ =
|
||||||
|
|
Loading…
Reference in New Issue