PDA

View Full Version : initialize opengl in activex control



02-19-2004, 04:49 PM
Hi -

I am trying to learn how to make an MFC activeX control with VC++ that displays a 3d polygon. Does anyone have a good example/tutorial that explains how to initialize openGL? I've already seen the MFC activex example from codeproject, but that didn't help(it doesn't even work on my machine, it causes prolbems and closes when I run it in IE or the activex control test container in VS.NET)

Thanks in advance

mikael_aronsson
02-20-2004, 01:17 AM
Hi !

I have seen Active/X controls for using OpenGL with Visual basic, try google and see if you can find one with source code and have a peek at it.

Setting up OpenGL is pretty easy, pick the source for any of the NeHe tutorials for Windows and have a look at it.

You need to create a rendering context, get your hand of the window handle so that you can get a device context (HDC) and then you use wglMakeCurrent to ative to rendering context for your device context.

It is all in the wgl* functions.

Mikael