« C++ OpenGL rendering to .NET control | Main | How not to get a job over the internet »

indistinguishable from magic (more on .net/c++ windows development)

Corey Taylor, a helpful developer on the g3d sourceforge forums pointed out some problems with code I posted last night; I think he's saying, essentially, that my C#/.NET app isn't doing what I want because the c++ code I'm calling doesn't do what I want. Makes sense. I need to make the c++ work, which means
create a valid G3D::RenderDevice, with an OpenGL context, and then access the image drawn by the RenderDevice. Arrg... There's some magical switchover between HDC (handle to a device context, I think -- a very very windows concept) and OpenGL context and System.Windows.Forms.PaintEventArgs...
Arthur C. Clarke said that any sufficiently advanced technology is indistinguishable from magic. How about any sufficiently obscure technology? Obscure, occult, obfuscated...

Aha. System.Windows.Forms.PaintEventArgs.Graphics.GetHDC() lets me access the HDC associated with my very own .NET component, in its Paint handler.

Now I need to go from an HDC to a G3D::RenderDevice, or maybe a G3D::Win32Window. I don't understand the relationship between a "window" and a "render device" in G3D. I can go read the code, though.

Meanwhile, Morgan McGuire (the uber-knowledgeable creator of G3D) is suggesting I create an ActiveX control, but I'm thinking, "Oh god, do I have to learn another Microsoft GUI component technology?"

Reader Comments (1)

Re Clarke - I saw this nice variation recently.

"Any technology which is distinguishable from magic is insufficiently advanced."

6.1.2005 at 08:17 PM | Unregistered Commenterdan

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>