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 |
No description available in the introspection data.
Synopsis
- newtype Offscreen = Offscreen (ManagedPtr Offscreen)
- class (BoxedPtr o, TypedObject o, IsDescendantOf Offscreen o) => IsOffscreen o
- toOffscreen :: (MonadIO m, IsOffscreen o) => o -> m Offscreen
- offscreenNewToTexture :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Offscreen
- offscreenNewWithTexture :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Offscreen
- offscreenRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- offscreenUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Offscreen Source # | |
BoxedPtr Offscreen Source # | |
Defined in GI.Cogl.Objects.Offscreen boxedPtrCopy :: Offscreen -> IO Offscreen boxedPtrFree :: Offscreen -> IO () | |
ManagedPtrNewtype Offscreen Source # | |
Defined in GI.Cogl.Objects.Offscreen toManagedPtr :: Offscreen -> ManagedPtr Offscreen | |
TypedObject Offscreen Source # | |
Defined in GI.Cogl.Objects.Offscreen | |
HasParentTypes Offscreen Source # | |
Defined in GI.Cogl.Objects.Offscreen | |
type ParentTypes Offscreen Source # | |
Defined in GI.Cogl.Objects.Offscreen |
class (BoxedPtr o, TypedObject o, IsDescendantOf Offscreen o) => IsOffscreen o Source #
Type class for types which can be safely cast to Offscreen
, for instance with toOffscreen
.
Instances
(BoxedPtr o, TypedObject o, IsDescendantOf Offscreen o) => IsOffscreen o Source # | |
Defined in GI.Cogl.Objects.Offscreen |
toOffscreen :: (MonadIO m, IsOffscreen o) => o -> m Offscreen Source #
Methods
newToTexture
offscreenNewToTexture Source #
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Offscreen | Returns: a newly instantiated |
Deprecated: (Since version 1.16)Use cogl_offscreen_new_with_texture instead.
This creates an offscreen buffer object using the given texture
as the
primary color buffer. It doesn't just initialize the contents of the
offscreen buffer with the texture
; they are tightly bound so that
drawing to the offscreen buffer effectivly updates the contents of the
given texture. You don't need to destroy the offscreen buffer before
you can use the texture
again.
<note>This only works with low-level CoglTexture
types such as
CoglTexture2D
, CoglTexture3D
and CoglTextureRectangle
, and not
with meta-texture types such as CoglTexture2DSliced
.</note>
newWithTexture
offscreenNewWithTexture Source #
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Offscreen | Returns: a newly instantiated |
This creates an offscreen framebuffer object using the given
texture
as the primary color buffer. It doesn't just initialize
the contents of the offscreen buffer with the texture
; they are
tightly bound so that drawing to the offscreen buffer effectively
updates the contents of the given texture. You don't need to
destroy the offscreen buffer before you can use the texture
again.
<note>This api only works with low-level CoglTexture
types such as
CoglTexture2D
, CoglTexture3D
and CoglTextureRectangle
, and not
with meta-texture types such as CoglTexture2DSliced
.</note>
The storage for the framebuffer is actually allocated lazily
so this function will never return Nothing
to indicate a runtime
error. This means it is still possible to configure the framebuffer
before it is really allocated.
Simple applications without full error handling can simply rely on
Cogl to lazily allocate the storage of framebuffers but you should
be aware that if Cogl encounters an error (such as running out of
GPU memory) then your application will simply abort with an error
message. If you need to be able to catch such exceptions at runtime
then you can explicitly allocate your framebuffer when you have
finished configuring it by calling cogl_framebuffer_allocate()
and
passing in a CoglError
argument to catch any exceptions.
ref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: For convenience it returns the
given |
Deprecated: (Since version 1.2)cogl_object_ref()
should be used in new code.
Increments the reference count on the offscreen
framebuffer.
unref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.2)cogl_object_unref()
should be used in new code.
Decreases the reference count for the offscreen
buffer and frees it when
the count reaches 0.