I would guess you'd have to call GLContext.useContext(Object).The context has to implement at least the basic GL11 functions, apparently.
Thanks! I use JNA to bind my DLL. Do you think I could just cast Windows' HGLRC to Pointer, then to Object, and pass that to GLContext.useContext() ?
[15:37:15] <gygax> perhaps I should just try to feed it a HGLRC[15:37:28] <elias_naur> nah[15:37:43] <wolf_m> as I said, my guess is you should write a wrapper around your native code and feed that into it[15:37:52] <elias_naur> the parameter is only used to cache function pointers[15:38:01] <gygax> thanks Elias[15:38:19] <gygax> that doesn't make my job easier :-)[15:38:27] <elias_naur> lwjgl has a map of handle->function_pointers[15:38:41] <elias_naur> so if you pass an existing handle to useContext, a lot of work will be saved[15:38:56] <elias_naur> what's important is that the relevant context is current when useContext is called[15:39:26] <gygax> so is there a way to get a "blank" map and initialize it with my externally-created GL context ?[15:40:52] <elias_naur> sure, just make the external context current and call GLContext.useContext(object_representing_the_context)[15:41:11] <elias_naur> make sure you hold on to the object, since the map is weak[15:41:46] <gygax> hold on - I'm not quite following yet[15:41:59] <gygax> where do I get object_representing_the_context from ?[15:42:10] <elias_naur> anywhere, a "new Object()" will do fine[15:42:11] <Evil> just make an: Object context = new Object();[15:42:14] <Evil> hahaha[15:42:22] <gygax> that was evil[15:42:23] <elias_naur> as long as it isn't garbage collected before you're done with the context[15:43:08] <Evil> it's just a "marker" for your context if you want to see it this way.[15:43:16] <gygax> ahaaa[15:43:24] <gygax> hey, that would be real easy[15:43:43] <Evil> if you want to use it, just make your context current and call useContext...[15:43:47] <elias_naur> the reason that new Object() is enough is because OpenGL state is global to the current thread[15:43:52] <Evil> .oO(hopefully this is right)[15:44:15] <gygax> let me try this and come back in, like, 15 minutes[15:44:18] <elias_naur> the HGLRC is only used with wgl[15:44:19] <gygax> thanks![15:44:35] <wolf_m> so I was wrong all along.. Good thing you came here gygax[15:44:41] <gygax> :-)[...][15:58:55] <gygax> well I'll be[15:59:06] <gygax> it worked![15:59:12] <wolf_m> congrats :)[15:59:19] <gygax> no, congrats to you guys[15:59:19] <Evil> hehehe.[15:59:44] <wolf_m> post your findings on the forums to provide a shortcut for others
But this doesn't is a solution to your questinon? I thought you like to use a externally created context only the pointer is known.