Date of registration: Feb 18th 2003
Location: Göttingen
Occupation: Linux Coder (ex Mathe SR Inf Student)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
class WindowBasis
{
protected:
WindowBasis(char *name) {
id = glutCreateWindow(name);
windows[id]=this;
glutReshapeFunc(reshapeCallback);
}
~WindowBasis() {
glutDestroyWindow(id);
windows.erase(id);
}
virtual void doReshape(int, int) = 0;
private:
static void reshapeCallback(int,int);
static std::map<int,WIndowBasis *> windows;
int id;
}
void WindowBasis::reshapeCallback(int w,int h) {
windows[glutGetWindow()]->doReshape(w,h);
}
|