我正在尝试访问SDL2库提供的Ptr
中的GLContext
值。这是获取GLContext
的函数:http://hackage.haskell.org/package/sdl2-2.5.0.0/docs/SDL-Video-OpenGL.html#v:glCreateContext
我如何访问内部的Ptr
?
import qualified SDL as SDL
import qualified SDL.Internal.Types as SDL
main :: IO ()
main = do
SDL.initializeAll
window @ (SDL.Window wp) <- SDL.createWindow "My SDL Application" SDL.defaultWindow
context @ (SDL.GLContext gl) <- SDL.glCreateContext window
putStrLn $ show wp
但是我得到的错误是:
Not in scope: data constructor ‘SDL.GLContext’
Neither ‘SDL’ nor ‘SDL.Internal.Types’ exports ‘
|
15 | context @ (SDL.GLContext gl) <- SDL.glCreateContext window
构造函数似乎已导出。我在做什么错了?