OpenGL-3.0.3.0: A binding for the OpenGL graphics system

Copyright | (c) Sven Panne 2004-2019 Lars Corbijn 2004-2016
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 Source #

#### Instances

Instances details

GeneratableObjectName QueryObject Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObject Methods genObjectName :: MonadIO m => m QueryObject Source # genObjectNames :: MonadIO m => Int -> m [QueryObject] Source #
ObjectName QueryObject Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObject Methods isObjectName :: MonadIO m => QueryObject -> m Bool Source # deleteObjectName :: MonadIO m => QueryObject -> m () Source # deleteObjectNames :: MonadIO m => [QueryObject] -> m () Source #
CanBeLabeled QueryObject Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObject Methods objectLabel :: QueryObject -> StateVar (Maybe String) Source #
Show QueryObject Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObject Methods showsPrec :: Int -> QueryObject -> ShowS Source # show :: QueryObject -> String Source # showList :: [QueryObject] -> ShowS Source #
Eq QueryObject Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObject Methods (==) :: QueryObject -> QueryObject -> Bool Source # (/=) :: QueryObject -> QueryObject -> Bool Source #
Ord QueryObject Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.QueryObject

Methods

compare :: QueryObject -> QueryObject -> Ordering Source #

(<) :: QueryObject -> QueryObject -> Bool Source #

(<=) :: QueryObject -> QueryObject -> Bool Source #

(>) :: QueryObject -> QueryObject -> Bool Source #

(>=) :: QueryObject -> QueryObject -> Bool Source #

max :: QueryObject -> QueryObject -> QueryObject Source #

min :: QueryObject -> QueryObject -> QueryObject Source #

type QueryIndex = GLuint Source #

maxVertexStreams :: GettableStateVar QueryIndex Source #

data QueryTarget Source #

Constructors

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

#### Instances

Instances details

Show QueryTarget Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods showsPrec :: Int -> QueryTarget -> ShowS Source # show :: QueryTarget -> String Source # showList :: [QueryTarget] -> ShowS Source #
Eq QueryTarget Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods (==) :: QueryTarget -> QueryTarget -> Bool Source # (/=) :: QueryTarget -> QueryTarget -> Bool Source #
Ord QueryTarget Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.QueryObjects

Methods

compare :: QueryTarget -> QueryTarget -> Ordering Source #

(<) :: QueryTarget -> QueryTarget -> Bool Source #

(<=) :: QueryTarget -> QueryTarget -> Bool Source #

(>) :: QueryTarget -> QueryTarget -> Bool Source #

(>=) :: QueryTarget -> QueryTarget -> Bool Source #

max :: QueryTarget -> QueryTarget -> QueryTarget Source #

min :: QueryTarget -> QueryTarget -> QueryTarget Source #

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

endQuery :: QueryTarget -> IO () Source #

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

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

# Query Target Queries

currentQuery :: QueryTarget -> GettableStateVar (Maybe QueryObject) Source #

queryCounterBits :: QueryTarget -> GettableStateVar GLsizei Source #

# Query Object Queries

queryResultAvailable :: QueryObject -> GettableStateVar Bool Source #

class Storable a => QueryResult a Source #

Minimal complete definition

getQueryObjectv

#### Instances

Instances details

QueryResult GLint Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods getQueryObjectv :: GLuint -> GLenum -> Ptr GLint -> IO ()
QueryResult GLint64 Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods getQueryObjectv :: GLuint -> GLenum -> Ptr GLint64 -> IO ()
QueryResult GLuint Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods getQueryObjectv :: GLuint -> GLenum -> Ptr GLuint -> IO ()
QueryResult GLuint64 Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.QueryObjects Methods getQueryObjectv :: GLuint -> GLenum -> Ptr GLuint64 -> IO ()

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

# Time Queries

timestampQuery :: QueryObject -> IO () Source #

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

timestamp :: GettableStateVar GLuint64 Source #

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