Thin Windows entry, preview shell, and platform legacy state
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "platform_windows/windows_bootstrap_helpers.h"
|
||||
#include "platform_windows/windows_lifecycle_shell.h"
|
||||
#include "platform_windows/windows_platform_services.h"
|
||||
#include "platform_windows/windows_stylus_input.h"
|
||||
#include "platform_windows/windows_window_shell.h"
|
||||
#include "wacom.h"
|
||||
#include "../resource.h"
|
||||
@@ -101,6 +102,68 @@ void shutdown_main_window_runtime(const MainWindowStartupState& startup, HINSTAN
|
||||
|
||||
}
|
||||
|
||||
int run_main_application(int argc, char** argv)
|
||||
{
|
||||
auto& state = retained_state();
|
||||
state.hInst = GetModuleHandle(NULL);
|
||||
|
||||
App::I = new App();
|
||||
App::I->set_platform_services(&pp::platform::windows::platform_services());
|
||||
App::I->initLog();
|
||||
|
||||
pp::platform::windows::init_shcore_API();
|
||||
pp::platform::windows::initialize_stylus_input();
|
||||
|
||||
if (pp::platform::windows::SetProcessDpiAwareness_fn)
|
||||
pp::platform::windows::SetProcessDpiAwareness_fn(PROCESS_PER_MONITOR_DPI_AWARE);
|
||||
|
||||
pp::platform::windows::ensure_runtime_data_directory();
|
||||
|
||||
pp::platform::windows::SplashScreen splash(state.hInst);
|
||||
|
||||
pp::platform::windows::initialize_retained_input_state();
|
||||
|
||||
pp::platform::windows::setup_exception_handler();
|
||||
|
||||
pp::platform::windows::read_WMI_info();
|
||||
|
||||
App::I->create();
|
||||
|
||||
auto startup = pp::platform::windows::initialize_main_window_startup_state();
|
||||
auto context = pp::platform::windows::OpenGlWindowContext {};
|
||||
switch (pp::platform::windows::initialize_main_window_and_gl(startup, state.hWnd, state.hInst, state.window_title, context))
|
||||
{
|
||||
case pp::platform::windows::MainStartupResult::Ok:
|
||||
break;
|
||||
case pp::platform::windows::MainStartupResult::GladLoadFailure:
|
||||
return 0;
|
||||
case pp::platform::windows::MainStartupResult::MissingCoreContextSupport:
|
||||
return -1;
|
||||
}
|
||||
|
||||
//wglSwapIntervalEXT(1);
|
||||
|
||||
bool start_in_vr = false;
|
||||
if (argc > 1)
|
||||
{
|
||||
switch (const_hash(argv[1]))
|
||||
{
|
||||
case const_hash("convert"):
|
||||
App::I->initShaders();
|
||||
App::I->cmd_convert(argv[2], argv[3]);
|
||||
return 0;
|
||||
case const_hash("-vrmode"):
|
||||
start_in_vr = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pp::platform::windows::run_main_window_runtime(startup, start_in_vr, splash);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void run_main_window_runtime(const MainWindowStartupState& startup, bool start_in_vr, SplashScreen& splash)
|
||||
{
|
||||
auto& state = retained_state();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
namespace pp::platform::windows {
|
||||
|
||||
int run_main_application(int argc, char** argv);
|
||||
void run_main_window_runtime(const MainWindowStartupState& startup, bool start_in_vr, SplashScreen& splash);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user