Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -1061,7 +1061,7 @@ |
1062 | 1062 | GLfloat tmp[16];
|
1063 | 1063 | ZeroMemory(&worldview,sizeof(D3DMATRIX));
|
1064 | 1064 | ZeroMemory(&tmp,sizeof(D3DMATRIX));
|
1065 | | - __gluMultMatricesf(matView,matWorld,worldview); // Get worldview
|
| 1065 | + __gluMultMatricesf(matWorld,matView,worldview); // Get worldview
|
1066 | 1066 | if(__gluInvertMatrixf(worldview,tmp)) // Invert
|
1067 | 1067 | memcpy(matNormal,tmp,16*sizeof(GLfloat));
|
1068 | 1068 | else memcpy(matNormal,worldview,16*sizeof(GLfloat));
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -649,13 +649,8 @@ |
650 | 650 | }
|
651 | 651 | if(riid == IID_IDirect3D7)
|
652 | 652 | {
|
653 | | - #ifdef _DEBUG
|
654 | 653 | *ppvObj = new glDirect3D7(this);
|
655 | 654 | return DD_OK;
|
656 | | - #else
|
657 | | - FIXME("Add IDirect3D Interfaces\n");
|
658 | | - ERR(DDERR_GENERIC);
|
659 | | - #endif
|
660 | 655 | }
|
661 | 656 | if(riid == IID_IDirectDrawGammaControl)
|
662 | 657 | {
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | palette = palettein;
|
115 | 115 | palette->AddRef();
|
116 | 116 | }
|
117 | | - paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP,GL_CLAMP,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
| 117 | + paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
118 | 118 | }
|
119 | 119 | else paltex = 0;
|
120 | 120 | }
|
— | — | @@ -386,7 +386,7 @@ |
387 | 387 | return;
|
388 | 388 | }
|
389 | 389 | }
|
390 | | - texture = renderer->MakeTexture(filter,filter,GL_CLAMP,GL_CLAMP,fakex,fakey,texformat,texformat2,texformat3);
|
| 390 | + texture = renderer->MakeTexture(filter,filter,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,fakex,fakey,texformat,texformat2,texformat3);
|
391 | 391 | }
|
392 | 392 |
|
393 | 393 | if(ddsd.ddpfPixelFormat.dwRGBBitCount > 8)
|
— | — | @@ -970,8 +970,8 @@ |
971 | 971 | }
|
972 | 972 | if(backbuffer) backbuffer->Restore2();
|
973 | 973 | if(zbuffer) zbuffer->Restore2();
|
974 | | - if(paltex) paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP,GL_CLAMP,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
975 | | - texture = renderer->MakeTexture(filter,filter,GL_CLAMP,GL_CLAMP,fakex,fakey,texformat,texformat2,texformat3);
|
| 974 | + if(paltex) paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
| 975 | + texture = renderer->MakeTexture(filter,filter,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,fakex,fakey,texformat,texformat2,texformat3);
|
976 | 976 | }
|
977 | 977 | }
|
978 | 978 | HRESULT WINAPI glDirectDrawSurface7::Restore()
|
— | — | @@ -1014,8 +1014,8 @@ |
1015 | 1015 | if(backbuffer) backbuffer->Restore();
|
1016 | 1016 | if(zbuffer) zbuffer->Restore();
|
1017 | 1017 | }
|
1018 | | - if(paltex) paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP,GL_CLAMP,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
1019 | | - texture = renderer->MakeTexture(filter,filter,GL_CLAMP,GL_CLAMP,fakex,fakey,texformat,texformat2,texformat3);
|
| 1018 | + if(paltex) paltex = renderer->MakeTexture(GL_NEAREST,GL_NEAREST,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,256,1,GL_RGBA,GL_UNSIGNED_BYTE,GL_RGB);
|
| 1019 | + texture = renderer->MakeTexture(filter,filter,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,fakex,fakey,texformat,texformat2,texformat3);
|
1020 | 1020 | return DD_OK;
|
1021 | 1021 | }
|
1022 | 1022 | else return DD_OK;
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -625,8 +625,6 @@ |
626 | 626 | if(dwFlags & DDBLT_COLORFILL)
|
627 | 627 | {
|
628 | 628 | SetShader(PROG_FILL,NULL,NULL,true);
|
629 | | - glDisable(GL_TEXTURE_2D);
|
630 | | - glDisable(GL_ALPHA_TEST);
|
631 | 629 | switch(ddInterface->GetBPP())
|
632 | 630 | {
|
633 | 631 | case 8:
|
— | — | @@ -663,10 +661,6 @@ |
664 | 662 | break;
|
665 | 663 | }
|
666 | 664 | }
|
667 | | - else
|
668 | | - {
|
669 | | - glEnable(GL_TEXTURE_2D);
|
670 | | - }
|
671 | 665 | if((dwFlags & DDBLT_KEYSRC) && (src && src->colorkey[0].enabled) && !(dwFlags & DDBLT_COLORFILL))
|
672 | 666 | {
|
673 | 667 | SetShader(PROG_CKEY,NULL,NULL,true);
|
— | — | @@ -726,7 +720,6 @@ |
727 | 721 | glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
728 | 722 | }
|
729 | 723 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
730 | | - glDisable(GL_TEXTURE_2D);
|
731 | 724 | SetFBO(0,0,false);
|
732 | 725 | if(((ddsd.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER)) &&
|
733 | 726 | (ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) ||
|
— | — | @@ -740,7 +733,6 @@ |
741 | 734 | GLuint texture;
|
742 | 735 | glGenTextures(1,&texture);
|
743 | 736 | glBindTexture(GL_TEXTURE_2D,texture);
|
744 | | - glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
|
745 | 737 | glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,(GLfloat)min);
|
746 | 738 | glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,(GLfloat)mag);
|
747 | 739 | glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,(GLfloat)wraps);
|
— | — | @@ -755,7 +747,7 @@ |
756 | 748 | glActiveTexture(GL_TEXTURE0);
|
757 | 749 | if(!backbuffer)
|
758 | 750 | {
|
759 | | - backbuffer = _MakeTexture(GL_LINEAR,GL_LINEAR,GL_CLAMP,GL_CLAMP,x,y,GL_BGRA,GL_UNSIGNED_BYTE,GL_RGBA8);
|
| 751 | + backbuffer = _MakeTexture(GL_LINEAR,GL_LINEAR,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,x,y,GL_BGRA,GL_UNSIGNED_BYTE,GL_RGBA8);
|
760 | 752 | backx = x;
|
761 | 753 | backy = y;
|
762 | 754 | }
|
— | — | @@ -869,7 +861,6 @@ |
870 | 862 | {
|
871 | 863 | _DrawBackbuffer(&texture,dest->fakex,dest->fakey);
|
872 | 864 | SetShader(PROG_TEXTURE,NULL,NULL,true);
|
873 | | - glEnable(GL_TEXTURE_2D);
|
874 | 865 | glBindTexture(GL_TEXTURE_2D,texture);
|
875 | 866 | GLuint prog = GetProgram() & 0xFFFFFFFF;
|
876 | 867 | GLint texloc = glGetUniformLocation(prog,"Texture");
|
— | — | @@ -879,7 +870,6 @@ |
880 | 871 | else
|
881 | 872 | {
|
882 | 873 | SetShader(PROG_TEXTURE,NULL,NULL,true);
|
883 | | - glEnable(GL_TEXTURE_2D);
|
884 | 874 | glBindTexture(GL_TEXTURE_2D,texture);
|
885 | 875 | GLuint prog = GetProgram() & 0xFFFFFFFF;
|
886 | 876 | GLint texloc = glGetUniformLocation(prog,"Texture");
|
— | — | @@ -916,7 +906,6 @@ |
917 | 907 | glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
918 | 908 | }
|
919 | 909 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
920 | | - glDisable(GL_TEXTURE_2D);
|
921 | 910 | glFlush();
|
922 | 911 | if(hasHWnd) SwapBuffers(hDC);
|
923 | 912 | else
|
— | — | @@ -965,8 +954,6 @@ |
966 | 955 | if(zbuffer) glEnable(GL_DEPTH_TEST);
|
967 | 956 | glDepthFunc(GL_LEQUAL);
|
968 | 957 | glDisable(GL_DITHER);
|
969 | | - glEnable(GL_LIGHTING);
|
970 | | - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient);
|
971 | 958 | }
|
972 | 959 |
|
973 | 960 | void glRenderer::_Clear(glDirectDrawSurface7 *target, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
|
Index: dxgltest/dxgltest.cpp |
— | — | @@ -714,15 +714,11 @@ |
715 | 715 | tab.pszText = _T("2D Graphics");
|
716 | 716 | hTab = GetDlgItem(hWnd,IDC_TABS);
|
717 | 717 | SendDlgItemMessage(hWnd,IDC_TABS,TCM_INSERTITEM,1,(LPARAM)&tab);
|
718 | | - #ifdef _DEBUG
|
719 | 718 | tab.pszText = _T("3D Graphics");
|
720 | 719 | SendDlgItemMessage(hWnd,IDC_TABS,TCM_INSERTITEM,2,(LPARAM)&tab);
|
721 | | - #endif
|
722 | 720 | tabwnd[0] = CreateDialog(hinstance,MAKEINTRESOURCE(IDD_SYSINFO),hTab,SysTabCallback);
|
723 | 721 | tabwnd[1] = CreateDialog(hinstance,MAKEINTRESOURCE(IDD_TESTGFX),hTab,Test2DCallback);
|
724 | | - #ifdef _DEBUG
|
725 | 722 | tabwnd[2] = CreateDialog(hinstance,MAKEINTRESOURCE(IDD_TESTGFX),hTab,Test3DCallback);
|
726 | | - #endif
|
727 | 723 | SendDlgItemMessage(hWnd,IDC_TABS,TCM_GETITEMRECT,0,(LPARAM)&tabrect);
|
728 | 724 | SetWindowPos(tabwnd[0],NULL,tabrect.left,tabrect.bottom+3,0,0,SWP_SHOWWINDOW|SWP_NOSIZE);
|
729 | 725 | ShowWindow(tabwnd[1],SW_HIDE);
|