Lines Matching refs:wt
110 MakeNewTexture(struct winthread *wt)
222 resize(struct winthread *wt, int w, int h)
224 wt->NewSize = GL_TRUE;
225 wt->WinWidth = w;
226 wt->WinHeight = h;
236 draw_loop(struct winthread *wt)
243 glXMakeCurrent(wt->Dpy, wt->Win, wt->Context);
244 if (!wt->Initialized) {
245 printf("glthreads: %d: GL_RENDERER = %s\n", wt->Index,
247 if (Texture /*&& wt->Index == 0*/) {
248 MakeNewTexture(wt);
250 wt->Initialized = GL_TRUE;
258 if (wt->NewSize) {
259 GLfloat w = (float) wt->WinWidth / (float) wt->WinHeight;
260 glViewport(0, 0, wt->WinWidth, wt->WinHeight);
267 wt->NewSize = GL_FALSE;
270 if (wt->MakeNewTexture) {
271 MakeNewTexture(wt);
272 wt->MakeNewTexture = GL_FALSE;
278 glRotatef(wt->Angle, 0, 1, 0);
279 glRotatef(wt->Angle, 1, 0, 0);
287 glXSwapBuffers(wt->Dpy, wt->Win);
301 wt->Angle += 1.0;
307 keypress(XEvent *event, struct winthread *wt)
322 /*printf("exit draw_loop %d\n", wt->Index);*/
327 wt->MakeNewTexture = GL_TRUE;
385 struct winthread *wt = &WinThreads[i];
386 if (event.xconfigure.window == wt->Win) {
387 resize(wt, event.xconfigure.width,
395 struct winthread *wt = &WinThreads[i];
396 if (event.xkey.window == wt->Win) {
397 keypress(&event, wt);
421 struct winthread *wt = &WinThreads[w];
422 if (XPending(wt->Dpy)) {
423 XNextEvent(wt->Dpy, &event);
426 resize(wt, event.xconfigure.width, event.xconfigure.height);
429 keypress(&event, wt);
446 create_window(struct winthread *wt, GLXContext shareCtx)
463 int xpos = (wt->Index % 8) * (width + 10);
464 int ypos = (wt->Index / 8) * (width + 20);
466 scrnum = DefaultScreen(wt->Dpy);
467 root = RootWindow(wt->Dpy, scrnum);
469 visinfo = glXChooseVisual(wt->Dpy, scrnum, attrib);
477 attr.colormap = XCreateColormap(wt->Dpy, root, visinfo->visual, AllocNone);
481 win = XCreateWindow(wt->Dpy, root, xpos, ypos, width, height,
495 XSetNormalHints(wt->Dpy, win, &sizehints);
496 XSetStandardProperties(wt->Dpy, win, "glthreads", "glthreads",
501 ctx = glXCreateContext(wt->Dpy, visinfo, shareCtx, True);
506 XMapWindow(wt->Dpy, win);
507 XSync(wt->Dpy, 0);
510 wt->Win = win;
511 wt->Context = ctx;
512 wt->Angle = 0.0;
513 wt->WinWidth = width;
514 wt->WinHeight = height;
515 wt->NewSize = GL_TRUE;
525 struct winthread *wt = (struct winthread *) p;
526 draw_loop(wt);