the Fiddler.'s picture

Garbage Collecting OpenGL resources

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture

Great news!

JTalton's picture

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