diff options
Diffstat (limited to 'tools/gfx')
| -rw-r--r-- | tools/gfx/model.cpp | 7 | ||||
| -rw-r--r-- | tools/gfx/model.h | 1 | ||||
| -rw-r--r-- | tools/gfx/render.h | 6 | ||||
| -rw-r--r-- | tools/gfx/window.cpp | 1 | ||||
| -rw-r--r-- | tools/gfx/window.h | 4 |
5 files changed, 15 insertions, 4 deletions
diff --git a/tools/gfx/model.cpp b/tools/gfx/model.cpp index 62e6ec1fd..ce176727b 100644 --- a/tools/gfx/model.cpp +++ b/tools/gfx/model.cpp @@ -195,6 +195,11 @@ RefPtr<TextureResource> loadTextureImage( return texture; } +static std::string makeString(const char* start, const char* end) +{ + return std::string(start, size_t(end - start)); +} + Result ModelLoader::load( char const* inputPath, void** outModel) @@ -208,7 +213,7 @@ Result ModelLoader::load( std::string baseDir; if( auto lastSlash = strrchr(inputPath, '/') ) { - baseDir = std::string(inputPath, lastSlash); + baseDir = makeString(inputPath, lastSlash); } std::string diagnostics; diff --git a/tools/gfx/model.h b/tools/gfx/model.h index b92dfda76..17b16510e 100644 --- a/tools/gfx/model.h +++ b/tools/gfx/model.h @@ -5,6 +5,7 @@ #include "vector-math.h" #include <vector> +#include <string> namespace gfx { diff --git a/tools/gfx/render.h b/tools/gfx/render.h index f59a5ef9f..bfbe0f82a 100644 --- a/tools/gfx/render.h +++ b/tools/gfx/render.h @@ -5,6 +5,8 @@ //#include "shader-input-layout.h" +#include <float.h> + #include "../../slang-com-helper.h" #include "../../source/core/smart-pointer.h" @@ -424,6 +426,10 @@ class TextureResource: public Resource Desc m_desc; }; +// Needed for building on cygwin with gcc +#undef Always +#undef None + enum class ComparisonFunc : uint8_t { Never = 0, diff --git a/tools/gfx/window.cpp b/tools/gfx/window.cpp index 8456e1ead..9e2195141 100644 --- a/tools/gfx/window.cpp +++ b/tools/gfx/window.cpp @@ -1,6 +1,5 @@ // window.cpp #include "window.h" -#pragma once #include <stdio.h> diff --git a/tools/gfx/window.h b/tools/gfx/window.h index e154acec3..e6f886f42 100644 --- a/tools/gfx/window.h +++ b/tools/gfx/window.h @@ -5,7 +5,7 @@ namespace gfx { -typedef struct Window Window; +struct Window; enum class KeyCode { @@ -94,7 +94,7 @@ int runApplication( #define GFX_CONSOLE_MAIN(APPLICATION_ENTRY) \ int main(int argc, char** argv) { \ - return gfx::runApplication(&(APPLIATION_ENTRY), argc, argv); \ + return gfx::runApplication(&(APPLICATION_ENTRY), argc, argv); \ } #ifdef _WIN32 |
