From: divverent Date: Mon, 31 Dec 2012 19:10:23 +0000 (+0000) Subject: slightly speed up vid_glx by better XShm handling X-Git-Tag: xonotic-v0.7.0~80 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=0b34348ca5a972c7f7f0778fb66b3b896f53066f;p=xonotic%2Fdarkplaces.git slightly speed up vid_glx by better XShm handling git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11869 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=72d3f0988ac562e626cc3c2226a2746ef8bfc0ed --- diff --git a/vid_glx.c b/vid_glx.c index 5b77483f..c066555c 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -909,18 +909,18 @@ void VID_Finish (void) vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data; DPSOFTRAST_SetRenderTargets(vid.width, vid.height, vid.softdepthpixels, vid.softpixels, NULL, NULL, NULL); + ++vidx11_shmwait; + XShmPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[!vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height, True); + // save mouse motion so we can deal with it later in_mouse_x = 0; in_mouse_y = 0; - while(vidx11_shmwait) + while(vidx11_shmwait > 1) HandleEvents(); in_mouse_x_save += in_mouse_x; in_mouse_y_save += in_mouse_y; in_mouse_x = 0; in_mouse_y = 0; - - ++vidx11_shmwait; - XShmPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[!vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height, True); } else { // no buffer switching here, we just flush the renderer DPSOFTRAST_Finish();