Index: buildtool/buildtool.vcxproj |
— | — | @@ -1,10 +1,18 @@ |
2 | 2 | <?xml version="1.0" encoding="utf-8"?>
|
3 | 3 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
4 | 4 | <ItemGroup Label="ProjectConfigurations">
|
| 5 | + <ProjectConfiguration Include="Debug no DXGL|Win32">
|
| 6 | + <Configuration>Debug no DXGL</Configuration>
|
| 7 | + <Platform>Win32</Platform>
|
| 8 | + </ProjectConfiguration>
|
5 | 9 | <ProjectConfiguration Include="Debug|Win32">
|
6 | 10 | <Configuration>Debug</Configuration>
|
7 | 11 | <Platform>Win32</Platform>
|
8 | 12 | </ProjectConfiguration>
|
| 13 | + <ProjectConfiguration Include="Release no DXGL|Win32">
|
| 14 | + <Configuration>Release no DXGL</Configuration>
|
| 15 | + <Platform>Win32</Platform>
|
| 16 | + </ProjectConfiguration>
|
9 | 17 | <ProjectConfiguration Include="Release|Win32">
|
10 | 18 | <Configuration>Release</Configuration>
|
11 | 19 | <Platform>Win32</Platform>
|
— | — | @@ -22,11 +30,21 @@ |
23 | 31 | <UseDebugLibraries>true</UseDebugLibraries>
|
24 | 32 | <CharacterSet>Unicode</CharacterSet>
|
25 | 33 | </PropertyGroup>
|
| 34 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'" Label="Configuration">
|
| 35 | + <ConfigurationType>Application</ConfigurationType>
|
| 36 | + <UseDebugLibraries>true</UseDebugLibraries>
|
| 37 | + <CharacterSet>Unicode</CharacterSet>
|
| 38 | + </PropertyGroup>
|
26 | 39 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
27 | 40 | <ConfigurationType>Application</ConfigurationType>
|
28 | 41 | <UseDebugLibraries>false</UseDebugLibraries>
|
29 | 42 | <CharacterSet>Unicode</CharacterSet>
|
30 | 43 | </PropertyGroup>
|
| 44 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release no DXGL|Win32'" Label="Configuration">
|
| 45 | + <ConfigurationType>Application</ConfigurationType>
|
| 46 | + <UseDebugLibraries>false</UseDebugLibraries>
|
| 47 | + <CharacterSet>Unicode</CharacterSet>
|
| 48 | + </PropertyGroup>
|
31 | 49 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
32 | 50 | <ImportGroup Label="ExtensionSettings">
|
33 | 51 | </ImportGroup>
|
— | — | @@ -33,16 +51,28 @@ |
34 | 52 | <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
35 | 53 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
36 | 54 | </ImportGroup>
|
| 55 | + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'" Label="PropertySheets">
|
| 56 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 57 | + </ImportGroup>
|
37 | 58 | <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
38 | 59 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
39 | 60 | </ImportGroup>
|
| 61 | + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release no DXGL|Win32'" Label="PropertySheets">
|
| 62 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
| 63 | + </ImportGroup>
|
40 | 64 | <PropertyGroup Label="UserMacros" />
|
41 | 65 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
42 | 66 | <LinkIncremental>true</LinkIncremental>
|
43 | 67 | </PropertyGroup>
|
| 68 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'">
|
| 69 | + <LinkIncremental>true</LinkIncremental>
|
| 70 | + </PropertyGroup>
|
44 | 71 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
45 | 72 | <LinkIncremental>false</LinkIncremental>
|
46 | 73 | </PropertyGroup>
|
| 74 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release no DXGL|Win32'">
|
| 75 | + <LinkIncremental>false</LinkIncremental>
|
| 76 | + </PropertyGroup>
|
47 | 77 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
48 | 78 | <ClCompile>
|
49 | 79 | <WarningLevel>Level3</WarningLevel>
|
— | — | @@ -57,6 +87,20 @@ |
58 | 88 | <PostBuildEvent />
|
59 | 89 | <PostBuildEvent />
|
60 | 90 | </ItemDefinitionGroup>
|
| 91 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'">
|
| 92 | + <ClCompile>
|
| 93 | + <WarningLevel>Level3</WarningLevel>
|
| 94 | + <Optimization>Disabled</Optimization>
|
| 95 | + <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 96 | + <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
|
| 97 | + </ClCompile>
|
| 98 | + <Link>
|
| 99 | + <GenerateDebugInformation>true</GenerateDebugInformation>
|
| 100 | + <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
| 101 | + </Link>
|
| 102 | + <PostBuildEvent />
|
| 103 | + <PostBuildEvent />
|
| 104 | + </ItemDefinitionGroup>
|
61 | 105 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
62 | 106 | <ClCompile>
|
63 | 107 | <WarningLevel>Level3</WarningLevel>
|
— | — | @@ -70,6 +114,19 @@ |
71 | 115 | <PostBuildEvent />
|
72 | 116 | <PostBuildEvent />
|
73 | 117 | </ItemDefinitionGroup>
|
| 118 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release no DXGL|Win32'">
|
| 119 | + <ClCompile>
|
| 120 | + <WarningLevel>Level3</WarningLevel>
|
| 121 | + <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| 122 | + <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
|
| 123 | + </ClCompile>
|
| 124 | + <Link>
|
| 125 | + <GenerateDebugInformation>true</GenerateDebugInformation>
|
| 126 | + <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
| 127 | + </Link>
|
| 128 | + <PostBuildEvent />
|
| 129 | + <PostBuildEvent />
|
| 130 | + </ItemDefinitionGroup>
|
74 | 131 | <ItemGroup>
|
75 | 132 | <ClInclude Include="resource.h" />
|
76 | 133 | </ItemGroup>
|
Index: ddraw/ddraw.vcxproj |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | <AdditionalDependencies>$(OutDir)cfgmgr.lib;glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
95 | 95 | </Link>
|
96 | 96 | <PreBuildEvent>
|
97 | | - <Command>$(OutDir)buildtool.exe makeheader $(SolutionDir)common</Command>
|
| 97 | + <Command>"$(OutDir)buildtool.exe" makeheader $(SolutionDir)common</Command>
|
98 | 98 | </PreBuildEvent>
|
99 | 99 | <PreBuildEvent>
|
100 | 100 | <Message>Create version headers</Message>
|
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | <PostBuildEvent />
|
121 | 121 | <PostBuildEvent />
|
122 | 122 | <PreBuildEvent>
|
123 | | - <Command>$(OutDir)buildtool.exe makeheader $(SolutionDir)common</Command>
|
| 123 | + <Command>"$(OutDir)buildtool.exe" makeheader $(SolutionDir)common</Command>
|
124 | 124 | </PreBuildEvent>
|
125 | 125 | <PreBuildEvent>
|
126 | 126 | <Message>Create version headers</Message>
|
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | <AdditionalDependencies>$(OutDir)cfgmgr.lib;glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
149 | 149 | </Link>
|
150 | 150 | <PreBuildEvent>
|
151 | | - <Command>$(OutDir)buildtool.exe makeheader $(SolutionDir)common</Command>
|
| 151 | + <Command>"$(OutDir)buildtool.exe" makeheader $(SolutionDir)common</Command>
|
152 | 152 | </PreBuildEvent>
|
153 | 153 | <PreBuildEvent>
|
154 | 154 | <Message>Create version headers</Message>
|
— | — | @@ -177,7 +177,7 @@ |
178 | 178 | </Link>
|
179 | 179 | <PostBuildEvent />
|
180 | 180 | <PreBuildEvent>
|
181 | | - <Command>$(OutDir)buildtool.exe makeheader $(SolutionDir)common</Command>
|
| 181 | + <Command>"$(OutDir)buildtool.exe" makeheader $(SolutionDir)common</Command>
|
182 | 182 | </PreBuildEvent>
|
183 | 183 | <PreBuildEvent>
|
184 | 184 | <Message>Create version headers</Message>
|
Index: dxgl.sln |
— | — | @@ -97,12 +97,12 @@ |
98 | 98 | {8041FD11-3A2E-4EE9-A3FF-A9755803B7FB}.Release no DXGL|Win32.Build.0 = Release|Win32
|
99 | 99 | {8041FD11-3A2E-4EE9-A3FF-A9755803B7FB}.Release|Win32.ActiveCfg = Release|Win32
|
100 | 100 | {8041FD11-3A2E-4EE9-A3FF-A9755803B7FB}.Release|Win32.Build.0 = Release|Win32
|
101 | | - {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug no DXGL|Win32.ActiveCfg = Debug|Win32
|
102 | | - {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug no DXGL|Win32.Build.0 = Debug|Win32
|
| 101 | + {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug no DXGL|Win32.ActiveCfg = Debug no DXGL|Win32
|
| 102 | + {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug no DXGL|Win32.Build.0 = Debug no DXGL|Win32
|
103 | 103 | {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug|Win32.ActiveCfg = Debug|Win32
|
104 | 104 | {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Debug|Win32.Build.0 = Debug|Win32
|
105 | | - {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release no DXGL|Win32.ActiveCfg = Release|Win32
|
106 | | - {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release no DXGL|Win32.Build.0 = Release|Win32
|
| 105 | + {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release no DXGL|Win32.ActiveCfg = Release no DXGL|Win32
|
| 106 | + {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release no DXGL|Win32.Build.0 = Release no DXGL|Win32
|
107 | 107 | {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release|Win32.ActiveCfg = Release|Win32
|
108 | 108 | {34883A93-DFE4-42EF-9DAE-BEE4D3FC87D0}.Release|Win32.Build.0 = Release|Win32
|
109 | 109 | {4DC98095-5F42-4A44-962C-346ABEE2C9B6}.Debug no DXGL|Win32.ActiveCfg = Debug|Win32
|
Index: dxgltest/Tests3D.cpp |
— | — | @@ -466,11 +466,11 @@ |
467 | 467 | D3DMATRIX matView;
|
468 | 468 | D3DMATRIX matProj;
|
469 | 469 | D3DMATRIX mat;
|
| 470 | + D3DMATERIAL7 material;
|
470 | 471 | switch(test)
|
471 | 472 | {
|
472 | 473 | case 0:
|
473 | 474 | MakeCube3D(points,normals,vertices);
|
474 | | - D3DMATERIAL7 material;
|
475 | 475 | ZeroMemory(&material,sizeof(D3DMATERIAL7));
|
476 | 476 | material.ambient.r = 0.5f;
|
477 | 477 | material.ambient.g = 0.5f;
|
— | — | @@ -553,6 +553,35 @@ |
554 | 554 | lights[0].dvAttenuation1 = 0.4f;
|
555 | 555 | error = d3d7dev->SetLight(0,&lights[0]);
|
556 | 556 | break;
|
| 557 | + case 2:
|
| 558 | + MakeCube3D(points,normals,vertices);
|
| 559 | + ZeroMemory(&material,sizeof(D3DMATERIAL7));
|
| 560 | + material.ambient.r = 1.0f;
|
| 561 | + material.ambient.g = 1.0f;
|
| 562 | + material.ambient.b = 1.0f;
|
| 563 | + material.diffuse.r = 1.0f;
|
| 564 | + material.diffuse.g = 1.0f;
|
| 565 | + material.diffuse.b = 1.0f;
|
| 566 | + error = d3d7dev->SetMaterial(&material);
|
| 567 | + error = d3d7dev->SetRenderState(D3DRENDERSTATE_LIGHTING, FALSE);
|
| 568 | + error = d3d7dev->SetRenderState(D3DRENDERSTATE_AMBIENT, 0xffffffff);
|
| 569 | + mat._11 = mat._22 = mat._33 = mat._44 = 1.0f;
|
| 570 | + mat._12 = mat._13 = mat._14 = mat._41 = 0.0f;
|
| 571 | + mat._21 = mat._23 = mat._24 = mat._42 = 0.0f;
|
| 572 | + mat._31 = mat._32 = mat._34 = mat._43 = 0.0f;
|
| 573 | + matWorld = mat;
|
| 574 | + error = d3d7dev->SetTransform(D3DTRANSFORMSTATE_WORLD,&matWorld);
|
| 575 | + matView = mat;
|
| 576 | + matView._43 = 10.0f;
|
| 577 | + error = d3d7dev->SetTransform(D3DTRANSFORMSTATE_VIEW,&matView);
|
| 578 | + matProj = mat;
|
| 579 | + matProj._11 = 2.0f;
|
| 580 | + matProj._22 = 2.0f;
|
| 581 | + matProj._34 = 1.0f;
|
| 582 | + matProj._43 = -1.0f;
|
| 583 | + matProj._44 = 0.0f;
|
| 584 | + error = d3d7dev->SetTransform(D3DTRANSFORMSTATE_PROJECTION,&matProj);
|
| 585 | + break;
|
557 | 586 | default:
|
558 | 587 | break;
|
559 | 588 | }
|
— | — | @@ -569,7 +598,7 @@ |
570 | 599 | ZeroMemory(&ddsd,sizeof(DDSURFACEDESC2));
|
571 | 600 | if(d3dver >= 3) ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
572 | 601 | else ddsd.dwSize = sizeof(DDSURFACEDESC);
|
573 | | - d3d7dev->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,0,1.0,0);
|
| 602 | + error = d3d7dev->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,0,1.0,0);
|
574 | 603 | float time = (float)clock() / (float)CLOCKS_PER_SEC;
|
575 | 604 | switch(test)
|
576 | 605 | {
|
— | — | @@ -598,16 +627,30 @@ |
599 | 628 | mat._31 = (FLOAT)sin( (float)time );
|
600 | 629 | error = d3d7dev->SetTransform(D3DTRANSFORMSTATE_WORLD, &mat);
|
601 | 630 | error = d3d7dev->BeginScene();
|
602 | | - d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[0]->GetSurface());
|
| 631 | + error = d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[0]->GetSurface());
|
603 | 632 | error = d3d7dev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_VERTEX,vertices,4,0);
|
604 | | - d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[1]->GetSurface());
|
| 633 | + error = d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[1]->GetSurface());
|
605 | 634 | error = d3d7dev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_VERTEX,vertices+4,4,0);
|
606 | | - d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[2]->GetSurface());
|
| 635 | + error = d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[2]->GetSurface());
|
607 | 636 | error = d3d7dev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_VERTEX,vertices+8,4,0);
|
608 | | - d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[3]->GetSurface());
|
| 637 | + error = d3d7dev->SetTexture(0,(LPDIRECTDRAWSURFACE7)textures[3]->GetSurface());
|
609 | 638 | error = d3d7dev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_VERTEX,vertices+12,4,0);
|
610 | 639 | error = d3d7dev->EndScene();
|
611 | 640 | break;
|
| 641 | + case 2:
|
| 642 | + mat._11 = mat._22 = mat._33 = mat._44 = 1.0f;
|
| 643 | + mat._12 = mat._13 = mat._14 = mat._41 = 0.0f;
|
| 644 | + mat._21 = mat._23 = mat._24 = mat._42 = 0.0f;
|
| 645 | + mat._31 = mat._32 = mat._34 = mat._43 = 0.0f;
|
| 646 | + mat._11 = (FLOAT)cos( (float)time );
|
| 647 | + mat._33 = (FLOAT)cos( (float)time );
|
| 648 | + mat._13 = -(FLOAT)sin( (float)time );
|
| 649 | + mat._31 = (FLOAT)sin( (float)time );
|
| 650 | + error = d3d7dev->SetTransform(D3DTRANSFORMSTATE_WORLD, &mat);
|
| 651 | + error = d3d7dev->BeginScene();
|
| 652 | + error = d3d7dev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,D3DFVF_VERTEX,vertices,24,cube_mesh,36,0);
|
| 653 | + error = d3d7dev->EndScene();
|
| 654 | + break;
|
612 | 655 | default:
|
613 | 656 | break;
|
614 | 657 | }
|
— | — | @@ -623,6 +666,7 @@ |
624 | 667 | GetClientRect(hWnd,&destrect);
|
625 | 668 | OffsetRect(&destrect,p.x,p.y);
|
626 | 669 | SetRect(&srcrect,0,0,width,height);
|
| 670 | + ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
627 | 671 | if(ddsurface && ddsrender)error = ddsurface->Blt(&destrect,ddsrender,&srcrect,DDBLT_WAIT,NULL);
|
628 | 672 | }
|
629 | 673 | }
|
— | — | @@ -634,14 +678,67 @@ |
635 | 679 |
|
636 | 680 | INT_PTR CALLBACK TexShader7Proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
637 | 681 | {
|
| 682 | + HRESULT error;
|
| 683 | + D3DVIEWPORT7 vp;
|
| 684 | + HWND hDisplay;
|
638 | 685 | switch(Msg)
|
639 | 686 | {
|
640 | 687 | case WM_INITDIALOG:
|
641 | | -
|
| 688 | + RECT r;
|
| 689 | + DDSCAPS2 caps;
|
| 690 | + DDSURFACEDESC2 ddsd;
|
| 691 | + DDPIXELFORMAT ddpfz;
|
| 692 | + testnum = 2;
|
| 693 | + ddinterface = new MultiDirectDraw(7,&error,NULL);
|
| 694 | + hDisplay = GetDlgItem(hWnd,IDC_DISPLAY);
|
| 695 | + ::hWnd = hDisplay;
|
| 696 | + error = ddinterface->SetCooperativeLevel(hDisplay,DDSCL_NORMAL);
|
| 697 | + ZeroMemory(&ddsd,sizeof(DDSURFACEDESC2));
|
| 698 | + ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
| 699 | + ddsd.dwFlags = DDSD_CAPS;
|
| 700 | + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
| 701 | + error = ddinterface->CreateSurface(&ddsd,&ddsurface,NULL);
|
| 702 | + error = ddinterface->CreateClipper(0,&ddclipper,NULL);
|
| 703 | + error = ddclipper->SetHWnd(0,hDisplay);
|
| 704 | + ZeroMemory(&ddsd,sizeof(DDSURFACEDESC2));
|
| 705 | + ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
| 706 | + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
| 707 | + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_3DDEVICE;
|
| 708 | + GetClientRect(hDisplay,&r);
|
| 709 | + ddsd.dwWidth = r.right;
|
| 710 | + ddsd.dwHeight = r.bottom;
|
| 711 | + error = ddinterface->CreateSurface(&ddsd,&ddsrender,NULL);
|
| 712 | + error = ddinterface->QueryInterface(IID_IDirect3D7,(VOID**)&d3d7);
|
| 713 | + error = d3d7->EnumZBufferFormats(IID_IDirect3DRGBDevice,zcallback,&ddpfz);
|
| 714 | + error = ddsrender->GetSurfaceDesc(&ddsd);
|
| 715 | + ddsd.dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT;
|
| 716 | + ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER|DDSCAPS_VIDEOMEMORY;
|
| 717 | + memcpy(&ddsd.ddpfPixelFormat,&ddpfz,sizeof(DDPIXELFORMAT));
|
| 718 | + error = ddinterface->CreateSurface(&ddsd,&zbuffer,NULL);
|
| 719 | + error = ddsrender->AddAttachedSurface(zbuffer);
|
| 720 | + error = d3d7->CreateDevice(IID_IDirect3DHALDevice,(LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(),&d3d7dev);
|
| 721 | + if(error != D3D_OK)
|
| 722 | + error = d3d7->CreateDevice(IID_IDirect3DRGBDevice,(LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(),&d3d7dev);
|
| 723 | + ddsrender->GetSurfaceDesc(&ddsd);
|
| 724 | + vp.dvMaxZ = 1.0f;
|
| 725 | + vp.dvMinZ = 0.0f;
|
| 726 | + vp.dwX = vp.dwY = 0;
|
| 727 | + vp.dwWidth = ddsd.dwWidth;
|
| 728 | + vp.dwHeight = ddsd.dwHeight;
|
| 729 | + error = d3d7dev->SetViewport(&vp);
|
| 730 | + error = d3d7dev->SetRenderState(D3DRENDERSTATE_ZENABLE,TRUE);
|
| 731 | + InitTest3D(2);
|
| 732 | + ::width = ddsd.dwWidth;
|
| 733 | + ::height = ddsd.dwHeight;
|
| 734 | + StartTimer(hWnd,WM_APP,60);
|
642 | 735 | break;
|
643 | 736 | case WM_CLOSE:
|
| 737 | + ddinterface->Release();
|
644 | 738 | EndDialog(hWnd,IDCANCEL);
|
645 | 739 | break;
|
| 740 | + case WM_APP:
|
| 741 | + RunTestTimed3D(testnum);
|
| 742 | + break;
|
646 | 743 | default:
|
647 | 744 | return FALSE;
|
648 | 745 | }
|