Skip to content

Commit

Permalink
Put WaveFrontReader.h into DX namespace (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Oct 8, 2024
1 parent 7fa6aa1 commit 0c4f28c
Show file tree
Hide file tree
Showing 5 changed files with 621 additions and 575 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug conf

option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)

option(ENABLE_CODE_COVERAGE "Build with code-coverage" OFF)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -315,5 +317,9 @@ if(WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET)))
if(BUILD_TESTING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/CMakeLists.txt"))
enable_testing()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests)

if(ENABLE_CODE_COVERAGE AND (DEFINED COV_COMPILER_SWITCHES))
target_compile_options(${PROJECT_NAME} PRIVATE ${COV_COMPILER_SWITCHES})
endif()
endif()
endif()
22 changes: 21 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,24 @@
}
},

{
"name": "Analyze",
"cacheVariables":
{
"ENABLE_CODE_ANALYSIS": true
},
"hidden": true
},
{
"name": "Coverage",
"cacheVariables":
{
"BUILD_TOOLS": false,
"ENABLE_CODE_COVERAGE": true
},
"hidden": true
},

{ "name": "x64-Debug" , "description": "MSVC for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "MSVC" ] },
{ "name": "x64-Release" , "description": "MSVC for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "MSVC" ] },
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "MSVC" ] },
Expand Down Expand Up @@ -267,7 +285,9 @@
{ "name": "arm64-Debug-Linux", "description": "WSL Linux ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "VCPKG" ] },
{ "name": "arm64-Release-Linux", "description": "WSL Linux ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "VCPKG" ] },

{ "name": "x64-Analyze" , "description": "MSVC for x64 (Debug) with DX12 using /analyze", "inherits": [ "base", "x64", "Debug", "MSVC" ], "cacheVariables": { "ENABLE_CODE_ANALYSIS": true } }
{ "name": "x64-Analyze" , "description": "MSVC for x64 (Debug) with DX12 using /analyze", "inherits": [ "base", "x64", "Debug", "MSVC", "Analyze" ] },
{ "name": "x64-Coverage" , "description": "MSVC for x64 (Debug) with DX12 w/ Code Coverage", "inherits": [ "base", "x64", "Debug", "MSVC", "Coverage" ] },
{ "name": "x64-Coverage-Clang", "description": "Clang/LLVM for x64 (Debug) with DX12 w/ Code Coverage", "inherits": [ "base", "x64", "Debug", "Clang", "Coverage" ] }
],
"testPresets": [
{ "name": "x64-Debug" , "configurePreset": "x64-Debug" },
Expand Down
6 changes: 4 additions & 2 deletions Meshconvert/MeshOBJ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ HRESULT LoadFromOBJ(
bool ccw,
bool dds)
{
WaveFrontReader<uint32_t> wfReader;
using Vertex = DX::WaveFrontReader<uint32_t>::Vertex;

DX::WaveFrontReader<uint32_t> wfReader;
HRESULT hr = wfReader.Load(szFilename, ccw);
if (FAILED(hr))
return hr;
Expand Down Expand Up @@ -117,7 +119,7 @@ HRESULT LoadFromOBJ(
if (FAILED(hr))
return hr;

hr = vbr.AddStream(wfReader.vertices.data(), wfReader.vertices.size(), 0, sizeof(WaveFrontReader<uint32_t>::Vertex));
hr = vbr.AddStream(wfReader.vertices.data(), wfReader.vertices.size(), 0, sizeof(Vertex));
if (FAILED(hr))
return hr;

Expand Down
Loading

0 comments on commit 0c4f28c

Please sign in to comment.