
Garbage Collecting OpenGL resources
Posted Sunday, 9 December, 2007 - 18:32 by the Fiddler.A quick test proved that it is possible to safely garbage collect OpenGL resources. The necessary hooks have been commited to SVN, and a small article describing the interaction between the GC and OpenGL has been uploaded to the manual.
This feature is completely optional: unless you use the relevant hooks, the GC will remain oblivious of your resources. It is also not 100% complete yet: X11GLContext is being updated to accomodate the necessary changes, a few locks are still missing for thread-safety, and the code is generally in an experimental stage.
This experiment was inspired by a discussion on object-oriented OpenGL classes. Unfortunately I do not have the time resources to pursue this feature to its conclusion, but I will gladly accept code for garbage-collectable VertexBufferObject, Shader or Texture classes.
Current work concerns context creation enhancements (Fsaa support). These features will appear on OpenTK 0.3.14, which should arrive shortly after Mono 1.2.6 is released.


Comments
Great news!
Great news!
Very interesting. I can't
Very interesting. I can't wait to find the time to take a look at the implementation. Good work!