summaryrefslogtreecommitdiffstats
path: root/Bindings/GLX.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-02-25 02:15:26 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-02-25 02:15:26 +0100
commitb4c3367c63459607f0919e77998d5405634e2003 (patch)
treebbd9a47429a642bc72456946ea8c5e7a646ee815 /Bindings/GLX.hs
parent7f12f41e5fce40042f97d167da9a0fb58e5a1651 (diff)
downloadhtanks-b4c3367c63459607f0919e77998d5405634e2003.tar
htanks-b4c3367c63459607f0919e77998d5405634e2003.zip
Added texture loading
Diffstat (limited to 'Bindings/GLX.hs')
-rw-r--r--Bindings/GLX.hs125
1 files changed, 62 insertions, 63 deletions
diff --git a/Bindings/GLX.hs b/Bindings/GLX.hs
index 4f364e4..65fad11 100644
--- a/Bindings/GLX.hs
+++ b/Bindings/GLX.hs
@@ -33,7 +33,6 @@ import Data.Word
import Foreign.C.String (withCString)
import Foreign.C.Types
-import Foreign.ForeignPtr
import Foreign.Ptr
import Foreign.Marshal.Alloc (alloca, allocaBytes)
import Foreign.Marshal.Array (peekArray, withArray0)
@@ -45,7 +44,7 @@ import Graphics.X11.Xlib.Types (Dimension, Display, Pixel, Position)
-{-# LINE 45 "GLX.chs" #-}
+{-# LINE 44 "GLX.chs" #-}
type Drawable = XID
@@ -74,55 +73,55 @@ data VisualInfo = VisualInfo
instance Storable VisualInfo where
sizeOf _ = ((40))
-{-# LINE 73 "GLX.chs" #-}
+{-# LINE 72 "GLX.chs" #-}
alignment _ = alignment (undefined :: CULong)
peek vi = do
visual <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) vi
-{-# LINE 77 "GLX.chs" #-}
+{-# LINE 76 "GLX.chs" #-}
visualid <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) vi
-{-# LINE 78 "GLX.chs" #-}
+{-# LINE 77 "GLX.chs" #-}
screen <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) vi
-{-# LINE 79 "GLX.chs" #-}
+{-# LINE 78 "GLX.chs" #-}
depth <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) vi
-{-# LINE 80 "GLX.chs" #-}
+{-# LINE 79 "GLX.chs" #-}
viclass <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) vi
-{-# LINE 81 "GLX.chs" #-}
+{-# LINE 80 "GLX.chs" #-}
red_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) vi
-{-# LINE 82 "GLX.chs" #-}
+{-# LINE 81 "GLX.chs" #-}
green_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) vi
-{-# LINE 83 "GLX.chs" #-}
+{-# LINE 82 "GLX.chs" #-}
blue_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) vi
-{-# LINE 84 "GLX.chs" #-}
+{-# LINE 83 "GLX.chs" #-}
colormap_size <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) vi
-{-# LINE 85 "GLX.chs" #-}
+{-# LINE 84 "GLX.chs" #-}
bits_per_rgb <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) vi
-{-# LINE 86 "GLX.chs" #-}
+{-# LINE 85 "GLX.chs" #-}
return (VisualInfo visual visualid screen depth viclass red_mask green_mask blue_mask colormap_size bits_per_rgb)
poke vi (VisualInfo visual visualid screen depth viclass red_mask green_mask blue_mask colormap_size bits_per_rgb) = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) vi visual
-{-# LINE 92 "GLX.chs" #-}
+{-# LINE 91 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) vi visualid
-{-# LINE 93 "GLX.chs" #-}
+{-# LINE 92 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) vi screen
-{-# LINE 94 "GLX.chs" #-}
+{-# LINE 93 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) vi depth
-{-# LINE 95 "GLX.chs" #-}
+{-# LINE 94 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) vi viclass
-{-# LINE 96 "GLX.chs" #-}
+{-# LINE 95 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) vi red_mask
-{-# LINE 97 "GLX.chs" #-}
+{-# LINE 96 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) vi green_mask
-{-# LINE 98 "GLX.chs" #-}
+{-# LINE 97 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) vi blue_mask
-{-# LINE 99 "GLX.chs" #-}
+{-# LINE 98 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) vi colormap_size
-{-# LINE 100 "GLX.chs" #-}
+{-# LINE 99 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) vi bits_per_rgb
-{-# LINE 101 "GLX.chs" #-}
+{-# LINE 100 "GLX.chs" #-}
data SetWindowAttributes = SetWindowAttributes
@@ -144,38 +143,38 @@ data SetWindowAttributes = SetWindowAttributes
instance Storable SetWindowAttributes where
sizeOf _ = ((60))
-{-# LINE 122 "GLX.chs" #-}
+{-# LINE 121 "GLX.chs" #-}
alignment _ = alignment (undefined :: CULong)
peek swa = do
background_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) swa
-{-# LINE 126 "GLX.chs" #-}
+{-# LINE 125 "GLX.chs" #-}
background_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) swa
-{-# LINE 127 "GLX.chs" #-}
+{-# LINE 126 "GLX.chs" #-}
border_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) swa
-{-# LINE 128 "GLX.chs" #-}
+{-# LINE 127 "GLX.chs" #-}
bit_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) swa
-{-# LINE 129 "GLX.chs" #-}
+{-# LINE 128 "GLX.chs" #-}
win_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) swa
-{-# LINE 130 "GLX.chs" #-}
+{-# LINE 129 "GLX.chs" #-}
backing_store <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) swa
-{-# LINE 131 "GLX.chs" #-}
+{-# LINE 130 "GLX.chs" #-}
backing_planes <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) swa
-{-# LINE 132 "GLX.chs" #-}
+{-# LINE 131 "GLX.chs" #-}
backing_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) swa
-{-# LINE 133 "GLX.chs" #-}
+{-# LINE 132 "GLX.chs" #-}
save_under <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) swa
-{-# LINE 134 "GLX.chs" #-}
+{-# LINE 133 "GLX.chs" #-}
event_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) swa
-{-# LINE 135 "GLX.chs" #-}
+{-# LINE 134 "GLX.chs" #-}
do_not_propagate_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 44)) swa
-{-# LINE 136 "GLX.chs" #-}
+{-# LINE 135 "GLX.chs" #-}
override_redirect <- ((\hsc_ptr -> peekByteOff hsc_ptr 48)) swa
-{-# LINE 137 "GLX.chs" #-}
+{-# LINE 136 "GLX.chs" #-}
colormap <- ((\hsc_ptr -> peekByteOff hsc_ptr 52)) swa
-{-# LINE 138 "GLX.chs" #-}
+{-# LINE 137 "GLX.chs" #-}
cursor <- ((\hsc_ptr -> peekByteOff hsc_ptr 56)) swa
-{-# LINE 139 "GLX.chs" #-}
+{-# LINE 138 "GLX.chs" #-}
return (SetWindowAttributes
background_pixmap
@@ -209,33 +208,33 @@ instance Storable SetWindowAttributes where
colormap
cursor) = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) swa background_pixmap
-{-# LINE 172 "GLX.chs" #-}
+{-# LINE 171 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) swa background_pixel
-{-# LINE 173 "GLX.chs" #-}
+{-# LINE 172 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) swa border_pixmap
-{-# LINE 174 "GLX.chs" #-}
+{-# LINE 173 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) swa bit_gravity
-{-# LINE 175 "GLX.chs" #-}
+{-# LINE 174 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) swa win_gravity
-{-# LINE 176 "GLX.chs" #-}
+{-# LINE 175 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) swa backing_store
-{-# LINE 177 "GLX.chs" #-}
+{-# LINE 176 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) swa backing_planes
-{-# LINE 178 "GLX.chs" #-}
+{-# LINE 177 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) swa backing_pixel
-{-# LINE 179 "GLX.chs" #-}
+{-# LINE 178 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) swa save_under
-{-# LINE 180 "GLX.chs" #-}
+{-# LINE 179 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 40)) swa event_mask
-{-# LINE 181 "GLX.chs" #-}
+{-# LINE 180 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 44)) swa do_not_propagate_mask
-{-# LINE 182 "GLX.chs" #-}
+{-# LINE 181 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 48)) swa override_redirect
-{-# LINE 183 "GLX.chs" #-}
+{-# LINE 182 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 52)) swa colormap
-{-# LINE 184 "GLX.chs" #-}
+{-# LINE 183 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 56)) swa cursor
-{-# LINE 185 "GLX.chs" #-}
+{-# LINE 184 "GLX.chs" #-}
nullSetWindowAttributes :: SetWindowAttributes
nullSetWindowAttributes = (SetWindowAttributes 0 0 0 0 0 0 0 0 False 0 0 False 0 0)
@@ -254,13 +253,13 @@ foreign import ccall unsafe "GL/glx.h XSetClassHint"
setClassHint :: Display -> Window -> ClassHint -> IO ()
setClassHint disp wnd hint = allocaBytes ((8)) $ \p ->
-{-# LINE 203 "GLX.chs" #-}
+{-# LINE 202 "GLX.chs" #-}
withCString (resName hint) $ \res_name ->
withCString (resClass hint) $ \res_class -> do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) p res_name
-{-# LINE 206 "GLX.chs" #-}
+{-# LINE 205 "GLX.chs" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) p res_class
-{-# LINE 207 "GLX.chs" #-}
+{-# LINE 206 "GLX.chs" #-}
xSetClassHint disp wnd p
@@ -278,35 +277,35 @@ chooseFBConfig disp sc attr = alloca $ \n -> withArray0 (fromIntegral none) (con
renderType :: CInt
renderType = (32785)
-{-# LINE 224 "GLX.chs" #-}
+{-# LINE 223 "GLX.chs" #-}
rgbaBit :: CInt
rgbaBit = (1)
-{-# LINE 227 "GLX.chs" #-}
+{-# LINE 226 "GLX.chs" #-}
drawableType :: CInt
drawableType = (32784)
-{-# LINE 230 "GLX.chs" #-}
+{-# LINE 229 "GLX.chs" #-}
windowBit :: CInt
windowBit = (1)
-{-# LINE 233 "GLX.chs" #-}
+{-# LINE 232 "GLX.chs" #-}
xRenderable :: CInt
xRenderable = (32786)
-{-# LINE 236 "GLX.chs" #-}
+{-# LINE 235 "GLX.chs" #-}
doublebuffer :: CInt
doublebuffer = (5)
-{-# LINE 239 "GLX.chs" #-}
+{-# LINE 238 "GLX.chs" #-}
depthSize :: CInt
depthSize = (12)
-{-# LINE 242 "GLX.chs" #-}
+{-# LINE 241 "GLX.chs" #-}
stencilSize :: CInt
stencilSize = (13)
-{-# LINE 245 "GLX.chs" #-}
+{-# LINE 244 "GLX.chs" #-}
foreign import ccall unsafe "GL/glx.h glXGetVisualFromFBConfig"
glXGetVisualFromFBConfig :: Display -> FBConfig -> IO (Ptr VisualInfo)