Skip to content

Commit

Permalink
Fixed creating D3DDevice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barnacle committed Sep 15, 2021
1 parent bf98558 commit 8be91a2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
12 changes: 10 additions & 2 deletions D3D/D3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ HRESULT CD3DRender::init(HWND hwnd, const int width, const int height)
d3dpp.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;

// Create the D3DDevice
if (FAILED(g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_d3dDevice)))
return E_FAIL;
if (FAILED(g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_d3dDevice)))
{
d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;

if (FAILED(g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_d3dDevice)))
{
if (FAILED(g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_d3dDevice)))
return E_FAIL;
}
}

g_d3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
g_d3dDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
Expand Down
Binary file modified D3D/D3D.rc
Binary file not shown.
8 changes: 4 additions & 4 deletions D3D/D3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_EXPORTING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DXSDK_DIR)\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DXSDK_DIR)include</AdditionalIncludeDirectories>
<BrowseInformation>true</BrowseInformation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
<AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(DXSDK_DIR)lib\x86</AdditionalLibraryDirectories>
</Link>
<Bscmake>
<PreserveSbr>true</PreserveSbr>
Expand All @@ -65,14 +65,14 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(DXSDK_DIR)\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DXSDK_DIR)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_EXPORTING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(DXSDK_DIR)lib\x86</AdditionalLibraryDirectories>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
Expand Down
2 changes: 1 addition & 1 deletion main/AboutBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace usf4_ce {
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(152, 65);
this->label1->TabIndex = 1;
this->label1->Text = L"Barnacle 21.04.2020 \r\n\r\nUSF4 Character Extractor 0.3b\r\n\r\n2014-2020";
this->label1->Text = L"Barnacle 16.09.2021 \r\n\r\nUSF4 Character Extractor 0.3c\r\n\r\n2014-2021";
//
// AboutBox
//
Expand Down
Binary file modified main/USF4ce.rc
Binary file not shown.
6 changes: 4 additions & 2 deletions main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -1613,10 +1613,12 @@ namespace usf4_ce {
}

System::Void TopSplitContainer_SplitterMoved(System::Object^ sender, System::Windows::Forms::SplitterEventArgs^ e) {
m_D3DWrap->resize(TopSplitContainer->Panel2->Width, TopSplitContainer->Panel2->Height);
if (m_D3DWrap != nullptr)
m_D3DWrap->resize(TopSplitContainer->Panel2->Width, TopSplitContainer->Panel2->Height);
}
System::Void MainForm_SizeChanged(System::Object^ sender, System::EventArgs^ e) {
m_D3DWrap->resize(TopSplitContainer->Panel2->Width, TopSplitContainer->Panel2->Height);
if (m_D3DWrap != nullptr)
m_D3DWrap->resize(TopSplitContainer->Panel2->Width, TopSplitContainer->Panel2->Height);
}

TreeNode^ _currentNode = gcnew TreeNode();
Expand Down
8 changes: 4 additions & 4 deletions main/main.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DXSDK_DIR)\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DXSDK_DIR)include</AdditionalIncludeDirectories>
<BrowseInformation>true</BrowseInformation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
Expand All @@ -64,7 +64,7 @@
<AdditionalDependencies />
<SubSystem>Windows</SubSystem>
<EntryPointSymbol>main</EntryPointSymbol>
<AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(DXSDK_DIR)lib\x86</AdditionalLibraryDirectories>
</Link>
<Bscmake>
<PreserveSbr>true</PreserveSbr>
Expand All @@ -74,13 +74,13 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DXSDK_DIR)\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DXSDK_DIR)include</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies />
<AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(DXSDK_DIR)lib\x86</AdditionalLibraryDirectories>
<SubSystem>Windows</SubSystem>
<EntryPointSymbol>main</EntryPointSymbol>
</Link>
Expand Down

0 comments on commit 8be91a2

Please sign in to comment.