diff options
Diffstat (limited to 'GLX.hs')
-rw-r--r-- | GLX.hs | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -26,7 +26,7 @@ glxDriver :: GLX glxDriver = GLX False -instance GLDriver GLX where +instance Driver GLX where initialized (GLX inited) = inited initGL (GLX inited) = do @@ -34,25 +34,25 @@ instance GLDriver GLX where disp <- openDisplay "" fbconfigs <- chooseFBConfig disp (fromIntegral . defaultScreen $ disp) - [(glxRenderType, glxRgbaBit) - , (glxDrawableType, glxWindowBit) - , (glxXRenderable, glxTrue) - , (glxDepthSize, 1) - , (glxStencilSize, 1) + [(renderType, rgbaBit) + , (drawableType, windowBit) + , (xRenderable, true) + , (depthSize, 1) + , (stencilSize, 1) ] visualinfo <- getVisualFromFBConfig disp (head fbconfigs) - rootwindow <- rootWindow disp (fromIntegral $ vi_screen visualinfo) - cmap <- createColormap disp rootwindow (vi_visual visualinfo) allocNone + rootwindow <- rootWindow disp (fromIntegral $ viScreen visualinfo) + cmap <- createColormap disp rootwindow (viVisual visualinfo) allocNone - let swa = nullSetWindowAttributes {swa_colormap = cmap, swa_event_mask = structureNotifyMask .|. keyPressMask .|. keyReleaseMask} + let swa = nullSetWindowAttributes {swaColormap = cmap, swaEventMask = structureNotifyMask .|. keyPressMask .|. keyReleaseMask} - wnd <- with swa $ \swaptr -> createWindow disp rootwindow 0 0 800 600 0 (fromIntegral $ vi_depth visualinfo) inputOutput (vi_visual visualinfo) (cWBorderPixel.|.cWColormap.|.cWEventMask) swaptr + wnd <- with swa $ \swaptr -> createWindow disp rootwindow 0 0 800 600 0 (fromIntegral $ viDepth visualinfo) inputOutput (viVisual visualinfo) (cWBorderPixel.|.cWColormap.|.cWEventMask) swaptr mapWindow disp wnd waitForMapNotify disp wnd - ctx <- with visualinfo $ \vi -> glXCreateContext disp vi (GLXContext nullPtr) True - glXMakeCurrent disp wnd ctx + ctx <- with visualinfo $ \vi -> createContext disp vi (Context nullPtr) True + makeCurrent disp wnd ctx return (GLX True) |