How to show the OpenGL scene in part of the window?

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!

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)

Boy! Change HWND from hWindow to hObject
If U use C++ Builder I’ll send U a good VCL (TOpenGLPanel) It can automatically set PFD and other bored things

Hi,
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!

try

glViewport( x , y , width, height );