Skip to content

Commit

Permalink
Re-export FooFunc and makeFoo, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpanne committed Feb 19, 2015
1 parent 1993a7a commit f8c5257
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 3 deletions.
15 changes: 14 additions & 1 deletion RegistryProcessor/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,20 @@ fixedReplay api version profile registry
| otherwise = (ts', es, cs)
where (ts, es, cs) = replay api version profile registry
(_, es11, _) = replay api (read "1.1") profile registry
ts' = S.toList . S.unions $ S.fromList ts : map referencedTypes cs
ts' = S.toList . addFuncsAndMakes . S.unions $ S.fromList ts : map referencedTypes cs

-- For debug callbacks, we want to export the Haskell types and their creators, too.
addFuncsAndMakes :: S.Set TypeName -> S.Set TypeName
addFuncsAndMakes =
flip (foldr addFuncAndMake) [
"GLDEBUGPROC",
"GLDEBUGPROCAMD",
"GLDEBUGPROCARB",
"GLDEBUGPROCKHR" ]
where addFuncAndMake t ts
| TypeName t `S.member` ts =
ts `S.union` S.fromList (map TypeName [ t ++ "Func", "make" ++ t ])
| otherwise = ts

-- Here is the heart of the feature construction logic: Chronologically replay
-- the whole version history for the given API/version/profile triple.
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Compatibility43.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Compatibility43 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Compatibility43 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_2D,
gl_2_BYTES,
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Compatibility44.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Compatibility44 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Compatibility44 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_2D,
gl_2_BYTES,
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Compatibility45.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Compatibility45 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Compatibility45 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_2D,
gl_2_BYTES,
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Core43.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Core43 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Core43 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_ACTIVE_ATOMIC_COUNTER_BUFFERS,
gl_ACTIVE_ATTRIBUTES,
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Core44.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Core44 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Core44 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_ACTIVE_ATOMIC_COUNTER_BUFFERS,
gl_ACTIVE_ATTRIBUTES,
Expand Down
2 changes: 2 additions & 0 deletions src/Graphics/Rendering/OpenGL/Raw/Core45.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
module Graphics.Rendering.OpenGL.Raw.Core45 (
-- * Types
GLDEBUGPROC,
GLDEBUGPROCFunc,
GLbitfield,
GLboolean,
GLbyte,
Expand All @@ -35,6 +36,7 @@ module Graphics.Rendering.OpenGL.Raw.Core45 (
GLuint64,
GLushort,
GLvoid,
makeGLDEBUGPROC,
-- * Enums
gl_ACTIVE_ATOMIC_COUNTER_BUFFERS,
gl_ACTIVE_ATTRIBUTES,
Expand Down
14 changes: 12 additions & 2 deletions src/Graphics/Rendering/OpenGL/Raw/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ module Graphics.Rendering.OpenGL.Raw.Types (
GLhalfARB,
GLhalfNV,
GLDEBUGPROCAMD, GLDEBUGPROCAMDFunc, makeGLDEBUGPROCAMD,
GLDEBUGPROCARB,
GLDEBUGPROCKHR,
GLDEBUGPROCARB, GLDEBUGPROCARBFunc, makeGLDEBUGPROCARB,
GLDEBUGPROCKHR, GLDEBUGPROCKHRFunc, makeGLDEBUGPROCKHR,

-- * Types from various extensions.
GLclampx,
Expand Down Expand Up @@ -208,8 +208,18 @@ foreign import CALLCONV "wrapper"

type GLDEBUGPROCARB = GLDEBUGPROC

type GLDEBUGPROCARBFunc = GLDEBUGPROCFunc

makeGLDEBUGPROCARB :: GLDEBUGPROCARBFunc -> IO (FunPtr GLDEBUGPROCARBFunc)
makeGLDEBUGPROCARB = makeGLDEBUGPROC

type GLDEBUGPROCKHR = GLDEBUGPROC

type GLDEBUGPROCKHRFunc = GLDEBUGPROCFunc

makeGLDEBUGPROCKHR :: GLDEBUGPROCKHRFunc -> IO (FunPtr GLDEBUGPROCKHRFunc)
makeGLDEBUGPROCKHR = makeGLDEBUGPROC

type GLclampx = CInt
-- NOTE: OpenGL ES uses khronos_int32_t for this.

Expand Down

0 comments on commit f8c5257

Please sign in to comment.