DXGL r931 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r930‎ | r931 | r932 >
Date:23:59, 22 May 2019
Author:admin
Status:new
Tags:
Comment:
Expand temporary backbuffer to up to 16 buffers.
Fix a crash in DXGL Test when running a 2D test after running a D3D test.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glRenderer.h (modified) (history)
  • /dxglcfg/tests.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -707,11 +707,11 @@
708708 tmp_cmd.BltVertex_STORAGE.vertex[1].dests =
709709 tmp_cmd.BltVertex_STORAGE.vertex[3].dests = 0.0f;
710710 tmp_cmd.BltVertex_STORAGE.vertex[0].dests =
711 - tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
 711+ tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
712712 tmp_cmd.BltVertex_STORAGE.vertex[0].destt =
713713 tmp_cmd.BltVertex_STORAGE.vertex[1].destt = 1.0f;
714714 tmp_cmd.BltVertex_STORAGE.vertex[2].destt =
715 - tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
 715+ tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
716716 }
717717 if (cmd->Blt.cmd.flags & 0x10000000)
718718 {
@@ -786,10 +786,10 @@
787787 r1.bottom = cmd->Blt.cmd.dest->levels[0].ddsd.dwHeight;
788788 }
789789 // Check backbuffer size and resize
790 - if((This->backbuffer->levels[0].ddsd.dwWidth < r1.right) ||
791 - (This->backbuffer->levels[0].ddsd.dwHeight < r1.bottom))
 790+ if((This->backbuffers[0]->levels[0].ddsd.dwWidth < r1.right) ||
 791+ (This->backbuffers[0]->levels[0].ddsd.dwHeight < r1.bottom))
792792 {
793 - DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
 793+ DDSURFACEDESC2 newdesc = This->backbuffers[0]->levels[0].ddsd;
794794 if (newdesc.dwWidth < r1.right) newdesc.dwWidth = r1.right;
795795 if (newdesc.dwHeight < r1.bottom) newdesc.dwHeight = r1.bottom;
796796 tmp_cmd.SetTextureSurfaceDesc.opcode = OP_SETTEXTURESURFACEDESC;
@@ -804,7 +804,7 @@
805805 tmp_cmd.Blt.cmd.destrect = r1;
806806 tmp_cmd.Blt.cmd.srcrect = cmd->Blt.cmd.destrect;
807807 tmp_cmd.Blt.cmd.src = cmd->Blt.cmd.dest;
808 - tmp_cmd.Blt.cmd.dest = This->backbuffer;
 808+ tmp_cmd.Blt.cmd.dest = This->backbuffers[0];
809809 tmp_cmd.Blt.cmd.srclevel = cmd->Blt.cmd.destlevel;
810810 tmp_cmd.Blt.cmd.destlevel = 0;
811811 glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
@@ -828,7 +828,7 @@
829829 i++;
830830 usetexture = TRUE;
831831 tmp_cmd.SetTexture.texstage[i].stage = 9;
832 - tmp_cmd.SetTexture.texstage[i].texture = This->backbuffer;
 832+ tmp_cmd.SetTexture.texstage[i].texture = This->backbuffers[0];
833833 }
834834 // Set Pattern texture (Unit 10)
835835 if (usepattern)
@@ -1003,11 +1003,11 @@
10041004 tmp_cmd.BltVertex_STORAGE.vertex[1].dests =
10051005 tmp_cmd.BltVertex_STORAGE.vertex[3].dests = 0.0f;
10061006 tmp_cmd.BltVertex_STORAGE.vertex[0].dests =
1007 - tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
 1007+ tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
10081008 tmp_cmd.BltVertex_STORAGE.vertex[0].destt =
10091009 tmp_cmd.BltVertex_STORAGE.vertex[1].destt = 1.0f;
10101010 tmp_cmd.BltVertex_STORAGE.vertex[2].destt =
1011 - tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
 1011+ tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
