-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
286 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#include "antara/gaming/core/api.scaling.hpp" | ||
|
||
#ifdef _WIN32 | ||
|
||
#include "antara/gaming/core/details/windows/api.scaling.hpp" | ||
|
||
#elif __APPLE__ | ||
|
||
#include "antara/gaming/core/details/osx/api.scaling.hpp" | ||
|
||
#elif __linux__ | ||
|
||
#include "antara/gaming/core/details/linux/api.scaling.hpp" | ||
|
||
#elif EMSCRIPTEN | ||
#include "antara/gaming/core/details/emscripten/api.scaling.hpp" | ||
#endif | ||
|
||
namespace antara::gaming::core | ||
{ | ||
bool is_high_dpi_capable() noexcept | ||
{ | ||
return details::is_high_dpi_capable(); | ||
} | ||
|
||
std::pair<float, float> get_scaling_factor() noexcept | ||
{ | ||
return details::get_scaling_factor(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
namespace antara::gaming::core | ||
{ | ||
bool is_high_dpi_capable() noexcept; | ||
std::pair<float, float> get_scaling_factor() noexcept; | ||
} |
32 changes: 32 additions & 0 deletions
32
modules/core/antara/gaming/core/details/emscripten/api.scaling.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
namespace antara::gaming::core::details | ||
{ | ||
bool is_high_dpi_capable() noexcept | ||
{ | ||
return true; | ||
} | ||
|
||
std::pair<float, float> get_scaling_factor() noexcept | ||
{ | ||
return {1.f, 1.f}; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
modules/core/antara/gaming/core/details/linux/api.scaling.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
namespace antara::gaming::core::details | ||
{ | ||
bool is_high_dpi_capable() noexcept | ||
{ | ||
return true; | ||
} | ||
|
||
std::pair<float, float> get_scaling_factor() noexcept | ||
{ | ||
return {1.f, 1.f}; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/core/antara/gaming/core/details/osx/api.scaling.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
namespace antara::gaming::core::details | ||
{ | ||
bool is_high_dpi_capable() noexcept; | ||
std::pair<float, float> get_scaling_factor() noexcept; | ||
} |
38 changes: 38 additions & 0 deletions
38
modules/core/antara/gaming/core/details/osx/api.scaling.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#import <CoreGraphics/CoreGraphics.h> | ||
#import <NSGeometry.h> | ||
#import <AppKit/AppKit.h> | ||
|
||
#include "antara/gaming/core/details/osx/api.scaling.hpp" | ||
|
||
namespace antara::gaming::core::details | ||
{ | ||
bool is_high_dpi_capable() noexcept | ||
{ | ||
NSBundle *bundle = [NSBundle mainBundle]; | ||
if (!bundle) | ||
return false; | ||
return bool([bundle objectForInfoDictionaryKey:@"NSHighResolutionCapable"]); | ||
} | ||
|
||
std::pair<float, float> get_scaling_factor() noexcept | ||
{ | ||
auto factor = static_cast<float>([[NSScreen mainScreen] backingScaleFactor]); | ||
return {factor, factor}; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
modules/core/antara/gaming/core/details/windows/api.scaling.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <utility> | ||
|
||
namespace antara::gaming::core::details | ||
{ | ||
bool is_high_dpi_capable() noexcept | ||
{ | ||
return true; | ||
} | ||
|
||
std::pair<float, float> get_scaling_factor() noexcept | ||
{ | ||
return {1.f, 1.f}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_library(antara_sdl STATIC) | ||
target_sources(antara_sdl PRIVATE antara/gaming/sdl/graphic.system.cpp antara/gaming/sdl/sdl.error.cpp) | ||
target_include_directories(antara_sdl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(antara_sdl PUBLIC antara::sdl_import antara::ecs antara::event) | ||
target_link_libraries(antara_sdl PUBLIC antara::sdl_import antara::ecs antara::event antara::core) | ||
add_library(antara::sdl ALIAS antara_sdl) |
Oops, something went wrong.