Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Methods
- beginGl
- checkExtension
- clear'
- clipEnsure
- clipPop
- clipPush
- clipPushRectangle
- clipPushWindowRect
- clipPushWindowRectangle
- clipStackRestore
- clipStackSave
- clutterCheckExtensionCLUTTER
- clutterWinsysHasFeatureCLUTTER
- createProgram
- createShader
- debugMatrixPrint
- disableFog
- doubleToInt
- doubleToUint
- endGl
- featuresAvailable
- flush
- frustum
- getBackfaceCullingEnabled
- getBitmasks
- getDepthTestEnabled
- getFeatures
- getModelviewMatrix
- getOptionGroup
- getProjectionMatrix
- getSource
- getViewport
- gtypeMatrixGetType
- handleGetType
- handleRef
- handleUnref
- isBitmap
- isMaterial
- isOffscreen
- isProgram
- isShader
- isTexture
- isVertexBuffer
- isVertexBufferIndices
- onscreenClutterBackendSetSizeCLUTTER
- ortho
- perspective
- polygon
- popDrawBuffer
- popFramebuffer
- popMatrix
- popSource
- programAttachShader
- programGetUniformLocation
- programLink
- programRef
- programSetUniform1f
- programSetUniform1i
- programSetUniformFloat
- programSetUniformInt
- programSetUniformMatrix
- programUniform1f
- programUniform1i
- programUniformFloat
- programUniformInt
- programUniformMatrix
- programUnref
- programUse
- pushDrawBuffer
- pushMatrix
- pushSource
- readPixels
- rectangle
- rectangleWithMultitextureCoords
- rectangleWithTextureCoords
- rectangles
- rectanglesWithTextureCoords
- rotate
- scale
- setBackfaceCullingEnabled
- setDepthTestEnabled
- setDrawBuffer
- setFog
- setModelviewMatrix
- setProjectionMatrix
- setSource
- setSourceColor
- setSourceColor4f
- setSourceColor4ub
- setSourceTexture
- setViewport
- shaderCompile
- shaderGetInfoLog
- shaderGetType
- shaderIsCompiled
- shaderRef
- shaderSource
- shaderUnref
- sqrti
- transform
- translate
- vertexBufferAdd
- vertexBufferDelete
- vertexBufferDisable
- vertexBufferDraw
- vertexBufferDrawElements
- vertexBufferEnable
- vertexBufferGetNVertices
- vertexBufferIndicesGetForQuads
- vertexBufferIndicesGetType
- vertexBufferNew
- vertexBufferRef
- vertexBufferSubmit
- vertexBufferUnref
- viewport
Synopsis
- beginGl :: (HasCallStack, MonadIO m) => m ()
- checkExtension :: (HasCallStack, MonadIO m) => Text -> Text -> m Int32
- clear' :: (HasCallStack, MonadIO m) => Color -> CULong -> m ()
- clipEnsure :: (HasCallStack, MonadIO m) => m ()
- clipPop :: (HasCallStack, MonadIO m) => m ()
- clipPush :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- clipPushRectangle :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- clipPushWindowRect :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- clipPushWindowRectangle :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> Int32 -> m ()
- clipStackRestore :: (HasCallStack, MonadIO m) => m ()
- clipStackSave :: (HasCallStack, MonadIO m) => m ()
- clutterCheckExtensionCLUTTER :: (HasCallStack, MonadIO m) => Text -> Text -> m Int32
- clutterWinsysHasFeatureCLUTTER :: (HasCallStack, MonadIO m) => WinsysFeature -> m Int32
- createProgram :: (HasCallStack, MonadIO m) => m (Ptr ())
- createShader :: (HasCallStack, MonadIO m) => ShaderType -> m (Ptr ())
- debugMatrixPrint :: (HasCallStack, MonadIO m) => Matrix -> m ()
- disableFog :: (HasCallStack, MonadIO m) => m ()
- doubleToInt :: (HasCallStack, MonadIO m) => Double -> m Int32
- doubleToUint :: (HasCallStack, MonadIO m) => Double -> m Word32
- endGl :: (HasCallStack, MonadIO m) => m ()
- featuresAvailable :: (HasCallStack, MonadIO m) => [FeatureFlags] -> m Int32
- flush :: (HasCallStack, MonadIO m) => m ()
- frustum :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> Float -> Float -> m ()
- getBackfaceCullingEnabled :: (HasCallStack, MonadIO m) => m Int32
- getBitmasks :: (HasCallStack, MonadIO m) => m (Int32, Int32, Int32, Int32)
- getDepthTestEnabled :: (HasCallStack, MonadIO m) => m Int32
- getFeatures :: (HasCallStack, MonadIO m) => m [FeatureFlags]
- getModelviewMatrix :: (HasCallStack, MonadIO m) => m Matrix
- getOptionGroup :: (HasCallStack, MonadIO m) => m OptionGroup
- getProjectionMatrix :: (HasCallStack, MonadIO m) => m Matrix
- getSource :: (HasCallStack, MonadIO m) => m (Ptr ())
- getViewport :: (HasCallStack, MonadIO m) => m [Float]
- gtypeMatrixGetType :: (HasCallStack, MonadIO m) => m GType
- handleGetType :: (HasCallStack, MonadIO m) => m GType
- handleRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- handleUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- isBitmap :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isMaterial :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isOffscreen :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isProgram :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isShader :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isTexture :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isVertexBuffer :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- isVertexBufferIndices :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- onscreenClutterBackendSetSizeCLUTTER :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> m ()
- ortho :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> Float -> Float -> m ()
- perspective :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- polygon :: (HasCallStack, MonadIO m) => TextureVertex -> Word32 -> Int32 -> m ()
- popDrawBuffer :: (HasCallStack, MonadIO m) => m ()
- popFramebuffer :: (HasCallStack, MonadIO m) => m ()
- popMatrix :: (HasCallStack, MonadIO m) => m ()
- popSource :: (HasCallStack, MonadIO m) => m ()
- programAttachShader :: (HasCallStack, MonadIO m) => Ptr () -> Ptr () -> m ()
- programGetUniformLocation :: (HasCallStack, MonadIO m) => Ptr () -> Text -> m Int32
- programLink :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- programRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- programSetUniform1f :: (HasCallStack, MonadIO m) => Ptr () -> Int32 -> Float -> m ()
- programSetUniform1i :: (HasCallStack, MonadIO m) => Ptr () -> Int32 -> Int32 -> m ()
- programSetUniformFloat :: (HasCallStack, MonadIO m) => Ptr () -> Int32 -> Int32 -> [Float] -> m ()
- programSetUniformInt :: (HasCallStack, MonadIO m) => Ptr () -> Int32 -> Int32 -> [Int32] -> m ()
- programSetUniformMatrix :: (HasCallStack, MonadIO m) => Ptr () -> Int32 -> Int32 -> Int32 -> [Float] -> m ()
- programUniform1f :: (HasCallStack, MonadIO m) => Int32 -> Float -> m ()
- programUniform1i :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> m ()
- programUniformFloat :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> [Float] -> m ()
- programUniformInt :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> [Int32] -> m ()
- programUniformMatrix :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> [Float] -> m ()
- programUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- programUse :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- pushDrawBuffer :: (HasCallStack, MonadIO m) => m ()
- pushMatrix :: (HasCallStack, MonadIO m) => m ()
- pushSource :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- readPixels :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> Int32 -> [ReadPixelsFlags] -> PixelFormat -> Word8 -> m ()
- rectangle :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- rectangleWithMultitextureCoords :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> [Float] -> Int32 -> m ()
- rectangleWithTextureCoords :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> m ()
- rectangles :: (HasCallStack, MonadIO m) => [Float] -> Word32 -> m ()
- rectanglesWithTextureCoords :: (HasCallStack, MonadIO m) => [Float] -> Word32 -> m ()
- rotate :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- scale :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> m ()
- setBackfaceCullingEnabled :: (HasCallStack, MonadIO m) => Int32 -> m ()
- setDepthTestEnabled :: (HasCallStack, MonadIO m) => Int32 -> m ()
- setDrawBuffer :: (HasCallStack, MonadIO m) => [BufferTarget] -> Ptr () -> m ()
- setFog :: (HasCallStack, MonadIO m) => Color -> FogMode -> Float -> Float -> Float -> m ()
- setModelviewMatrix :: (HasCallStack, MonadIO m) => Matrix -> m ()
- setProjectionMatrix :: (HasCallStack, MonadIO m) => Matrix -> m ()
- setSource :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- setSourceColor :: (HasCallStack, MonadIO m) => Color -> m ()
- setSourceColor4f :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m ()
- setSourceColor4ub :: (HasCallStack, MonadIO m) => Word8 -> Word8 -> Word8 -> Word8 -> m ()
- setSourceTexture :: (HasCallStack, MonadIO m, IsTexture a) => a -> m ()
- setViewport :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> Int32 -> m ()
- shaderCompile :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- shaderGetInfoLog :: (HasCallStack, MonadIO m) => Ptr () -> m Text
- shaderGetType :: (HasCallStack, MonadIO m) => Ptr () -> m ShaderType
- shaderIsCompiled :: (HasCallStack, MonadIO m) => Ptr () -> m Int32
- shaderRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- shaderSource :: (HasCallStack, MonadIO m) => Ptr () -> Text -> m ()
- shaderUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- sqrti :: (HasCallStack, MonadIO m) => Int32 -> m Int32
- transform :: (HasCallStack, MonadIO m) => Matrix -> m ()
- translate :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> m ()
- vertexBufferAdd :: (HasCallStack, MonadIO m) => Ptr () -> Text -> Word8 -> AttributeType -> Int32 -> Word16 -> Ptr () -> m ()
- vertexBufferDelete :: (HasCallStack, MonadIO m) => Ptr () -> Text -> m ()
- vertexBufferDisable :: (HasCallStack, MonadIO m) => Ptr () -> Text -> m ()
- vertexBufferDraw :: (HasCallStack, MonadIO m) => Ptr () -> VerticesMode -> Int32 -> Int32 -> m ()
- vertexBufferDrawElements :: (HasCallStack, MonadIO m) => Ptr () -> VerticesMode -> Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- vertexBufferEnable :: (HasCallStack, MonadIO m) => Ptr () -> Text -> m ()
- vertexBufferGetNVertices :: (HasCallStack, MonadIO m) => Ptr () -> m Word32
- vertexBufferIndicesGetForQuads :: (HasCallStack, MonadIO m) => Word32 -> m (Ptr ())
- vertexBufferIndicesGetType :: (HasCallStack, MonadIO m) => Ptr () -> m IndicesType
- vertexBufferNew :: (HasCallStack, MonadIO m) => Word32 -> m (Ptr ())
- vertexBufferRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- vertexBufferSubmit :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- vertexBufferUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- viewport :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> m ()
Methods
beginGl
beginGl :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)Use the CoglGLES2Context
api instead
We do not advise nor reliably support the interleaving of raw GL drawing and
Cogl drawing functions, but if you insist, beginGl
and endGl
provide a simple mechanism that may at least give you a fighting chance of
succeeding.
Note: this doesn't help you modify the behaviour of Cogl drawing functions through the modification of GL state; that will never be reliably supported, but if you are trying to do something like:
{ - setup some OpenGL state. - draw using OpenGL (e.g. glDrawArrays() ) - reset modified OpenGL state. - continue using Cogl to draw }
You should surround blocks of drawing using raw GL with beginGl
and endGl
:
{ cogl_begin_gl (); - setup some OpenGL state. - draw using OpenGL (e.g. glDrawArrays() ) - reset modified OpenGL state. cogl_end_gl (); - continue using Cogl to draw }
Don't ever try and do:
{ - setup some OpenGL state. - use Cogl to draw - reset modified OpenGL state. }
When the internals of Cogl evolves, this is very liable to break.
This function will flush all batched primitives, and subsequently flush all internal Cogl state to OpenGL as if it were going to draw something itself.
The result is that the OpenGL modelview matrix will be setup; the state corresponding to the current source material will be set up and other world state such as backface culling, depth and fogging enabledness will be sent to OpenGL.
<note>No special material state is flushed, so if you want Cogl to setup a
simplified material state it is your responsibility to set a simple source
material before calling beginGl
. E.g. by calling
setSourceColor4ub
.</note>
<note>It is your responsibility to restore any OpenGL state that you modify
to how it was after calling beginGl
if you don't do this then the
result of further Cogl calls is undefined.</note>
<note>You can not nest begin/end blocks.</note>
Again we would like to stress, we do not advise the use of this API and if possible we would prefer to improve Cogl than have developers require raw OpenGL.
Since: 1.0
checkExtension
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.2)OpenGL is an implementation detail for Cogl and so it's not appropriate to expose OpenGL extensions through the Cogl API. This function can be replaced by the following equivalent code:|[ CoglBool retval = (strstr (ext, name) != NULL) ? TRUE : FALSE;]|
Check whether name
occurs in list of extensions in ext
.
clear'
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> CULong |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_framebuffer_clear()
api instead
Clears all the auxiliary buffers identified in the buffers
mask, and if
that includes the color buffer then the specified color
is used.
clipEnsure
clipEnsure :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.2)Calling this function has no effect
Ensures that the current clipping region has been set in GL. This will automatically be called before any Cogl primitives but it maybe be neccessary to call if you are using raw GL calls with clipping.
Since: 1.0
clipPop
clipPop :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)Use cogl_framebuffer_pop_clip()
instead
Reverts the clipping region to the state before the last call to
clipPush
.
clipPush
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)The x, y, width, height arguments are inconsistent with other API that specify rectangles in model space, and when used with a coordinate space that puts the origin at the center and y+ extending up, it's awkward to use. Please use cogl_framebuffer_push_rectangle_clip()
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call clipPop
.
clipPushRectangle
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_framebuffer_push_rectangle_clip()
instead
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call clipPop
.
Since: 1.2
clipPushWindowRect
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_framebuffer_push_scissor_clip()
instead
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call clipPop
.
clipPushWindowRectangle
clipPushWindowRectangle Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_framebuffer_push_scissor_clip()
instead
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call clipPop
.
Since: 1.2
clipStackRestore
clipStackRestore :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.2)This was originally added to allow us to restore the clip stack when switching back from an offscreen framebuffer, but it's not necessary anymore given that framebuffers now own separate clip stacks which will be automatically switched between when a new buffer is set. Calling this function has no effect
Restore the state of the clipping stack that was previously saved
by clipStackSave
.
Since: 0.8.2
clipStackSave
clipStackSave :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.2)This was originally added to allow us to save the clip stack when switching to an offscreen framebuffer, but it's not necessary anymore given that framebuffers now own separate clip stacks which will be automatically switched between when a new buffer is set. Calling this function has no effect
Save the entire state of the clipping stack and then clear all
clipping. The previous state can be returned to with
clipStackRestore
. Each call to clipPush
after this
must be matched by a call to clipPop
before calling
clipStackRestore
.
Since: 0.8.2
clutterCheckExtensionCLUTTER
clutterCheckExtensionCLUTTER :: (HasCallStack, MonadIO m) => Text -> Text -> m Int32 Source #
No description available in the introspection data.
clutterWinsysHasFeatureCLUTTER
clutterWinsysHasFeatureCLUTTER :: (HasCallStack, MonadIO m) => WinsysFeature -> m Int32 Source #
No description available in the introspection data.
createProgram
:: (HasCallStack, MonadIO m) | |
=> m (Ptr ()) | Returns: a new cogl program. |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code.
createShader
:: (HasCallStack, MonadIO m) | |
=> ShaderType |
|
-> m (Ptr ()) | Returns: a new shader handle. |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Create a new shader handle, use shaderSource
to set the
source code to be used on it.
debugMatrixPrint
:: (HasCallStack, MonadIO m) | |
=> Matrix |
|
-> m () |
Prints the contents of a Matrix
to stdout.
Since: 2.0
disableFog
disableFog :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)Use CoglSnippet
shader api for fog
This function disables fogging, so primitives drawn afterwards will not be blended with any previously set fog color.
doubleToInt
doubleToInt :: (HasCallStack, MonadIO m) => Double -> m Int32 Source #
No description available in the introspection data.
doubleToUint
doubleToUint :: (HasCallStack, MonadIO m) => Double -> m Word32 Source #
No description available in the introspection data.
endGl
endGl :: (HasCallStack, MonadIO m) => m () Source #
featuresAvailable
:: (HasCallStack, MonadIO m) | |
=> [FeatureFlags] |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.10)Use cogl_has_feature()
instead
Checks whether the given COGL features are available. Multiple
features can be checked for by or-ing them together with the '|'
operator. True
is only returned if all of the requested features
are available.
flush
flush :: (HasCallStack, MonadIO m) => m () Source #
This function should only need to be called in exceptional circumstances.
As an optimization Cogl drawing functions may batch up primitives internally, so if you are trying to use raw GL outside of Cogl you stand a better chance of being successful if you ask Cogl to flush any batched geometry before making your state changes.
It only ensure that the underlying driver is issued all the commands necessary to draw the batched primitives. It provides no guarantees about when the driver will complete the rendering.
This provides no guarantees about the GL state upon returning and to avoid confusing Cogl you should aim to restore any changes you make before resuming use of Cogl.
If you are making state changes with the intention of affecting Cogl drawing primitives you are 100% on your own since you stand a good chance of conflicting with Cogl internals. For example clutter-gst which currently uses direct GL calls to bind ARBfp programs will very likely break when Cogl starts to use ARBfb programs itself for the material API.
Since: 1.0
frustum
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_frustum()
instead
Replaces the current projection matrix with a perspective matrix for a given viewing frustum defined by 4 side clip planes that all cross through the origin and 2 near and far clip planes.
Since: 0.8.2
getBackfaceCullingEnabled
getBackfaceCullingEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_cull_face_mode()
instead
Queries if backface culling has been enabled via
setBackfaceCullingEnabled
getBitmasks
getBitmasks :: (HasCallStack, MonadIO m) => m (Int32, Int32, Int32, Int32) Source #
Deprecated: (Since version 1.8)Use cogl_framebuffer_get_red/green/blue/alpha_bits()
instead
Gets the number of bitplanes used for each of the color components
in the color buffer. Pass Nothing
for any of the arguments if the
value is not required.
getDepthTestEnabled
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_depth_state()
instead
Queries if depth testing has been enabled via cogl_set_depth_test_enable()
getFeatures
:: (HasCallStack, MonadIO m) | |
=> m [FeatureFlags] | Returns: A logical OR of all the supported COGL features. |
Deprecated: (Since version 1.10)Use cogl_foreach_feature()
instead
Returns all of the features supported by COGL.
Since: 0.8
getModelviewMatrix
getModelviewMatrix :: (HasCallStack, MonadIO m) => m Matrix Source #
Deprecated: (Since version 1.10)Use cogl_framebuffer_get_modelview_matrix()
instead
Stores the current model-view matrix in matrix
.
getOptionGroup
:: (HasCallStack, MonadIO m) | |
=> m OptionGroup | Returns: a |
Deprecated: (Since version 1.16)Not replaced
Retrieves the OptionGroup
used by Cogl to parse the command
line options. Clutter uses this to handle the Cogl command line
options during its initialization process.
Since: 1.0
getProjectionMatrix
getProjectionMatrix :: (HasCallStack, MonadIO m) => m Matrix Source #
Deprecated: (Since version 1.10)Use cogl_framebuffer_get_projection_matrix()
instead
Stores the current projection matrix in matrix
.
getSource
:: (HasCallStack, MonadIO m) | |
=> m (Ptr ()) | Returns: The current source material. |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
Returns the current source material as previously set using
setSource
.
<note>You should typically consider the returned material immutable and not try to change any of its properties unless you own a reference to that material. At times you may be able to get a reference to an internally managed materials and the result of modifying such materials is undefined.</note>
Since: 1.6
getViewport
getViewport :: (HasCallStack, MonadIO m) => m [Float] Source #
Deprecated: (Since version 1.10)Use cogl_framebuffer_get_viewport4fv()
instead
Stores the current viewport in v
. v
[0] and v
[1] get the x and y
position of the viewport and v
[2] and v
[3] get the width and
height.
gtypeMatrixGetType
:: (HasCallStack, MonadIO m) | |
=> m GType | Returns: the GType for the registered "CoglMatrix" boxed type. This
can be used for example to define GObject properties that accept a
|
Deprecated: (Since version 1.18)Use cogl_matrix_get_gtype()
instead.
No description available in the introspection data.
handleGetType
handleGetType :: (HasCallStack, MonadIO m) => m GType Source #
No description available in the introspection data.
handleRef
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: the handle, with its reference count increased |
Increases the reference count of handle
by 1
handleUnref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Drecreases the reference count of handle
by 1; if the reference
count reaches 0, the resources allocated by handle
will be freed
isBitmap
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Checks whether object
is a Bitmap
Since: 1.0
isMaterial
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_is_pipeline()
instead
Gets whether the given handle references an existing material object.
isOffscreen
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Determines whether the given CoglObject
references an offscreen
framebuffer object.
isProgram
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Gets whether the given handle references an existing program object.
isShader
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Gets whether the given handle references an existing shader object.
isTexture
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Gets whether the given object references a texture object.
isVertexBuffer
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Checks whether handle
is a Vertex Buffer Object
Since: 1.0
isVertexBufferIndices
isVertexBufferIndices Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Checks whether handle
is a handle to the indices for a vertex
buffer object
Since: 1.4
onscreenClutterBackendSetSizeCLUTTER
onscreenClutterBackendSetSizeCLUTTER :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> m () Source #
No description available in the introspection data.
ortho
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_orthographic()
instead
Replaces the current projection matrix with an orthographic projection matrix. See <xref linkend="cogl-ortho-matrix"/> to see how the matrix is calculated.
<figure id="cogl-ortho-matrix"> <title></title> <graphic fileref="cogl_ortho.png" format="PNG"/> </figure>
<note>This function copies the arguments from OpenGL's glOrtho()
even
though they are unnecessarily confusing due to the z near and z far
arguments actually being a "distance" from the origin, where
negative values are behind the viewer, instead of coordinates for
the z clipping planes which would have been consistent with the
left, right bottom and top arguments.</note>
Since: 1.0
perspective
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_perspective()
instead
Replaces the current projection matrix with a perspective matrix based on the provided values.
<note>You should be careful not to have to great a zFar
/ zNear
ratio since that will reduce the effectiveness of depth testing
since there wont be enough precision to identify the depth of
objects near to each other.</note>
polygon
:: (HasCallStack, MonadIO m) | |
=> TextureVertex |
|
-> Word32 |
|
-> Int32 |
|
-> m () |
Draws a convex polygon using the current source material to fill / texture with according to the texture coordinates passed.
If useColor
is True
then the color will be changed for each vertex using
the value specified in the color member of TextureVertex
. This can be
used for example to make the texture fade out by setting the alpha value of
the color.
All of the texture coordinates must be in the range [0,1] and repeating the texture is not supported.
Because of the way this function is implemented it will currently only work if either the texture is not sliced or the backend is not OpenGL ES and the minifying and magnifying functions are both set to COGL_MATERIAL_FILTER_NEAREST.
Since: 1.0
popDrawBuffer
popDrawBuffer :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)The latest drawing apis take explicit CoglFramebuffer
arguments so this stack of framebuffers shouldn't be used anymore.
Restore setDrawBuffer
state.
popFramebuffer
popFramebuffer :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)The latest drawing apis take explicit CoglFramebuffer
arguments so this stack of framebuffers shouldn't be used anymore.
Restores the framebuffer that was previously at the top of the stack. All subsequent drawing will be redirected to this framebuffer.
Since: 1.2
popMatrix
popMatrix :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.10)Use cogl_framebuffer_pop_matrix()
instead
Restores the current model-view matrix from the matrix stack.
popSource
popSource :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
Removes the material at the top of the source stack. The material
at the top of this stack defines the GPU state used to process
later primitives as defined by setSource
.
Since: 1.6
programAttachShader
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Attaches a shader to a program object. A program can have multiple
vertex or fragment shaders but only one of them may provide a
main()
function. It is allowed to use a program with only a vertex
shader or only a fragment shader.
programGetUniformLocation
programGetUniformLocation Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> m Int32 | Returns: the offset of a uniform in a specified program.
This uniform can be set using |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Retrieve the location (offset) of a uniform variable in a shader program, a uniform is a variable that is constant for all vertices/fragments for a shader object and is possible to modify as an external parameter.
programLink
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Links a program making it ready for use. Note that calling this function is optional. If it is not called the program will automatically be linked the first time it is used.
programRef
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Add an extra reference to a program.
programSetUniform1f
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Int32 |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Changes the value of a floating point uniform for the given linked
program
.
Since: 1.4
programSetUniform1i
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Changes the value of an integer uniform for the given linked
program
.
Since: 1.4
programSetUniformFloat
programSetUniformFloat Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Int32 |
|
-> Int32 |
|
-> [Float] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Changes the value of a float vector uniform, or uniform array for
the given linked program
.
Since: 1.4
programSetUniformInt
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Int32 |
|
-> Int32 |
|
-> [Int32] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Changes the value of a int vector uniform, or uniform array for
the given linked program
.
Since: 1.4
programSetUniformMatrix
programSetUniformMatrix Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> [Float] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead
Changes the value of a matrix uniform, or uniform array in the
given linked program
.
Since: 1.4
programUniform1f
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Changes the value of a floating point uniform in the currently
used (see programUse
) shader program.
programUniform1i
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Changes the value of an integer uniform in the currently
used (see programUse
) shader program.
programUniformFloat
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> [Float] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Changes the value of a float vector uniform, or uniform array in the
currently used (see programUse
) shader program.
programUniformInt
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> [Int32] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Changes the value of a int vector uniform, or uniform array in the
currently used (see programUse
) shader program.
programUniformMatrix
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> [Float] |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Changes the value of a matrix uniform, or uniform array in the
currently used (see programUse
) shader program. The size
parameter is used to determine the square size of the matrix.
programUnref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Removes a reference to a program. If it was the last reference the program object will be destroyed.
programUse
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Activate a specific shader program replacing that part of the GL
rendering pipeline, if passed in COGL_INVALID_HANDLE
the default
behavior of GL is reinstated.
This function affects the global state of the current Cogl
context. It is much more efficient to attach the shader to a
specific material used for rendering instead by calling
materialSetUserProgram
.
pushDrawBuffer
pushDrawBuffer :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.16)The latest drawing apis take explicit CoglFramebuffer
arguments so this stack of framebuffers shouldn't be used anymore.
Save setDrawBuffer
state.
pushMatrix
pushMatrix :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.10)Use cogl_framebuffer_push_matrix()
instead
Stores the current model-view matrix on the matrix stack. The matrix
can later be restored with popMatrix
.
pushSource
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
Pushes the given material
to the top of the source stack. The
material at the top of this stack defines the GPU state used to
process later primitives as defined by setSource
.
Since: 1.6
readPixels
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> [ReadPixelsFlags] |
|
-> PixelFormat |
|
-> Word8 |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_framebuffer_read_pixels()
instead
This reads a rectangle of pixels from the current framebuffer where position (0, 0) is the top left. The pixel at (x, y) is the first read, and the data is returned with a rowstride of (width * 4).
Currently Cogl assumes that the framebuffer is in a premultiplied
format so if format
is non-premultiplied it will convert it. To
read the pixel values without any conversion you should either
specify a format that doesn't use an alpha channel or use one of
the formats ending in PRE.
rectangle
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Fills a rectangle at the given coordinates with the current source material
rectangleWithMultitextureCoords
rectangleWithMultitextureCoords Source #
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> [Float] |
|
-> Int32 |
|
-> m () |
This function draws a rectangle using the current source material to texture or fill with. As a material may contain multiple texture layers this interface lets you supply texture coordinates for each layer of the material.
The first pair of coordinates are for the first layer (with the smallest layer index) and if you supply less texture coordinates than there are layers in the current source material then default texture coordinates (0.0, 0.0, 1.0, 1.0) are generated.
Since: 1.0
rectangleWithTextureCoords
rectangleWithTextureCoords Source #
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Draw a rectangle using the current material and supply texture coordinates
to be used for the first texture layer of the material. To draw the entire
texture pass in tx1
=0.0 ty1
=0.0 tx2
=1.0 ty2
=1.0.
Since: 1.0
rectangles
:: (HasCallStack, MonadIO m) | |
=> [Float] |
|
-> Word32 |
|
-> m () |
Draws a series of rectangles in the same way that
rectangle
does. In some situations it can give a
significant performance boost to use this function rather than
calling rectangle
separately for each rectangle.
verts
should point to an array of float
s with
nRects
* 4 elements. Each group of 4 values corresponds to the
parameters x1, y1, x2, and y2, and have the same
meaning as in rectangle
.
Since: 1.0
rectanglesWithTextureCoords
rectanglesWithTextureCoords Source #
:: (HasCallStack, MonadIO m) | |
=> [Float] |
|
-> Word32 |
|
-> m () |
Draws a series of rectangles in the same way that
rectangleWithTextureCoords
does. In some situations it can give a
significant performance boost to use this function rather than
calling rectangleWithTextureCoords
separately for each rectangle.
verts
should point to an array of float
s with
nRects
* 8 elements. Each group of 8 values corresponds to the
parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same
meaning as in rectangleWithTextureCoords
.
Since: 0.8.6
rotate
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_rotate()
instead
Multiplies the current model-view matrix by one that rotates the
model around the vertex specified by x
, y
and z
. The rotation
follows the right-hand thumb rule so for example rotating by 10
degrees about the vertex (0, 0, 1) causes a small counter-clockwise
rotation.
scale
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_pop_matrix()
instead
Multiplies the current model-view matrix by one that scales the x, y and z axes by the given values.
setBackfaceCullingEnabled
setBackfaceCullingEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_cull_face_mode()
instead
Sets whether textures positioned so that their backface is showing should be hidden. This can be used to efficiently draw two-sided textures or fully closed cubes without enabling depth testing. This only affects calls to the cogl_rectangle* family of functions and cogl_vertex_buffer_draw*. Backface culling is disabled by default.
setDepthTestEnabled
:: (HasCallStack, MonadIO m) | |
=> Int32 | |
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_depth_state()
instead
Sets whether depth testing is enabled. If it is disabled then the
order that actors are layered on the screen depends solely on the
order specified using clutter_actor_raise()
and
clutter_actor_lower()
, otherwise it will also take into account the
actor's depth. Depth testing is disabled by default.
setDrawBuffer
:: (HasCallStack, MonadIO m) | |
=> [BufferTarget] |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)The latest drawing apis take explicit CoglFramebuffer
arguments so this stack of framebuffers shouldn't be used anymore.
Redirects all subsequent drawing to the specified framebuffer. This can either be an offscreen buffer created with cogl_offscreen_new_to_texture () or you can revert to your original on screen window buffer.
setFog
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> FogMode |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
shader api for fog
Enables fogging. Fogging causes vertices that are further away from the eye
to be rendered with a different color. The color is determined according to
the chosen fog mode; at it's simplest the color is linearly interpolated so
that vertices at zNear
are drawn fully with their original color and
vertices at zFar
are drawn fully with fogColor
. Fogging will remain
enabled until you call disableFog
.
<note>The fogging functions only work correctly when primitives use
unmultiplied alpha colors. By default Cogl will premultiply textures
and setSourceColor
will premultiply colors, so unless you
explicitly load your textures requesting an unmultiplied internal format
and use materialSetColor
you can only use fogging with fully
opaque primitives. This might improve in the future when we can depend
on fragment shaders.</note>
setModelviewMatrix
:: (HasCallStack, MonadIO m) | |
=> Matrix |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_set_modelview_matrix()
instead
Loads matrix
as the new model-view matrix.
setProjectionMatrix
:: (HasCallStack, MonadIO m) | |
=> Matrix |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_set_projection_matrix()
instead
Loads matrix as the new projection matrix.
setSource
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
This function changes the material at the top of the source stack.
The material at the top of this stack defines the GPU state used to
process subsequent primitives, such as rectangles drawn with
rectangle
or vertices drawn using vertexBufferDraw
.
Since: 1.0
setSourceColor
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
This is a convenience function for creating a solid fill source material from the given color. This color will be used for any subsequent drawing operation.
The color will be premultiplied by Cogl, so the color should be non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for semi-transparent red.
See also setSourceColor4ub
and setSourceColor4f
if you already have the color components.
Since: 1.0
setSourceColor4f
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
This is a convenience function for creating a solid fill source material from the given color using normalized values for each component. This color will be used for any subsequent drawing operation.
The value for each component is a fixed point number in the range
between 0 and 1
.0. If the values passed in are outside that
range, they will be clamped.
Since: 1.0
setSourceColor4ub
:: (HasCallStack, MonadIO m) | |
=> Word8 |
|
-> Word8 |
|
-> Word8 |
|
-> Word8 |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
This is a convenience function for creating a solid fill source material from the given color using unsigned bytes for each component. This color will be used for any subsequent drawing operation.
The value for each component is an unsigned byte in the range between 0 and 255.
Since: 1.0
setSourceTexture
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m () |
Deprecated: (Since version 1.16)Latest drawing apis all take an explicit CoglPipeline
argument so this stack of Material
s shouldn't be used.
This is a convenience function for creating a material with the first
layer set to texture
and setting that material as the source with
cogl_set_source.
Note: There is no interaction between calls to cogl_set_source_color and cogl_set_source_texture. If you need to blend a texture with a color then you can create a simple material like this: <programlisting> material = cogl_material_new (); cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80); cogl_material_set_layer (material, 0, tex_handle); cogl_set_source (material); </programlisting>
Since: 1.0
setViewport
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.8)Use cogl_framebuffer_set_viewport()
instead
Replaces the current viewport with the given values.
Since: 1.2
shaderCompile
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Compiles the shader, no return value, but the shader is now ready for linking into a program. Note that calling this function is optional. If it is not called then the shader will be automatically compiled when it is linked.
shaderGetInfoLog
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Text | Returns: a newly allocated string containing the info log. Use
|
Deprecated: (Since version 1.16)Use CoglSnippet
api
Retrieves the information log for a coglobject, can be used in conjunction
with cogl_shader_get_parameteriv()
to retrieve the compiler warnings/error
messages that caused a shader to not compile correctly, mainly useful for
debugging purposes.
shaderGetType
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m ShaderType | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Retrieves the type of a shader CoglHandle
shaderIsCompiled
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Retrieves whether a shader CoglHandle
has been compiled
shaderRef
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Add an extra reference to a shader.
shaderSource
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Replaces the current source associated with a shader with a new one.
Please see <link linkend="cogl-Shaders-and-Programmable-Pipeline.description">above</link> for a description of the recommended format for the shader code.
shaderUnref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api
Removes a reference to a shader. If it was the last reference the shader object will be destroyed.
sqrti
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Int32 | Returns: integer square root. |
Very fast fixed point implementation of square root for integers.
This function is at least 6x faster than clib sqrt()
on x86, and (this is
not a typo!) about 500x faster on ARM without FPU. It's error is less than
5% for arguments smaller than SQRTI_ARG_5_PERCENT
and less than 10%
for narguments smaller than SQRTI_ARG_10_PERCENT
. The maximum
argument that can be passed to this function is SQRTI_ARG_MAX
.
Since: 1.0
transform
:: (HasCallStack, MonadIO m) | |
=> Matrix |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_transform()
instead
Multiplies the current model-view matrix by the given matrix.
Since: 1.4
translate
:: (HasCallStack, MonadIO m) | |
=> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.10)Use cogl_framebuffer_translate()
instead
Multiplies the current model-view matrix by one that translates the model along all three axes according to the given values.
vertexBufferAdd
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> Word8 |
|
-> AttributeType |
|
-> Int32 |
|
-> Word16 |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Adds an attribute to a buffer, or replaces a previously added attribute with the same name.
You either can use one of the built-in names such as "gl_Vertex", or "gl_MultiTexCoord0" to add standard attributes, like positions, colors and normals, or you can add custom attributes for use in shaders.
The number of vertices declared when calling vertexBufferNew
determines how many attribute values will be read from the supplied
pointer
.
The data for your attribute isn't copied anywhere until you call
vertexBufferSubmit
, or issue a draw call which automatically
submits pending attribute changes. so the supplied pointer must remain
valid until then. If you are updating an existing attribute (done by
re-adding it) then you still need to re-call vertexBufferSubmit
to commit the changes to the GPU. Be carefull to minimize the number
of calls to vertexBufferSubmit
, though.
<note>If you are interleving attributes it is assumed that each interleaved attribute starts no farther than +- stride bytes from the other attributes it is interleved with. I.e. this is ok: <programlisting> |-0-0-0-0-0-0-0-0-0-0| </programlisting> This is not ok: <programlisting> |- - - - -0-0-0-0-0-0 0 0 0 0| </programlisting> (Though you can have multiple groups of interleved attributes)</note>
vertexBufferDelete
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Deletes an attribute from a buffer. You will need to call
vertexBufferSubmit
or issue a draw call to commit this
change to the GPU.
vertexBufferDisable
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Disables a previosuly added attribute.
Since it can be costly to add and remove new attributes to buffers; to make individual buffers more reuseable it is possible to enable and disable attributes before using a buffer for drawing.
You don't need to call vertexBufferSubmit
after using this
function.
vertexBufferDraw
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> VerticesMode |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Allows you to draw geometry using all or a subset of the vertices in a vertex buffer.
Any un-submitted attribute changes are automatically submitted before drawing.
vertexBufferDrawElements
vertexBufferDrawElements Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> VerticesMode |
|
-> Ptr () |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
This function lets you use an array of indices to specify the vertices within your vertex buffer that you want to draw. The indices themselves are created by calling cogl_vertex_buffer_indices_new ()
Any un-submitted attribute changes are automatically submitted before drawing.
vertexBufferEnable
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Text |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Enables a previosuly disabled attribute.
Since it can be costly to add and remove new attributes to buffers; to make individual buffers more reuseable it is possible to enable and disable attributes before using a buffer for drawing.
You don't need to call vertexBufferSubmit
after using this function
vertexBufferGetNVertices
vertexBufferGetNVertices Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Word32 | Returns: the number of vertices |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Retrieves the number of vertices that handle
represents
vertexBufferIndicesGetForQuads
vertexBufferIndicesGetForQuads Source #
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m (Ptr ()) | Returns: A |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Creates a vertex buffer containing the indices needed to draw pairs
of triangles from a list of vertices grouped as quads. There will
be at least nIndices
entries in the buffer (but there may be
more).
The indices will follow this pattern:
0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 ... etc
For example, if you submit vertices for a quad like like that shown in <xref linkend="quad-indices-order"/> then you can request 6 indices to render two triangles like those shown in <xref linkend="quad-indices-triangles"/>.
<figure id="quad-indices-order"> <title>Example of vertices submitted to form a quad</title> <graphic fileref="quad-indices-order.png" format="PNG"/> </figure>
<figure id="quad-indices-triangles"> <title>Illustration of the triangle indices that will be generated</title> <graphic fileref="quad-indices-triangles.png" format="PNG"/> </figure>
vertexBufferIndicesGetType
vertexBufferIndicesGetType Source #
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m IndicesType | Returns: The CoglIndicesType used |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Queries back the data type used for the given indices
vertexBufferNew
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m (Ptr ()) | Returns: a new |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Creates a new vertex buffer that you can use to add attributes.
vertexBufferRef
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: the |
Deprecated: (Since version 1.2)Use cogl_object_ref()
instead
Increment the reference count for a vertex buffer
vertexBufferSubmit
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglPrimitive
api instead
Submits all the user added attributes to the GPU; once submitted, the attributes can be used for drawing.
You should aim to minimize calls to this function since it implies validating your data; it potentially incurs a transport cost (especially if you are using GLX indirect rendering) and potentially a format conversion cost if the GPU doesn't natively support any of the given attribute formats.
vertexBufferUnref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.2)Use cogl_object_unref()
instead
Decrement the reference count for a vertex buffer