Compare commits

...
This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.

1 Commits

3 changed files with 6 additions and 3 deletions

View File

@ -28,6 +28,7 @@ target_include_directories(
)
option(USE_GLEW "use glew rather than glad" OFF)
option(BUILD_TEST "build unittests" OFF)
if (USE_GLEW)
message(STATUS "use glew to load opengl functions")
@ -42,7 +43,7 @@ if (USE_GLEW)
PUBLIC $<$<BOOL:"${USE_GLEW}">:TINYENGINE_USE_GLEW>
)
else()
message(STATUS "use glad to load opengl functions, this only work on MacOS")
message(STATUS "use glad to load opengl functions")
target_include_directories(
${ENGINE_NAME}
PUBLIC libs/glad/include
@ -106,7 +107,7 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} -E remove_directory output
COMMAND ${CMAKE_COMMAND} -E make_directory output
COMMAND ${CMAKE_COMMAND} -E make_directory output/game
COMMAND ${CMAKE_COMMAND} -E copy ./build/${PROJECT_NAME} output/game/${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy $<IF:$<STREQUAL:$<PLATFORM_ID>,"Windows">,./build/${PROJECT_NAME}.exe,./build/${PROJECT_NAME}> output/game/${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy_directory ./assets output/game/assets
COMMAND ${CMAKE_COMMAND} -E remove_directory ./output/game/assets/test
COMMAND ${CMAKE_COMMAND} -E copy ./HowToPlay.md output/

View File

@ -63,7 +63,7 @@ T Random(const T& low, const T& high) {
static_assert(std::is_floating_point<T>::value || std::is_integral<T>::value);
std::random_device device;
if (std::is_floating_point<T>::value) {
if constexpr (std::is_floating_point<T>::value) {
std::uniform_real_distribution<T> dist(low, high);
return dist(device);
} else {

View File

@ -26,6 +26,8 @@
#include <utility>
#include <limits>
#include <cassert>
#include <functional>
#include <cstring>
#include "miniaudio.h"
#include "stb_image.h"