Drawing over an object (borland builder)
After a bit of trial and error I managed to get an opengl window running in borland builder 6. However, I can only get it to display on the background of a form, for example putting a tabcontrol or a button or other object on the form obscures the 3d view.
Does anyone know how to make it draw on an object such a panel?
Yeah, you know how you need the HDC of the form to initialize OpenGL? Well simply pass the HDC of a TPanel control. Its like this
HDC hdc = GetDC(Panel->Handle);
Then just pass this hdc to the OpenGL initialization routines. And make sure when you call glViewport and gluPerspective you use the width and height of the Panel and not the Form.
HDC hdc = GetDC(Panel->Handle);
Then just pass this hdc to the OpenGL initialization routines. And make sure when you call glViewport and gluPerspective you use the width and height of the Panel and not the Form.
Author Freeworld3Dhttp://www.freeworld3d.org
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement