Inject GLFW shell and move Win32 key map

This commit is contained in:
2026-06-17 10:53:51 +02:00
parent 59a9074109
commit 0a7961d8b3
10 changed files with 95 additions and 60 deletions

View File

@@ -46,7 +46,6 @@ void error_log(int code, const char * s)
int main(int argc, char** args)
{
auto platform_services = pp::platform::legacy::create_platform_services();
GLFWwindow* wnd = nullptr;
glfwSetErrorCallback(error_log);
if (!glfwInit())
@@ -69,6 +68,11 @@ int main(int argc, char** args)
pp::platform::linux_desktop::set_fps_title_callback([wnd](std::string title) {
glfwSetWindowTitle(wnd, title.c_str());
});
auto platform_services = pp::platform::legacy::create_platform_services({
.acquire_render_context = [wnd] { glfwMakeContextCurrent(wnd); },
.present_render_context = [wnd] { glfwSwapBuffers(wnd); },
.request_app_close = [wnd] { glfwSetWindowShouldClose(wnd, GLFW_TRUE); },
});
glfwSetCursorPosCallback(wnd, [](GLFWwindow* wnd, double x, double y){
g_cursor_pos = glm::vec2(x, y);
@@ -101,7 +105,7 @@ int main(int argc, char** args)
}, true);
});
pp::platform::legacy::acquire_legacy_glfw_render_context();
glfwMakeContextCurrent(wnd);
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
{
printf("Failed to initialize OpenGL context\n");