Renamed some files and added Makefile
This commit is contained in:
parent
b4f295da91
commit
9ca9555fed
5 changed files with 100 additions and 93 deletions
|
@ -1,8 +1,8 @@
|
||||||
{-# INCLUDE <GL/gl.h> #-}
|
{-# INCLUDE <GL/gl.h> #-}
|
||||||
{-# INCLUDE <GL/glpng.h> #-}
|
{-# INCLUDE <GL/glpng.h> #-}
|
||||||
{-# LINE 1 "GLPng.chs" #-}
|
{-# LINE 1 "Bindings/GLPng.hsc" #-}
|
||||||
{-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable #-}
|
{-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable #-}
|
||||||
{-# LINE 2 "GLPng.chs" #-}
|
{-# LINE 2 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
module Bindings.GLPng ( PngInfo(..)
|
module Bindings.GLPng ( PngInfo(..)
|
||||||
, Mipmap(..)
|
, Mipmap(..)
|
||||||
|
@ -22,9 +22,9 @@ import Graphics.Rendering.OpenGL.GL.Texturing.Parameters (Repetition(..), Clampi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{-# LINE 21 "GLPng.chs" #-}
|
{-# LINE 21 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
{-# LINE 22 "GLPng.chs" #-}
|
{-# LINE 22 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
data PngInfo = PngInfo
|
data PngInfo = PngInfo
|
||||||
|
@ -36,45 +36,45 @@ data PngInfo = PngInfo
|
||||||
|
|
||||||
instance Storable PngInfo where
|
instance Storable PngInfo where
|
||||||
sizeOf _ = ((16))
|
sizeOf _ = ((16))
|
||||||
{-# LINE 33 "GLPng.chs" #-}
|
{-# LINE 33 "Bindings/GLPng.hsc" #-}
|
||||||
alignment _ = alignment (undefined :: CUInt)
|
alignment _ = alignment (undefined :: CUInt)
|
||||||
|
|
||||||
peek pi = do
|
peek pi = do
|
||||||
w <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) pi
|
w <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) pi
|
||||||
{-# LINE 37 "GLPng.chs" #-}
|
{-# LINE 37 "Bindings/GLPng.hsc" #-}
|
||||||
h <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) pi
|
h <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) pi
|
||||||
{-# LINE 38 "GLPng.chs" #-}
|
{-# LINE 38 "Bindings/GLPng.hsc" #-}
|
||||||
d <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) pi
|
d <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) pi
|
||||||
{-# LINE 39 "GLPng.chs" #-}
|
{-# LINE 39 "Bindings/GLPng.hsc" #-}
|
||||||
a <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) pi
|
a <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) pi
|
||||||
{-# LINE 40 "GLPng.chs" #-}
|
{-# LINE 40 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
return (PngInfo w h d a)
|
return (PngInfo w h d a)
|
||||||
|
|
||||||
poke pi (PngInfo w h d a) = do
|
poke pi (PngInfo w h d a) = do
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) pi w
|
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) pi w
|
||||||
{-# LINE 45 "GLPng.chs" #-}
|
{-# LINE 45 "Bindings/GLPng.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) pi h
|
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) pi h
|
||||||
{-# LINE 46 "GLPng.chs" #-}
|
{-# LINE 46 "Bindings/GLPng.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) pi d
|
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) pi d
|
||||||
{-# LINE 47 "GLPng.chs" #-}
|
{-# LINE 47 "Bindings/GLPng.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) pi a
|
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) pi a
|
||||||
{-# LINE 48 "GLPng.chs" #-}
|
{-# LINE 48 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
png_NoMipmap :: CInt
|
png_NoMipmap :: CInt
|
||||||
png_NoMipmap = (0)
|
png_NoMipmap = (0)
|
||||||
{-# LINE 54 "GLPng.chs" #-}
|
{-# LINE 54 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
png_BuildMipmap :: CInt
|
png_BuildMipmap :: CInt
|
||||||
png_BuildMipmap = (-1)
|
png_BuildMipmap = (-1)
|
||||||
{-# LINE 57 "GLPng.chs" #-}
|
{-# LINE 57 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
png_SimpleMipmap :: CInt
|
png_SimpleMipmap :: CInt
|
||||||
png_SimpleMipmap = (-2)
|
png_SimpleMipmap = (-2)
|
||||||
{-# LINE 60 "GLPng.chs" #-}
|
{-# LINE 60 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
data Mipmap = NoMipmap | BuildMipmap | SimpleMipmap
|
data Mipmap = NoMipmap | BuildMipmap | SimpleMipmap
|
||||||
|
@ -89,11 +89,11 @@ marshalMipmap m
|
||||||
|
|
||||||
png_Alpha :: CInt
|
png_Alpha :: CInt
|
||||||
png_Alpha = (-2)
|
png_Alpha = (-2)
|
||||||
{-# LINE 74 "GLPng.chs" #-}
|
{-# LINE 74 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
png_Solid :: CInt
|
png_Solid :: CInt
|
||||||
png_Solid = (-1)
|
png_Solid = (-1)
|
||||||
{-# LINE 77 "GLPng.chs" #-}
|
{-# LINE 77 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
data Trans = Alpha | Solid
|
data Trans = Alpha | Solid
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
@ -110,27 +110,27 @@ magToMin magFilter = (magFilter, Nothing)
|
||||||
|
|
||||||
gl_NEAREST :: CInt
|
gl_NEAREST :: CInt
|
||||||
gl_NEAREST = (9728)
|
gl_NEAREST = (9728)
|
||||||
{-# LINE 93 "GLPng.chs" #-}
|
{-# LINE 93 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_LINEAR :: CInt
|
gl_LINEAR :: CInt
|
||||||
gl_LINEAR = (9729)
|
gl_LINEAR = (9729)
|
||||||
{-# LINE 96 "GLPng.chs" #-}
|
{-# LINE 96 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_NEAREST_MIPMAP_NEAREST :: CInt
|
gl_NEAREST_MIPMAP_NEAREST :: CInt
|
||||||
gl_NEAREST_MIPMAP_NEAREST = (9984)
|
gl_NEAREST_MIPMAP_NEAREST = (9984)
|
||||||
{-# LINE 99 "GLPng.chs" #-}
|
{-# LINE 99 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_LINEAR_MIPMAP_NEAREST :: CInt
|
gl_LINEAR_MIPMAP_NEAREST :: CInt
|
||||||
gl_LINEAR_MIPMAP_NEAREST = (9985)
|
gl_LINEAR_MIPMAP_NEAREST = (9985)
|
||||||
{-# LINE 102 "GLPng.chs" #-}
|
{-# LINE 102 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_NEAREST_MIPMAP_LINEAR :: CInt
|
gl_NEAREST_MIPMAP_LINEAR :: CInt
|
||||||
gl_NEAREST_MIPMAP_LINEAR = (9986)
|
gl_NEAREST_MIPMAP_LINEAR = (9986)
|
||||||
{-# LINE 105 "GLPng.chs" #-}
|
{-# LINE 105 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_LINEAR_MIPMAP_LINEAR :: CInt
|
gl_LINEAR_MIPMAP_LINEAR :: CInt
|
||||||
gl_LINEAR_MIPMAP_LINEAR = (9987)
|
gl_LINEAR_MIPMAP_LINEAR = (9987)
|
||||||
{-# LINE 108 "GLPng.chs" #-}
|
{-# LINE 108 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
marshalMinificationFilter :: MinificationFilter -> CInt
|
marshalMinificationFilter :: MinificationFilter -> CInt
|
||||||
|
@ -148,23 +148,23 @@ marshalMagnificationFilter = marshalMinificationFilter . magToMin
|
||||||
|
|
||||||
gl_CLAMP :: CInt
|
gl_CLAMP :: CInt
|
||||||
gl_CLAMP = (10496)
|
gl_CLAMP = (10496)
|
||||||
{-# LINE 125 "GLPng.chs" #-}
|
{-# LINE 125 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_REPEAT :: CInt
|
gl_REPEAT :: CInt
|
||||||
gl_REPEAT = (10497)
|
gl_REPEAT = (10497)
|
||||||
{-# LINE 128 "GLPng.chs" #-}
|
{-# LINE 128 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_CLAMP_TO_EDGE :: CInt
|
gl_CLAMP_TO_EDGE :: CInt
|
||||||
gl_CLAMP_TO_EDGE = (33071)
|
gl_CLAMP_TO_EDGE = (33071)
|
||||||
{-# LINE 131 "GLPng.chs" #-}
|
{-# LINE 131 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_CLAMP_TO_BORDER :: CInt
|
gl_CLAMP_TO_BORDER :: CInt
|
||||||
gl_CLAMP_TO_BORDER = (33069)
|
gl_CLAMP_TO_BORDER = (33069)
|
||||||
{-# LINE 134 "GLPng.chs" #-}
|
{-# LINE 134 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
gl_MIRRORED_REPEAT :: CInt
|
gl_MIRRORED_REPEAT :: CInt
|
||||||
gl_MIRRORED_REPEAT = (33648)
|
gl_MIRRORED_REPEAT = (33648)
|
||||||
{-# LINE 137 "GLPng.chs" #-}
|
{-# LINE 137 "Bindings/GLPng.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
marshalTextureWrapMode :: (Repetition, Clamping) -> CInt
|
marshalTextureWrapMode :: (Repetition, Clamping) -> CInt
|
||||||
|
|
128
Bindings/GLX.hs
128
Bindings/GLX.hs
|
@ -1,7 +1,7 @@
|
||||||
{-# INCLUDE <GL/glx.h> #-}
|
{-# INCLUDE <GL/glx.h> #-}
|
||||||
{-# LINE 1 "GLX.chs" #-}
|
{-# LINE 1 "Bindings/GLX.hsc" #-}
|
||||||
{-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
|
||||||
{-# LINE 2 "GLX.chs" #-}
|
{-# LINE 2 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
module Bindings.GLX ( createColormap
|
module Bindings.GLX ( createColormap
|
||||||
, createWindow
|
, createWindow
|
||||||
|
@ -44,7 +44,7 @@ import Graphics.X11.Xlib.Types (Dimension, Display, Pixel, Position)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{-# LINE 44 "GLX.chs" #-}
|
{-# LINE 44 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
type Drawable = XID
|
type Drawable = XID
|
||||||
|
@ -73,55 +73,55 @@ data VisualInfo = VisualInfo
|
||||||
|
|
||||||
instance Storable VisualInfo where
|
instance Storable VisualInfo where
|
||||||
sizeOf _ = ((40))
|
sizeOf _ = ((40))
|
||||||
{-# LINE 72 "GLX.chs" #-}
|
{-# LINE 72 "Bindings/GLX.hsc" #-}
|
||||||
alignment _ = alignment (undefined :: CULong)
|
alignment _ = alignment (undefined :: CULong)
|
||||||
|
|
||||||
peek vi = do
|
peek vi = do
|
||||||
visual <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) vi
|
visual <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) vi
|
||||||
{-# LINE 76 "GLX.chs" #-}
|
{-# LINE 76 "Bindings/GLX.hsc" #-}
|
||||||
visualid <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) vi
|
visualid <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) vi
|
||||||
{-# LINE 77 "GLX.chs" #-}
|
{-# LINE 77 "Bindings/GLX.hsc" #-}
|
||||||
screen <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) vi
|
screen <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) vi
|
||||||
{-# LINE 78 "GLX.chs" #-}
|
{-# LINE 78 "Bindings/GLX.hsc" #-}
|
||||||
depth <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) vi
|
depth <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) vi
|
||||||
{-# LINE 79 "GLX.chs" #-}
|
{-# LINE 79 "Bindings/GLX.hsc" #-}
|
||||||
viclass <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) vi
|
viclass <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) vi
|
||||||
{-# LINE 80 "GLX.chs" #-}
|
{-# LINE 80 "Bindings/GLX.hsc" #-}
|
||||||
red_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) vi
|
red_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) vi
|
||||||
{-# LINE 81 "GLX.chs" #-}
|
{-# LINE 81 "Bindings/GLX.hsc" #-}
|
||||||
green_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) vi
|
green_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) vi
|
||||||
{-# LINE 82 "GLX.chs" #-}
|
{-# LINE 82 "Bindings/GLX.hsc" #-}
|
||||||
blue_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) vi
|
blue_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) vi
|
||||||
{-# LINE 83 "GLX.chs" #-}
|
{-# LINE 83 "Bindings/GLX.hsc" #-}
|
||||||
colormap_size <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) vi
|
colormap_size <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) vi
|
||||||
{-# LINE 84 "GLX.chs" #-}
|
{-# LINE 84 "Bindings/GLX.hsc" #-}
|
||||||
bits_per_rgb <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) vi
|
bits_per_rgb <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) vi
|
||||||
{-# LINE 85 "GLX.chs" #-}
|
{-# LINE 85 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
return (VisualInfo visual visualid screen depth viclass red_mask green_mask blue_mask colormap_size bits_per_rgb)
|
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
|
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
|
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) vi visual
|
||||||
{-# LINE 91 "GLX.chs" #-}
|
{-# LINE 91 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) vi visualid
|
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) vi visualid
|
||||||
{-# LINE 92 "GLX.chs" #-}
|
{-# LINE 92 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) vi screen
|
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) vi screen
|
||||||
{-# LINE 93 "GLX.chs" #-}
|
{-# LINE 93 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) vi depth
|
((\hsc_ptr -> pokeByteOff hsc_ptr 12)) vi depth
|
||||||
{-# LINE 94 "GLX.chs" #-}
|
{-# LINE 94 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) vi viclass
|
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) vi viclass
|
||||||
{-# LINE 95 "GLX.chs" #-}
|
{-# LINE 95 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) vi red_mask
|
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) vi red_mask
|
||||||
{-# LINE 96 "GLX.chs" #-}
|
{-# LINE 96 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) vi green_mask
|
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) vi green_mask
|
||||||
{-# LINE 97 "GLX.chs" #-}
|
{-# LINE 97 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) vi blue_mask
|
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) vi blue_mask
|
||||||
{-# LINE 98 "GLX.chs" #-}
|
{-# LINE 98 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) vi colormap_size
|
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) vi colormap_size
|
||||||
{-# LINE 99 "GLX.chs" #-}
|
{-# LINE 99 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) vi bits_per_rgb
|
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) vi bits_per_rgb
|
||||||
{-# LINE 100 "GLX.chs" #-}
|
{-# LINE 100 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
|
|
||||||
data SetWindowAttributes = SetWindowAttributes
|
data SetWindowAttributes = SetWindowAttributes
|
||||||
|
@ -143,38 +143,38 @@ data SetWindowAttributes = SetWindowAttributes
|
||||||
|
|
||||||
instance Storable SetWindowAttributes where
|
instance Storable SetWindowAttributes where
|
||||||
sizeOf _ = ((60))
|
sizeOf _ = ((60))
|
||||||
{-# LINE 121 "GLX.chs" #-}
|
{-# LINE 121 "Bindings/GLX.hsc" #-}
|
||||||
alignment _ = alignment (undefined :: CULong)
|
alignment _ = alignment (undefined :: CULong)
|
||||||
|
|
||||||
peek swa = do
|
peek swa = do
|
||||||
background_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) swa
|
background_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) swa
|
||||||
{-# LINE 125 "GLX.chs" #-}
|
{-# LINE 125 "Bindings/GLX.hsc" #-}
|
||||||
background_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) swa
|
background_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) swa
|
||||||
{-# LINE 126 "GLX.chs" #-}
|
{-# LINE 126 "Bindings/GLX.hsc" #-}
|
||||||
border_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) swa
|
border_pixmap <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) swa
|
||||||
{-# LINE 127 "GLX.chs" #-}
|
{-# LINE 127 "Bindings/GLX.hsc" #-}
|
||||||
bit_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) swa
|
bit_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) swa
|
||||||
{-# LINE 128 "GLX.chs" #-}
|
{-# LINE 128 "Bindings/GLX.hsc" #-}
|
||||||
win_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) swa
|
win_gravity <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) swa
|
||||||
{-# LINE 129 "GLX.chs" #-}
|
{-# LINE 129 "Bindings/GLX.hsc" #-}
|
||||||
backing_store <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) swa
|
backing_store <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) swa
|
||||||
{-# LINE 130 "GLX.chs" #-}
|
{-# LINE 130 "Bindings/GLX.hsc" #-}
|
||||||
backing_planes <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) swa
|
backing_planes <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) swa
|
||||||
{-# LINE 131 "GLX.chs" #-}
|
{-# LINE 131 "Bindings/GLX.hsc" #-}
|
||||||
backing_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) swa
|
backing_pixel <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) swa
|
||||||
{-# LINE 132 "GLX.chs" #-}
|
{-# LINE 132 "Bindings/GLX.hsc" #-}
|
||||||
save_under <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) swa
|
save_under <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) swa
|
||||||
{-# LINE 133 "GLX.chs" #-}
|
{-# LINE 133 "Bindings/GLX.hsc" #-}
|
||||||
event_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) swa
|
event_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) swa
|
||||||
{-# LINE 134 "GLX.chs" #-}
|
{-# LINE 134 "Bindings/GLX.hsc" #-}
|
||||||
do_not_propagate_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 44)) swa
|
do_not_propagate_mask <- ((\hsc_ptr -> peekByteOff hsc_ptr 44)) swa
|
||||||
{-# LINE 135 "GLX.chs" #-}
|
{-# LINE 135 "Bindings/GLX.hsc" #-}
|
||||||
override_redirect <- ((\hsc_ptr -> peekByteOff hsc_ptr 48)) swa
|
override_redirect <- ((\hsc_ptr -> peekByteOff hsc_ptr 48)) swa
|
||||||
{-# LINE 136 "GLX.chs" #-}
|
{-# LINE 136 "Bindings/GLX.hsc" #-}
|
||||||
colormap <- ((\hsc_ptr -> peekByteOff hsc_ptr 52)) swa
|
colormap <- ((\hsc_ptr -> peekByteOff hsc_ptr 52)) swa
|
||||||
{-# LINE 137 "GLX.chs" #-}
|
{-# LINE 137 "Bindings/GLX.hsc" #-}
|
||||||
cursor <- ((\hsc_ptr -> peekByteOff hsc_ptr 56)) swa
|
cursor <- ((\hsc_ptr -> peekByteOff hsc_ptr 56)) swa
|
||||||
{-# LINE 138 "GLX.chs" #-}
|
{-# LINE 138 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
return (SetWindowAttributes
|
return (SetWindowAttributes
|
||||||
background_pixmap
|
background_pixmap
|
||||||
|
@ -208,33 +208,33 @@ instance Storable SetWindowAttributes where
|
||||||
colormap
|
colormap
|
||||||
cursor) = do
|
cursor) = do
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) swa background_pixmap
|
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) swa background_pixmap
|
||||||
{-# LINE 171 "GLX.chs" #-}
|
{-# LINE 171 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) swa background_pixel
|
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) swa background_pixel
|
||||||
{-# LINE 172 "GLX.chs" #-}
|
{-# LINE 172 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) swa border_pixmap
|
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) swa border_pixmap
|
||||||
{-# LINE 173 "GLX.chs" #-}
|
{-# LINE 173 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) swa bit_gravity
|
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) swa bit_gravity
|
||||||
{-# LINE 174 "GLX.chs" #-}
|
{-# LINE 174 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) swa win_gravity
|
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) swa win_gravity
|
||||||
{-# LINE 175 "GLX.chs" #-}
|
{-# LINE 175 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) swa backing_store
|
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) swa backing_store
|
||||||
{-# LINE 176 "GLX.chs" #-}
|
{-# LINE 176 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) swa backing_planes
|
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) swa backing_planes
|
||||||
{-# LINE 177 "GLX.chs" #-}
|
{-# LINE 177 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) swa backing_pixel
|
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) swa backing_pixel
|
||||||
{-# LINE 178 "GLX.chs" #-}
|
{-# LINE 178 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) swa save_under
|
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) swa save_under
|
||||||
{-# LINE 179 "GLX.chs" #-}
|
{-# LINE 179 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 40)) swa event_mask
|
((\hsc_ptr -> pokeByteOff hsc_ptr 40)) swa event_mask
|
||||||
{-# LINE 180 "GLX.chs" #-}
|
{-# LINE 180 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 44)) swa do_not_propagate_mask
|
((\hsc_ptr -> pokeByteOff hsc_ptr 44)) swa do_not_propagate_mask
|
||||||
{-# LINE 181 "GLX.chs" #-}
|
{-# LINE 181 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 48)) swa override_redirect
|
((\hsc_ptr -> pokeByteOff hsc_ptr 48)) swa override_redirect
|
||||||
{-# LINE 182 "GLX.chs" #-}
|
{-# LINE 182 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 52)) swa colormap
|
((\hsc_ptr -> pokeByteOff hsc_ptr 52)) swa colormap
|
||||||
{-# LINE 183 "GLX.chs" #-}
|
{-# LINE 183 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 56)) swa cursor
|
((\hsc_ptr -> pokeByteOff hsc_ptr 56)) swa cursor
|
||||||
{-# LINE 184 "GLX.chs" #-}
|
{-# LINE 184 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
nullSetWindowAttributes :: SetWindowAttributes
|
nullSetWindowAttributes :: SetWindowAttributes
|
||||||
nullSetWindowAttributes = (SetWindowAttributes 0 0 0 0 0 0 0 0 False 0 0 False 0 0)
|
nullSetWindowAttributes = (SetWindowAttributes 0 0 0 0 0 0 0 0 False 0 0 False 0 0)
|
||||||
|
@ -253,13 +253,13 @@ foreign import ccall unsafe "GL/glx.h XSetClassHint"
|
||||||
|
|
||||||
setClassHint :: Display -> Window -> ClassHint -> IO ()
|
setClassHint :: Display -> Window -> ClassHint -> IO ()
|
||||||
setClassHint disp wnd hint = allocaBytes ((8)) $ \p ->
|
setClassHint disp wnd hint = allocaBytes ((8)) $ \p ->
|
||||||
{-# LINE 202 "GLX.chs" #-}
|
{-# LINE 202 "Bindings/GLX.hsc" #-}
|
||||||
withCString (resName hint) $ \res_name ->
|
withCString (resName hint) $ \res_name ->
|
||||||
withCString (resClass hint) $ \res_class -> do
|
withCString (resClass hint) $ \res_class -> do
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) p res_name
|
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) p res_name
|
||||||
{-# LINE 205 "GLX.chs" #-}
|
{-# LINE 205 "Bindings/GLX.hsc" #-}
|
||||||
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) p res_class
|
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) p res_class
|
||||||
{-# LINE 206 "GLX.chs" #-}
|
{-# LINE 206 "Bindings/GLX.hsc" #-}
|
||||||
xSetClassHint disp wnd p
|
xSetClassHint disp wnd p
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,35 +277,35 @@ chooseFBConfig disp sc attr = alloca $ \n -> withArray0 (fromIntegral none) (con
|
||||||
|
|
||||||
renderType :: CInt
|
renderType :: CInt
|
||||||
renderType = (32785)
|
renderType = (32785)
|
||||||
{-# LINE 223 "GLX.chs" #-}
|
{-# LINE 223 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
rgbaBit :: CInt
|
rgbaBit :: CInt
|
||||||
rgbaBit = (1)
|
rgbaBit = (1)
|
||||||
{-# LINE 226 "GLX.chs" #-}
|
{-# LINE 226 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
drawableType :: CInt
|
drawableType :: CInt
|
||||||
drawableType = (32784)
|
drawableType = (32784)
|
||||||
{-# LINE 229 "GLX.chs" #-}
|
{-# LINE 229 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
windowBit :: CInt
|
windowBit :: CInt
|
||||||
windowBit = (1)
|
windowBit = (1)
|
||||||
{-# LINE 232 "GLX.chs" #-}
|
{-# LINE 232 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
xRenderable :: CInt
|
xRenderable :: CInt
|
||||||
xRenderable = (32786)
|
xRenderable = (32786)
|
||||||
{-# LINE 235 "GLX.chs" #-}
|
{-# LINE 235 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
doublebuffer :: CInt
|
doublebuffer :: CInt
|
||||||
doublebuffer = (5)
|
doublebuffer = (5)
|
||||||
{-# LINE 238 "GLX.chs" #-}
|
{-# LINE 238 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
depthSize :: CInt
|
depthSize :: CInt
|
||||||
depthSize = (12)
|
depthSize = (12)
|
||||||
{-# LINE 241 "GLX.chs" #-}
|
{-# LINE 241 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
stencilSize :: CInt
|
stencilSize :: CInt
|
||||||
stencilSize = (13)
|
stencilSize = (13)
|
||||||
{-# LINE 244 "GLX.chs" #-}
|
{-# LINE 244 "Bindings/GLX.hsc" #-}
|
||||||
|
|
||||||
foreign import ccall unsafe "GL/glx.h glXGetVisualFromFBConfig"
|
foreign import ccall unsafe "GL/glx.h glXGetVisualFromFBConfig"
|
||||||
glXGetVisualFromFBConfig :: Display -> FBConfig -> IO (Ptr VisualInfo)
|
glXGetVisualFromFBConfig :: Display -> FBConfig -> IO (Ptr VisualInfo)
|
||||||
|
|
7
Makefile
Normal file
7
Makefile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
all: HTanks
|
||||||
|
|
||||||
|
HTanks : Bindings/GLX.hs Bindings/GLPng.hs GLDriver.hs GLX.hs Texture.hs Tank.hs Level.hs Game.hs Render.hs HTanks.hs
|
||||||
|
ghc --make HTanks -lGL -lglpng
|
||||||
|
|
||||||
|
%.hs : %.hsc
|
||||||
|
hsc2hs $<
|
Reference in a new issue