Skip to content

Commit

Permalink
Merge pull request #85 from fallahn/golf-1.14
Browse files Browse the repository at this point in the history
Golf 1.14.1
  • Loading branch information
fallahn authored Oct 7, 2023
2 parents b59c2c5 + b7a6186 commit 0e6abcc
Show file tree
Hide file tree
Showing 54 changed files with 6,828 additions and 643 deletions.
4 changes: 2 additions & 2 deletions crogine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ Global
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|Any CPU.ActiveCfg = Release|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|ARM.ActiveCfg = Release|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|ARM64.ActiveCfg = Release|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.ActiveCfg = ReleaseGNS|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.Build.0 = ReleaseGNS|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.ActiveCfg = Release|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.Build.0 = Release|x64
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x86.ActiveCfg = Release|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x86.Build.0 = Release|Win32
{B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release-asan|Any CPU.ActiveCfg = Release-asan|Win32
Expand Down
36 changes: 23 additions & 13 deletions crogine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
cmake_minimum_required(VERSION 3.5.0)

#required for std::filesystem
if(APPLE)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()

project(crogine)
SET(PROJECT_NAME crogine)

Expand All @@ -20,9 +26,9 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/mo

if(CMAKE_COMPILER_IS_GNUCXX)
if(PROJECT_STATIC_RUNTIME)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17 -static")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-potentially-evaluated-expression -std=c++17 -static")
else()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-potentially-evaluated-expression -std=c++17")
endif()
endif()

Expand Down Expand Up @@ -67,7 +73,10 @@ find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)

if(USE_OPENAL)
find_package(OpenAL REQUIRED)
#use mojo AL on mac
if(NOT APPLE)
find_package(OpenAL REQUIRED)
endif()
else()
find_package(SDL2_mixer REQUIRED)
endif()
Expand All @@ -89,7 +98,9 @@ SET(PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
include(${PROJECT_DIR}/CMakeLists.txt)

if(USE_OPENAL)
include_directories(${OPENAL_INCLUDE_DIR})
if(NOT APPLE)
include_directories(${OPENAL_INCLUDE_DIR})
endif()
SET(PROJECT_SRC ${PROJECT_SRC} ${project_src_openal})
else()
include_directories(${SDL2_MIXER_INCLUDE_DIR})
Expand All @@ -104,7 +115,7 @@ else()
SET(PROJECT_SRC ${PROJECT_SRC} ${project_src_nix})
endif()

# add the Resourcepath source and GL41 loader for apple, else load GL46
# add the Resourcepath source, mojoal source and GL41 loader for apple, else load GL46
if (APPLE)
set(PROJECT_SRC ${PROJECT_SRC} ${project_src_macos})
else()
Expand All @@ -121,18 +132,17 @@ if(NOT TARGET crogine)
endif()


if(USE_OPENAL)
target_link_libraries(${PROJECT_NAME}
${SDL2_LIBRARY}
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${OPENAL_LIBRARY})
${OPENGL_LIBRARIES})

if(USE_OPENAL)
if(NOT APPLE)
target_link_libraries(${PROJECT_NAME} ${OPENAL_LIBRARY})
endif()
else()
target_link_libraries(${PROJECT_NAME}
${SDL2_LIBRARY}
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES}
${SDL2_MIXER_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${SDL2_MIXER_LIBRARY})
endif()

if(MSVC)
Expand Down
5 changes: 5 additions & 0 deletions crogine/include/crogine/core/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ namespace cro
*/
void setPosition(std::int32_t x, std::int32_t y);

/*
\brief Returns the window's position in destop coordinates
*/
glm::ivec2 getPosition() const;

/*!
\brief Sets the window icon from an array of RGBA pixels.
The image size is assumed to be 16x16 pixels in 8-bit format.
Expand Down
1 change: 1 addition & 0 deletions crogine/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ SET(project_src_nix
)

SET(project_src_macos
${PROJECT_DIR}/audio/mojoal.c
${PROJECT_DIR}/detail/ResourcePath.mm
${PROJECT_DIR}/detail/41/glad.c
)
2 changes: 1 addition & 1 deletion crogine/src/audio/ALCheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source distribution.
#define alcCheck(x,y) x;
#else
#ifdef __APPLE__
#include <al.h>
#include "al.h"
#else
#include <AL/al.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions crogine/src/audio/OpenALImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ source distribution.
#include "AudioFile.hpp"

#ifdef __APPLE__
#include <al.h>
#include <alc.h>
#include "al.h"
#include "alc.h"
#else
#include <AL/al.h>
#include <AL/alc.h>
Expand Down
Loading

0 comments on commit 0e6abcc

Please sign in to comment.