GMS 2 Best Way to Render from a DLL?


I've been experimenting with working with extensions and DLLs, and was wondering what people have done in the past to render from a DLL? I've seen a few extensions that seem to do this, but wasn't sure.

Right now, I'm thinking my best bet is to share a buffer with the DLL, and buffer_set_surface with it after my extension writes its 'framebuffer' to it.

I was looking for a way to grab a sprite's textureID, but we don't seem to be able to do anything with the texture pointers we are given outside of the GMS functions that use 'em... and I can't seem to give anything a GL Texture ID from my extension.

Anyone else have any ideas? Or even better - anyone figure out how to go from Texture Pointer <-> Texture ID??