View Full Version : How to get a handle to a GLUT window ?
07-18-2002, 03:57 AM
I'm using GLUT to create a second window from my app.
The question is:
How do I get a handle to the GLUT-created window ? A simple int from GLUT will not suffice, I want to minize/maximize and do other Win API stuff with the window.
I know this is possible... just don't know how.
Thanks in advance,
07-18-2002, 09:36 AM
I never used glut, but it's point is to be api(and os) independant. So there's no point in using win32 api calls for a glut window. I am pretty sure that glut provides some calls to tell it how large you want the window to be.
07-18-2002, 02:10 PM
LPCTSTR lpClassName, // pointer to class name
LPCTSTR lpWindowName // pointer to window name
HWND thewindow = FindWindow(NULL,WindowName);
07-19-2002, 12:08 AM
Yep you are correct. But I want to be able to minimize and maximize and restore the window, and GLUT has no functionality for that.
It seems no-one knows how to get the handle... ;-)
Thanks no-one =)
I'll try that FindWindow() stuff...
07-19-2002, 03:43 AM
Hi, I'm not a winblows hacker, but ...
There is a global symbol
which you could use to pick up data from the current window structure ...
which would be the handle you require, I think!
So, in your program, set up this to make the
symbol available to you ...
extern GLUTwindow *__glutCurrentWindow;
and then pick out the stuff you need from the current window.
If you read the code, you should be able to get info from any window created by GLUT.
Just a matter of getting the right pointer to the window info structure in question!
Hope this helps ... if only a little ...
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.