Skip to content

Commit df5dc42

Browse files
committed
Fixed signatures of patchVertices, maxPatchVertices and maxTessellationLevel. Renamed maxTessellationLevel to maxTessGenLevel.
1 parent e59f1fd commit df5dc42

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/Graphics/Rendering/OpenGL/GL/PrimitiveMode.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ data PrimitiveMode =
8282
-- 'patchVertices' is set to a value less than or equal to zero or greater
8383
-- than the implementation-dependent maximum value 'maxPatchVertices'.
8484

85-
patchVertices :: SettableStateVar GLint
86-
patchVertices = makeSettableStateVar $ glPatchParameteri gl_PATCH_VERTICES
85+
patchVertices :: StateVar GLsizei
86+
patchVertices =
87+
makeStateVar (getSizei1 id GetMaxPatchVertices)
88+
(glPatchParameteri gl_PATCH_VERTICES . fromIntegral)
8789

8890
-- | Contains the maximumum number of vertices in a single patch.
8991

90-
maxPatchVertices :: GettableStateVar GLint
91-
maxPatchVertices = makeGettableStateVar $ getInteger1 id GetMaxPatchVertices
92+
maxPatchVertices :: GettableStateVar GLsizei
93+
maxPatchVertices = makeGettableStateVar $ getSizei1 id GetMaxPatchVertices

src/Graphics/Rendering/OpenGL/GL/QueryUtils/PName.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,9 @@ data PName1I
370370
| GetMaxVertexAttribs -- ^ sizei
371371
| GetMaxVaryingFloats -- ^ sizei
372372
-- tessellation
373-
| GetMaxPatchVertices -- ^ int
374-
| GetMaxTessellationLevel -- ^ int
373+
| GetPatchVertices -- ^ sizei
374+
| GetMaxPatchVertices -- ^ sizei
375+
| GetMaxTessGenLevel -- ^ sizei
375376
-- coordtrans
376377
| GetMatrixMode -- ^ enum
377378
| GetModelviewStackDepth -- ^ sizei
@@ -639,8 +640,9 @@ instance GetPName PName1I where
639640
GetMaxVaryingFloats -> Just gl_MAX_VARYING_COMPONENTS
640641
GetMaxVertexAttribs -> Just gl_MAX_VERTEX_ATTRIBS
641642
-- tessellation
643+
GetPatchVertices -> Just gl_PATCH_VERTICES
642644
GetMaxPatchVertices -> Just gl_MAX_PATCH_VERTICES
643-
GetMaxTessellationLevel -> Just gl_MAX_TESS_GEN_LEVEL
645+
GetMaxTessGenLevel -> Just gl_MAX_TESS_GEN_LEVEL
644646
-- coordtrans
645647
GetMatrixMode -> Just gl_MATRIX_MODE
646648
GetModelviewStackDepth -> Just gl_MODELVIEW_STACK_DEPTH

src/Graphics/Rendering/OpenGL/GL/Shaders/Limits.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Graphics.Rendering.OpenGL.GL.Shaders.Limits (
1616
maxVertexTextureImageUnits, maxTextureImageUnits,
1717
maxCombinedTextureImageUnits, maxTextureCoords, maxVertexUniformComponents,
1818
maxFragmentUniformComponents, maxVertexAttribs, maxVaryingFloats,
19-
maxTessellationLevel
19+
maxTessGenLevel
2020
) where
2121

2222
import Graphics.Rendering.OpenGL.GL.StateVar
@@ -79,8 +79,8 @@ maxVaryingFloats = getLimit GetMaxVaryingFloats
7979

8080
-- | Contains the maximum allowed tessellation level.
8181

82-
maxTessellationLevel :: GettableStateVar GLint
83-
maxTessellationLevel = makeGettableStateVar $ getInteger1 id GetMaxTessellationLevel
82+
maxTessGenLevel :: GettableStateVar GLsizei
83+
maxTessGenLevel = makeGettableStateVar $ getSizei1 id GetMaxTessGenLevel
8484

8585
getLimit :: PName1I -> GettableStateVar GLsizei
8686
getLimit = makeGettableStateVar . getSizei1 id

0 commit comments

Comments
 (0)