packages feed

GLUtil 0.7 → 0.7.1

raw patch · 4 files changed

+8/−5 lines, 4 files

Files

GLUtil.cabal view
@@ -1,5 +1,5 @@ Name:                GLUtil-Version:             0.7+Version:             0.7.1 Synopsis:            Miscellaneous OpenGL utilities. License:             BSD3 License-file:        LICENSE
src/Graphics/GLUtil/ShaderProgram.hs view
@@ -4,8 +4,7 @@ module Graphics.GLUtil.ShaderProgram    (-- * The ShaderProgram type    ShaderProgram(..), -   -- * Simple shader programs utilizing a vertex shader and a-   -- fragment shader+   -- * Simple shader programs utilizing a vertex shader and a fragment shader    simpleShaderProgram, simpleShaderProgramWith, simpleShaderExplicit,     -- * Explicit shader loading    loadShaderProgramWith,
src/Graphics/GLUtil/Textures.hs view
@@ -12,7 +12,7 @@ import Data.Vector.Storable (Vector, unsafeWith) import Data.Word (Word8, Word16) import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)-import Foreign.Ptr (Ptr, plusPtr, castPtr)+import Foreign.Ptr (Ptr, plusPtr, castPtr, nullPtr) import Foreign.Marshal.Array (withArray)  import Graphics.GLUtil.TypeMapping (HasGLType(..))@@ -71,6 +71,11 @@   withPixels (ShortString b) m = aux. toForeignPtr $ b     where aux (fp,o,_) = withForeignPtr fp $ \p ->                            m (plusPtr (castPtr p :: Ptr Word16) o)++-- |Create a new 2D texture with uninitialized contents.+freshTexture :: forall a proxy. HasGLType a+             => Int -> Int -> TexColor -> proxy a -> IO TextureObject+freshTexture w h c _ = loadTexture $ texInfo w h c (nullPtr::Ptr a)  -- |Create a new 2D texture with data from a 'TexInfo'. loadTexture :: IsPixelData a => TexInfo a -> IO TextureObject
src/Graphics/GLUtil/TypeMapping.hs view
@@ -90,7 +90,6 @@ class Storable a => HasGLType a where   glType :: a -> DataType -instance HasGLType Int where glType _ = GL.Int instance HasGLType GLint where glType _ = GL.Int instance HasGLType Word8 where glType _ = GL.UnsignedByte instance HasGLType Word16 where glType _ = GL.UnsignedShort