diff options
Diffstat (limited to 'Draw.hs')
-rw-r--r-- | Draw.hs | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -4,7 +4,7 @@ module Draw where | |||
4 | import Control.Concurrent | 4 | import Control.Concurrent |
5 | import Data.Int | 5 | import Data.Int |
6 | import Data.IORef | 6 | import Data.IORef |
7 | import Foreign.ForeignPtr | 7 | import Data.GI.Base.ManagedPtr (newManagedPtr) |
8 | import Foreign.Ptr | 8 | import Foreign.Ptr |
9 | import GI.Gdk.Objects | 9 | import GI.Gdk.Objects |
10 | import GI.Gtk | 10 | import GI.Gtk |
@@ -50,9 +50,8 @@ createContext st glarea = do | |||
50 | Just win -> windowCreateGlContext win | 50 | Just win -> windowCreateGlContext win |
51 | Nothing -> do | 51 | Nothing -> do |
52 | oops "createContext: GLArea has no window." | 52 | oops "createContext: GLArea has no window." |
53 | fp <- newForeignPtr_ nullPtr | 53 | mp <- newManagedPtr nullPtr (return ()) |
54 | disown <- newIORef Nothing | 54 | return $ GLContext mp |
55 | return $ GLContext $ ManagedPtr fp disown | ||
56 | 55 | ||
57 | oops :: String -> IO () | 56 | oops :: String -> IO () |
58 | oops s = hPutStrLn stderr s | 57 | oops s = hPutStrLn stderr s |