Forums > Dev

native paint

Aug 24 2010 | 5:05 pm


I would like to develop an external to display music scores, based on the Guido Engine library ( My problem is that the Guido library has already its own graphic device abstraction and needs to be initialized with native devices (CGContextRef on MacOS, HDC on Windows).
Can my external get a native graphic device (for example from a t_jgraphics) ?

Thanks in advance for any help.

Aug 24 2010 | 8:24 pm

I would suggest that you render to an offscreen bitmap (CGBitmapContextCreate() for CGContextRef(), and CreateCompatibleBitmap()/SelectObject() for HDC).

Then create a t_jsurface with the pixels via jgraphics_image_surface_create_for_data (you might need to swap the pixel plane ordering). And draw the image in the t_jgraphics.

There’s example usage of jgraphics_image_surface_create_for_data() in Tim’s taptool blue project:

Aug 26 2010 | 2:27 pm

It works ! :-)
Thanks for the tip.

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Dev