Question

I have a code already implemented using freeglut library for opengl. I would like to include a windows interface using windows form. Whats the easiest way to make a window interface for my project.

Was it helpful?

Solution

Twi things to get straight: You don't have a class implemented. you have a main functions that initializes GLUT, creates a window and enters a main loop. Those last two parts (creating window, doing the main loop) can not be mixed with other frameworks. If you want to use Windows Forms you no longer can use GLUT. Period, there's no way around this.

Anyway, porting code from GLUT to another framework is not hard. Follow the tutorial Nathan linked in the comment to your question to get a bare bones OpenGL window with Windows forms. Then you transplant your GLUT callback function code (display, reshape, keyboard and so on) into the event handler functions of the Windows Forms OpenGL window object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top