I am writing a plugin for motionbuilder and need to use some opengl toolkits which are based on Glut. The problem I have is that inside motionbuilder I already have a window and an opengl context created using the SDK for motionbuilder. But with Glut it wants to create its own window which wont be native to motionbuilder.
How would I get glut to work inside my own window in motionbuilder? somehow I need to make the glut window the child of the motionbuilder window but I am not sure how to do that.

Here is the typical Main() entry point where the glut window is created

int main(int argc,char** argv)
{
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE);
	glutInitWindowSize(640,480);
	glutInitWindowPosition(300,100);
	glutCreateWindow("My_Glut_Window");

	glutDisplayFunc(Display);	/* Callback Function for display 
	glutMainLoop();

}

By the way does anyone have a list of good opengl and glut forums?

Thanks in advance.

Hi there

I think glut is supposed to provide you with some cheap and cheerful way to create a window for your opengl code. If you already have that in place with motionbuilder, the best way forward is to use that and do away with glut. The are lots of tutorials that show basic and advanced opengl topics without glut.

Is there any feature of these glut tutorials that you are particularly after?

opengl.org is the place to be for opengl.

I hope this helps

madmortigan

Thanks for your reply. The main reason I asked this question is because there are several toolkits that have been built on top of glut. For example there is one called PLib or PUI which is free and has a variety of controls such as menus, sliders, text boxes, etc. It would be very easy for me to develope my application if I could only get past the window issue with glut. So the point is its not so much the glut functionality per se, but its to be able to use the toolkit. I looked at rewriting the toolkit but it would be a big job and sort of defeats the purpose of using something thats already been done.
All I need to know is how to get my native motionbuilder window to replace the glut window.

Of course I would also be open to any suggestion for other free toolkits that do not use Glut. I just dont want to have to reinvent the wheel for all the controls I will need.
Another possibility is to use the Windows API and use the controls from windows, which I breifly looked at and not sure how you would embed windows controls in the motionbuilder window.

Anyone else have some thoughts on this ?

Thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.