Graphics.Rendering.OpenGL.GL.QueryObjects

OpenGL-2.13.1.0: A binding for the OpenGL graphics system

Copyright | (c) Sven Panne, Lars Corbijn 2004-2013
License | BSD3
Maintainer | Sven Panne <svenpanne@gmail.com>
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell2010

Graphics.Rendering.OpenGL.GL.QueryObjects

Contents

- Creating and Delimiting Queries
- Query Target Queries
- Query Object Queries
- Time Queries

Description

This module corresponds to section 4.2 (Query Objects and Asynchronous Queries) of the OpenGL 4.4 specs.

Synopsis

- data QueryObject
- type QueryIndex = GLuint
- maxVertexStreams :: GettableStateVar QueryIndex
- data QueryTarget
  - = SamplesPassed
  - | AnySamplesPassed
  - | AnySamplesPassedConservative
  - | TimeElapsed
  - | PrimitivesGenerated QueryIndex
  - | TransformFeedbackPrimitivesWritten QueryIndex
- beginQuery :: QueryTarget -> QueryObject -> IO ()
- endQuery :: QueryTarget -> IO ()
- withQuery :: QueryTarget -> QueryObject -> IO a -> IO a
- currentQuery :: QueryTarget -> GettableStateVar (Maybe QueryObject)
- queryCounterBits :: QueryTarget -> GettableStateVar GLsizei
- queryResultAvailable :: QueryObject -> GettableStateVar Bool
- class Storable a => QueryResult a
- queryResult :: QueryResult a => QueryObject -> GettableStateVar a
- timestampQuery :: QueryObject -> IO ()
- timestamp :: GettableStateVar GLuint64

# Creating and Delimiting Queries

data QueryObject

Instances

Eq QueryObject |
Ord QueryObject |
Show QueryObject |
ObjectName QueryObject |
GeneratableObjectName QueryObject |
CanBeLabeled QueryObject |

type QueryIndex = GLuint

maxVertexStreams :: GettableStateVar QueryIndex

data QueryTarget

Constructors

SamplesPassed |
AnySamplesPassed |
AnySamplesPassedConservative |
TimeElapsed |
PrimitivesGenerated QueryIndex |
TransformFeedbackPrimitivesWritten QueryIndex |

Instances

Eq QueryTarget |
Ord QueryTarget |
Show QueryTarget |

beginQuery :: QueryTarget -> QueryObject -> IO ()

endQuery :: QueryTarget -> IO ()

withQuery :: QueryTarget -> QueryObject -> IO a -> IO a

Convenience function for an exception-safe combination of `beginQuery` and `endQuery`.

# Query Target Queries

currentQuery :: QueryTarget -> GettableStateVar (Maybe QueryObject)

queryCounterBits :: QueryTarget -> GettableStateVar GLsizei

# Query Object Queries

queryResultAvailable :: QueryObject -> GettableStateVar Bool

class Storable a => QueryResult a

Minimal complete definition

getQueryObjectv

Instances

QueryResult GLint |
QueryResult GLuint |
QueryResult GLint64 |
QueryResult GLuint64 |

queryResult :: QueryResult a => QueryObject -> GettableStateVar a

# Time Queries

timestampQuery :: QueryObject -> IO ()

Record the time after all previous commands on the GL client and server state and the framebuffer have been fully realized

timestamp :: GettableStateVar GLuint64

Contains the GL time after all previous commands have reached the GL server but have not yet necessarily executed.