[cairo] What is the closure in stream output to file based surfaces for?
David.Weiss at ptvgroup.com
Tue Jul 29 02:03:57 PDT 2014
I want to implement file output for a rendering application and want to use C++ file streams using the following callback write function:
cairo_status_t cairo_write_func (void *closure, const unsigned char *data, unsigned int length)
const std::string s(data, length);
fout << s;
catch (std::exception &e)
I just can't figure out what the closure is for.
Can anyone explain the concept to me?
Is it comparable to variable capturing in C++11 closures?
Could I just pass nullptr as I do not use it anyway?
Logistics Software Development
Haid-und-Neu-Str. 15, 76131 Karlsruhe, Germany
david.weiss at ptvgroup.com<mailto:david.weiss at ptvgroup.com>
PTV Planung Transport Verkehr AG
Executive Board: Vincent Kobesen (CEO)
Chairman of the Supervisory Board: Dr. h.c. Frank-Jürgen Weise
Commercial Register (HRB-Nr): 109262
Local Court: Mannheim
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo