Changeset 33093 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Oct 13, 2010 10:29:43 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66622
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r32247 r33093 299 299 if (siHavePBO==0 && siHaveFBO==0) 300 300 { 301 #if 1 301 302 GLint dRow, sRow; 302 303 for (dRow=yoffset, sRow=y-height-1; dRow<yoffset-height; dRow++, sRow--) … … 304 305 gl->CopyTexSubImage2D(target, level, xoffset, dRow, x, sRow, width, 1); 305 306 } 307 #else 308 { 309 GLint w, h, i; 310 char *img1, *img2, *sPtr, *dPtr; 311 CRContext *ctx = crStateGetCurrent(); 312 313 w = ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D->level[0][level].width; 314 h = ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D->level[0][level].height; 315 316 img1 = crAlloc(4*w*h); 317 img2 = crAlloc(4*width*(-height)); 318 CRASSERT(img1 && img2); 319 320 gl->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, -height); 321 gl->GetTexImage(target, level, GL_RGBA, GL_UNSIGNED_BYTE, img1); 322 323 sPtr=img1+4*xoffset+4*w*yoffset; 324 dPtr=img2+4*width*(-height-1); 325 326 for (i=0; i<-height; ++i) 327 { 328 crMemcpy(dPtr, sPtr, 4*width); 329 sPtr += 4*w; 330 dPtr -= 4*width; 331 } 332 333 gl->TexSubImage2D(target, level, xoffset, yoffset, width, -height, GL_RGBA, GL_UNSIGNED_BYTE, img2); 334 335 crFree(img1); 336 crFree(img2); 337 } 338 #endif 306 339 } 307 340 else if (siHaveFBO==1) /*@todo more states to set and restore here*/
Note:
See TracChangeset
for help on using the changeset viewer.