Reformat platform code
This commit is contained in:
parent
3c9835a662
commit
c0928ea80c
11 changed files with 488 additions and 543 deletions
|
@ -1,6 +1,6 @@
|
||||||
#include <@APP_INCLUDE@>
|
#include <@APP_INCLUDE@>
|
||||||
#include <engine.hpp>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <engine.hpp>
|
||||||
|
|
||||||
#include "platform.hpp"
|
#include "platform.hpp"
|
||||||
#include <string_utils.hpp>
|
#include <string_utils.hpp>
|
||||||
|
@ -61,8 +61,8 @@ void* get_next_metal_drawable(platform::window_ptr window);
|
||||||
void* create_vulkan_surface(platform::window_ptr window, void* surface_creation_info);
|
void* create_vulkan_surface(platform::window_ptr window, void* surface_creation_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::map<InputButton, int> inputToKeyCode = { {
|
static std::map<InputButton, int> inputToKeyCode = {
|
||||||
{InputButton::C, SDL_SCANCODE_C},
|
{{InputButton::C, SDL_SCANCODE_C},
|
||||||
{InputButton::V, SDL_SCANCODE_V},
|
{InputButton::V, SDL_SCANCODE_V},
|
||||||
{InputButton::X, SDL_SCANCODE_X},
|
{InputButton::X, SDL_SCANCODE_X},
|
||||||
{InputButton::Y, SDL_SCANCODE_Y},
|
{InputButton::Y, SDL_SCANCODE_Y},
|
||||||
|
@ -82,8 +82,7 @@ static std::map<InputButton, int> inputToKeyCode = { {
|
||||||
{InputButton::Ctrl, SDL_SCANCODE_LCTRL},
|
{InputButton::Ctrl, SDL_SCANCODE_LCTRL},
|
||||||
{InputButton::Space, SDL_SCANCODE_SPACE},
|
{InputButton::Space, SDL_SCANCODE_SPACE},
|
||||||
{InputButton::LeftArrow, SDL_SCANCODE_LEFT},
|
{InputButton::LeftArrow, SDL_SCANCODE_LEFT},
|
||||||
{InputButton::RightArrow, SDL_SCANCODE_RIGHT}
|
{InputButton::RightArrow, SDL_SCANCODE_RIGHT}}};
|
||||||
}};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Platform functions"
|
* Platform functions"
|
||||||
|
@ -100,7 +99,8 @@ bool platform::supports_feature(const PlatformFeature feature) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform::window_ptr platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
platform::window_ptr
|
||||||
|
platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
||||||
auto& win = windows.emplace_back();
|
auto& win = windows.emplace_back();
|
||||||
|
|
||||||
int sdl_flags = SDL_WINDOW_ALLOW_HIGHDPI;
|
int sdl_flags = SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
|
@ -403,8 +403,7 @@ void* platform::get_next_image(window_ptr window) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class GFXBackend>
|
template<class GFXBackend> void try_initialize() {
|
||||||
void try_initialize() {
|
|
||||||
if (gfx_interface == nullptr) {
|
if (gfx_interface == nullptr) {
|
||||||
auto backend = new GFXBackend();
|
auto backend = new GFXBackend();
|
||||||
const bool supported = backend->is_supported() && platform::supports_context(backend->required_context());
|
const bool supported = backend->is_supported() && platform::supports_context(backend->required_context());
|
||||||
|
@ -491,10 +490,8 @@ int main(int argc, char* argv[]) {
|
||||||
case SDL_MOUSEWHEEL: {
|
case SDL_MOUSEWHEEL: {
|
||||||
mouse_wheel_x = event.wheel.x;
|
mouse_wheel_x = event.wheel.x;
|
||||||
mouse_wheel_y = event.wheel.y;
|
mouse_wheel_y = event.wheel.y;
|
||||||
}
|
} break;
|
||||||
break;
|
case SDL_MOUSEBUTTONDOWN: {
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
|
||||||
{
|
|
||||||
int engine_button = 0;
|
int engine_button = 0;
|
||||||
if (event.button.button == SDL_BUTTON_RIGHT)
|
if (event.button.button == SDL_BUTTON_RIGHT)
|
||||||
engine_button = 1;
|
engine_button = 1;
|
||||||
|
@ -502,24 +499,20 @@ int main(int argc, char* argv[]) {
|
||||||
engine_button = 2;
|
engine_button = 2;
|
||||||
|
|
||||||
engine->process_mouse_down(engine_button, {0, 0});
|
engine->process_mouse_down(engine_button, {0, 0});
|
||||||
}
|
} break;
|
||||||
break;
|
case SDL_KEYDOWN: {
|
||||||
case SDL_KEYDOWN:
|
|
||||||
{
|
|
||||||
engine->process_key_down(event.key.keysym.scancode);
|
engine->process_key_down(event.key.keysym.scancode);
|
||||||
}
|
} break;
|
||||||
break;
|
case SDL_KEYUP: {
|
||||||
case SDL_KEYUP:
|
|
||||||
{
|
|
||||||
engine->process_key_up(event.key.keysym.scancode);
|
engine->process_key_up(event.key.keysym.scancode);
|
||||||
}
|
} break;
|
||||||
break;
|
case SDL_WINDOWEVENT: {
|
||||||
case SDL_WINDOWEVENT:
|
|
||||||
{
|
|
||||||
if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
|
if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||||
auto window = get_window_by_sdl_id(event.window.windowID);
|
auto window = get_window_by_sdl_id(event.window.windowID);
|
||||||
if (window != nullptr)
|
if (window != nullptr)
|
||||||
engine->resize(window, {static_cast<uint32_t>(event.window.data1), static_cast<uint32_t>(event.window.data2)});
|
engine->resize(
|
||||||
|
window,
|
||||||
|
{static_cast<uint32_t>(event.window.data1), static_cast<uint32_t>(event.window.data2)});
|
||||||
} else if (event.window.event == SDL_WINDOWEVENT_MOVED) {
|
} else if (event.window.event == SDL_WINDOWEVENT_MOVED) {
|
||||||
auto window = get_window_by_sdl_id(event.window.windowID);
|
auto window = get_window_by_sdl_id(event.window.windowID);
|
||||||
if (window != nullptr)
|
if (window != nullptr)
|
||||||
|
@ -527,13 +520,10 @@ int main(int argc, char* argv[]) {
|
||||||
} else if (event.window.event == SDL_WINDOWEVENT_CLOSE) {
|
} else if (event.window.event == SDL_WINDOWEVENT_CLOSE) {
|
||||||
engine->quit();
|
engine->quit();
|
||||||
}
|
}
|
||||||
}
|
} break;
|
||||||
break;
|
case SDL_TEXTINPUT: {
|
||||||
case SDL_TEXTINPUT:
|
|
||||||
{
|
|
||||||
engine->process_text_input(event.text.text);
|
engine->process_text_input(event.text.text);
|
||||||
}
|
} break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,7 +532,8 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
auto begin = std::chrono::high_resolution_clock::now();
|
auto begin = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
float deltatime = (float)std::chrono::duration_cast<std::chrono::nanoseconds>(begin - end).count() / 1000000000ULL;
|
float deltatime =
|
||||||
|
(float)std::chrono::duration_cast<std::chrono::nanoseconds>(begin - end).count() / 1000000000ULL;
|
||||||
end = begin;
|
end = begin;
|
||||||
|
|
||||||
engine->update(deltatime);
|
engine->update(deltatime);
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#define VK_USE_PLATFORM_METAL_EXT
|
#define VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
#include <MetalKit/MetalKit.h>
|
|
||||||
#include <GameController/GameController.h>
|
|
||||||
#import "QuartzCore/QuartzCore.hpp"
|
#import "QuartzCore/QuartzCore.hpp"
|
||||||
|
#include <GameController/GameController.h>
|
||||||
|
#include <MetalKit/MetalKit.h>
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
#include <engine.hpp>
|
|
||||||
#include <@APP_INCLUDE@>
|
#include <@APP_INCLUDE@>
|
||||||
|
#include <engine.hpp>
|
||||||
|
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
#ifdef PLATFORM_IOS
|
#ifdef PLATFORM_IOS
|
||||||
|
@ -61,7 +61,8 @@ void* create_vulkan_surface(platform::window_ptr window, void* surface_creation_
|
||||||
|
|
||||||
- (void)controllerConnected {
|
- (void)controllerConnected {
|
||||||
GCController* controller = [GCController controllers][0];
|
GCController* controller = [GCController controllers][0];
|
||||||
[[controller extendedGamepad] setValueChangedHandler:^(GCExtendedGamepad * _Nonnull gamepad, GCControllerElement * _Nonnull element) {
|
[[controller extendedGamepad]
|
||||||
|
setValueChangedHandler:^(GCExtendedGamepad* _Nonnull gamepad, GCControllerElement* _Nonnull element) {
|
||||||
const auto& handle_element = [element](int index, GCControllerElement* e) {
|
const auto& handle_element = [element](int index, GCControllerElement* e) {
|
||||||
if (element == e)
|
if (element == e)
|
||||||
inputKeys[index] = [(GCControllerButtonInput*)e value] == 1.0f;
|
inputKeys[index] = [(GCControllerButtonInput*)e value] == 1.0f;
|
||||||
|
@ -100,10 +101,10 @@ void* create_vulkan_surface(platform::window_ptr window, void* surface_creation_
|
||||||
float mouse_x = 0.0f, mouse_y = 0.0f;
|
float mouse_x = 0.0f, mouse_y = 0.0f;
|
||||||
bool mouse_down = false;
|
bool mouse_down = false;
|
||||||
|
|
||||||
@interface GameViewController ()
|
@interface GameViewController () {
|
||||||
{
|
|
||||||
GameView* view;
|
GameView* view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GameViewController
|
@implementation GameViewController
|
||||||
|
@ -141,8 +142,7 @@ int width, height;
|
||||||
int drawable_width, drawable_height;
|
int drawable_width, drawable_height;
|
||||||
CAMetalLayer* layer;
|
CAMetalLayer* layer;
|
||||||
|
|
||||||
template<class GFXBackend>
|
template<class GFXBackend> void try_initialize() {
|
||||||
void try_initialize() {
|
|
||||||
if (gfx_interface == nullptr) {
|
if (gfx_interface == nullptr) {
|
||||||
auto backend = new GFXBackend();
|
auto backend = new GFXBackend();
|
||||||
const bool supported = backend->is_supported() && platform::supports_context(backend->required_context());
|
const bool supported = backend->is_supported() && platform::supports_context(backend->required_context());
|
||||||
|
@ -195,15 +195,13 @@ void try_initialize() {
|
||||||
app_main(engine);
|
app_main(engine);
|
||||||
engine->set_app(app);
|
engine->set_app(app);
|
||||||
|
|
||||||
engine->add_window((void*)CFBridgingRetain([view layer]), (void*)1, {static_cast<uint32_t>(width), static_cast<uint32_t>(height)});
|
engine->add_window(
|
||||||
|
(void*)CFBridgingRetain([view layer]), (void*)1, {static_cast<uint32_t>(width), static_cast<uint32_t>(height)});
|
||||||
|
|
||||||
app->initialize_render();
|
app->initialize_render();
|
||||||
|
|
||||||
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
|
||||||
[nc addObserver:view
|
[nc addObserver:view selector:@selector(controllerConnected) name:GCControllerDidConnectNotification object:nil];
|
||||||
selector:@selector(controllerConnected)
|
|
||||||
name:GCControllerDidConnectNotification
|
|
||||||
object:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)didReceiveMemoryWarning {
|
- (void)didReceiveMemoryWarning {
|
||||||
|
@ -239,9 +237,7 @@ bool platform::supports_context(GFXContext context) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::initialize_context(const GFXContext context) {
|
void platform::initialize_context(const GFXContext context) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void* platform::get_context_information() {
|
void* platform::get_context_information() {
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
|
@ -282,9 +278,7 @@ void* platform::get_next_image(window_ptr window) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::capture_mouse(const bool capture) {
|
void platform::capture_mouse(const bool capture) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: unimplemented
|
// TODO: unimplemented
|
||||||
PlatformTheme platform::get_theme() {
|
PlatformTheme platform::get_theme() {
|
||||||
|
@ -337,9 +331,7 @@ bool platform::is_main_window(platform::window_ptr index) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::show_window(const platform::window_ptr index) {
|
void platform::show_window(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool platform::supports_feature(const PlatformFeature feature) {
|
bool platform::supports_feature(const PlatformFeature feature) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -385,21 +377,16 @@ bool platform::get_key_down(InputButton key) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform::window_ptr platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
platform::window_ptr
|
||||||
|
platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
||||||
return (void*)1;
|
return (void*)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_title(const platform::window_ptr 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 platform::window_ptr index) {}
|
||||||
|
|
||||||
bool platform::is_window_focused(const platform::window_ptr index) {
|
void platform::set_window_focused(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void platform::set_window_focused(const platform::window_ptr index) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prism::Extent platform::get_window_size(const platform::window_ptr 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)};
|
||||||
|
@ -409,37 +396,21 @@ prism::Extent platform::get_window_drawable_size(const platform::window_ptr inde
|
||||||
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)};
|
||||||
}
|
}
|
||||||
|
|
||||||
prism::Offset platform::get_window_position(const platform::window_ptr index) {
|
prism::Offset platform::get_window_position(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
void platform::set_window_size(const platform::window_ptr index, const prism::Extent extent) {}
|
||||||
|
|
||||||
void platform::set_window_size(const platform::window_ptr index, const prism::Extent extent) {
|
void platform::set_window_position(const platform::window_ptr index, const prism::Offset offset) {}
|
||||||
|
|
||||||
}
|
void platform::close_window(const platform::window_ptr index) {}
|
||||||
|
|
||||||
void platform::set_window_position(const platform::window_ptr index, const prism::Offset offset) {
|
int platform::get_keycode(const InputButton button) {}
|
||||||
|
|
||||||
}
|
prism::Rectangle platform::get_monitor_resolution() {}
|
||||||
|
|
||||||
void platform::close_window(const platform::window_ptr index) {
|
prism::Rectangle platform::get_monitor_work_area() {}
|
||||||
|
|
||||||
}
|
prism::Offset platform::get_screen_cursor_position() {}
|
||||||
|
|
||||||
int platform::get_keycode(const InputButton button) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prism::Rectangle platform::get_monitor_resolution() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prism::Rectangle platform::get_monitor_work_area() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prism::Offset platform::get_screen_cursor_position() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool platform::get_mouse_button_down(const int index) {
|
bool platform::get_mouse_button_down(const int index) {
|
||||||
return mouse_down;
|
return mouse_down;
|
||||||
|
@ -449,9 +420,7 @@ float platform::get_monitor_dpi() {
|
||||||
return 2.0f;
|
return 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<float, float> platform::get_wheel_delta() {
|
std::tuple<float, float> platform::get_wheel_delta() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* platform::get_name() {
|
const char* platform::get_name() {
|
||||||
return "iOS";
|
return "iOS";
|
||||||
|
|
|
@ -43,14 +43,14 @@ namespace impl {
|
||||||
* loading the Wasm).
|
* loading the Wasm).
|
||||||
*/
|
*/
|
||||||
if (navigator["gpu"]) {
|
if (navigator["gpu"]) {
|
||||||
navigator["gpu"]["requestAdapter"]().then(function (adapter) {
|
navigator["gpu"]["requestAdapter"]().then(
|
||||||
|
function(adapter) {
|
||||||
adapter["requestDevice"]().then(function(device) {
|
adapter["requestDevice"]().then(function(device) {
|
||||||
Module["preinitializedWebGPUDevice"] = device;
|
Module["preinitializedWebGPUDevice"] = device;
|
||||||
entry();
|
entry();
|
||||||
});
|
});
|
||||||
}, function () {
|
},
|
||||||
console.error("No WebGPU adapter; not starting");
|
function() { console.error("No WebGPU adapter; not starting"); });
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
console.error("No support for WebGPU; not starting");
|
console.error("No support for WebGPU; not starting");
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace impl {
|
||||||
console.error("Entry point not found; unable to start");
|
console.error("Entry point not found; unable to start");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
} // namespace impl
|
||||||
|
|
||||||
//****************************************************************************/
|
//****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <@APP_INCLUDE@>
|
#include <@APP_INCLUDE@>
|
||||||
#include <emscripten/html5.h>
|
#include <emscripten/html5.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "engine.hpp"
|
#include "engine.hpp"
|
||||||
#include "platform.hpp"
|
|
||||||
#include "gfx_webgpu.hpp"
|
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
#include "gfx_webgpu.hpp"
|
||||||
|
#include "platform.hpp"
|
||||||
#include "string_utils.hpp"
|
#include "string_utils.hpp"
|
||||||
|
|
||||||
@APP_CLASS@* app = nullptr;
|
@APP_CLASS@* app = nullptr;
|
||||||
|
@ -45,19 +45,15 @@ extern "C" int __main__(int argc, char* argv[]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::capture_mouse(const bool capture) {
|
void platform::capture_mouse(const bool capture) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PlatformTheme platform::get_theme() {
|
PlatformTheme platform::get_theme() {
|
||||||
return PlatformTheme::Light;
|
return PlatformTheme::Light;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::begin_text_input() {
|
void platform::begin_text_input() {}
|
||||||
}
|
|
||||||
|
|
||||||
void platform::end_text_input() {
|
void platform::end_text_input() {}
|
||||||
}
|
|
||||||
|
|
||||||
void* platform::create_surface(window_ptr window, void* surface_creation_info) {
|
void* platform::create_surface(window_ptr window, void* surface_creation_info) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -79,9 +75,7 @@ bool platform::supports_context(GFXContext context) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::show_window(const platform::window_ptr index) {
|
void platform::show_window(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool platform::supports_feature(const PlatformFeature feature) {
|
bool platform::supports_feature(const PlatformFeature feature) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -103,21 +97,18 @@ bool platform::get_key_down(InputButton key) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform::window_ptr platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
platform::window_ptr
|
||||||
|
platform::open_window(const std::string_view title, const prism::Rectangle rect, const WindowFlags flags) {
|
||||||
return (void*)1;
|
return (void*)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_title(const platform::window_ptr 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 platform::window_ptr index) {
|
bool platform::is_window_focused(const platform::window_ptr index) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_focused(const platform::window_ptr index) {
|
void platform::set_window_focused(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prism::Extent platform::get_window_size(const platform::window_ptr index) {
|
prism::Extent platform::get_window_size(const platform::window_ptr index) {
|
||||||
return {100, 100};
|
return {100, 100};
|
||||||
|
@ -131,17 +122,11 @@ prism::Offset platform::get_window_position(const platform::window_ptr index) {
|
||||||
return {0, 0};
|
return {0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform::set_window_size(const platform::window_ptr index, const prism::Extent extent) {
|
void platform::set_window_size(const platform::window_ptr index, const prism::Extent extent) {}
|
||||||
|
|
||||||
}
|
void platform::set_window_position(const platform::window_ptr index, const prism::Offset offset) {}
|
||||||
|
|
||||||
void platform::set_window_position(const platform::window_ptr index, const prism::Offset offset) {
|
void platform::close_window(const platform::window_ptr index) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void platform::close_window(const platform::window_ptr index) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int platform::get_keycode(const InputButton button) {
|
int platform::get_keycode(const InputButton button) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -179,6 +164,4 @@ void prism::set_domain_path(const prism::domain domain, const prism::path& path)
|
||||||
domain_data[(int)domain] = replace_substring(path.string(), "{resource_dir}/", "");
|
domain_data[(int)domain] = replace_substring(path.string(), "{resource_dir}/", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
prism::path prism::get_writeable_directory() {
|
prism::path prism::get_writeable_directory() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
<meta content="width=device-width, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" name="viewport"/>
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta content="yes" name="apple-mobile-web-app-capable"/>
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"/>
|
||||||
<link rel="shortcut icon" href="#" />
|
<link href="#" rel="shortcut icon"/>
|
||||||
<title>Hello Triangle</title>
|
<title>Hello Triangle</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
return document.getElementById("canvas");
|
return document.getElementById("canvas");
|
||||||
})()
|
})()
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{{{ SCRIPT }}}
|
{{{ SCRIPT }}}
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in a new issue