10121012 }
10131013 if (cmd->Blt.cmd.flags & 0x10000000)
10141014 {
@@ -1138,10 +1138,10 @@
11391139 (cmd->DrawScreen.texture->bigheight != (view[3]-view[2]))))
11401140 {
11411141 // Check backbuffer size and resize
1142 - if ((This->backbuffer->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
1143 - (This->backbuffer->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
 1142+ if ((This->backbuffers[0]->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
 1143+ (This->backbuffers[0]->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
11441144 {
1145 - DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
 1145+ DDSURFACEDESC2 newdesc = This->backbuffers[0]->levels[0].ddsd;
11461146 if (newdesc.dwWidth < cmd->DrawScreen.texture->bigwidth)
11471147 newdesc.dwWidth = cmd->DrawScreen.texture->bigwidth;
11481148 if (newdesc.dwHeight < cmd->DrawScreen.texture->bigheight)
@@ -1181,11 +1181,11 @@
11821182 sizeof(BltVertex), &vertex->s, TRUE, sizeof(MIN_STORAGE_CMD));
11831183 glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
11841184 // Set render target to backbuffer
1185 - if ((This->state.target.target != This->backbuffer) || (This->state.target.target != 0))
 1185+ if ((This->state.target.target != This->backbuffers[0]) || (This->state.target.target != 0))
11861186 {
11871187 tmp_cmd.SetRenderTarget.opcode = OP_SETRENDERTARGET;
11881188 tmp_cmd.SetRenderTarget.size = sizeof(SetRenderTargetCmd) - 8;
1189 - tmp_cmd.SetRenderTarget.target.target = This->backbuffer;
 1189+ tmp_cmd.SetRenderTarget.target.target = This->backbuffers[0];
11901190 tmp_cmd.SetRenderTarget.target.level = 0;
11911191 tmp_cmd.SetRenderTarget.target.zbuffer = NULL;
11921192 tmp_cmd.SetRenderTarget.target.zlevel = 0;
@@ -1193,8 +1193,8 @@
11941194 glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
11951195 }
11961196 // Set viewport to backbuffer
1197 - r2.right = This->backbuffer->levels[0].ddsd.dwWidth;
1198 - r2.bottom = This->backbuffer->levels[0].ddsd.dwHeight;
 1197+ r2.right = This->backbuffers[0]->levels[0].ddsd.dwWidth;
 1198+ r2.bottom = This->backbuffers[0]->levels[0].ddsd.dwHeight;
11991199 if (This->state.viewport.x || This->state.viewport.y ||
12001200 (This->state.viewport.width != r2.right) || (This->state.viewport.hieght != r2.bottom))
12011201 {
@@ -1241,7 +1241,7 @@
12421242 tmp_cmd.SetTexture.opcode = OP_SETTEXTURE;
12431243 tmp_cmd.SetTexture.size = sizeof(SetTextureCmd) + sizeof(DWORD) + sizeof(glTexture*);
12441244 tmp_cmd.SetTexture.texstage[0].stage = 8;
1245 - tmp_cmd.SetTexture.texstage[0].texture = This->backbuffer;
 1245+ tmp_cmd.SetTexture.texstage[0].texture = This->backbuffers[0];
12461246 tmp_cmd.SetTexture.count = 1;
12471247 glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
12481248 }
@@ -1358,9 +1358,9 @@
13591359 (cmd->DrawScreen.texture->bigheight != (view[3] - view[2]))))
13601360 {
13611361 This->bltvertices[0].s = This->bltvertices[2].s =
1362 - (GLfloat)cmd->DrawScreen.texture->bigwidth / (GLfloat)This->backbuffer->bigwidth;
 1362+ (GLfloat)cmd->DrawScreen.texture->bigwidth / (GLfloat)This->backbuffers[0]->bigwidth;
13631363 This->bltvertices[0].t = This->bltvertices[1].t =
1364 - (GLfloat)cmd->DrawScreen.texture->bigheight / (GLfloat)This->backbuffer->bigheight;
 1364+ (GLfloat)cmd->DrawScreen.texture->bigheight / (GLfloat)This->backbuffers[0]->bigheight;
13651365 This->bltvertices[1].s = This->bltvertices[2].t = This->bltvertices[3].s = This->bltvertices[3].t = 0.0f;
13661366 }
13671367 else
@@ -1675,7 +1675,7 @@
16761676 This->fogstart = 0.0f;
16771677 This->fogend = 1.0f;
16781678 This->fogdensity = 1.0f;
1679 - This->backbuffer = NULL;
 1679+ ZeroMemory(&This->backbuffers, 16 * sizeof(glTexture*));
16801680 This->hDC = NULL;
16811681 This->hRC = NULL;
16821682 This->pbo = NULL;
@@ -2817,6 +2817,7 @@
28182818 */
28192819 DWORD glRenderer__Entry(glRenderer *This)
28202820 {
 2821+ int i;
28212822 EnterCriticalSection(&This->cs);
28222823 glRenderer__InitGL(This,(int)This->inputs[0],(int)This->inputs[1],(int)This->inputs[2],
28232824 (int)This->inputs[3],(unsigned int)This->inputs[4],(HWND)This->inputs[5],
@@ -2843,10 +2844,13 @@
28442845 BufferObject_Release(This->pbo);
28452846 This->pbo = NULL;
28462847 }
2847 - if(This->backbuffer)
 2848+ for (i = 0; i < 16; i++)
28482849 {
2849 - glTexture_Release(This->backbuffer, TRUE);
2850 - This->backbuffer = NULL;
 2850+ if (This->backbuffers[i])
 2851+ {
 2852+ glTexture_Release(This->backbuffers[i], TRUE);
 2853+ This->backbuffers[i] = NULL;
 2854+ }
28512855 }
28522856 //glRenderer__DeleteCommandBuffer(&This->cmd1);
28532857 //glRenderer__DeleteCommandBuffer(&This->cmd2);
@@ -3396,11 +3400,11 @@
33973401 {
33983402 ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
33993403 if(!(cmd->flags & 0x80000000))
3400 - glRenderer__DrawBackbufferRect(This, cmd->dest, destrect, destrect2, PROG_TEXTURE);
 3404+ glRenderer__DrawBackbufferRect(This, cmd->dest, destrect, destrect2, PROG_TEXTURE, 0);
34013405 This->bltvertices[1].dests = This->bltvertices[3].dests = 0.0f;
3402 - This->bltvertices[0].dests = This->bltvertices[2].dests = (GLfloat)(destrect.right - destrect.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
 3406+ This->bltvertices[0].dests = This->bltvertices[2].dests = (GLfloat)(destrect.right - destrect.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
34033407 This->bltvertices[0].destt = This->bltvertices[1].destt = 1.0f;
3404 - This->bltvertices[2].destt = This->bltvertices[3].destt = 1.0f - ((GLfloat)(destrect.bottom - destrect.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
 3408+ This->bltvertices[2].destt = This->bltvertices[3].destt = 1.0f - ((GLfloat)(destrect.bottom - destrect.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
34053409 }
34063410 ShaderManager_SetShader(This->shaders, shaderid, NULL, 1);
34073411 GenShader2D *shader = (GenShader2D*)This->shaders->gen3d->current_genshader;
@@ -3529,7 +3533,7 @@
35303534 if (usedest && (shader->shader.uniforms[2] != -1))
35313535 {
35323536 if(cmd->flags & 0x80000000) glUtil_SetTexture(This->util, 9, cmd->dest);
3533 - else glUtil_SetTexture(This->util, 9, This->backbuffer);
 3537+ else glUtil_SetTexture(This->util, 9, This->backbuffers[0]);
35343538 This->ext->glUniform1i(shader->shader.uniforms[2], 9);
35353539 }
35363540 if (usepattern && (shader->shader.uniforms[3] != -1))
@@ -3611,7 +3615,7 @@
36123616 glTexture__FinishCreate(texture);
36133617 }
36143618
3615 -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass)
 3619+void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass, int index)
36163620 {
36173621 GLfloat view[4];
36183622 DDSURFACEDESC2 ddsd;
@@ -3619,7 +3623,7 @@
36203624 x2 = (DWORD)((float)x * This->postsizex);
36213625 y2 = (DWORD)((float)y * This->postsizey);
36223626 glUtil_SetActiveTexture(This->util,8);
3623 - if(!This->backbuffer)
 3627+ if(!This->backbuffers[index])
36243628 {
36253629 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
36263630 memcpy(&ddsd, &ddsdbackbuffer, sizeof(DDSURFACEDESC2));
@@ -3626,9 +3630,9 @@
36273631 ddsd.dwWidth = x2;
36283632 ddsd.lPitch = x2 * 4;
36293633 ddsd.dwHeight = y2;
3630 - glTexture_Create(&ddsd, &This->backbuffer, This, x2, y2, FALSE, TRUE, 0);
 3634+ glTexture_Create(&ddsd, &This->backbuffers[index], This, x2, y2, FALSE, TRUE, 0);
36313635 }
3632 - if((This->backbuffer->levels[0].ddsd.dwWidth != x2) || (This->backbuffer->levels[0].ddsd.dwHeight != y2))
 3636+ if((This->backbuffers[index]->levels[0].ddsd.dwWidth != x2) || (This->backbuffers[index]->levels[0].ddsd.dwHeight != y2))
36333637 {
36343638 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
36353639 ddsd.dwSize = sizeof(DDSURFACEDESC2);
@@ -3635,9 +3639,9 @@
36363640 ddsd.dwWidth = x2;
36373641 ddsd.dwHeight = y2;
36383642 ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT;
3639 - glTexture__SetSurfaceDesc(This->backbuffer, &ddsd);
 3643+ glTexture__SetSurfaceDesc(This->backbuffers[index], &ddsd);
36403644 }
3641 - glUtil_SetFBOTextures(This->util,&This->fbo,This->backbuffer,NULL,0,0,FALSE);
 3645+ glUtil_SetFBOTextures(This->util,&This->fbo,This->backbuffers[index],NULL,0,0,FALSE);
36423646 view[0] = view[2] = 0;
36433647 view[1] = (GLfloat)x2;
36443648 view[3] = (GLfloat)y2;
@@ -3644,7 +3648,7 @@
36453649 glUtil_SetViewport(This->util,0,0,x2,y2);
36463650 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
36473651 glUtil_SetTexture(This->util,8,*texture);
3648 - *texture = This->backbuffer;
 3652+ *texture = This->backbuffers[index];
36493653 if (!paletted && firstpass && (dxglcfg.postfilter == 1))
36503654 glTexture__SetFilter(*texture, 8, GL_LINEAR, GL_LINEAR, This);
36513655 else glTexture__SetFilter(*texture, 8, GL_NEAREST, GL_NEAREST, This);
@@ -3665,7 +3669,7 @@
36663670 glUtil_SetFBO(This->util, NULL);
36673671 }
36683672
3669 -void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype)
 3673+void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype, int index)
36703674 {
36713675 GLfloat view[4];
36723676 DDSURFACEDESC2 ddsd;
@@ -3673,8 +3677,9 @@
36743678 int x2 = destrect.right;
36753679 int y1 = destrect.top;
36763680 int y2 = destrect.bottom;
 3681+ if (index > 15) return;
36773682 glUtil_SetActiveTexture(This->util, 0);
3678 - if (!This->backbuffer)
 3683+ if (!This->backbuffers[index])
36793684 {
36803685 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
36813686 memcpy(&ddsd, &ddsdbackbuffer, sizeof(DDSURFACEDESC2));
@@ -3681,27 +3686,27 @@
36823687 ddsd.dwWidth = x2;
36833688 ddsd.lPitch = x2 * 4;
36843689 ddsd.dwHeight = y2;
3685 - glTexture_Create(&ddsd, &This->backbuffer, This, x2, y2, FALSE, TRUE, 0);
 3690+ glTexture_Create(&ddsd, &This->backbuffers[index], This, x2, y2, FALSE, TRUE, 0);
36863691 }
3687 - if ((This->backbuffer->levels[0].ddsd.dwWidth < x2) || (This->backbuffer->levels[0].ddsd.dwHeight < y2))
 3692+ if ((This->backbuffers[index]->levels[0].ddsd.dwWidth < x2) || (This->backbuffers[index]->levels[0].ddsd.dwHeight < y2))
36883693 {
3689 - if (This->backbuffer->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffer->levels[0].ddsd.dwWidth;
3690 - if (This->backbuffer->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffer->levels[0].ddsd.dwHeight;
 3694+ if (This->backbuffers[index]->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffers[index]->levels[0].ddsd.dwWidth;
 3695+ if (This->backbuffers[index]->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffers[index]->levels[0].ddsd.dwHeight;
36913696 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
36923697 ddsd.dwSize = sizeof(DDSURFACEDESC2);
36933698 ddsd.dwWidth = x2;
36943699 ddsd.dwHeight = y2;
36953700 ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT;
3696 - glTexture__SetSurfaceDesc(This->backbuffer, &ddsd);
 3701+ glTexture__SetSurfaceDesc(This->backbuffers[index], &ddsd);
36973702 x2 = destrect.right;
36983703 y2 = destrect.bottom;
36993704 }
3700 - glUtil_SetFBOTextures(This->util, &This->fbo, This->backbuffer, NULL, 0, 0, FALSE);
 3705+ glUtil_SetFBOTextures(This->util, &This->fbo, This->backbuffers[index], NULL, 0, 0, FALSE);
37013706 view[0] = view[2] = 0;
3702 - view[1] = (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
3703 - view[3] = (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight;
3704 - glUtil_SetViewport(This->util, 0, 0, This->backbuffer->levels[0].ddsd.dwWidth, This->backbuffer->levels[0].ddsd.dwHeight);
3705 - glUtil_SetScissor(This->util, TRUE, 0, 0, This->backbuffer->levels[0].ddsd.dwWidth, This->backbuffer->levels[0].ddsd.dwHeight);
 3707+ view[1] = (GLfloat)This->backbuffers[index]->levels[0].ddsd.dwWidth;
 3708+ view[3] = (GLfloat)This->backbuffers[index]->levels[0].ddsd.dwHeight;
 3709+ glUtil_SetViewport(This->util, 0, 0, This->backbuffers[index]->levels[0].ddsd.dwWidth, This->backbuffers[index]->levels[0].ddsd.dwHeight);
 3710+ glUtil_SetScissor(This->util, TRUE, 0, 0, This->backbuffers[index]->levels[0].ddsd.dwWidth, This->backbuffers[index]->levels[0].ddsd.dwHeight);
37063711 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
37073712 glUtil_SetScissor(This->util, FALSE, 0, 0, 0, 0);
37083713 glUtil_SetTexture(This->util, 8, texture);
@@ -4080,7 +4085,7 @@
40814086 glUtil_SetTexture(This->util,9,paltex);
40824087 if(dxglcfg.scalingfilter || (This->postsizex != 1.0f) || (This->postsizey != 1.0f))
40834088 {
4084 - glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE,TRUE);
 4089+ glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE,TRUE,0);
40854090 ShaderManager_SetShader(This->shaders,PROG_TEXTURE,NULL,0);
40864091 progtype = PROG_TEXTURE;
40874092 glUtil_SetTexture(This->util,8,texture);
@@ -4093,7 +4098,7 @@
40944099 {
40954100 progtype = PROG_TEXTURE;
40964101 ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
4097 - glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE, TRUE);
 4102+ glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE, TRUE, 0);
40984103 glUtil_SetTexture(This->util, 8, texture);
40994104 This->ext->glUniform1i(This->shaders->shaders[progtype].tex0, 0);
41004105 }
Index: ddraw/glRenderer.h
@@ -136,7 +136,7 @@
137137 HANDLE start;
138138 unsigned int frequency;
139139 DXGLTimer timer;
140 - glTexture *backbuffer;
 140+ glTexture *backbuffers[16];
141141 DWORD fogcolor;
142142 GLfloat fogstart;
143143 GLfloat fogend;
@@ -210,8 +210,8 @@
211211 void glRenderer__MakeTexture(glRenderer *This, glTexture *texture);
212212 void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync, BOOL settime, OVERLAY *overlays, int overlaycount);
213213 void glRenderer__DeleteTexture(glRenderer *This, glTexture *texture);
214 -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass);
215 -void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype);
 214+void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass, int index);
 215+void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype, int index);
216216 void glRenderer__InitD3D(glRenderer *This, int zbuffer, int x, int y);
217217 void glRenderer__Clear(glRenderer *This, ClearCommand *cmd);
218218 void glRenderer__UpdateFVF(glRenderer *This, DWORD fvf);
Index: dxglcfg/tests.cpp
@@ -244,7 +244,7 @@
245245 if (d3d7)
246246 {
247247 d3d7->Release();
248 - d3d7dev = NULL;
 248+ d3d7 = NULL;
249249 }
250250 if(ddsrender)
251251 {