1
// Copyright 2006 Alp Toker <alp@atoker.com>
2
// This software is made available under the MIT License
3
// See COPYING for details
9
public class Drawable : IDisposable
13
public Drawable (IntPtr handle)
16
GlitzAPI.glitz_drawable_reference (Handle);
19
public Drawable (Drawable other, ref DrawableFormat format, uint width, uint height)
21
this.Handle = GlitzAPI.glitz_create_drawable (other.Handle, ref format, width, height);
22
GlitzAPI.glitz_drawable_reference (Handle);
25
public static Drawable CreatePbuffer (Drawable other, ref DrawableFormat format, uint width, uint height)
27
IntPtr Handle = GlitzAPI.glitz_create_pbuffer_drawable (other.Handle, ref format, width, height);
28
return new Drawable (Handle);
31
public void UpdateSize (uint width, uint height)
33
GlitzAPI.glitz_drawable_update_size (Handle, width, height);
36
public void SwapBufferRegion (int x_origin, int y_origin, Box[] box)
38
GlitzAPI.glitz_drawable_swap_buffer_region (Handle, x_origin, y_origin, box, box.Length);
41
public void SwapBuffers ()
43
GlitzAPI.glitz_drawable_swap_buffers (Handle);
48
GlitzAPI.glitz_drawable_flush (Handle);
53
GlitzAPI.glitz_drawable_flush (Handle);
56
public FeatureMask Features {
58
return GlitzAPI.glitz_drawable_get_features (Handle);
62
public IntPtr Format {
64
return GlitzAPI.glitz_drawable_get_format (Handle);
70
return GlitzAPI.glitz_drawable_get_width (Handle);
76
return GlitzAPI.glitz_drawable_get_height (Handle);
80
public IntPtr FindStandardFormat (FormatName format_name)
82
return GlitzAPI.glitz_find_standard_format (Handle, format_name);
90
void IDisposable.Dispose ()
93
GC.SuppressFinalize (this);
96
protected virtual void Dispose (bool disposing)
98
if (Handle == IntPtr.Zero)
101
Console.WriteLine ("glitz_drawable_destroy");
102
GlitzAPI.glitz_drawable_destroy (Handle);
103
Handle = IntPtr.Zero;
106
public void Destroy()
112
public void Destroy ()
114
GlitzAPI.glitz_drawable_destroy (Handle);