Child Window and OpenGL

Hi,
I’ve made a windows where there is a OpenGL child windows inside. But when i resize the window the OpenGL windows’s limits don’t change and i don’t find whitch procedure or function i could use.
Thank’s

Keziah

Hi !

When the parent window changes size add a MoveWindow( hWndChild, x, y, w, h, true) call in the resize event handler.

Mikael

hi,
will u pls elaborate the solution??
i also have the samw problem.

Hello keziah23li98,

I believe prashantgp has created a program the uses Child Windows using glutCreateSubWindow, so he might be able to help you. I can help you some, but all I can say is that this is an example of how to use a glutCreateSubWindow:

glutCreateSubWindow(int win, int x, int y, int width, int height);

“int win” is known as the Sub-Window name, so prashant might be able to help you.

  • VC6-OGL

Thank’s for helping me…
I don’t use glut for creating windows, so i will try to use the command MoveWindows
Thank’s

keziah

there may be an easier way, but i just figure out my windows positions as a percentage of the screen area. then i do some simple calculations based upon the new window XY
WndProc(…)
{
.
.
.
WM_SIZE:
int iX;
int iY;
iX = LOWORD(lParam);
iY = HIWORD(lParam);
ResizeChildWindows(iX,iY);
break;
.
.
.
}