iOS builds now successfully build
This commit is contained in:
parent
e77efa542e
commit
e910425dc5
3 changed files with 56 additions and 34 deletions
|
@ -27,13 +27,13 @@ constexpr bool default_enable_normal_mapping = false;
|
||||||
constexpr bool default_enable_point_shadows = false;
|
constexpr bool default_enable_point_shadows = false;
|
||||||
constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCF;
|
constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCF;
|
||||||
constexpr int default_shadow_resolution = 1024;
|
constexpr int default_shadow_resolution = 1024;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
constexpr bool default_enable_ibl = true;
|
constexpr bool default_enable_ibl = true;
|
||||||
constexpr bool default_enable_normal_mapping = true;
|
constexpr bool default_enable_normal_mapping = true;
|
||||||
constexpr bool default_enable_point_shadows = true;
|
constexpr bool default_enable_point_shadows = true;
|
||||||
constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCSS;
|
constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCSS;
|
||||||
constexpr int default_shadow_resolution = 2048;
|
constexpr int default_shadow_resolution = 2048;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct RenderOptions {
|
struct RenderOptions {
|
||||||
DisplayColorSpace display_color_space = DisplayColorSpace::SRGB;
|
DisplayColorSpace display_color_space = DisplayColorSpace::SRGB;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <MetalKit/MetalKit.h>
|
#include <MetalKit/MetalKit.h>
|
||||||
#include <gfx_metal.hpp>
|
#include <gfx_vulkan.hpp>
|
||||||
#include <GameController/GameController.h>
|
#include <GameController/GameController.h>
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
@ -127,7 +127,7 @@ int drawable_width, drawable_height;
|
||||||
drawable_width = [view frame].size.width * [view contentScaleFactor];
|
drawable_width = [view frame].size.width * [view contentScaleFactor];
|
||||||
drawable_height = [view frame].size.height * [view contentScaleFactor];
|
drawable_height = [view frame].size.height * [view contentScaleFactor];
|
||||||
|
|
||||||
engine = new prism::Engine(0, nullptr);
|
engine = new prism::engine(0, nullptr);
|
||||||
|
|
||||||
app = new @APP_CLASS@();
|
app = new @APP_CLASS@();
|
||||||
engine->set_app(app);
|
engine->set_app(app);
|
||||||
|
@ -135,7 +135,7 @@ int drawable_width, drawable_height;
|
||||||
GFXCreateInfo createInfo = {};
|
GFXCreateInfo createInfo = {};
|
||||||
createInfo.api_validation_enabled = true;
|
createInfo.api_validation_enabled = true;
|
||||||
|
|
||||||
GFXMetal* gfx = new GFXMetal();
|
GFXVulkan* gfx = new GFXVulkan();
|
||||||
gfx->initialize(createInfo);
|
gfx->initialize(createInfo);
|
||||||
engine->set_gfx(gfx);
|
engine->set_gfx(gfx);
|
||||||
|
|
||||||
|
@ -167,7 +167,40 @@ void platform::capture_mouse(const bool capture) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Offset platform::get_cursor_position() {
|
// TODO: unimplemented
|
||||||
|
PlatformTheme platform::get_theme() {
|
||||||
|
return PlatformTheme::Light;
|
||||||
|
}
|
||||||
|
|
||||||
|
void platform::begin_text_input() {
|
||||||
|
// TODO: stub
|
||||||
|
}
|
||||||
|
|
||||||
|
void platform::end_text_input() {
|
||||||
|
// TODO: stub
|
||||||
|
}
|
||||||
|
|
||||||
|
void* platform::create_native_surface(platform::window_ptr index, void* instance) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool platform::is_main_window(platform::window_ptr index) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<const char*> platform::get_native_surface_extension() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void platform::show_window(const platform::window_ptr index) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool platform::supports_feature(const PlatformFeature feature) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
prism::Offset platform::get_cursor_position() {
|
||||||
return {static_cast<int32_t>(mouse_x), static_cast<int32_t>(mouse_y)};
|
return {static_cast<int32_t>(mouse_x), static_cast<int32_t>(mouse_y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,70 +240,62 @@ bool platform::get_key_down(InputButton key) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int platform::open_window(const std::string_view title, const Rectangle rect, const WindowFlags flags) {
|
platform::window_ptr platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_title(const int index, const std::string_view title) {
|
void platform::set_window_title(const platform::window_ptr index, const std::string_view title) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform::is_window_focused(const int index) {
|
bool platform::is_window_focused(const platform::window_ptr index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_focused(const int index) {
|
void platform::set_window_focused(const platform::window_ptr index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Extent platform::get_window_size(const int index) {
|
prism::Extent platform::get_window_size(const platform::window_ptr index) {
|
||||||
return {static_cast<uint32_t>(width), static_cast<uint32_t>(height)};
|
return {static_cast<uint32_t>(width), static_cast<uint32_t>(height)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Extent platform::get_window_drawable_size(const int index) {
|
prism::Extent platform::get_window_drawable_size(const platform::window_ptr index) {
|
||||||
return {static_cast<uint32_t>(drawable_width), static_cast<uint32_t>(drawable_height)};
|
return {static_cast<uint32_t>(drawable_width), static_cast<uint32_t>(drawable_height)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Offset platform::get_window_position(const int index) {
|
prism::Offset platform::get_window_position(const platform::window_ptr index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_size(const int index, const Extent extent) {
|
void platform::set_window_size(const platform::window_ptr index, const prism::Extent extent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_position(const int index, const Offset offset) {
|
void platform::set_window_position(const platform::window_ptr index, const prism::Offset offset) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::close_window(const int index) {
|
void platform::close_window(const platform::window_ptr index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char* platform::translate_keycode(const unsigned int keycode) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int platform::get_keycode(const InputButton button) {
|
int platform::get_keycode(const InputButton button) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle platform::get_monitor_resolution() {
|
prism::Rectangle platform::get_monitor_resolution() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle platform::get_monitor_work_area() {
|
prism::Rectangle platform::get_monitor_work_area() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Offset platform::get_screen_cursor_position() {
|
prism::Offset platform::get_screen_cursor_position() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float platform::get_window_dpi(const int index) {
|
|
||||||
return 2.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool platform::get_mouse_button_down(const int index) {
|
bool platform::get_mouse_button_down(const int index) {
|
||||||
return mouse_down;
|
return mouse_down;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
|
|
||||||
void file::initialize_domain(const FileDomain domain, const AccessMode mode, const std::string_view path) {
|
void prism::set_domain_path(const prism::domain domain, const prism::path& path) {
|
||||||
NSBundle* bundle = [NSBundle mainBundle];
|
NSBundle* bundle = [NSBundle mainBundle];
|
||||||
NSString* resourceFolderPath = [bundle resourcePath];
|
NSString* resourceFolderPath = [bundle resourcePath];
|
||||||
|
|
||||||
|
@ -19,12 +19,9 @@ void file::initialize_domain(const FileDomain domain, const AccessMode mode, con
|
||||||
domain_data[(int)domain] = s;
|
domain_data[(int)domain] = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string file::get_writeable_path(const std::string_view path) {
|
prism::path prism::get_writeable_directory() {
|
||||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||||
|
|
||||||
NSString* resourceFolderPath = paths[0];
|
NSString* resourceFolderPath = paths[0];
|
||||||
|
|
||||||
std::string s = std::string([resourceFolderPath cStringUsingEncoding:NSUTF8StringEncoding]) + "/" + std::string(path);
|
return std::string([resourceFolderPath cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue