Fix error display when compiling/linking shaders
This commit is contained in:
@@ -19,6 +19,7 @@ import Shader.Data
|
||||
import Shader.Parameters
|
||||
|
||||
import Foreign
|
||||
import Foreign.C.String
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.ByteString.Unsafe as BU
|
||||
import Control.Monad
|
||||
@@ -345,10 +346,10 @@ makeShaderProgram' str srcs = do
|
||||
mapM_ glDeleteShader shaders
|
||||
return theprog
|
||||
|
||||
glCheckError :: (Storable t1, Storable a1, Show a1) =>
|
||||
glCheckError :: (Storable t1) =>
|
||||
[Char]
|
||||
-> (t2 -> GLenum -> Ptr t1 -> IO ())
|
||||
-> (t2 -> t1 -> Ptr a3 -> Ptr a1 -> IO ())
|
||||
-> (t2 -> t1 -> Ptr a3 -> CString -> IO ())
|
||||
-> t2
|
||||
-> GLenum
|
||||
-> IO ()
|
||||
@@ -363,7 +364,7 @@ glCheckError str f g x statustype =
|
||||
len <- peek ptr -- we may have to use this length more intelligently
|
||||
alloca $ \charPtr -> do
|
||||
g x len nullPtr charPtr
|
||||
char <- peek charPtr
|
||||
char <- peekCString charPtr
|
||||
error $ str ++ show char
|
||||
else return ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user