Skip to content

Instantly share code, notes, and snippets.

@james4k
Last active September 20, 2015 20:25
Show Gist options
  • Save james4k/690b8eb725cc72bbb4e5 to your computer and use it in GitHub Desktop.
Save james4k/690b8eb725cc72bbb4e5 to your computer and use it in GitHub Desktop.
package lime.graphics.cairo;
@:cppFileCode("
void lime_cairo_surface_destroy (double surface);
void lime_cairo_surface_flush (double surface);
")
abstract CairoSurface(Dynamic) from Float to Float {
public function destroy ():Void {
#if (lime_cairo && !macro)
lime_cairo_surface_destroy (this);
#end
}
public function flush ():Void {
#if (lime_cairo && !macro)
lime_cairo_surface_flush (this);
#end
}
// Native Methods
private inline static function lime_cairo_surface_destroy (surface:Float):Void {
untyped __cpp__ ("lime_cairo_surface_destroy ({0})", surface);
}
private inline static function lime_cairo_surface_flush (surface:Float):Void {
untyped __cpp__ ("lime_cairo_surface_flush ({0})", surface);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment