View Full Version : How to show the OpenGL scene in part of the window?

07-24-2002, 01:14 AM
Dear all,

I am a biginner for OpenGL. By now, I only fin d the samples that draw the scene on the whole window. But I would like to show the scene only in part of the window. I would like to spare some space for other controls, for a example, a button. How can I do this? where can I find some sample code? (C++ is better)

Any answers are apprieciated!

Andrea Rossini
07-24-2002, 04:49 AM
Open a empty box over the main window,
make the Render context on the emty box HWND.

(the empty box can be a static but It would be better to create a new WNDCLASS)

07-24-2002, 06:36 AM
Boy! Change HWND from hWindow to hObject http://www.opengl.org/discussion_boards/ubb/smile.gif
If U use C++ Builder I'll send U a good VCL (TOpenGLPanel) It can automatically set PFD and other bored things http://www.opengl.org/discussion_boards/ubb/smile.gif

07-24-2002, 10:31 AM
thank you very much guys! I got the basic idea of how to do it now. But if somebody can tell me how to do it on MAC OS X computer. That will be great!

Anyway, thanks a lot!

07-25-2002, 07:21 PM

glViewport( x , y , width, height );