Move texture objects to openglraw

This commit is contained in:
2023-03-09 17:54:11 +00:00
parent 44b56ed163
commit 1d6fdd7eb1
9 changed files with 178 additions and 124 deletions
+5 -3
View File
@@ -5,13 +5,15 @@ import Foreign.Storable
import Graphics.GL.Core45
import Graphics.Rendering.OpenGL hiding (Point, imageHeight, scale, translate)
mglCreateSingle :: (GLsizei -> Ptr GLuint -> IO ()) -> IO GLuint
mglCreateSingle f = do
mglCreate :: (GLsizei -> Ptr GLuint -> IO ()) -> IO GLuint
mglCreate f = do
alloca $ \nameptr -> do
f 1 nameptr
peek nameptr
mglDelete :: (GLsizei -> Ptr GLuint -> IO ()) -> GLuint -> IO ()
mglDelete f i = with i $ \ptr -> f 1 ptr
unTexture :: TextureObject -> GLuint
unTexture (TextureObject t) = t