mirror of
https://github.com/NoelFB/blah.git
synced 2025-02-21 13:58:28 +08:00
Add required headers to compile on macos
This commit is contained in:
parent
d8930f15ac
commit
4e80149987
@ -90,6 +90,7 @@ endif()
|
|||||||
|
|
||||||
# Link and create SDL2 Definition if we're using SDL2
|
# Link and create SDL2 Definition if we're using SDL2
|
||||||
if (SDL2_ENABLED)
|
if (SDL2_ENABLED)
|
||||||
|
find_package(SDL2 REQUIRED)
|
||||||
add_compile_definitions(BLAH_USE_SDL2)
|
add_compile_definitions(BLAH_USE_SDL2)
|
||||||
target_include_directories(blah PUBLIC "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
|
target_include_directories(blah PUBLIC "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
|
||||||
set(LIBS ${LIBS} ${SDL2_LIBRARIES})
|
set(LIBS ${LIBS} ${SDL2_LIBRARIES})
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <blah/core/log.h>
|
#include <blah/core/log.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
#include <initializer_list>
|
||||||
|
|
||||||
namespace Blah
|
namespace Blah
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <cstdio>
|
||||||
#include <blah/containers/vector.h>
|
#include <blah/containers/vector.h>
|
||||||
|
|
||||||
namespace Blah
|
namespace Blah
|
||||||
|
@ -5,18 +5,18 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define BLAH_ERROR(message) \
|
#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, ...) \
|
#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
|
#else
|
||||||
|
|
||||||
#define BLAH_ERROR(message) \
|
#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, ...) \
|
#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
|
#endif
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <blah/graphics/material.h>
|
#include <blah/graphics/material.h>
|
||||||
#include <blah/math/calc.h>
|
#include <blah/math/calc.h>
|
||||||
#include <blah/core/app.h>
|
#include <blah/core/app.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using namespace Blah;
|
using namespace Blah;
|
||||||
namespace
|
namespace
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <blah/graphics/material.h>
|
#include <blah/graphics/material.h>
|
||||||
#include <blah/core/log.h>
|
#include <blah/core/log.h>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace Blah;
|
using namespace Blah;
|
||||||
|
|
||||||
|
@ -114,7 +114,9 @@ namespace Blah
|
|||||||
void gl_context_make_current(void* context);
|
void gl_context_make_current(void* context);
|
||||||
void gl_context_destroy(void* context);
|
void gl_context_destroy(void* context);
|
||||||
|
|
||||||
|
#if _WIN32
|
||||||
// D3D11 Methods
|
// D3D11 Methods
|
||||||
void* d3d11_get_hwnd();
|
void* d3d11_get_hwnd();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -649,6 +649,7 @@ void PlatformBackend::gl_context_destroy(void* context)
|
|||||||
SDL_GL_DeleteContext(context);
|
SDL_GL_DeleteContext(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if _WIN32
|
||||||
void* PlatformBackend::d3d11_get_hwnd()
|
void* PlatformBackend::d3d11_get_hwnd()
|
||||||
{
|
{
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
@ -656,5 +657,5 @@ void* PlatformBackend::d3d11_get_hwnd()
|
|||||||
SDL_GetWindowWMInfo(window, &info);
|
SDL_GetWindowWMInfo(window, &info);
|
||||||
return info.info.win.window;
|
return info.info.win.window;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif // BLAH_USE_SDL2
|
#endif // BLAH_USE_SDL2
|
||||||
|
Loading…
Reference in New Issue
Block a user