Skip to content

Commit 6a5374b

Browse files
committed
Removed debugging code from example.
1 parent ebc76d8 commit 6a5374b

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

examples/RedBook8/Chapter01/Triangles.hs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-
22
Triangles.hs (adapted from triangles.cpp which is (c) The Red Book Authors.)
3-
Copyright (c) Sven Panne 2013 <[email protected]>
3+
Copyright (c) Sven Panne 2014 <[email protected]>
44
This file is part of HOpenGL and distributed under a BSD-style license
55
See the file libraries/GLUT/LICENSE
66
@@ -13,17 +13,8 @@ import Foreign.Ptr
1313
import Foreign.Storable
1414
import Graphics.UI.GLUT
1515
import Prelude hiding ( init )
16-
import System.IO
1716
import LoadShaders
1817

19-
-- TODO: Just for debugging, remove me later.
20-
checkError :: String -> IO ()
21-
checkError functionName = get errors >>= mapM_ reportError
22-
where reportError e =
23-
hPutStrLn stderr (showError e ++ " detected in " ++ functionName)
24-
showError (Error category message) =
25-
"GL error " ++ show category ++ " (" ++ message ++ ")"
26-
2718
bufferOffset :: Integral a => a -> Ptr b
2819
bufferOffset = plusPtr nullPtr . fromIntegral
2920

@@ -60,7 +51,6 @@ init = do
6051
(ToFloat, VertexArrayDescriptor 2 Float 0 (bufferOffset firstIndex))
6152
vertexAttribArray vPosition $= Enabled
6253

63-
checkError "init"
6454
return $ Descriptor triangles firstIndex (fromIntegral numVertices)
6555

6656
display :: Descriptor -> DisplayCallback
@@ -69,18 +59,13 @@ display (Descriptor triangles firstIndex numVertices) = do
6959
bindVertexArrayObject $= Just triangles
7060
drawArrays Triangles firstIndex numVertices
7161
flush
72-
checkError "display"
7362

7463
main :: IO ()
7564
main = do
7665
(progName, _args) <- getArgsAndInitialize
7766
initialDisplayMode $= [ RGBAMode ]
7867
initialWindowSize $= Size 512 512
7968
initialContextVersion $= (4, 3)
80-
81-
-- TODO: Just for debugging, remove me later.
82-
initialContextFlags $= [ DebugContext ]
83-
8469
initialContextProfile $= [ CoreProfile ]
8570
_ <- createWindow progName
8671
descriptor <- init

0 commit comments

Comments
 (0)