| 478 | |
| 479 | |
| 480 | void VirtualWin::sendVGL(GLint drawBuf, bool spoilLast, bool doStereo, |
| 481 | int stereoMode, int compress, int qual, int subsamp) |
| 482 | { |
| 483 | int w = oglDraw->getWidth(), h = oglDraw->getHeight(); |
| 484 | |
| 485 | if(spoilLast && fconfig.spoil && !vglconn->isReady()) |
| 486 | return; |
| 487 | Frame *f; |
| 488 | |
| 489 | if(oglDraw->getRGBSize() != 24) |
| 490 | THROW("The VGL Transport requires 8 bits per component"); |
| 491 | int glFormat = GL_RGB, pixelFormat = PF_RGB; |
| 492 | if(compress != RRCOMP_RGB) |
| 493 | { |
| 494 | glFormat = oglDraw->getFormat(); |
| 495 | if(glFormat == GL_RGBA) pixelFormat = PF_RGBX; |
| 496 | else if(glFormat == GL_BGR) pixelFormat = PF_BGR; |
| 497 | else if(glFormat == GL_BGRA) pixelFormat = PF_BGRX; |
| 498 | } |
| 499 | |
| 500 | if(!fconfig.spoil) vglconn->synchronize(); |
| 501 | ERRIFNOT(f = vglconn->getFrame(w, h, pixelFormat, FRAME_BOTTOMUP, |
| 502 | doStereo && stereoMode == RRSTEREO_QUADBUF)); |
| 503 | if(doStereo && IS_ANAGLYPHIC(stereoMode)) |
| 504 | { |
| 505 | stereoFrame.deInit(); |
| 506 | makeAnaglyph(f, drawBuf, stereoMode); |
| 507 | } |
| 508 | else if(doStereo && IS_PASSIVE(stereoMode)) |
| 509 | { |
| 510 | rFrame.deInit(); gFrame.deInit(); bFrame.deInit(); |
| 511 | makePassive(f, drawBuf, glFormat, stereoMode); |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | rFrame.deInit(); gFrame.deInit(); bFrame.deInit(); stereoFrame.deInit(); |
| 516 | GLint readBuf = drawBuf; |
| 517 | if(doStereo || stereoMode == RRSTEREO_LEYE) readBuf = LEYE(drawBuf); |
| 518 | if(stereoMode == RRSTEREO_REYE) readBuf = REYE(drawBuf); |
| 519 | readPixels(0, 0, f->hdr.framew, f->pitch, f->hdr.frameh, glFormat, f->pf, |
| 520 | f->bits, readBuf, doStereo); |
| 521 | if(doStereo && f->rbits) |
| 522 | readPixels(0, 0, f->hdr.framew, f->pitch, f->hdr.frameh, glFormat, f->pf, |
| 523 | f->rbits, REYE(drawBuf), doStereo); |
| 524 | } |
| 525 | f->hdr.winid = x11Draw; |
| 526 | f->hdr.framew = f->hdr.width; |
| 527 | f->hdr.frameh = f->hdr.height; |
| 528 | f->hdr.x = 0; |
| 529 | f->hdr.y = 0; |
| 530 | f->hdr.qual = qual; |
| 531 | f->hdr.subsamp = subsamp; |
| 532 | f->hdr.compress = (unsigned char)compress; |
| 533 | if(!syncdpy) { XSync(dpy, False); syncdpy = true; } |
| 534 | if(fconfig.logo) f->addLogo(); |
| 535 | vglconn->sendFrame(f); |
| 536 | } |
| 537 |
nothing calls this directly
no test coverage detected