From 4e80149987d8e52a278570f5790b9dc20bea0cd7 Mon Sep 17 00:00:00 2001 From: Sherjil Ozair Date: Sun, 3 Jan 2021 02:27:58 +0000 Subject: [PATCH] Add required headers to compile on macos --- CMakeLists.txt | 1 + include/blah/containers/stackvector.h | 1 + include/blah/containers/str.h | 1 + include/blah/core/log.h | 8 ++++---- src/drawing/batch.cpp | 1 + src/graphics/material.cpp | 1 + src/internal/platform_backend.h | 2 ++ src/internal/platform_backend_sdl2.cpp | 3 ++- 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6e8831..264cadb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ endif() # Link and create SDL2 Definition if we're using SDL2 if (SDL2_ENABLED) + find_package(SDL2 REQUIRED) add_compile_definitions(BLAH_USE_SDL2) target_include_directories(blah PUBLIC "$") set(LIBS ${LIBS} ${SDL2_LIBRARIES}) diff --git a/include/blah/containers/stackvector.h b/include/blah/containers/stackvector.h index e1afe24..671c2f9 100644 --- a/include/blah/containers/stackvector.h +++ b/include/blah/containers/stackvector.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include namespace Blah { diff --git a/include/blah/containers/str.h b/include/blah/containers/str.h index d0beaa3..2d45097 100644 --- a/include/blah/containers/str.h +++ b/include/blah/containers/str.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include namespace Blah diff --git a/include/blah/core/log.h b/include/blah/core/log.h index c906271..7f2fbad 100644 --- a/include/blah/core/log.h +++ b/include/blah/core/log.h @@ -5,18 +5,18 @@ #include #define BLAH_ERROR(message) \ - do { Log::error(message "\n\tin file: %s:%d", __FILE__, __LINE__); abort(); } while(0) + do { Blah::Log::error(message "\n\tin file: %s:%d", __FILE__, __LINE__); abort(); } while(0) #define BLAH_ERROR_FMT(message, ...) \ - do { Log::error(message "\n\tin file: %s:%d", __VA_ARGS__, __FILE__, __LINE__); abort(); } while(0) + do { Blah::Log::error(message "\n\tin file: %s:%d", __VA_ARGS__, __FILE__, __LINE__); abort(); } while(0) #else #define BLAH_ERROR(message) \ - Log::error(message "\n\tin file: %s:%d", __FILE__, __LINE__) + Blah::Log::error(message "\n\tin file: %s:%d", __FILE__, __LINE__) #define BLAH_ERROR_FMT(message, ...) \ - Log::error(message "\n\tin file: %s:%d", __VA_ARGS__, __FILE__, __LINE__) + Blah::Log::error(message "\n\tin file: %s:%d", __VA_ARGS__, __FILE__, __LINE__) #endif diff --git a/src/drawing/batch.cpp b/src/drawing/batch.cpp index eeb3029..2e6c990 100644 --- a/src/drawing/batch.cpp +++ b/src/drawing/batch.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using namespace Blah; namespace diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index 01139b7..2616164 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -1,5 +1,6 @@ #include #include +#include using namespace Blah; diff --git a/src/internal/platform_backend.h b/src/internal/platform_backend.h index 0f2b09f..de0f583 100644 --- a/src/internal/platform_backend.h +++ b/src/internal/platform_backend.h @@ -114,7 +114,9 @@ namespace Blah void gl_context_make_current(void* context); void gl_context_destroy(void* context); +#if _WIN32 // D3D11 Methods void* d3d11_get_hwnd(); +#endif } } \ No newline at end of file diff --git a/src/internal/platform_backend_sdl2.cpp b/src/internal/platform_backend_sdl2.cpp index ea51a60..94216f1 100644 --- a/src/internal/platform_backend_sdl2.cpp +++ b/src/internal/platform_backend_sdl2.cpp @@ -649,6 +649,7 @@ void PlatformBackend::gl_context_destroy(void* context) SDL_GL_DeleteContext(context); } +#if _WIN32 void* PlatformBackend::d3d11_get_hwnd() { SDL_SysWMinfo info; @@ -656,5 +657,5 @@ void* PlatformBackend::d3d11_get_hwnd() SDL_GetWindowWMInfo(window, &info); return info.info.win.window; } - +#endif #endif // BLAH_USE_SDL2