Home | History | Annotate | Download | only in opengl

Lines Matching defs:wt

118 MakeNewTexture(struct winthread *wt)
230 resize(struct winthread *wt, int w, int h)
232 wt->NewSize = GL_TRUE;
233 wt->WinWidth = w;
234 wt->WinHeight = h;
244 draw_loop(struct winthread *wt)
251 if (!wt->Initialized) {
252 eglMakeCurrent(wt->Display, wt->Surface, wt->Surface, wt->Context);
253 printf("xeglthreads: %d: GL_RENDERER = %s\n", wt->Index,
255 if (Texture /*&& wt->Index == 0*/) {
256 MakeNewTexture(wt);
258 wt->Initialized = GL_TRUE;
265 if (eglGetCurrentContext() != wt->Context) {
267 eglGetCurrentContext(), wt->Context);
272 if (wt->NewSize) {
273 GLfloat w = (float) wt->WinWidth / (float) wt->WinHeight;
274 glViewport(0, 0, wt->WinWidth, wt->WinHeight);
281 wt->NewSize = GL_FALSE;
284 if (wt->MakeNewTexture) {
285 MakeNewTexture(wt);
286 wt->MakeNewTexture = GL_FALSE;
292 glRotatef(wt->Angle, 0, 1, 0);
293 glRotatef(wt->Angle, 1, 0, 0);
301 eglSwapBuffers(wt->Display, wt->Surface);
315 wt->Angle += 1.0;
317 eglMakeCurrent(wt->Display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
322 keypress(XEvent *event, struct winthread *wt)
337 /*printf("exit draw_loop %d\n", wt->Index);*/
342 wt->MakeNewTexture = GL_TRUE;
400 struct winthread *wt = &WinThreads[i];
401 if (event.xconfigure.window == wt->Win) {
402 resize(wt, event.xconfigure.width,
410 struct winthread *wt = &WinThreads[i];
411 if (event.xkey.window == wt->Win) {
412 keypress(&event, wt);
436 struct winthread *wt = &WinThreads[w];
437 if (XPending(wt->Dpy)) {
438 XNextEvent(wt->Dpy, &event);
441 resize(wt, event.xconfigure.width, event.xconfigure.height);
444 keypress(&event, wt);
461 create_window(struct winthread *wt, EGLContext shareCtx)
482 int xpos = (wt->Index % 8) * (width + 10);
483 int ypos = (wt->Index / 8) * (width + 20);
485 scrnum = DefaultScreen(wt->Dpy);
486 root = RootWindow(wt->Dpy, scrnum);
488 if (!eglChooseConfig(wt->Display, attribs, &config, 1, &num_configs) ||
496 if (!eglGetConfigAttrib(wt->Display, config, EGL_NATIVE_VISUAL_ID, &vid)) {
501 visinfo = XGetVisualInfo(wt->Dpy, VisualIDMask,
510 attr.colormap = XCreateColormap(wt->Dpy, root, visinfo->visual, AllocNone);
514 win = XCreateWindow(wt->Dpy, root, xpos, ypos, width, height,
530 XSetNormalHints(wt->Dpy, win, &sizehints);
531 XSetStandardProperties(wt->Dpy, win, "xeglthreads", "xeglthreads",
537 ctx = eglCreateContext(wt->Display, config, shareCtx, NULL);
541 surf = eglCreateWindowSurface(wt->Display, config, win, NULL);
546 XMapWindow(wt->Dpy, win);
547 XSync(wt->Dpy, 0);
550 wt->Win = win;
551 wt->Context = ctx;
552 wt->Surface = surf;
553 wt->Angle = 0.0;
554 wt->WinWidth = width;
555 wt->WinHeight = height;
556 wt->NewSize = GL_TRUE;
566 struct winthread *wt = (struct winthread *) p;
567 draw_loop(wt);