hidgl: Provide more explicit management of rendering instancesapi_refactor/hidgl-provide-more-explicit-ma
commit803d72530fd9a537e03cd6561ae59ca0249f4641
authorPeter Clifton <peter@clifton-electronics.co.uk>
Thu, 7 Jan 2016 02:18:58 +0000 (7 02:18 +0000)
committerPeter Clifton <peter@clifton-electronics.co.uk>
Sat, 9 Jan 2016 16:19:50 +0000 (9 16:19 +0000)
tree6c9b36246aae2a07866d5daf69b765fc969ccdce
parent31dd04ace85c775d91dfb3d8c8bfd499d1268370
hidgl: Provide more explicit management of rendering instances

Provide an (hidgl_instance *) pointer which is used to refer to a hidgl
instance when caling hidgl_* APIs that are instance, but not hidGC specific.

Various hidgl APIs now take the hidgl_instance as a parameter, or in the case
of hidgl_new_instance(), return a new instance.

Graphics APIs which previously had a hidGC parameter remain the same, as the
hidglGC structure now contains a link to the hidgl instance which created it.

This change paves the way to potentially having multiple hidgl instances active
simultaneously, and removes various global variables (such as "buffer" and
"global_depth") which were previously accessible to allow the gtk-gl HID to
draw using the hidgl internals.

The gtk-gl HID_DRAW graphics API now subclasses the hidgl HID_DRAW API, so the
gtk-gl HID can access the (non-private) gtk_gc->hidgl_gc.* fields.
src/hid/common/hidgl.c
src/hid/common/hidgl.h
src/hid/gtk/gtkhid-gl.c