PDA

View Full Version : Child Window and OpenGL



keziah23li98
02-09-2003, 11:03 PM
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

mikael_aronsson
02-10-2003, 04:59 AM
Hi !

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

Mikael

prashantgp
02-11-2003, 07:44 PM
hi,
will u pls elaborate the solution??
i also have the samw problem.

Stack Overflow
02-12-2003, 04:17 PM
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

keziah23li98
02-12-2003, 10:55 PM
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

02-12-2003, 11:22 PM
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;
.
.
.
}